-
Notifications
You must be signed in to change notification settings - Fork 3
AST design
Freeman Man edited this page Apr 19, 2016
·
7 revisions
Guide to create abstract syntax tree
create a node if the node is changing type, same applies to terminals
e.g.
- AssignmentExpression(Expression) to ExpressionStatement(Statement)
- IdentifierReference(Expression) to Identifier to IDENTIFIER, IdentifierReference(Expression) will be the last point we create a node
avoid creating a new node if what it is doing is just type casting
e.g.
- from NewExpression to MemberExpression
... more?