Skip to content
This repository was archived by the owner on Oct 11, 2025. It is now read-only.

AST design

Freeman Man edited this page Apr 19, 2016 · 7 revisions

Guide to create abstract syntax tree

  • create terminals at the latest node possible before it changes type -- e.g. IdentifierReference(Expression) to IDENTIFIER, IdentifierReference(Expression) will be the last point we create a node
  • create a node if the node is changing type -- e.g. Expression to Statement
  • avoid creating a new node if what it is doing is just type casting -- e.g. from NewExpression to MemberExpression

... more?

Clone this wiki locally