Versions in this module Expand all Collapse all v0 v0.0.0 Jan 24, 2025 Changes in this version + const TEST_POSTLUDE + const TEST_PRELUDE + type Arg interface + IsExpr func() bool + IsJump func() bool + IsReg func() bool + IsRelative func() bool + type ArgExpr struct + Expr Expr + func (a ArgExpr) IsExpr() bool + func (a ArgExpr) IsJump() bool + func (a ArgExpr) IsReg() bool + func (a ArgExpr) IsRelative() bool + type ArgJump struct + Arg Token + func (a ArgJump) IsExpr() bool + func (a ArgJump) IsJump() bool + func (a ArgJump) IsReg() bool + func (a ArgJump) IsRelative() bool + type ArgReg struct + Reg Token + func (a ArgReg) Evaluate() (int, error) + func (a ArgReg) IsExpr() bool + func (a ArgReg) IsJump() bool + func (a ArgReg) IsReg() bool + func (a ArgReg) IsRelative() bool + func (a ArgReg) ToExpr() ArgExpr + type Assembler struct + Compiler Compiler + func (asm *Assembler) BuildAssembly(content string, name string, reservedBytes int, reduce bool) ([]byte, error) + func (asm *Assembler) BuildFile(content string, name string, reservedBytes int, reduce bool) ([]byte, error) + type Compiler struct + Boot Section + BootData Section + Bss Section + CurrentSection *Section + Data Section + Labels map[string]*Label + Stack Section + Text Section + func (c *Compiler) CompileToAsm(program []Stmnt, reservedBytes int, reduce bool) ([]byte, error) + func (c *Compiler) CompileToBin(program []Stmnt, reservedBytes int, reduce bool) ([]byte, error) + func (c *Compiler) FormatSections() string + type ExpectedTokenError struct + func (e ExpectedTokenError) Error() string + type Expr interface + Evaluate func(map[string]*Label) (int, error) + IsRelative func() bool + type ExprBinary struct + Left Expr + Operator Token + Right Expr + func (e ExprBinary) Evaluate(labels map[string]*Label) (int, error) + func (exp ExprBinary) IsRelative() bool + func (exp ExprBinary) String() string + type ExprLiteral struct + Operator Token + func (e ExprLiteral) Evaluate(labels map[string]*Label) (int, error) + func (exp ExprLiteral) IsRelative() bool + func (exp ExprLiteral) String() string + type ExprUnary struct + Expression Expr + Operator Token + func (e ExprUnary) Evaluate(labels map[string]*Label) (int, error) + func (exp ExprUnary) IsRelative() bool + func (exp ExprUnary) String() string + type FileRef struct + Filename string + Index int + Line int + func (f FileRef) String() string + type GenericTokenError struct + func (e GenericTokenError) Error() string + type InstrArgCountError struct + func (e InstrArgCountError) Error() string + type InstrArgTypeError struct + ArgN int + Stmnt StmntInstr + func (e InstrArgTypeError) Error() string + type Label struct + Global bool + Name string + Value int + type ReduceIndex struct + Index int + Node *ReduceTrie + func (r *ReduceIndex) Next(instruction StmntInstr) error + type ReduceTrie struct + Children map[string]*ReduceTrie + Depth int + Final bool + Indexes []int + Instr string + Parent *ReduceTrie + TokenType token.Type + func (r *ReduceTrie) AddChild(index int, instruction StmntInstr) (*ReduceTrie, error) + func (r *ReduceTrie) Max() (*ReduceTrie, int, error) + func (r *ReduceTrie) Value() int + type Runner struct + AssemblyName string + Hardware usb.Hardware + Reduce bool + ReservedBytes int + Timeout time.Duration + func (r *Runner) Close() error + func (r *Runner) PortSet() bool + func (r *Runner) RunTest(t *testing.T, asm string, expect string) + func (r *Runner) RunTestWithHeader(t *testing.T, asm string, expect string) + func (r *Runner) SetDefaults() + func (r *Runner) SetupPort() error + type Section struct + Bin []byte + Offset int + Size int + func (s *Section) Validate(name string) error + type Stmnt interface + CanReduce func() bool + Compile func(map[string]*Label) ([]byte, error) + IsFinalReduce func() bool + Size func() int + type StmntDirective struct + Directive Token + func (s StmntDirective) CanReduce() bool + func (s StmntDirective) Compile(labels map[string]*Label) ([]byte, error) + func (s StmntDirective) IsFinalReduce() bool + func (s StmntDirective) Size() int + type StmntGlobal struct + Label Token + func (s StmntGlobal) CanReduce() bool + func (s StmntGlobal) Compile(labels map[string]*Label) ([]byte, error) + func (s StmntGlobal) IsFinalReduce() bool + func (s StmntGlobal) Size() int + func (s StmntGlobal) String() string + type StmntInstr struct + Args []Arg + Instruction Token + func (s *StmntInstr) Setup() + func (s *StmntInstr) String() string + func (s StmntInstr) CanReduce() bool + func (s StmntInstr) Compile(labels map[string]*Label) ([]byte, error) + func (s StmntInstr) IsFinalReduce() bool + func (s StmntInstr) Size() int + type StmntInt struct + Args []ArgExpr + func (s StmntInt) CanReduce() bool + func (s StmntInt) Compile(labels map[string]*Label) ([]byte, error) + func (s StmntInt) IsFinalReduce() bool + func (s StmntInt) Size() int + func (s StmntInt) String() string + type StmntLabel struct + Label Token + func (s StmntLabel) CanReduce() bool + func (s StmntLabel) Compile(labels map[string]*Label) ([]byte, error) + func (s StmntLabel) IsFinalReduce() bool + func (s StmntLabel) Size() int + func (s StmntLabel) String() string + type Token struct + Lexeme string + Number int + Ref FileRef + TokenType token.Type + func (t *Token) Equal(other *Token) bool + func (t Token) String() string + type UnfinishedError struct + func (e UnfinishedError) Error() string + type UnknownIdentifierError struct + func (e UnknownIdentifierError) Error() string + type UnknownTokenError struct + func (e UnknownTokenError) Error() string