CS450 Compiler Design
79
2) Contextual Analysis --> Decorated AST
Program
LetCommand
SequentialDeclaration
n
Ident
Ident
Ident
Ident
SimpleT
VarDecl
SimpleT
VarDecl
Integer
c
Char
c
‘&’
n
n
+
1
Ident
Ident
Ident
Op
Char.Lit
Int.Lit
SimpleV
Char.Expr
SimpleV
VNameExp
Int.Expr
AssignCommand
BinaryExpr
SequentialCommand
AssignCommand
:char
:char
:int
:int
:int
:int
SimpleV
:int