Haseeb
Haseeb
Assignment # 02
Grammar
Function Type identifier < ArgList > CompoundStmt
ArgList Arg | ArgList ,Arg
Arg Type identifier
Declaration Type IdentList ;
Type int | float
IdentList identifier ,IdentList | identifier
Stmt ForStmt | WhileStmt | Expr ;| IfStmt
| CompoundStmt | Declaration | ;
ForStmt for < Expr ; OptExpr ; OptExpr > Stmt
OptExpr Expr |
LoopStmt loop < Expr > Stmt
IfStmt agar < Expr > Stmt MagarPart
MagarPart magar Stmt |
CompoundStmt { StmtList }
StmtList StmtListStmt |
Expr Rvalue
Rvalue Rvalue Compare Mag | Mag
Compare == | < | > | <= | >= | != | <>
Mag Mag + Term | Mag – Term | Term
Term Term * Factor | Term / Factor | Factor
Factor < Expr > | identifier | number
StmtList StmtList’
StmtList’ Stmt StmtList’|
Expr Rvalue
Function Int,float $
ArgList’ , >
IdentList identifier ;
IdentList’ , ;
LoopStmt loop