AST
You can see the AST as a DOM document, the source code of the program beeing the graphical text output, and the DOM beeing a representation of it.
The main node is the program node, and it's structured like this :
Nodes
Every node has a common structure enabling you to scan them and act accordingly.
NOTE : This structure depends also on what options you enable.
Nodes hierarchy
AST
Kind: global class Properties
Name | Type | Description |
withPositions |
| Should locate any node (by default false) |
withSource |
| Should extract the node original code (by default false) |
asT.swapLocations()
Change parent node informations after swapping childs
Kind: instance method of AST
asT.resolvePrecedence()
Check and fix precence, by default using right
Kind: instance method of AST
asT.prepare(kind, parser) ⇒ function
function
Prepares an AST node
Kind: instance method of AST
Param | Type | Description |
kind |
| Defines the node type (if null, the kind must be passed at the function call) |
parser |
| The parser instance (use for extracting locations) |
Last updated