Documentation ¶
Index ¶
- Constants
- Variables
- func RunCode(codeA interface{}, ctxA *RunningContext) interface{}
- func TokenIsEOF(tokenA Token) bool
- type Expression
- type ExpressionStatement
- type FuncContext
- type GlobalContext
- type Identifier
- type IntegerLiteral
- type LetStatement
- type Lexer
- type Node
- type Parser
- type Program
- type QoxeVM
- type ReturnStatement
- type RunningContext
- type Statement
- type Token
- type TokenType
Constants ¶
View Source
const ( ILLEGAL = "ILLEGAL" EOF = "EOF" // Identifiers + Literals IDENT = "IDENT" INT = "INT" // Operators ASSIGN = "=" PLUS = "+" MINUS = "-" BANG = "!" ASTERISK = "*" SLASH = "/" LT = "<" GT = ">" EQ = "==" NOT_EQ = "!=" // Delimiters COMMA = "," SEMICOLON = ";" LPAREN = "(" RPAREN = ")" LBRACE = "{" RBRACE = "}" // Keywords FUNCTION = "FUNCTION" LET = "LET" TRUE = "TRUE" FALSE = "FALSE" IF = "IF" ELSE = "ELSE" RETURN = "RETURN" )
token
View Source
const ( LOWEST int EQUALS // == LESSGREATER // > or < SUM // + PRODUCT // * PREFIX // -X or !X CALL // myFunction(X) )
parser
Variables ¶
View Source
var VersionG string = "0.0.1"
Functions ¶
func RunCode ¶
func RunCode(codeA interface{}, ctxA *RunningContext) interface{}
func TokenIsEOF ¶
Types ¶
type Expression ¶
type Expression interface { Node // contains filtered or unexported methods }
type ExpressionStatement ¶
type ExpressionStatement struct { Token Token Expression Expression }
func (*ExpressionStatement) String ¶
func (es *ExpressionStatement) String() string
func (*ExpressionStatement) TokenLiteral ¶
func (es *ExpressionStatement) TokenLiteral() string
type FuncContext ¶
type FuncContext struct { Vars map[string]interface{} Tmp interface{} DeferStack *tk.SimpleStack }
func NewFuncContext ¶
func NewFuncContext() *FuncContext
type GlobalContext ¶
type GlobalContext struct { SyncMap tk.SyncMap SyncQueue tk.SyncQueue SyncStack tk.SyncStack SyncSeq tk.Seq Vars map[string]interface{} VerboseLevel int }
var GlobalsG *GlobalContext
type Identifier ¶
func (*Identifier) String ¶
func (i *Identifier) String() string
func (*Identifier) TokenLiteral ¶
func (i *Identifier) TokenLiteral() string
type IntegerLiteral ¶
func (*IntegerLiteral) String ¶
func (il *IntegerLiteral) String() string
func (*IntegerLiteral) TokenLiteral ¶
func (il *IntegerLiteral) TokenLiteral() string
type LetStatement ¶
type LetStatement struct { Token Token Name *Identifier Value Expression }
func (*LetStatement) String ¶
func (ls *LetStatement) String() string
func (*LetStatement) TokenLiteral ¶
func (ls *LetStatement) TokenLiteral() string
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
func (*Parser) ParseProgram ¶
type QoxeVM ¶
type QoxeVM struct { Regs []interface{} Stack *tk.SimpleStack RootFunc *FuncContext Running *RunningContext }
type ReturnStatement ¶
type ReturnStatement struct { Token Token ReturnValue Expression }
func (*ReturnStatement) String ¶
func (rs *ReturnStatement) String() string
func (*ReturnStatement) TokenLiteral ¶
func (rs *ReturnStatement) TokenLiteral() string
Click to show internal directories.
Click to hide internal directories.