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

LANGUAGE php52

TOKENS

  TOpenTag, TInlineHtml, THtmlComment, TCloseTag, TDouble, TDoubleQuote, TSingleQuote, TOpenDQuote, TOpenBQuote, TOpenSQuote, THeredoc, THeredocEnd, THLiteral, TVariable, TString, TInteger, TDOpenCurly, TOpenCurlyD, TBLiteral, TDLiteral, TSLiteral, TCloseDQuote, TCloseBQuote, TCloseSQuote, _other_

TYPES

  php52                 = Start_Source(Source)

  Key                   = k060;
                          k016;
                          k088;
                          k103;
                          k119;
                          k018;
                          k092;
                          k058;
                          k009;
                          k029;
                          k038;
                          k101;
                          k125;
                          k035;
                          k094;
                          k127;
                          k066;
                          k086;
                          k116;
                          k068;
                          k044;
                          k002;
                          k095;
                          k118;
                          k073;
                          k003;
                          k011;
                          k090;
                          k071;
                          k067;
                          k087;
                          k124;
                          k065;
                          k031;
                          k051;
                          k098;
                          k053;
                          k047;
                          k039;
                          k106;
                          k107;
                          k048;
                          k019;
                          k111;
                          k076;
                          k056;
                          k010;
                          k020;
                          k126;
                          k085;
                          k023;
                          k043;
                          k077;
                          k061;
                          k032;
                          k115;
                          k080;
                          k015;
                          k110;
                          k072;
                          k024;
                          k014;
                          k052;
                          k050;
                          k026;
                          k093;
                          k113;
                          k057;
                          k028;
                          k081;
                          k102;
                          k070;
                          k022;
                          k012;
                          k078;
                          k108;
                          k128;
                          k049;
                          k079;
                          k083;
                          k100;
                          k030;
                          k046;
                          k109;
                          k055;
                          k021;
                          k041;
                          k074;
                          bcls;
                          k054;
                          k104;
                          k075;
                          k059;
                          k017;
                          k001;
                          k112;
                          k045;
                          k025;
                          k117;
                          k063;
                          k013;
                          k033;
                          k099;
                          k036;
                          k040;
                          k123;
                          k121;
                          k105;
                          k091;
                          k005;
                          k034;
                          k042;
                          k120;
                          k097;
                          k082;
                          k062;
                          k004;
                          k114;
                          k084;
                          k064;
                          k006;
                          k096;
                          k037;
                          oopr;
                          k122;
                          k069;
                          k027;
                          bopn

  Source                = src(HtmlStm*)

  HtmlStm               = open(TOpenTag);
                          hcom(THtmlComment);
                          key(Key);
                          else(_other_);
                          fun(FunDeclStm);
                          stm(Stm);
                          halt;
                          hdta(TInlineHtml);
                          close(TCloseTag);
                          cls(ClsDeclStm)

  Stm                   = do(Stm, Exp);
                          each(ExpEach, EachStm);
                          if(Exp, IfStm);
                          noop;
                          echo(Exp*);
                          unset(Var*);
                          exp(Exp);
                          brk(Exp);
                          sdecl(StaticVar*);
                          retn(Exp);
                          decl(DeclArg*, DeclStm);
                          blk(HtmlStm*);
                          try(HtmlStm*, Catch*);
                          for(Exp*, Exp*, Exp*, ForStm);
                          use(UseFile);
                          throw(Exp);
                          gdecl(GlobalVar*);
                          while(Exp, WhileStm);
                          cont(Exp);
                          case(Exp, Case*)

  DeclArg               = arg(TString, StaticScalar)

  DeclStm               = std(Stm);
                          new(HtmlStm*)

  ExpEach               = exp(Exp, Var, OptAs)

  OptAs                 = val(Var);
                          non

  EachStm               = std(Stm);
                          new(HtmlStm*)

  Catch                 = catch(TString, TVariable, HtmlStm*)

  UseFile               = cdstr(TDoubleQuote);
                          csstr(TSingleQuote);
                          sstr(TSingleQuote);
                          dstr(TDoubleQuote)

  GlobalVar             = ivar(Var);
                          var(TVariable)

  StaticVar             = var(TVariable, OptVal)

  StaticScalar          = std(CommonScalar);
                          lbl(TString);
                          neg(StaticScalar);
                          pos(StaticScalar);
                          arr(StaticArrayPair*)

  StaticArrayPair       = one(StaticScalar);
                          pair(StaticScalar, StaticScalar)

  CommonScalar          = cls;
                          int(TInteger);
                          line;
                          fun;
                          scc(TString, TString);
                          file;
                          sstr(TSingleQuote);
                          dstr(TDoubleQuote);
                          meth;
                          real(TDouble)

  Case                  = case(Exp, CaseSep, HtmlStm*);
                          dft(CaseSep, HtmlStm*)

  CaseSep               = col;
                          sem

  ForStm                = std(Stm);
                          new(HtmlStm*)

  WhileStm              = new(HtmlStm*);
                          std(Stm)

  IfStm                 = std(Stm, ElseIf*);
                          new(HtmlStm*, ElseIf*)

  ElseIf                = estm(Stm);
                          cstms(Exp, HtmlStm*);
                          estms(HtmlStm*);
                          cstm(Exp, Stm)

  ClsDeclStm            = idecl(TString, TString*, ClsStm*);
                          cdecl(ClsTyp, TString, OptBase, TString*, ClsStm*)

  Modifier              = prot;
                          stat;
                          var;
                          pub;
                          priv;
                          fin;
                          abs

  Constant              = lbl(TString, OptVal)

  ClsStm                = fdecl(Modifier*, FunId, FunPar*, FunBody);
                          vdecl(Modifier*, StaticVar*);
                          cdecl(Constant*)

  FunBody               = body(HtmlStm*);
                          abs

  OptBase               = non;
                          base(TString)

  ClsTyp                = abs;
                          fin;
                          cls

  FunDeclStm            = fdecl(FunId, FunPar*, HtmlStm*)

  FunPar                = pvar(OptTyp, TVariable, OptVal);
                          pref(OptTyp, TVariable, OptVal)

  OptTyp                = lbl(TString);
                          arr;
                          non

  OptVal                = val(StaticScalar);
                          non

  FunId                 = ref(TString);
                          lbl(TString)

  Var                   = var(VarCall, VarProp*);
                          vref(Var)

  VarProp               = vprop(ObjProp, Exp*)

  VarCall               = call(FunCall);
                          base(BaseVar)

  FunCall               = sfun(TString, Exp*);
                          mfun(TString, MethodCall);
                          vfun(RefVar, Exp*)

  MethodCall            = sfun(TString, Exp*);
                          vfun(RefVar, Exp*)

  BaseVar               = nobj(RefVar);
                          smbr(TString, RefVar)

  RefVar                = avar(RefVar, Exp);
                          cvar(CompVar);
                          evar(RefVar, Exp)

  CompVar               = exp(Exp);
                          lbl(TString);
                          iref(CompVar);
                          var(TVariable)

  Exp                   = xor(Exp, Exp);
                          cast(Cast, Exp);
                          sub(Exp, Exp);
                          oref(ClsIdRef, Exp*);
                          bxor(Exp, Exp);
                          not(Exp);
                          neq2(Exp, Exp);
                          use(Exp);
                          vref(Var);
                          diveq(Var, Exp);
                          mlt(Exp, Exp);
                          eqid(Exp, Exp);
                          oinc(Exp);
                          muleq(Var, Exp);
                          sl(Exp, Exp);
                          obj(ClsIdRef, Exp*);
                          vasg(Var, Exp);
                          non;
                          cexp(Exp, Exp, Exp);
                          band(Exp, Exp);
                          bnot(Exp);
                          gt(Exp, Exp);
                          subeq(Var, Exp);
                          oreq(Var, Exp);
                          div(Exp, Exp);
                          le(Exp, Exp);
                          inst(Exp, ClsIdRef);
                          exit2(Exp);
                          andeq(Var, Exp);
                          exit1(Exp);
                          var(Var);
                          neqid(Exp, Exp);
                          ifun(BuiltIn);
                          sr(Exp, Exp);
                          vinc(Var);
                          add(Exp, Exp);
                          incv(Var);
                          sleq(Var, Exp);
                          neq1(Exp, Exp);
                          xoreq(Var, Exp);
                          eq(Exp, Exp);
                          inc(Exp);
                          clone(Exp);
                          pos(Exp);
                          ge(Exp, Exp);
                          affe(Exp);
                          shell(TOpenBQuote, Encaps*, TCloseBQuote);
                          vdec(Var);
                          conc(Exp, Exp);
                          and(Exp, Exp);
                          lt(Exp, Exp);
                          lasg(AsgElm*, Exp);
                          coneq(Var, Exp);
                          arr(ArrayPair*);
                          print(Exp);
                          sreq(Var, Exp);
                          decv(Var);
                          addeq(Var, Exp);
                          modeq(Var, Exp);
                          neg(Exp);
                          mod(Exp, Exp);
                          or(Exp, Exp);
                          lit(Scalar);
                          ouse(Exp);
                          bor(Exp, Exp)

  BuiltIn               = eval(Exp);
                          empty(Var);
                          isset(Var*)

  Cast                  = real1;
                          str;
                          arr;
                          int2;
                          real3;
                          int1;
                          obj;
                          unset;
                          bool2;
                          real2;
                          bool1

  ArrayPair             = one(Exp);
                          pair(Exp, Exp)

  Scalar                = std(CommonScalar);
                          dstr(TOpenDQuote, Encaps*, TCloseDQuote);
                          lbl(TString);
                          hstr(THeredoc, Encaps*, THeredoc);
                          sstr(TOpenSQuote, Encaps*, TCloseSQuote)

  Encaps                = blit(TBLiteral);
                          dlit(TDLiteral);
                          exp2(TDOpenCurly, TString, Exp);
                          hlbl(THeredocEnd);
                          slit(TSLiteral);
                          hlit(THLiteral);
                          lbl(TString);
                          svar(TVariable);
                          int(TInteger);
                          cvar(TOpenCurlyD, Var);
                          else(_other_);
                          exp1(TDOpenCurly, Exp);
                          key(Key)

  AsgElm                = list(AsgElm*);
                          non;
                          var(Var)

  ClsIdRef              = lbl(TString);
                          dref(DynClsIdRef)

  DynClsIdRef           = var(BaseVar);
                          prop(BaseVar, ObjProp*)

  ObjProp               = epart(ObjProp, Exp);
                          apart(ObjProp, Exp);
                          vpart(CompVar)