Documentation ¶
Index ¶
- type AddExp
- type AddExpHandler
- type BaseExp
- type BaseFactor
- type BaseStatement
- type BitMode
- type CharFactor
- type CharFactorHandler
- type ConfigStmt
- type ConfigStmtHandler
- type ConfigType
- type DataType
- type DeclareStmt
- type DeclareStmtHandler
- type DefaultHandler
- type Exp
- type ExportSymStmt
- type ExportSymStmtHandler
- type ExternSymStmt
- type ExternSymStmtHandler
- type Factor
- type HexFactor
- type HexFactorHandler
- type IdentFactor
- type IdentFactorHandler
- type ImmExp
- type ImmExpHandler
- type JumpType
- type LabelStmt
- type LabelStmtHandler
- type MemoryAddrExp
- type MemoryAddrExpHandler
- type MnemonicStmt
- type MnemonicStmtHandler
- type MultExp
- type MultExpHandler
- type Node
- type NumberFactor
- type NumberFactorHandler
- type Prog
- type Program
- type ProgramHandler
- type SegmentExp
- type SegmentExpHandler
- type Statement
- type StringFactor
- type StringFactorHandler
- type SupCPU
- type SupCPURange
- type Visitor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddExpHandler ¶
type BaseFactor ¶
type BaseFactor struct{}
func (BaseFactor) Type ¶
func (b BaseFactor) Type() string
type BaseStatement ¶
type BaseStatement struct{}
func (BaseStatement) Type ¶
func (b BaseStatement) Type() string
type CharFactor ¶
type CharFactor struct { BaseFactor Value string }
func NewCharFactor ¶
func NewCharFactor(baseFactor BaseFactor, value string) *CharFactor
NewCharFactor Create a new CharFactor
func (CharFactor) TokenLiteral ¶
func (c CharFactor) TokenLiteral() string
type CharFactorHandler ¶
type CharFactorHandler interface {
CharFactor(*CharFactor) bool
}
type ConfigStmt ¶
type ConfigStmt struct { BaseStatement ConfigType ConfigType Factor Factor }
func NewConfigStmt ¶
func NewConfigStmt(baseStatement BaseStatement, configType ConfigType, factor Factor) *ConfigStmt
NewConfigStmt Create a new ConfigStmt
func (ConfigStmt) TokenLiteral ¶
func (c ConfigStmt) TokenLiteral() string
type ConfigStmtHandler ¶
type ConfigStmtHandler interface {
ConfigStmt(*ConfigStmt) bool
}
type ConfigType ¶
type ConfigType string
TODO: go generateで作成できないか
const ( Bits ConfigType = "BITS" InstrSet ConfigType = "INSTRSET" Optimize ConfigType = "OPTIMIZE" Format ConfigType = "FORMAT" Padding ConfigType = "PADDING" PadSet ConfigType = "PADSET" Section ConfigType = "SECTION" Absolute ConfigType = "ABSOLUTE" File ConfigType = "FILE" )
func NewConfigType ¶
func NewConfigType(s string) (ConfigType, bool)
type DeclareStmt ¶
type DeclareStmt struct { BaseStatement Id *IdentFactor Value Exp // interfaceはポインタにしない }
func NewDeclareStmt ¶
func NewDeclareStmt(baseStatement BaseStatement, id *IdentFactor, value Exp) *DeclareStmt
NewDeclareStmt Create a new DeclareStmt
func (DeclareStmt) TokenLiteral ¶
func (d DeclareStmt) TokenLiteral() string
type DeclareStmtHandler ¶
type DeclareStmtHandler interface {
DeclareStmt(*DeclareStmt) bool
}
type DefaultHandler ¶
type ExportSymStmt ¶
type ExportSymStmt struct { BaseStatement Symbols []*IdentFactor }
func NewExportSymStmt ¶
func NewExportSymStmt(baseStatement BaseStatement, symbols []*IdentFactor) *ExportSymStmt
NewExportSymStmt Create a new ExportSymStmt
func (ExportSymStmt) TokenLiteral ¶
func (es ExportSymStmt) TokenLiteral() string
type ExportSymStmtHandler ¶
type ExportSymStmtHandler interface {
ExportSymStmt(*ExportSymStmt) bool
}
type ExternSymStmt ¶
type ExternSymStmt struct { BaseStatement Symbols []*IdentFactor }
func NewExternSymStmt ¶
func NewExternSymStmt(baseStatement BaseStatement, symbols []*IdentFactor) *ExternSymStmt
NewExternSymStmt Create a new ExternSymStmt
func (ExternSymStmt) TokenLiteral ¶
func (es ExternSymStmt) TokenLiteral() string
type ExternSymStmtHandler ¶
type ExternSymStmtHandler interface {
ExternSymStmt(*ExternSymStmt) bool
}
type HexFactor ¶
type HexFactor struct { BaseFactor Value string }
func NewHexFactor ¶
func NewHexFactor(baseFactor BaseFactor, value string) *HexFactor
NewHexFactor Create a new HexFactor
func (HexFactor) TokenLiteral ¶
type HexFactorHandler ¶
type IdentFactor ¶
type IdentFactor struct { BaseFactor Value string }
func NewIdentFactor ¶
func NewIdentFactor(baseFactor BaseFactor, value string) *IdentFactor
NewIdentFactor Create a new IdentFactor
func (IdentFactor) TokenLiteral ¶
func (i IdentFactor) TokenLiteral() string
type IdentFactorHandler ¶
type IdentFactorHandler interface {
IdentFactor(*IdentFactor) bool
}
type ImmExpHandler ¶
type LabelStmt ¶
type LabelStmt struct { BaseStatement Label *IdentFactor }
func NewLabelStmt ¶
func NewLabelStmt(baseStatement BaseStatement, label *IdentFactor) *LabelStmt
NewLabelStmt Create a new LabelStmt
func (LabelStmt) TokenLiteral ¶
type LabelStmtHandler ¶
type MemoryAddrExp ¶
type MemoryAddrExp struct { BaseExp DataType DataType JumpType JumpType Left *AddExp Right *AddExp // nullable }
func NewMemoryAddrExp ¶
func NewMemoryAddrExp(baseExp BaseExp, dataType DataType, jumpType JumpType, left *AddExp, right *AddExp) *MemoryAddrExp
NewMemoryAddrExp Create a new MemoryAddrExp
func (MemoryAddrExp) TokenLiteral ¶
func (m MemoryAddrExp) TokenLiteral() string
type MemoryAddrExpHandler ¶
type MemoryAddrExpHandler interface {
MemoryAddrExp(*MemoryAddrExp) bool
}
type MnemonicStmt ¶
type MnemonicStmt struct { BaseStatement Opcode *IdentFactor Operands []Exp }
func NewMnemonicStmt ¶
func NewMnemonicStmt(baseStatement BaseStatement, opcode *IdentFactor, operands []Exp) *MnemonicStmt
NewMnemonicStmt Create a new MnemonicStmt
func (MnemonicStmt) TokenLiteral ¶
func (ms MnemonicStmt) TokenLiteral() string
type MnemonicStmtHandler ¶
type MnemonicStmtHandler interface {
MnemonicStmt(*MnemonicStmt) bool
}
type MultExpHandler ¶
type NumberFactor ¶
type NumberFactor struct { BaseFactor Value int }
func NewNumberFactor ¶
func NewNumberFactor(baseFactor BaseFactor, value int) *NumberFactor
NewNumberFactor Create a new NumberFactor
func (NumberFactor) TokenLiteral ¶
func (n NumberFactor) TokenLiteral() string
type NumberFactorHandler ¶
type NumberFactorHandler interface {
NumberFactor(*NumberFactor) bool
}
type ProgramHandler ¶
type SegmentExp ¶
func NewSegmentExp ¶
func NewSegmentExp(baseExp BaseExp, dataType DataType, left *AddExp, right *AddExp) *SegmentExp
NewSegmentExp Create a new SegmentExp
func (SegmentExp) TokenLiteral ¶
func (s SegmentExp) TokenLiteral() string
type SegmentExpHandler ¶
type SegmentExpHandler interface {
SegmentExp(*SegmentExp) bool
}
type StringFactor ¶
type StringFactor struct { BaseFactor Value string }
func NewStringFactor ¶
func NewStringFactor(baseFactor BaseFactor, value string) *StringFactor
NewStringFactor Create a new StringFactor
func (StringFactor) TokenLiteral ¶
func (s StringFactor) TokenLiteral() string
type StringFactorHandler ¶
type StringFactorHandler interface {
StringFactor(*StringFactor) bool
}
type SupCPU ¶
type SupCPU int
const ( SUP_8086 SupCPU = 0 SUP_80186 SupCPU = 1 SUP_80286 SupCPU = 2 SUP_80386 SupCPU = 3 SUP_80486 SupCPU = 4 SUP_Pentium SupCPU = 5 SUP_PentiumWithMMX SupCPU = 6 SUP_PentiumPro SupCPU = 7 SUP_Pentium2 SupCPU = 8 SUP_Pentium3 SupCPU = 9 SUP_Pentium4 SupCPU = 10 SUP_Core SupCPU = 11 SUP_Core2 SupCPU = 12 SUP_Core7 SupCPU = 13 SUP_Itanium SupCPU = 99 )
http://ref.x86asm.net/index.html -------------------------------- 00: 8086 01: 80186 02: 80286 03: 80386 (i386) 04: 80486 (i486) P1 (05): Pentium (1) PX (06): Pentium with MMX PP (07): Pentium Pro P2 (08): Pentium II P3 (09): Pentium III P4 (10): Pentium 4 C1 (11): Core (1) C2 (12): Core 2 C7 (13): Core i7 IT (99): Itanium (only geek editions)
type SupCPURange ¶
type SupCPURange struct { Start SupCPU // 範囲の開始 End SupCPU // 範囲の終了 AnyLater bool // 任意の後続プロセッサをサポート LateStep bool // 後続プロセッサの特定ステッピングのみサポート }
func NewSupCPUByCode ¶
func NewSupCPUByCode(code string) (*SupCPURange, bool)
func (SupCPURange) IsSupported ¶
func (r SupCPURange) IsSupported(targetCPU SupCPU) bool