Expand description

The “parser” stage turns the stream of lexemes (from the lexer) into ab “abstract syntax tree”.

There is some validation when going from lexeme stream to AST, but not all of it.

Structs

The Abstract Syntax Tree of a Dmgrs program.

A block of statements

A constant declaration: const FOO = EXPR;

A function in the program.

A single instruction within a function.

Wraps a span around any other type.

A static declaration: static FOO: [u8] = [BYTE, BYTE, BYTE, ...];

Enums

Attributes for the program or for a specific fn or static.

Where to branch the loop to

An “expression” means an integer constant expression.

An argument to an instruction.

An item is anything that can appear at the top level of a source file.

The type of a static item.

A single statement within a block.