Xreate
The Xreate programming language
Public Types | Public Attributes | List of all members
Expression Struct Reference

AST node to represent a single instruction or an annotation. More...

#include <ast.h>

Detailed Description

AST node to represent a single instruction or an annotation.

Attention
In case of any changes update xreate::ExpressionHints auxiliary helper as well

Expression is a generic building block of syntax tree which is able to hold node data along with child nodes as operands.

Note
For types the expression-like data structure TypeAnnotation is used rather than Expression itself.
See also
xreate::AST, xreate::TypeAnnotation

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< Expressionoperands
 Holds child instructions as arguments.
 
TypeAnnotation type
 Holds type of instruction's result.
 
std::map< std::string, Expressiontags
 Holds additional annotations.
 
std::list< CodeScope * > blocks
 Child code blocks. More...
 

Member Data Documentation

◆ bindings

std::vector<std::string> bindings

Exact meaning depends on particular instruction.

As an example, named lists/structs hold field names in bindings

◆ blocks

std::list<CodeScope*> blocks

Child code blocks.

For example, If statement holds TRUE-branch as first and FALSE-branch as second block here


The documentation for this struct was generated from the following files: