Skip Navigation
 
 
/* ------------------------------------------------------------------------ */
/*                                                                          */
/* [st.abs]                    Abstract Grammar                             */
/*                                                                          */
/* ------------------------------------------------------------------------ */

LANGUAGE st

TOKENS

  ASGOP, BINOP, CHRLIT, IDENT, INTLIT, FLTLIT, KEYWRD, SYMKEY, STRLIT

TYPES

  st        = Start_file(class*)

  class     = imm(var*, stats1);
              dfn(exp, method*)

  method    = pri(msgpat, var*, prim, stats);
              mth(msgpat, var*, stats)

  prim      = prim(INTLIT)

  msgpat    = ksel(keyvars);
              bsel(binsel, var);
              usel(unasel)

  unasel    = a(IDENT)

  binsel    = d;
              a(BINOP);
              b;
              c

  var       = a(IDENT)

  keyvars   = a(keyword, var);
              b(keyvars, keyword, var)

  keyword   = a(KEYWRD)

  stats     = a;
              b(stats1)

  stats1    = exp(stat);
              seq(stat, stats)

  stat      = exp(exp);
              rtn(exp)

  exp       = asg(var, ASGOP, exp);
              c(casexp);
              b(msgexp);
              a(exp0)

  exp0      = a(var);
              d(exp);
              c(block);
              b(aryelt)

  msgexp    = b(binexp);
              a(unaexp);
              c(keyexp)

  unaexp    = a(unanoj, unasel)

  unanoj    = c(unaexp);
              b(exp0)

  binexp    = a(binobj, binsel, unanoj)

  binobj    = a(unanoj);
              b(binexp)

  keyexp    = a(binobj, keylst)

  keylst    = b(keylst, keyword, binobj);
              a(keyword, binobj)

  casexp    = a(msgexp, msglst)

  msglst    = b(msglst, msgelt);
              a(msgelt)

  msgelt    = c(keylst);
              a(unasel);
              b(binsel, unanoj)

  block     = blk(var*, stats)

  aryelt    = flt(FLTLIT);
              ary(aryelt*);
              chr(CHRLIT);
              a(IDENT);
              d(KEYWRD);
              int(INTLIT);
              b(binsel);
              c(SYMKEY);
              sym(aryelt);
              str(STRLIT)