Module phile::ast
[−]
[src]
This module contains types for building Abstract Syntax Trees
(ASTs). ASTs describe the syntactic structure of PHiLe programs.
Defined here are various kinds of AST nodes that the parser
module emits from a sequence of tokens produced by the lexer
module. AST nodes, like tokens, contain source location data
in order to easily map them to the original source code.
Structs
Argument |
Declaration of a single function argument. |
BinaryOp |
Any binary operator. |
Call |
A function call operation. |
ClassDecl |
Definition of a |
CondExp |
A conditional expression or 'Elvis operator', |
EnumDecl |
Definition of an |
Field |
A field specification within a struct or class type definition. |
Function |
A function definition. |
FunctionTy |
A function type. |
If |
An if statement or expression. |
Impl |
Implementation of the methods of a user-defined type. |
Match |
A match statement or expression. |
MemberAccess |
Dot syntax for accessing fields and methods. |
Node |
Generic AST node (helper for Exp, Ty, etc.) |
Prog |
Root of the AST. |
QualAccess |
Namespace-style member access, for e.g. enums. |
RelDecl |
Declaration of an explicit relation between two class types.
A |
Struct |
A struct literal. |
StructDecl |
Definition of a |
Subscript |
An indexing or subscripting operator. |
VarDecl |
A variable declaration statement for locals. |
Variant |
Definition of one enum variant. |
Enums
ExpKind |
Type and value of an |
Item |
A top-level source item. |
TyKind |
Type and value of a |
Type Definitions
Exp |
AST node representing an expression. |
Ty |
AST node representing a type annotation. |