Module semantic_analyzer::ast
source · Expand description
AST representation
AST
Abstract Syntax Tree representation contains tree node that
represent full cycle and aspects of the programming language, and
represent Turing-complete state machine.
Structs
Bindingbinding element of AST. Basic entity forvaluesre-declaration, to bind new values for already declared values.CodeLocationcode location of source for AST elements. Contains:linenadposition.Constantconstant declaration element of AST. Basic constant entity contains:ConstantExpressionconstant expression element of AST. Used to declare constants. The constant expression value based on other constant or primitive values. Constant Expression can contain optional expression operation with other constant expression. So it can be represented as Constant expression tree as operations with other constant expressions.ConstantNameconstant name forConstantelements of ASTExpressionelement of AST is basic entity that represent expression, and optionally expression with optional operations with other expression. So it can be expression tree with expression operations.ExpressionConditionexpression condition element of AST. Used inExpressionLogicConditionforIfConditiondeclaration. It contains condition between twe expressions.- Logic expression condition
ExpressionStructValueexpression struct value element of AST. Used for expression value declaration. The basic entity is:FunctionCallfunction call element of AST. Basic entity for function call representation.FunctionNamefunction name forFunctionelements of AST.FunctionParameterfunction parameter element of AST. Used forFunctionStatementdeclaration.FunctionStatementit’s one of the most basic element of AST. Basic entity of program logic. It contains function declaration and function body.- Basic
Idententity for elements of AST IfStatementif statement AST element. Contains full representation of if statement with entities:- Import name element of AST
LetBindinglet binding element of AST. Basic entity forvaluesdeclarations.ParameterNameparameter name element of AST, used forFunctionparameters declaration.StructTypestruct type basic element used forStructTypes. It contains basic elements:StructTypesstruct type element of AST. Basic entity to declare struct complex types and its attributes.ValueNamevalue name element of AST. It’s basic entity for:
Enums
BodyStatementone of the basic AST elements. It’s part of Function body.Conditioncondition declarations. Used forExpressionCondition. Contains basic condition entities:<. >, ==, <=, >=, !=ConstantValueconstant value element of AST. Used forConstantExpression. Constant value basic entities:ExpressionOperationsexpression operation element of AST. Used for expression operations:ExpressionValueexpression value element of AST. Basic entity forExpressionelements of AST. Expression value contains entities:IfBodyStatementstatement of if-body elements tree of AST. Used as body statement of If-control flow.IfBodyStatementsset of elements in the AST, that represents control flow:if,loopIfConditionif-condition control flow element of AST. One of the basic control flow. Basic entities:IfLoopBodyStatementstatement of loop-if-body elements tree of AST. Used as body statement of If-control flow in theLoopAST element.LogicConditiondeclaration of logical condition operation. It can contains only:and,or. Used forIfConditionelement of AST.LoopBodyStatementstatement of loop-body elements tree of AST. Used as body statement of loop-control flow.MainStatementmain AST statement for all elements.PrimitiveTypesprimitive types elements of AST. It’s represent basic (primitive) types.PrimitiveValuerepresents primitive value element of AST. Values based on primitive types. Used forConstantValueandExpressionValue.Typeelement of AST. Basic entity that represents types. Basic type entity is:
Constants
- Max priority level fpr expressions operations
Traits
GetLocationrepresent location of source data for AST element. Useful to locate specific source code location, especially forIdent.GetNametrait, represent name of specific entity.
Type Aliases
- Imports with full path of import
- Main