PreviousUpNext

15.4.503  src/lib/compiler/back/top/lambdacode/lambdacode-form.pkg

## lambdacode-form.pkg 

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


###               "The dynamic principle of fantasy is play,
###                which belongs also to the child, and as such
###                it appears to be inconsistent with the principle
###                of serious work.
###
###                But without this playing with fantasy
###                no creative work has ever yet come to birth.
###
###                                    -- Carl Jung


stipulate
    package hbo =  highcode_baseops;            # highcode_baseops              is from   src/lib/compiler/back/top/highcode/highcode-baseops.pkg
    package hcf =  highcode_form;               # highcode_form                 is from   src/lib/compiler/back/top/highcode/highcode-form.pkg
    package tmp =  highcode_codetemp;           # highcode_codetemp             is from   src/lib/compiler/back/top/highcode/highcode-codetemp.pkg
    package hut =  highcode_uniq_types;         # highcode_uniq_types           is from   src/lib/compiler/back/top/highcode/highcode-uniq-types.pkg
    package sy  =  symbol;                      # symbol                        is from   src/lib/compiler/front/basics/map/symbol.pkg
    package vh  =  varhome;                     # varhome                       is from   src/lib/compiler/front/typer-stuff/basics/varhome.pkg
herein 

    package  lambdacode_form
    : (weak) Lambdacode_Form                    # Lambdacode_Form               is from   src/lib/compiler/back/top/lambdacode/lambdacode-form.api
    {

        # See comments in    src/lib/compiler/back/top/lambdacode/lambdacode-form.api
        #
        Constructor
            =
            ( sy::Symbol,
              vh::Valcon_Form,
              hut::Uniqtypoid
            ); 


        # See comments in    src/lib/compiler/back/top/lambdacode/lambdacode-form.api
        #
        Casetag                                                                                 # Constant in a 'case' rule lefthandside.
          = VAL_CASETAG    (Constructor, List( hut::Uniqtype ), tmp::Codetemp)
          | INT_CASETAG     Int
          | INT1_CASETAG   one_word_int::Int
          | INTEGER_CASETAG  multiword_int::Int
          | UNT_CASETAG     Unt
          | UNT1_CASETAG   one_word_unt::Unt
          | FLOAT64_CASETAG String
          | STRING_CASETAG  String
          | VLEN_CASETAG    Int; 


        # See comments in    src/lib/compiler/back/top/lambdacode/lambdacode-form.api
        #
        Lambdacode_Expression
          = VAR     tmp::Codetemp
          | INT     Int
          | INT1   one_word_int::Int
          | UNT     Unt
          | UNT1   one_word_unt::Unt
          | FLOAT64 String
          | STRING  String 
          | BASEOP  (hbo::Baseop, hut::Uniqtypoid, List( hut::Uniqtype ))                               # Op, result_tpe, argtypes.
          | GENOP   (Dictionary, hbo::Baseop, hut::Uniqtypoid, List( hut::Uniqtype ))

          | FN   (tmp::Codetemp, hut::Uniqtypoid, Lambdacode_Expression)
          | MUTUALLY_RECURSIVE_FNS  (List(tmp::Codetemp), List(hut::Uniqtypoid), List(Lambdacode_Expression), Lambdacode_Expression)
          | APPLY  (Lambdacode_Expression, Lambdacode_Expression)
          | LET  (tmp::Codetemp, Lambdacode_Expression, Lambdacode_Expression)

          | TYPEFUN     (List(hut::Uniqkind),   Lambdacode_Expression)
          | APPLY_TYPEFUN  (Lambdacode_Expression, List( hut::Uniqtype ))

          | RAISE           (Lambdacode_Expression, hut::Uniqtypoid) 
          | EXCEPT          (Lambdacode_Expression, Lambdacode_Expression)
          | EXCEPTION_TAG   (Lambdacode_Expression, hut::Uniqtypoid)                 

          | CONSTRUCTOR (Constructor, List( hut::Uniqtype ), Lambdacode_Expression)
          | SWITCH      (Lambdacode_Expression, vh::Valcon_Signature, List ((Casetag, Lambdacode_Expression)), Null_Or( Lambdacode_Expression ))

          | VECTOR            (List( Lambdacode_Expression ), hut::Uniqtype)
          | RECORD             List( Lambdacode_Expression )
          | PACKAGE_RECORD     List( Lambdacode_Expression )
          | GET_FIELD         (Int, Lambdacode_Expression)

          | PACK    (hut::Uniqtypoid, List( hut::Uniqtype ), List( hut::Uniqtype ), Lambdacode_Expression)   
          | BOX     (hut::Uniqtype, Bool, Lambdacode_Expression)                                        # NEVER USED.
          | UNBOX   (hut::Uniqtype, Bool, Lambdacode_Expression)                                        # NEVER USED.

        withtype
        Dictionary
          =
          { default: Lambdacode_Expression,
            table:   List( (List(hut::Uniqtype), Lambdacode_Expression) )
          };

    };                                                                                          # package lambdacode 
end;                                                                                            # stipulate




Comments and suggestions to: bugs@mythryl.org

PreviousUpNext