Are there 2 approaches to adding AST functionality in ecmascript: 1) The AST as JSON Either Brendan's original example or the S-expression-ish jsonml. This covers both the in memory representation of the AST and its serialization format. 2) API Similar to the ast module in python where multiple api calls build the AST nodes.