ProgramBlock
|Block⟩ ';'
DeclsDeclList
| ε
DeclListDecl
|Decl⟩ ; ⟨DeclList
Decl 'VAR' idOptType
| 'TYPE' id '=' ⟨Type
|ProcDecl
OptType ε
| ':' ⟨Type
ProcDecl 'PROC' id '(' ⟨Formals⟩ ')' ⟨OptType⟩ '=' ⟨Block
| 'PROC' id '(' ⟨Formals⟩ ')' '=' ⟨Block
FormalsFormalList
| ε
FormalListFormal
|FormalList⟩ ',' ⟨Formal
Formal id ':' ⟨Type
Type 'INT'
|SubrTy
|ArrayTy
| id
|ProcTy
SubrTy '[' number 'TO' number ']'
ArrayTy 'ARRAY' ⟨SubrTy⟩ 'OF' ⟨Type
ProcTy 'PROC' '(' ⟨Formals⟩ ')' ⟨OptType
BlockDecls⟩ 'BEGIN' ⟨Stmts⟩ 'END'
StmtsStmtList
| ε
StmtListStmt
|StmtList⟩ ';' ⟨Stmt
StmtAssignment
|Return
|Block
|Conditional
|Iteration
|Output
|Expr
AssignmentExpr⟩ ':=' ⟨Expr
Return 'RETURN' ⟨Expr
Conditional 'IF' ⟨Expr⟩ 'THEN' ⟨StmtList⟩ 'ELSE' ⟨StmtList⟩ 'END'
Iteration 'WHILE' ⟨Expr⟩ 'DO' ⟨StmtList⟩ 'END'
Output 'PRINT' ⟨Expr
ExprOperand
|Expr⟩ ⟨Operator⟩ ⟨Operand
Operand number
| id
|Operand⟩ '[' ⟨Expr⟩ ']'
|Operand⟩ '(' ⟨Actuals⟩ ')'
| '(' ⟨Expr⟩ ')'
Operator '+'
| '>'
| '=='
| 'AND'
ActualsActualList
| ε
ActualListExpr
|Actuals⟩ ',' ⟨Expr

where number is a terminal symbol that describes integer numbers, and id is a terminal symbol that describes identifiers made up of a single letter followed by a sequences of letters and digits.