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

  • Binding binding element of AST. Basic entity for values re-declaration, to bind new values for already declared values.
  • CodeLocation code location of source for AST elements. Contains: line nad position.
  • Constant constant declaration element of AST. Basic constant entity contains:
  • ConstantExpression constant 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.
  • ConstantName constant name for Constant elements of AST
  • Expression element 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.
  • ExpressionCondition expression condition element of AST. Used in ExpressionLogicCondition for IfCondition declaration. It contains condition between twe expressions.
  • Logic expression condition
  • ExpressionStructValue expression struct value element of AST. Used for expression value declaration. The basic entity is:
  • FunctionCall function call element of AST. Basic entity for function call representation.
  • FunctionName function name for Function elements of AST.
  • FunctionParameter function parameter element of AST. Used for FunctionStatement declaration.
  • FunctionStatement it’s one of the most basic element of AST. Basic entity of program logic. It contains function declaration and function body.
  • Basic Ident entity for elements of AST
  • IfStatement if statement AST element. Contains full representation of if statement with entities:
  • Import name element of AST
  • LetBinding let binding element of AST. Basic entity for values declarations.
  • ParameterName parameter name element of AST, used for Function parameters declaration.
  • StructType struct type basic element used for StructTypes. It contains basic elements:
  • StructTypes struct type element of AST. Basic entity to declare struct complex types and its attributes.
  • ValueName value name element of AST. It’s basic entity for:

Enums

  • BodyStatement one of the basic AST elements. It’s part of Function body.
  • Condition condition declarations. Used for ExpressionCondition. Contains basic condition entities: <. >, ==, <=, >=, !=
  • ConstantValue constant value element of AST. Used for ConstantExpression. Constant value basic entities:
  • ExpressionOperations expression operation element of AST. Used for expression operations:
  • ExpressionValue expression value element of AST. Basic entity for Expression elements of AST. Expression value contains entities:
  • IfBodyStatement statement of if-body elements tree of AST. Used as body statement of If-control flow.
  • IfBodyStatements set of elements in the AST, that represents control flow: if, loop
  • IfCondition if-condition control flow element of AST. One of the basic control flow. Basic entities:
  • IfLoopBodyStatement statement of loop-if-body elements tree of AST. Used as body statement of If-control flow in the Loop AST element.
  • LogicCondition declaration of logical condition operation. It can contains only: and, or. Used for IfCondition element of AST.
  • LoopBodyStatement statement of loop-body elements tree of AST. Used as body statement of loop-control flow.
  • MainStatement main AST statement for all elements.
  • PrimitiveTypes primitive types elements of AST. It’s represent basic (primitive) types.
  • PrimitiveValue represents primitive value element of AST. Values based on primitive types. Used for ConstantValue and ExpressionValue.
  • Type element of AST. Basic entity that represents types. Basic type entity is:

Constants

Traits

  • GetLocation represent location of source data for AST element. Useful to locate specific source code location, especially for Ident.
  • GetName trait, represent name of specific entity.

Type Aliases