Table of Contents

3.0.2 Node Types

All AST nodes inherit SyntaxNode. SyntaxNode is an abstract node type. It associates a semantic ID (SyntaxNodeId) with a specific location in a workspace source file.

The node types derived directly from SyntaxNode are as follows:

Node type Described in
DirectiveNode RD-VBAL §3.1 Attributes and Directives
ExpressionNode RD-VBAL §3.2.0 Literal Expressions, RD-VBAL §3.3.0 Operator Expressions, RD-VBAL §5.6 Expressions
StatementNode RD-VBAL §3.4.0 Statements

Every statement node derives from StatementNode, which implements IExecutableNode. A statement node's Inputs are the expressions evaluated immediately before the statement executes.

Expression Nodes

The following expression node types have their own semantics pages:

Expression Node type Described in
A bare name SimpleNameExpressionNode RD-VBAL §5.6.10 Simple Name Expressions
Member access MemberAccessExpressionNode RD-VBAL §5.6.12 Member Access Expressions
Index IndexExpressionNode RD-VBAL §5.6.13 Index Expressions
Dictionary access DictionaryAccessExpressionNode RD-VBAL §5.6.14 Dictionary Access Expressions
New <class> NewExpressionNode RD-VBAL §5.6.8 New Expressions
TypeOf <expr> Is <type> TypeOfIsExpressionNode RD-VBAL §5.6.7 TypeOf...Is Expressions

The target of an assignment statement draws from the first four: member access, index, dictionary access, or a bare name (RD-VBAL §3.4.2 Simple Statements).

Unbuilt Trivia Nodes

A grammar alternative that the parser recognizes but has no dedicated node type for is never silently dropped from the AST. It is never folded into an unrelated node either. It is preserved as an Unbuilt trivia node:

Position Node type
Expression UnbuiltExpressionTriviaNode
Statement UnbuiltStatementTriviaNode, the statement-position counterpart of UnbuiltExpressionTriviaNode

An Unbuilt trivia node carries:

  • the exact original source text of the construct;
  • whatever sub-expression the parser's own walk already built underneath it.

The Unbuilt trivia fallback keeps the AST a faithful, lossless representation of the source, even where a proper semantic node does not exist. The fallback applies to any construct without a dedicated node type.


⏮️ RD-VBAL §3.0.1 Token Semantics | ⏭️ RD-VBAL §3.0.3 Binding Contexts