PreviousUpNext

15.3.126  src/lib/compiler/back/low/main/nextcode/nextcode-function-stack.api

## nextcode-function-stack.api --- nextcode functions awaiting compilation.

# Compiled by:
#     src/lib/compiler/core.sublib

stipulate
    package ncf =  nextcode_form;                                                       # nextcode_form         is from   src/lib/compiler/back/top/nextcode/nextcode-form.pkg
    package lbl =  codelabel;                                                           # codelabel             is from   src/lib/compiler/back/low/code/codelabel.pkg
herein

    api Nextcode_Function_Stack {
        #
        package tcf:  Treecode_Form;                                                    # Treecode_Form         is from   src/lib/compiler/back/low/treecode/treecode-form.api

        Function_Form
          #
          = FN_IN_NEXTCODE_FORM
              ( ncf::Codetemp,                                                          # fun_id
                List( ncf::Codetemp ),                                                  # fun_parameters
                List( ncf::Type ),                                                      # fun_parameter_types
                ncf::Instruction                                                        # fun_body
              )
          #
          | FN_PARAMETERS_IN_TREECODE_FORM  List( tcf::Expression )
          ;

        Callers_Info
          #
          = PRIVATE_FN                              Ref( Function_Form )                # A fun is 'private' if all callers are known (and in current package) -- this allows the optimizer to customize the calling register protocol.
          | PRIVATE_FN_WHICH_NEEDS_HEAPLIMIT_CHECK  Ref( Function_Form )
          #
          | PUBLIC_FN { fn:      Ref(  Null_Or(  ncf::Function ) ),                     # A fun is 'public' if it may have unknown callers -- if it is externally visible via the api or passed around as a value.
                        parameter_types:  List( ncf::Type )
                      }
          ;


        push_nextcode_function
            :
            (ncf::Function, lbl::Codelabel)
            ->
            Callers_Info;

        pop_function:  Void ->  Null_Or( (lbl::Codelabel, Callers_Info) );

        push_function:  (lbl::Codelabel, Callers_Info) -> Void;
    };
end;





## COPYRIGHT (c) 1995 AT&T Bell Laboratories.
## Subsequent changes by Jeff Prothero Copyright (c) 2010-2015,
## released per terms of SMLNJ-COPYRIGHT.


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext