Documentation ¶
Index ¶
- func Preprocess(tokens []Token, absPath string, open func(name string) (io.ReadCloser, error), ...) ([]Token, map[string][][]rune, *Defines, []string, []error)
- type Constant
- type DataType
- type Define
- type Defines
- type Expr
- type ExprBinary
- type ExprFuncCall
- type ExprGrouping
- type ExprIdentifier
- type ExprListInitializer
- type ExprLiteral
- type ExprTypeCast
- type ExprUnary
- type ExprVisitor
- type FuncParam
- type ParseError
- type Position
- type ScanError
- type Stmt
- type StmtAssignment
- type StmtCall
- type StmtConstDecl
- type StmtEvent
- type StmtEventDecl
- type StmtFuncDecl
- type StmtIf
- type StmtLoop
- type StmtVarDecl
- type StmtVisitor
- type Token
- type TokenType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Defines ¶
type Defines struct {
// contains filtered or unexported fields
}
func NewDefines ¶
func NewDefines() *Defines
func (*Defines) GetDefines ¶
type Expr ¶
type Expr interface { Accept(visitor ExprVisitor) error Type() DataType Position() (start, end Position) }
type ExprBinary ¶
func (*ExprBinary) Accept ¶
func (e *ExprBinary) Accept(visitor ExprVisitor) error
func (*ExprBinary) Position ¶
func (e *ExprBinary) Position() (start, end Position)
func (*ExprBinary) Type ¶
func (e *ExprBinary) Type() DataType
type ExprFuncCall ¶
func (*ExprFuncCall) Accept ¶
func (e *ExprFuncCall) Accept(visitor ExprVisitor) error
func (*ExprFuncCall) Position ¶
func (e *ExprFuncCall) Position() (start, end Position)
func (*ExprFuncCall) Type ¶
func (e *ExprFuncCall) Type() DataType
type ExprGrouping ¶
func (*ExprGrouping) Accept ¶
func (e *ExprGrouping) Accept(visitor ExprVisitor) error
func (*ExprGrouping) Position ¶
func (e *ExprGrouping) Position() (start, end Position)
func (*ExprGrouping) Type ¶
func (e *ExprGrouping) Type() DataType
type ExprIdentifier ¶
func (*ExprIdentifier) Accept ¶
func (e *ExprIdentifier) Accept(visitor ExprVisitor) error
func (*ExprIdentifier) Position ¶
func (e *ExprIdentifier) Position() (start, end Position)
func (*ExprIdentifier) Type ¶
func (e *ExprIdentifier) Type() DataType
type ExprListInitializer ¶
type ExprListInitializer struct { OpenBracket Token CloseBracket Token Values []Expr ReturnType DataType }
func (*ExprListInitializer) Accept ¶
func (e *ExprListInitializer) Accept(visitor ExprVisitor) error
func (*ExprListInitializer) Position ¶
func (e *ExprListInitializer) Position() (start, end Position)
func (*ExprListInitializer) Type ¶
func (e *ExprListInitializer) Type() DataType
type ExprLiteral ¶
func (*ExprLiteral) Accept ¶
func (e *ExprLiteral) Accept(visitor ExprVisitor) error
func (*ExprLiteral) Position ¶
func (e *ExprLiteral) Position() (start, end Position)
func (*ExprLiteral) Type ¶
func (e *ExprLiteral) Type() DataType
type ExprTypeCast ¶
func (*ExprTypeCast) Accept ¶
func (e *ExprTypeCast) Accept(visitor ExprVisitor) error
func (*ExprTypeCast) Position ¶
func (e *ExprTypeCast) Position() (start, end Position)
func (*ExprTypeCast) Type ¶
func (e *ExprTypeCast) Type() DataType
type ExprVisitor ¶
type ExprVisitor interface { VisitIdentifier(expr *ExprIdentifier) error VisitExprFuncCall(expr *ExprFuncCall) error VisitTypeCast(expr *ExprTypeCast) error VisitLiteral(expr *ExprLiteral) error VisitListInitializer(expr *ExprListInitializer) error VisitUnary(expr *ExprUnary) error VisitBinary(expr *ExprBinary) error VisitGrouping(expr *ExprGrouping) error }
type ParseError ¶
func (ParseError) Error ¶
func (p ParseError) Error() string
type Stmt ¶
type Stmt interface { Accept(visitor StmtVisitor) error Position() (start, end Position) }
type StmtAssignment ¶
func (*StmtAssignment) Accept ¶
func (s *StmtAssignment) Accept(visitor StmtVisitor) error
func (*StmtAssignment) Position ¶
func (s *StmtAssignment) Position() (start, end Position)
type StmtConstDecl ¶
func (*StmtConstDecl) Accept ¶
func (s *StmtConstDecl) Accept(visitor StmtVisitor) error
func (*StmtConstDecl) Position ¶
func (s *StmtConstDecl) Position() (start, end Position)
type StmtEventDecl ¶
func (*StmtEventDecl) Accept ¶
func (s *StmtEventDecl) Accept(visitor StmtVisitor) error
func (*StmtEventDecl) Position ¶
func (s *StmtEventDecl) Position() (start, end Position)
type StmtFuncDecl ¶
type StmtFuncDecl struct { Name Token CloseParen Token Params []FuncParam Body []Stmt StartLine int EndLine int }
func (*StmtFuncDecl) Accept ¶
func (s *StmtFuncDecl) Accept(visitor StmtVisitor) error
func (*StmtFuncDecl) Position ¶
func (s *StmtFuncDecl) Position() (start, end Position)
type StmtVarDecl ¶
func (*StmtVarDecl) Accept ¶
func (s *StmtVarDecl) Accept(visitor StmtVisitor) error
func (*StmtVarDecl) Position ¶
func (s *StmtVarDecl) Position() (start, end Position)
type StmtVisitor ¶
type StmtVisitor interface { VisitVarDecl(stmt *StmtVarDecl) error VisitConstDecl(stmt *StmtConstDecl) error VisitFuncDecl(stmt *StmtFuncDecl) error VisitEventDecl(stmt *StmtEventDecl) error VisitEvent(stmt *StmtEvent) error VisitCall(stmt *StmtCall) error VisitAssignment(stmt *StmtAssignment) error VisitIf(stmt *StmtIf) error VisitLoop(stmt *StmtLoop) error }
type Token ¶
type TokenType ¶
type TokenType int
const ( TkNewLine TokenType = iota TkAt TkOpenParen TkCloseParen TkOpenBracket TkCloseBracket TkColon TkDot TkComma TkBang TkOr TkAnd TkPlus TkPlusAssign TkMinus TkMinusAssign TkMultiply TkMultiplyAssign TkDivide TkDivideAssign TkModulus TkModulusAssign TkAssign TkEqual TkNotEqual TkLess TkGreater TkLessEqual TkGreaterEqual TkIf TkElif TkElse TkWhile TkFor TkVar TkConst TkFunc TkEvent TkIdentifier TkLiteral TkType TkPreprocessor TkEOF )
Click to show internal directories.
Click to hide internal directories.