pub enum AstNode {
Show 35 variants
Byte(u8),
Short(u16),
LiteralByte(u8),
LiteralShort(u16),
Instruction(Instruction),
LabelDef(Rune, String),
LabelRef {
label: String,
rune: Rune,
token: TokenWithPos,
},
SublabelDef(TokenWithPos),
SublabelRef(TokenWithPos),
RelativeRef(TokenWithPos),
ConditionalRef(TokenWithPos),
RawAddressRef(TokenWithPos),
JSRRef(TokenWithPos),
HyphenRef(TokenWithPos),
Padding(u16),
PaddingLabel(TokenWithPos),
RelativePadding(u16),
RelativePaddingLabel(TokenWithPos),
MacroDef(String, Vec<AstNode>),
MacroCall(String, usize, usize),
RawString(Vec<u8>),
Include(TokenWithPos),
DotRef(TokenWithPos),
SemicolonRef(TokenWithPos),
EqualsRef(TokenWithPos),
CommaRef(TokenWithPos),
UnderscoreRef(TokenWithPos),
QuestionRef(TokenWithPos),
ExclamationRef(TokenWithPos),
ConditionalBlockStart(TokenWithPos),
ConditionalBlockEnd(TokenWithPos),
LambdaStart(TokenWithPos),
LambdaEnd(TokenWithPos),
Eof,
Ignored,
}Expand description
AST node types
Variants§
Byte(u8)
Raw byte value
Short(u16)
16-bit short value
LiteralByte(u8)
Literal byte value (prefixed with #)
LiteralShort(u16)
Literal short value (prefixed with #)
Instruction(Instruction)
Instruction with mode flags
LabelDef(Rune, String)
Label definition
LabelRef
Label reference
SublabelDef(TokenWithPos)
Sublabel definition
SublabelRef(TokenWithPos)
Sublabel reference
RelativeRef(TokenWithPos)
Relative address reference
ConditionalRef(TokenWithPos)
Conditional jump reference
RawAddressRef(TokenWithPos)
Raw address reference
JSRRef(TokenWithPos)
JSR call reference
HyphenRef(TokenWithPos)
Hyphen address reference
Padding(u16)
Padding to specific address
PaddingLabel(TokenWithPos)
RelativePadding(u16)
Relative padding by hex count ($1234)
RelativePaddingLabel(TokenWithPos)
Relative padding to label ($label)
MacroDef(String, Vec<AstNode>)
Macro definition
MacroCall(String, usize, usize)
Macro call (name, line, position)
RawString(Vec<u8>)
Raw string data
Include(TokenWithPos)
Include directive
DotRef(TokenWithPos)
Dot reference - generates LIT + 8-bit address (like uxnasm’s ‘.’ rune)
SemicolonRef(TokenWithPos)
Semicolon reference - generates LIT2 + 16-bit address (like uxnasm’s ‘;’ rune)
EqualsRef(TokenWithPos)
Equals reference - generates 16-bit address directly (like uxnasm’s ‘=’ rune)
CommaRef(TokenWithPos)
Comma reference - generates LIT + relative 8-bit address (like uxnasm’s ‘,’ rune)
UnderscoreRef(TokenWithPos)
Underscore reference - generates relative 8-bit address (like uxnasm’s ‘_’ rune)
QuestionRef(TokenWithPos)
Question reference - generates conditional jump (like uxnasm’s ‘?’ rune)
ExclamationRef(TokenWithPos)
Exclamation reference - generates JSR call (like uxnasm’s ‘!’ rune)
ConditionalBlockStart(TokenWithPos)
Conditional block start (e.g., ?{) - lambda id for auto label
ConditionalBlockEnd(TokenWithPos)
Conditional block end (e.g., }) - lambda id for auto label
LambdaStart(TokenWithPos)
Lambda block start ‘{’ (standalone, not ‘?{’)
LambdaEnd(TokenWithPos)
Lambda block end ‘}’ corresponding to LambdaStart