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 class type.

CondExp

A conditional expression or 'Elvis operator', ?:.

EnumDecl

Definition of an enum type.

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 RelDecl node semantically means that the LHS of the relation is the class in which the RelDecl is contained, while the RHS is the type of the corresponding field.

Struct

A struct literal.

StructDecl

Definition of a struct type.

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 Exp expression node.

Item

A top-level source item.

TyKind

Type and value of a Ty type node.

Type Definitions

Exp

AST node representing an expression.

Ty

AST node representing a type annotation.