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

LANGUAGE sp11

TOKENS

  Ide, Bin, Nat, Flt, Lit, Str

TYPES

  sp11            = Start_Step11(Step11)

  Step11          = root(Schema*)

  Schema          = dfn(Ide, SchemaBody)

  SchemaBody      = dfn(Interface*, ConstDecl, Decl*)

  Interface       = use(Ide, Ref*);
                    ref(Ide, Ref*)

  Ref             = one(Ide);
                    two(Ide, Ide)

  ConstDecl       = nul;
                    dfn(Constant*)

  Constant        = dfn(Ide, Type, Exp)

  Type            = list(Bound, KeyUniq, Type);
                    num;
                    agen(Label, Type);
                    str(Size);
                    bin(Size);
                    logic;
                    array(Bound, KeyOpt, KeyUniq, Type);
                    ref(Ide);
                    int;
                    real(Exp);
                    bool;
                    tgen(Label);
                    enum(Ide*);
                    bag(Bound, Type);
                    sel(Ide*);
                    set(Bound, Type)

  Bound           = dfn(Exp, Exp)

  Size            = nul;
                    dfn(Exp, KeyFix)

  KeyOpt          = nul;
                    opt

  KeyUniq         = uniq;
                    nul

  KeyFix          = fix;
                    nul

  Exp             = lbl(Ide, Exp);
                    init(Exp);
                    div1(Exp, Exp);
                    ge(Exp, Exp);
                    in(Exp, Exp);
                    pipe(Exp, Exp);
                    mod(Exp, Exp);
                    gt(Exp, Exp);
                    like(Exp, Exp);
                    qopr(Exp*);
                    qry(Ide, Exp, Exp);
                    xor(Exp, Exp);
                    eq(Exp, Exp);
                    exp(Exp);
                    ival(Exp, IvalOpr, Exp, IvalOpr, Exp);
                    eeq(Exp, Exp);
                    sub(Exp, Exp);
                    nat(Nat);
                    nul;
                    ene(Exp, Exp);
                    or(Exp, Exp);
                    ne(Exp, Exp);
                    str(Str);
                    expo(Exp, Exp);
                    false;
                    usub(Exp);
                    lit(Lit);
                    true;
                    mul(Exp, Exp);
                    rng(Exp, Exp);
                    attr(Ide);
                    grp(Ide);
                    call(Fun, Exp*, Exp*);
                    add(Exp, Exp);
                    e(Exp*);
                    flt(Flt);
                    self(Exp*);
                    undef;
                    uadd(Exp);
                    lt(Exp, Exp);
                    div2(Exp, Exp);
                    pi(Exp*);
                    le(Exp, Exp);
                    and(Exp, Exp);
                    not(Exp);
                    bin(Bin)

  IvalOpr         = opn;
                    cls

  Fun             = asin;
                    abs;
                    cos;
                    loi;
                    hib;
                    exist;
                    vin;
                    len;
                    blen;
                    odd;
                    typ;
                    log10;
                    size;
                    val;
                    nvl;
                    atan;
                    ide(Ide);
                    sqrt;
                    role;
                    log2;
                    acos;
                    sin;
                    used;
                    ins;
                    vuniq;
                    log;
                    exp;
                    lob;
                    del;
                    frm;
                    tan;
                    hii

  FPar            = proc(Ide*, Type);
                    fun(Ide*, Type)

  Decl            = fun(FunHead, AHead, Stmt*);
                    proc(ProcHead, AHead, Stmt*);
                    typ(Ide, Type, Exp*);
                    rule(RuleHead, AHead, Stmt*, Exp*);
                    obj(ObjHead, ObjBody)

  ObjHead         = dfn(Ide, SubSup, SubSup)

  ProcHead        = dfn(Ide, FPar*)

  FunHead         = dfn(Ide, FPar*, Type)

  ObjBody         = dfn(EAttrDecl*, DAttrDecl*, IAttrDecl*, LblAttrs*, Exp*)

  EAttrDecl       = dfn(Attr*, KeyOpt, Type)

  DAttrDecl       = dfn(Attr, Type, Exp)

  IAttrDecl       = dfn(Attr, Type, Ide)

  LblAttrs        = nlbl(Attr*);
                    lbl(Ide, Attr*)

  Attr            = ide(Ide);
                    qual(Ide, Ide)

  SubSup          = supr(CondSubType);
                    nul;
                    sub(Ide*);
                    supd(CondSubType)

  CondSubType     = dfn(ExpSup);
                    nul

  ExpSup          = and(ExpSup, ExpSup);
                    exp(ExpSup);
                    sel(ExpSup*);
                    andor(ExpSup, ExpSup);
                    ide(Ide)

  RuleHead        = dfn(Ide, Ide*)

  AHead           = dfn(Decl*, ConstDecl, LocalDecl)

  LocalDecl       = dfn(Var*);
                    nul

  Var             = dfn(Ide*, Type, Exp)

  Label           = nul;
                    ide(Ide)

  LoopCtrl        = nul;
                    for(Ide, Exp, Exp, Exp);
                    while(Exp);
                    unitl(Exp)

  Case            = exp(Exp*, Stmt);
                    dft(Stmt)

  Stmt            = alias(Ide, Ide, Exp*, Stmt*);
                    block(Stmt*);
                    if(Exp, Stmt*, Stmt*);
                    retn(Exp);
                    loop(LoopCtrl, Stmt*);
                    setv(Ide, Exp*, Exp);
                    esc;
                    case(Exp, Case*);
                    call(Fun, Exp*);
                    skip;
                    null