PreviousUpNext

15.4.1388  src/lib/x-kit/widget/edit/app-to-compileimp.pkg

## app-to-compileimp.pkg
#
# Here we define the port which
#
#     src/lib/x-kit/widget/edit/compile-imp.pkg
#
# exports to random clients like gadgets and mills.

# Compiled by:
#     src/lib/x-kit/widget/xkit-widget.sublib



stipulate
    include package   threadkit;                                                                        # threadkit                     is from   src/lib/src/lib/thread-kit/src/core-thread-kit/threadkit.pkg
    #
    package g2d =  geometry2d;                                                                          # geometry2d                    is from   src/lib/std/2d/geometry2d.pkg
    package cs  =  compiler::compiler_state;                                                            # compiler              is from   src/lib/core/compiler/compiler.pkg
    package sci =  compiler::sourcecode_info;                                                           # sourcecode_info               is from   src/lib/compiler/front/basics/source/sourcecode-info.pkg
#   package cs  =  compiler_state;                                                                      # compiler_state                is from   src/lib/compiler/toplevel/interact/compiler-state.pkg
#   package ds  =  deep_syntax;                                                                         # deep_syntax                   is from   src/lib/compiler/front/typer-stuff/deep-syntax/deep-syntax.pkg

    package pp  =  standard_prettyprinter;                                                              # standard_prettyprinter        is from   src/lib/prettyprint/big/src/standard-prettyprinter.pkg

                                                                                                        # compiler                      is from   src/lib/core/compiler/compiler.pkg
    package acf =  compiler::anormcode_form;                                                            # anormcode_form                is from   src/lib/compiler/back/top/anormcode/anormcode-form.pkg
    package ds  =  compiler::deep_syntax;                                                               # deep_syntax                   is from   src/lib/compiler/front/typer-stuff/deep-syntax/deep-syntax.pkg
    package it  =  compiler::import_tree;                                                               # import_tree                   is from   src/lib/compiler/execution/main/import-tree.pkg
    package lt  =  compiler::linking_mapstack;                                                          # linking_mapstack              is from   src/lib/compiler/execution/linking-mapstack/linking-mapstack.pkg
    package pcs =  compiler::per_compile_stuff;                                                         # per_compile_stuff             is from   src/lib/compiler/front/typer-stuff/main/per-compile-stuff.pkg
    package ph  =  compiler::picklehash;                                                                # picklehash                    is from   src/lib/compiler/front/basics/map/picklehash.pkg
    package raw =  compiler::raw_syntax;                                                                # raw_syntax                    is from   src/lib/compiler/front/parser/raw-syntax/raw-syntax.pkg
    package sci =  compiler::sourcecode_info;                                                           # sourcecode_info               is from   src/lib/compiler/front/basics/source/sourcecode-info.pkg
    package seg =  compiler::code_segment;                                                              # code_segment                  is from   src/lib/compiler/execution/code-segments/code-segment.pkg
    package syx =  compiler::symbolmapstack;                                                            # symbolmapstack                is from   src/lib/compiler/front/typer-stuff/symbolmapstack/symbolmapstack.pkg
    package tmp =  compiler::highcode_codetemp;                                                         # highcode_codetemp             is from   src/lib/compiler/back/top/highcode/highcode-codetemp.pkg
herein

    # This port is implemented in:
    #
    #     src/lib/x-kit/widget/edit/compile-imp.pkg
    #
    package app_to_compileimp {
        #
        App_To_Compileimp
          =
          { id:                                         Id,                                             # Unique id to facilitate storing guiboss_to_compileimp instances in indexed datastructures like red-black trees.
            #

            parse_string_to_raw_declarations                                                            # This facility created for   src/lib/x-kit/widget/edit/eval-mode.pkg
              :
              {                                                                                         # 
                sourcecode_info:                        sci::Sourcecode_Info,                           # Source code to compile, also error sink.
                pp:                                     pp::Prettyprinter                               # Where to prettyprint results.
              }                                                                                         #
              ->                                                                                        #
              List( raw::Declaration ),                                                                 # 

            compile_raw_declaration_to_package_closure                                                  # This facility created for   src/lib/x-kit/widget/edit/eval-mode.pkg
              :
              {                                                                                         # 
                declaration:                            raw::Declaration,                               #
                sourcecode_info:                        sci::Sourcecode_Info,                           # Source code to compile, also error sink.
                pp:                                     pp::Prettyprinter,                              # Where to prettyprint results.
                compiler_state_stack:                   (cs::Compiler_State, List(cs::Compiler_State)), # Compiler symbol tables to use for this compile.
                options:                                List( cs::Compile_And_Eval_String_Option )      # Future-proofing, lets us add more parameters in future without breaking backward compatibility at the client-call level.
              }                                                                                         #
              ->
              Null_Or ( 
                  { package_closure:                    seg::Package_Closure,
                    import_trees:                       List( it::Import_Tree ),
                    export_picklehash:                  Null_Or( ph::Picklehash ),
                    linking_mapstack:                   lt::Picklehash_To_Heapchunk_Mapstack,
                    code_and_data_segments:             seg::Code_And_Data_Segments,
                    new_symbolmapstack:                 syx::Symbolmapstack,                            # A symbol table delta containing (only) stuff from raw_declaration.
                    deep_syntax_declaration:            ds::Declaration,                                # Typechecked form of  raw_declaration.
                    exported_highcode_variables:        List( tmp::Codetemp ),
                    inline_expression:                  Null_Or( acf::Function ),
                    top_level_pkg_etc_defs_jar:         cs::Compiler_Mapstack_Set_Jar,
                    get_current_compiler_mapstack_set:  Void -> cs::Compiler_Mapstack_Set,
                    compiler_verbosity:                 pcs::Compiler_Verbosity,
                    compiler_state_stack:               (cs::Compiler_State, List(cs::Compiler_State))
                  }
              ),
        
            link_and_run_package_closure                                                                # This facility created for   src/lib/x-kit/widget/edit/eval-mode.pkg
              :
              {                                                                                         # 
                sourcecode_info:                        sci::Sourcecode_Info,                           # Source code to compile, also error sink.
                pp:                                     pp::Prettyprinter                               # Where to prettyprint results.
              } 
              ->
              { package_closure:                        seg::Package_Closure,
                import_trees:                           List( it::Import_Tree ),
                export_picklehash:                      Null_Or( ph::Picklehash ),
                linking_mapstack:                       lt::Picklehash_To_Heapchunk_Mapstack,
                code_and_data_segments:                 seg::Code_And_Data_Segments,
                new_symbolmapstack:                     syx::Symbolmapstack,                            # A symbol table delta containing (only) stuff from raw_declaration.
                deep_syntax_declaration:                ds::Declaration,                                # Typechecked form of  raw_declaration.
                exported_highcode_variables:            List( tmp::Codetemp ),
                inline_expression:                      Null_Or( acf::Function ),
                top_level_pkg_etc_defs_jar:             cs::Compiler_Mapstack_Set_Jar,
                get_current_compiler_mapstack_set:      Void -> cs::Compiler_Mapstack_Set,
                compiler_verbosity:                     pcs::Compiler_Verbosity,
                compiler_state_stack:                   (cs::Compiler_State, List(cs::Compiler_State))  # Compiler symbol tables to use for this compile.
              }                                                                                         #
              ->                                                                                        #
              (cs::Compiler_State, List(cs::Compiler_State))                                            # Updated compiler symbol tables.  Caller may keep or discard.
          };
    };
end;




Comments and suggestions to: bugs@mythryl.org

PreviousUpNext