Xreate
The Xreate programming language
|
AST node to represent a single instruction or an annotation. More...
#include <ast.h>
AST node to represent a single instruction or an annotation.
Expression is a generic building block of syntax tree which is able to hold node data along with child nodes as operands.
Public Types | |
enum | |
is it string, number, compound operation and so on | |
Public Attributes | |
enum xreate::Expression:: { ... } | __state = INVALID |
is it string, number, compound operation and so on | |
Operator | op |
Valid for compound State. Holds type of compound operator. | |
unsigned int | id |
Unique id to identify expression within syntax tree. | |
std::vector< std::string > | bindings |
Exact meaning depends on particular instruction. More... | |
std::vector< Expression > | operands |
Holds child instructions as arguments. | |
TypeAnnotation | type |
Holds type of instruction's result. | |
std::map< std::string, Expression > | tags |
Holds additional annotations. | |
std::list< CodeScope * > | blocks |
Child code blocks. More... | |
std::vector<std::string> bindings |
Exact meaning depends on particular instruction.
As an example, named lists/structs hold field names in bindings
std::list<CodeScope*> blocks |
Child code blocks.
For example, If statement holds TRUE-branch as first and FALSE-branch as second block here