Computer Science Department
Programming Methods Laboratory

Compilation     winter 99/00
Ecole Polytechnique Federale de Lausanne
J0 Abstract Syntax

P  = ModDecl ident {D}

D  = FD
   | VD

VD = VarDecl T ident

FD = FunDecl RT ident {VD} S

S  = VD
   | FunCall ident {E}
   | Assignment E E
   | Block {S}
   | If E S [S]
   | While E S
   | Return E

E  = Operation Op E E
   | FunCall ident {E}
   | Indexed E E
   | Ident ident
   | NumLit int
   | StrLit String
   | NewArray T E

T  = IntType
   | StringType
   | ArrayType T
   
RT = T
   | VoidType

Op = And | Or | Eq | Ne | Lt | Gt | Le | Ge
   | Add | Sub | Mul | Div | Mod | Neg | Not