Versions in this module Expand all Collapse all v0 v0.1.0 Dec 15, 2024 Changes in this version + func IsNumber(e ExpNode) bool + type AssignStat struct + Dest []Var + Src []ExpNode + func NewAssignStat(dst []Var, src []ExpNode) AssignStat + func NewFunctionStat(fName Var, method Name, fx Function) AssignStat + func (s AssignStat) HWrite(w HWriter) + func (s AssignStat) ProcessStat(p StatProcessor) + type BFunctionCall struct + Args []ExpNode + Method Name + Target ExpNode + func (f BFunctionCall) HWrite(w HWriter) + func (f BFunctionCall) ProcessExp(p ExpProcessor) + type BinOp struct + Left ExpNode + OpType ops.Op + Right []Operation + func NewBinOp(left ExpNode, op ops.Op, opTok *token.Token, right ExpNode) *BinOp + func (b BinOp) HWrite(w HWriter) + func (b BinOp) ProcessExp(p ExpProcessor) + type BlockStat struct + Return []ExpNode + Stats []Stat + func NewBlockStat(stats []Stat, rtn []ExpNode) BlockStat + func (s BlockStat) HWrite(w HWriter) + func (s BlockStat) ProcessStat(p StatProcessor) + type Bool struct + Val bool + func False(tok *token.Token) Bool + func True(tok *token.Token) Bool + func (b Bool) HWrite(w HWriter) + func (b Bool) ProcessExp(p ExpProcessor) + type BreakStat struct + func NewBreakStat(tok *token.Token) BreakStat + func (s BreakStat) HWrite(w HWriter) + func (s BreakStat) ProcessStat(p StatProcessor) + type CondStat struct + Body BlockStat + Cond ExpNode + func (s CondStat) HWrite(w HWriter) + type EmptyStat struct + func NewEmptyStat(tok *token.Token) EmptyStat + func (s EmptyStat) HWrite(w HWriter) + func (s EmptyStat) ProcessStat(p StatProcessor) + type Etc struct + func NewEtc(tok *token.Token) Etc + func (e Etc) HWrite(w HWriter) + func (e Etc) ProcessExp(p ExpProcessor) + func (e Etc) ProcessTailExp(p TailExpProcessor) + type ExpNode interface + ProcessExp func(ExpProcessor) + func NewNumber(id *token.Token) (ExpNode, error) + type ExpProcessor interface + ProcesBoolExp func(Bool) + ProcessBFunctionCallExp func(BFunctionCall) + ProcessBinOpExp func(BinOp) + ProcessEtcExp func(Etc) + ProcessFloatExp func(Float) + ProcessFunctionCallExp func(FunctionCall) + ProcessFunctionExp func(Function) + ProcessIndexExp func(IndexExp) + ProcessIntExp func(Int) + ProcessNameExp func(Name) + ProcessNilExp func(Nil) + ProcessStringExp func(String) + ProcessTableConstructorExp func(TableConstructor) + ProcessUnOpExp func(UnOp) + type Float struct + Val float64 + func NewFloat(x float64) Float + func (f Float) HWrite(w HWriter) + func (f Float) ProcessExp(p ExpProcessor) + type ForInStat struct + Body BlockStat + Params []ExpNode + Vars []Name + func NewForInStat(startTok, endTok *token.Token, itervars []Name, params []ExpNode, ...) *ForInStat + func (s ForInStat) HWrite(w HWriter) + func (s ForInStat) ProcessStat(p StatProcessor) + type ForStat struct + Body BlockStat + Start ExpNode + Step ExpNode + Stop ExpNode + Var Name + func NewForStat(startTok, endTok *token.Token, itervar Name, params []ExpNode, body BlockStat) *ForStat + func (s ForStat) HWrite(w HWriter) + func (s ForStat) ProcessStat(p StatProcessor) + type Function struct + Body BlockStat + Name string + func NewFunction(startTok, endTok *token.Token, parList ParList, body BlockStat) Function + func (f Function) HWrite(w HWriter) + func (f Function) ProcessExp(p ExpProcessor) + type FunctionCall struct + func NewFunctionCall(target ExpNode, method Name, args []ExpNode) FunctionCall + func (f FunctionCall) InBrackets() *BFunctionCall + func (f FunctionCall) ProcessExp(p ExpProcessor) + func (f FunctionCall) ProcessStat(p StatProcessor) + func (f FunctionCall) ProcessTailExp(p TailExpProcessor) + type GotoStat struct + Label Name + func NewGotoStat(gotoTok *token.Token, lbl Name) GotoStat + func (s GotoStat) HWrite(w HWriter) + func (s GotoStat) ProcessStat(p StatProcessor) + type HWriter interface + Dedent func() + Indent func() + Next func() + Writef func(string, ...interface{}) + type IfStat struct + Else *BlockStat + ElseIfs []CondStat + If CondStat + func NewIfStat(ifTok *token.Token, cond ExpNode, body BlockStat) IfStat + func (s IfStat) AddElseIf(cond ExpNode, body BlockStat) IfStat + func (s IfStat) HWrite(w HWriter) + func (s IfStat) ProcessStat(p StatProcessor) + func (s IfStat) WithElse(endTok *token.Token, body BlockStat) IfStat + type IndentWriter struct + func NewIndentWriter(w io.Writer) *IndentWriter + func (w *IndentWriter) Dedent() + func (w *IndentWriter) Indent() + func (w *IndentWriter) Next() + func (w *IndentWriter) Writef(f string, args ...interface{}) + type IndexExp struct + Coll ExpNode + Idx ExpNode + func NewIndexExp(coll ExpNode, idx ExpNode) IndexExp + func (e IndexExp) FunctionName() string + func (e IndexExp) HWrite(w HWriter) + func (e IndexExp) ProcessExp(p ExpProcessor) + func (e IndexExp) ProcessVar(p VarProcessor) + type Int struct + Val uint64 + func NewInt(val uint64) Int + func (n Int) HWrite(w HWriter) + func (n Int) ProcessExp(p ExpProcessor) + type LabelStat struct + func NewLabelStat(label Name) LabelStat + func (s LabelStat) HWrite(w HWriter) + func (s LabelStat) ProcessStat(p StatProcessor) + type LocalAttrib uint8 + const CloseAttrib + const ConstAttrib + const NoAttrib + type LocalFunctionStat struct + Name Name + func NewLocalFunctionStat(name Name, fx Function) LocalFunctionStat + func (s LocalFunctionStat) HWrite(w HWriter) + func (s LocalFunctionStat) ProcessStat(p StatProcessor) + type LocalStat struct + NameAttribs []NameAttrib + Values []ExpNode + func NewLocalStat(nameAttribs []NameAttrib, values []ExpNode) LocalStat + func (s LocalStat) HWrite(w HWriter) + func (s LocalStat) ProcessStat(p StatProcessor) + type Location struct + func LocFromToken(tok *token.Token) Location + func LocFromTokens(t1, t2 *token.Token) Location + func MergeLocations(l1, l2 Locator) Location + func (l Location) EndPos() *token.Pos + func (l Location) Locate() Location + func (l Location) StartPos() *token.Pos + type Locator interface + Locate func() Location + type Name struct + Val string + func NewName(id *token.Token) Name + func (n Name) AstString() String + func (n Name) FunctionName() string + func (n Name) HWrite(w HWriter) + func (n Name) ProcessExp(p ExpProcessor) + func (n Name) ProcessVar(p VarProcessor) + type NameAttrib struct + Attrib LocalAttrib + Name Name + func NewNameAttrib(name Name, attribName *Name, attrib LocalAttrib) NameAttrib + type Nil struct + func NewNil(tok *token.Token) Nil + func (n Nil) HWrite(w HWriter) + func (n Nil) ProcessExp(p ExpProcessor) + type NoTableKey struct + func (k NoTableKey) HWrite(w HWriter) + func (k NoTableKey) ProcessExp(p ExpProcessor) + type Node interface + HWrite func(w HWriter) + type Operation struct + Op ops.Op + Operand ExpNode + type ParList struct + HasDots bool + Params []Name + func NewParList(params []Name, hasDots bool) ParList + type RepeatStat struct + func NewRepeatStat(repTok *token.Token, body BlockStat, cond ExpNode) RepeatStat + func (s RepeatStat) HWrite(w HWriter) + func (s RepeatStat) ProcessStat(p StatProcessor) + type Stat interface + ProcessStat func(StatProcessor) + type StatProcessor interface + ProcessAssignStat func(AssignStat) + ProcessBlockStat func(BlockStat) + ProcessBreakStat func(BreakStat) + ProcessEmptyStat func(EmptyStat) + ProcessForInStat func(ForInStat) + ProcessForStat func(ForStat) + ProcessFunctionCallStat func(FunctionCall) + ProcessGotoStat func(GotoStat) + ProcessIfStat func(IfStat) + ProcessLabelStat func(LabelStat) + ProcessLocalFunctionStat func(LocalFunctionStat) + ProcessLocalStat func(LocalStat) + ProcessRepeatStat func(RepeatStat) + ProcessWhileStat func(WhileStat) + type String struct + Val []byte + func NewLongString(id *token.Token) String + func NewString(id *token.Token) (ss String, err error) + func (s String) HWrite(w HWriter) + func (s String) ProcessExp(p ExpProcessor) + type TableConstructor struct + Fields []TableField + func NewTableConstructor(opTok, clTok *token.Token, fields []TableField) TableConstructor + func (c TableConstructor) HWrite(w HWriter) + func (c TableConstructor) ProcessExp(p ExpProcessor) + type TableField struct + Key ExpNode + Value ExpNode + func NewTableField(key ExpNode, value ExpNode) TableField + type TailExpNode interface + ProcessTailExp func(TailExpProcessor) + type TailExpProcessor interface + ProcessEtcTailExp func(Etc) + ProcessFunctionCallTailExp func(FunctionCall) + type UnOp struct + Op ops.Op + Operand ExpNode + func NewUnOp(opTok *token.Token, op ops.Op, exp ExpNode) *UnOp + func (u UnOp) HWrite(w HWriter) + func (u UnOp) ProcessExp(p ExpProcessor) + type Var interface + FunctionName func() string + ProcessVar func(VarProcessor) + type VarProcessor interface + ProcessIndexExpVar func(IndexExp) + ProcessNameVar func(Name) + type WhileStat struct + func NewWhileStat(whileTok, endTok *token.Token, cond ExpNode, body BlockStat) WhileStat + func (s WhileStat) HWrite(w HWriter) + func (s WhileStat) ProcessStat(p StatProcessor)