Global.borg

Global.borg


`*-----------------------------------*`
`*          >>>Pico v.1.1<<<         *`
`*            Theo D'Hondt           *`
`*  VUB Programming Technology Lab   *`
`*              (c)1999              *`
`*-----------------------------------*`
`*        global declarations        *`
`*      (METACIRCULAR VERSION)       *`
`*-----------------------------------*`

{ _EMPTY_: void;
  _EOLN_ : void;
  _EXIT_ : void;
  _FALSE_: void;
  _TRUE_ : void;
  _VOID_ : void;
  _ZERO_ : void;

  TAG_idx:: 1;

  Error(Msg)::
    { display('***error*** ', Msg);
      continue(_EXIT_, void) };

  VOI_tag:: 0;
  VOI_siz:: 1;
  Make_VOI()::
    [ VOI_tag ];

  NAT_tag:: 1;
  NAT_siz:: 3;
  NAT_NAM_idx:: 2;
  NAT_NAT_idx:: 3;
  Make_NAT(Nam, Nat)::
    [ NAT_tag, Nam, Nat ];

  FRC_tag:: 2;
  FRC_siz:: 1;
  FRC_VAL_idx:: 2;
  Make_FRC(Val)::
    [ FRC_tag, Val ];

  TXT_tag:: 3;
  TXT_siz:: 1;
  TXT_VAL_idx:: 2;
  Make_TXT(Val)::
    [ TXT_tag, Val ];

  TAB_tag:: 4;
  TAB_siz:: 1;
  TAB_TAB_idx:: 2;
  Make_TAB(Tab)::
    [ TAB_tag, Tab ];

  FUN_tag:: 5;
  FUN_siz:: 5;
  FUN_NAM_idx:: 2;
  FUN_PAR_idx:: 3;
  FUN_EXP_idx:: 4;
  FUN_DCT_idx:: 5;
  Make_FUN(Nam, Par, Bod, Dct)::
    [ FUN_tag, Nam, Par, Bod, Dct ];

  REF_tag:: 6;
  REF_siz:: 2;
  REF_NAM_idx:: 2;
  Make_REF(Nam)::
    [ REF_tag, Nam ];

  APL_tag:: 7;
  APL_siz:: 3;
  APL_NAM_idx:: 2;
  APL_ARG_idx:: 3;
  Make_APL(Nam, Arg)::
    [ APL_tag, Nam, Arg ];

  TBL_tag:: 8;
  TBL_siz:: 3;
  TBL_NAM_idx:: 2;
  TBL_IDX_idx:: 3;
  Make_TBL(Nam, Idx)::
    [ TBL_tag, Nam, Idx ];

  MES_tag:: 9;
  MES_siz:: 3;
  MES_NAM_idx:: 2;
  MES_INV_idx:: 3;
  Make_MES(Nam, Inv)::
    [ MES_tag, Nam, Inv ];

  DEF_tag:: 10;
  DEF_siz:: 3;
  DEF_INV_idx:: 2;
  DEF_EXP_idx:: 3;
  Make_DEF(Inv, Exp)::
    [ DEF_tag, Inv, Exp ];

  DCL_tag:: 11;
  DCL_siz:: 3;
  DCL_INV_idx:: 2;
  DCL_EXP_idx:: 3;
  Make_DCL(Inv, Exp)::
    [ DCL_tag, Inv, Exp ];

  SET_tag:: 12;
  SET_siz:: 3;
  SET_INV_idx:: 2;
  SET_EXP_idx:: 3;
  Make_SET(Inv, Exp)::
    [ SET_tag, Inv, Exp ];

  VAR_tag:: 13;
  VAR_siz:: 3;
  VAR_NAM_idx:: 2;
  VAR_VAL_idx:: 3;
  VAR_DCT_idx:: 4;
  Make_VAR(Nam, Val, Dct)::
    [ VAR_tag, Nam, Val, Dct ];

  CST_tag:: 14;
  CST_siz:: 3;
  CST_NAM_idx:: 2;
  CST_VAL_idx:: 3;
  CST_DCT_idx:: 4;
  Make_CST(Nam, Val, Dct)::
    [ CST_tag, Nam, Val, Dct ];

  CTX_tag:: 15;
  CTX_siz:: 5;
  CTX_DCT_idx:: 2;
  CTX_LOW_idx:: 3;
  CTX_HGH_idx:: 4;
  CTX_TAB_idx:: 5;
  Make_CTX(Dct, Low, Hgh, Tab)::
    [ CTX_tag, Dct, Low, Hgh, Tab ];

  NBR_tag:: 16;
  NBR_siz:: 1;
  NBR_VAL_idx:: 2;
  Make_NBR(Val)::
    [ NBR_tag, Val ];

  SIZ_tab:: [ VOI_siz,
              NAT_siz,
              FRC_siz,
              TXT_siz,
              TAB_siz,
              FUN_siz,
              REF_siz,
              APL_siz,
              TBL_siz,
              MES_siz,
              DEF_siz,
              DCL_siz,
              SET_siz,
              VAR_siz,
              CST_siz,
              CTX_siz,
              NBR_siz ];

  _EMPTY_:= Make_TAB([]);
  _EOLN_ := Make_TXT(eoln);
  _VOID_ := Make_VOI();
  _ZERO_ := Make_NBR(0);

  display('globals ...... installed', eoln) }