PreviousUpNext

15.3.21  src/app/makelib/stuff/raw-libfile.api

## raw-libfile.api
#
# Api for the library representation used while
# actually parsing a file
#
#    foo.lib
#
# This is only used in
#
#     src/app/makelib/parse/libfile-grammar-actions.pkg

# Compiled by:
#     src/app/makelib/makelib.sublib



# This file is essentially a utility library for the
# makefile parser, in particular for libfile_grammar_actions in
#
#     src/app/makelib/parse/libfile-grammar-actions.pkg
#
# which is the only file which references us.
#
# Involves:
#     - running tools
#     - fully analyzing sub-libraries and sub-freezefiles
#     - parsing source files and getting their export lists




###                  "Free software projects without good
###                   input filtering of ideas turn into
###                   bloated sludge.
###
###                   Egcs has good filtering (you should
###                   hear some of the things people say
###                   about the Cygnus guys after they get
###                   told "no" a few times ;)) so it works."
###
###                                        --Alan Cox


# This api is implemented in:
#     src/app/makelib/stuff/raw-libfile.pkg

stipulate
    package ad  =  anchor_dictionary;                                           # anchor_dictionary                     is from   src/app/makelib/paths/anchor-dictionary.pkg
    package lg  =  inter_library_dependency_graph;                              # inter_library_dependency_graph        is from   src/app/makelib/depend/inter-library-dependency-graph.pkg
    package lnd =  line_number_db;                                              # line_number_db                        is from   src/lib/compiler/front/basics/source/line-number-db.pkg
    package ms  =  makelib_state;                                               # makelib_state                         is from   src/app/makelib/main/makelib-state.pkg
    package mvi =  makelib_version_intlist;                                     # makelib_version_intlist               is from   src/app/makelib/stuff/makelib-version-intlist.pkg
    package pmt =  private_makelib_tools;                                       # private_makelib_tools                 is from   src/app/makelib/tools/main/private-makelib-tools.pkg
    package sg  =  intra_library_dependency_graph;                              # intra_library_dependency_graph        is from   src/app/makelib/depend/intra-library-dependency-graph.pkg
    package spm =  source_path_map;                                             # source_path_map                       is from   src/app/makelib/paths/source-path-map.pkg
    package sy  =  symbol;                                                      # symbol                                is from   src/lib/compiler/front/basics/map/symbol.pkg
    package sym =  symbol_map;                                                  # symbol_map                            is from   src/app/makelib/stuff/symbol-map.pkg
    package sys =  symbol_set;                                                  # symbol_set                            is from   src/app/makelib/stuff/symbol-set.pkg
herein

    api Raw_Libfile {
        #

        Sublibraries
             =
            List ( ( ad::File,
                     lg::Inter_Library_Dependency_Graph
                   , ad::Renamings              # MUSTDIE
                 ) ); 


        Libfile;


        empty_libfile:  Libfile;


        make_primordial_libfile
            :
            ms::Makelib_State
             -> lg::Inter_Library_Dependency_Graph
             -> Libfile;


        expand_one:   { makelib_state:  ms::Makelib_State,
                        #       
                        load_plugin:        ad::Path_Root -> String -> Bool,
                        #       
                        recursive_parse:   ( ad::File,
                                              Null_Or( mvi::Makelib_Version_Intlist )
                                             , ad::Renamings    # MUSTDIE
                                            )
                                            ->
                                            lg::Inter_Library_Dependency_Graph
                      }
                      ->
                      { name:           String,
                        make_path:      Void -> ad::Dir_Path,
                        library:        (ad::File, lnd::Source_Code_Region),
                        ilk:            Null_Or( String ),
                         #
                        tool_options:   Null_Or( pmt::Tool_Options ),
                        local_index:    pmt::Index,
                        path_root:      ad::Path_Root
                      }
                      ->
                      Libfile;

        sequential:  ( Libfile,
                       Libfile,
                       (String -> Void)
                      )
                      ->
                      Libfile;

        make_libfile            # Bad name! It doesn't construct a Libfile. In fact, it takes one as argument. XXX BUGGO FIXME.
            :
            ( ad::File,
              Libfile,
              sys::Set,
              ms::Makelib_State,
              sg::Masked_Tome
            )                                                           #  pervasive dictionary 
            ->
            { exports:               sym::Map( lg::Fat_Tome ),
              imported_symbols:      sys::Set
            };


        make_index
            :
            ( ms::Makelib_State,
              ad::File,
              Libfile
            )
            ->
            Void;


        sublibraries
            :
            Libfile
            ->
            Sublibraries;


        sources
             :
             Libfile
             ->
             spm::Map
                 {
                   ilk:     String, 
                   derived: Bool
                 };   

        num_find:     ms::Makelib_State -> Libfile -> String -> Int;

        is_defined_hostproperty:      ms::Makelib_State -> Libfile -> String -> Bool;

        ml_find:      Libfile -> sy::Symbol -> Bool;

#       get_all_symbols_exported_by_libfile:   Libfile -> sys::Set;

        # Return set of all symbols exported from
        # one or all .api and .pkg files in library:
        #
        api_or_pkg_exported_symbols
            :
            ( Libfile,
              Null_Or( ad::File ),                              # NULL means get symbols from all files in library; THE(file) means get symbols only from indicated file.
              (String -> Void)
            )
            ->
            sys::Set;


        sublibrary_exported_symbols
            :
            ( Libfile,
              Null_Or( ad::File ),
              (String -> Void)
            )
            ->
            sys::Set;


        freezefile_exports
            :
            ( Libfile,
              ad::File,
              (String -> Void),
              Bool,
              (Void -> Libfile)
           )
           ->
           sys::Set;

        is_error_libfile:  Libfile -> Bool;
    };
end;

## (C) 1999 Lucent Technologies, Bell Laboratories
## Author: Matthias Blume (blume@kurims.kyoto-u.ac.jp)
## Subsequent changes by Jeff Prothero Copyright (c) 2010-2015,
## released per terms of SMLNJ-COPYRIGHT.



Comments and suggestions to: bugs@mythryl.org

PreviousUpNext