--description of the abstract syntax of ModulaX --in ASDL v.1.2 module ModulaX { program = (module) module = (identifier, block) block = (declaration*, stmt*) declaration = DECLCONST (identifier, typ?, expr) | DECLTYPE (typedeclaration) | DECLTYPEREC (typedeclaration*) | DECLVAR (identifier*, typ?, expr?) | DECLPROC (identifier, signature, block) typedeclaration = (identifier, typ) signature = (formal*, typ?) formal = (identifier*, mode?, typ) mode = VALUE | VAR stmt = STMTBLOCK (block) | STMTASSIGN (expr lhs, expr rhs) | STMTCALL (proccall) | STMTEXIT | STMTEVAL (expr) | STMTFOR (identifier index, expr from, expr to, expr? by, stmt*) | STMTIF (expr condition, stmt* thenpart, elsifclause*, elseclause?) | STMTLOOP (stmt*) | STMTREAD (string format, expr*) | STMTREPEAT (stmt*, expr condition) | STMTRETURN (expr?) | STMTWHILE (expr condition, stmt*) | STMTWRITE (string format, expr*) elsifclause = (expr condition, stmt*) elseclause = (stmt*) typ = TYPARRAY (typ* indextypes, typ elementtype) | TYPRECORD (field*) | TYPSUBRANGE (expr lowbound, expr highbound) | TYPID (identifier) | TYPREF (typ) field = (identifier, typ) expr = EXPRBINARY (expr, binary, expr) | EXPRUNARY (unary, expr) | EXPRID (identifier) | EXPRINT (int) | EXPRREAL (real) | EXPRTEXT (string) | EXPRRECSEL (expr, identifier) | EXPRARRAYREF (expr, expr*) | EXPRPROCCALL (proccall) | EXPRDEREF (expr) | EXPRNEW (typ) | EXPRNIL (typ) proccall = (expr, expr*) binary = OR | AND | EQUAL | NEQUAL | LESS | GREATER | LE | GE | ADD | SUB | MUL | DIV | MOD unary = NOT | UPLUS | UMINUS real = (int mantissa, int exp) }