Package com.ezylang.evalex.parser
Class ASTNode
- java.lang.Object
-
- com.ezylang.evalex.parser.ASTNode
-
public class ASTNode extends java.lang.ObjectExpressions are parsed into an abstract syntax tree (AST). The tree has one root node and each node has zero or more children (parameters), depending on the operation. A leaf node is a numerical or string constant that has no more children (parameters). Other nodes define operators, functions and special operations like array index and structure separation.The tree is evaluated from bottom (leafs) to top, in a recursive way, until the root node is evaluated, which then holds the result of the complete expression.
To be able to visualize the tree, a
toJSONmethod is provided. The produced JSON string can be used to visualize the tree. OE.g. with this online tool:
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringtoJSON()Produces a JSON string representation of this node ad all its children.
-