Module ast

Source
Expand description

The AST (abstract-syntax-tree) types with an integrated type checker.

Structs§

Function
A function statement, the basis for the whole language.
FunctionCall
A function call expression.
If
A node for an if statement, giving an expression to evaluate along with a body of multiple statements.
Parameter
AST node that contains a parameter (used inside of function declerations or for the start of Variable).
Variable
Variable that includes a parameter but extends with a recursive ExpressionNode.
WhileLoop
A while loop. This goes down into WhileLoop.

Enums§

BinOp
A binary operation type. Having a seperate enum for this avoids repitition and allows for some optimisations downstream.
Constant
Similar to the VarType enum but with defined data in each possible option.
ExpressionNode
The main expression enum, allowing for grouping of all expressions inside of the AST.
StatementNode
The main statement enum, allowing for grouping of statements inside of the AST.
VarType
Variable types for zypo-rs.