9
CS269: HW/SW Engineering of Embedded Systems, Winter02
Abstract syntax trees
•Nodes of the ASTs are defined in a class hierarchy
•Nodes provide a constructor that defines all children and fields:
–a child
•a single node
•a list of nodes
–a terminal symbol
•identifier
•set of modifiers
•constants
•Annotations store semantic information.
ExprNode
BinaryOpNode
LiteralNode
LogCondNode
CandNode(
  ExprNode exp1, ExprNode exp2)
TreeNode
CandNode
NameNode
Absent
TreeNode
StringLitNode(
  String lit)
StringLitNode