Documentation
¶
Index ¶
Constants ¶
View Source
const ( ISN_NOP = iota ISN_PUSH ISN_POP ISN_AND ISN_OR ISN_NOT ISN_FIND ISN_JZ ISN_JNZ ISN_CLEAR ISN_RET ISN_MAX )
View Source
const ( EOF = iota TOK_ILLEGAL TOK_AND TOK_OR TOK_NOT TOK_TERM TOK_STRING TOK_LPAREN TOK_RPAREN TOK_COLON )
View Source
const ( OPERAND_INVALID = iota OPERAND_INTEGER OPERAND_LABEL OPERAND_TERM )
View Source
const (
PROGRAM_CAPACITY = 512
)
View Source
const (
STACK_CAPACITY = 512
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IOperand ¶
type IOperand interface {
String() string
Bytecode() string
Type() OperandType
TypeString() string
}
type Integer ¶
func MakeInteger ¶
type LabelTable ¶
type LabelTable struct {
// contains filtered or unexported fields
}
var ( LabelOnce sync.Once LabelInst *LabelTable )
func GetLabelTable ¶
func GetLabelTable() *LabelTable
func (*LabelTable) Lookup ¶
func (lt *LabelTable) Lookup(sym string) *Label
func (*LabelTable) MakeLabel ¶
func (lt *LabelTable) MakeLabel() *Label
type Operand ¶
type Operand struct {
// contains filtered or unexported fields
}
func (*Operand) Type ¶
func (o *Operand) Type() OperandType
func (*Operand) TypeString ¶
type OperandType ¶
type OperandType int
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
func (*Parser) PrintSyntax ¶
func (p *Parser) PrintSyntax()
func (*Parser) PrintTokens ¶
func (p *Parser) PrintTokens()
type Program ¶
type Program struct {
// contains filtered or unexported fields
}
func NewProgram ¶
func NewProgram() Program
type ProgramType ¶
type ProgramType [PROGRAM_CAPACITY]*Inst
type StackType ¶
type StackType [STACK_CAPACITY]interface{}
type Syntax ¶
type Syntax struct {
// contains filtered or unexported fields
}
func (*Syntax) MapChildren ¶
func (*Syntax) RemoveChild ¶
Click to show internal directories.
Click to hide internal directories.