Documentation ¶
Index ¶
- type ArrayLiteral
- type AssignStatement
- type BlockStatement
- type Boolean
- type BreakStatement
- type CallExpression
- type DeleteStatement
- type ElvisOperatorExpression
- type EnumStatement
- type Expression
- type ExpressionStatement
- type FloatLiteral
- type ForStatement
- type FunctionLiteral
- type HashLiteral
- type Identifier
- type IfExpression
- type Import
- type IndexExpression
- type InfixExpression
- type IntegerLiteral
- type Node
- type ObjectCall
- type PostfixExpression
- type PrefixExpression
- type Program
- type ReturnStatement
- type Scope
- type ScopeOperatorExpression
- type Stack
- type Statement
- type StringLiteral
- type TernaryOperatorExpression
- type VarStatement
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArrayLiteral ¶
type ArrayLiteral struct { Token token.Token // the '[' token Elements []Expression }
func (*ArrayLiteral) String ¶
func (al *ArrayLiteral) String() string
func (*ArrayLiteral) TokenLiteral ¶
func (al *ArrayLiteral) TokenLiteral() string
type AssignStatement ¶
type AssignStatement struct { Token token.Token // the token.VAR token Name Expression // it can be var a = a + 1; or a = a + 1; or a[0] = 1; Value Expression // Any valid expression }
func (*AssignStatement) String ¶
func (ls *AssignStatement) String() string
func (*AssignStatement) TokenLiteral ¶
func (ls *AssignStatement) TokenLiteral() string
type BlockStatement ¶
func (*BlockStatement) String ¶
func (bs *BlockStatement) String() string
func (*BlockStatement) TokenLiteral ¶
func (bs *BlockStatement) TokenLiteral() string
type Boolean ¶
func (*Boolean) TokenLiteral ¶
type BreakStatement ¶
func (*BreakStatement) String ¶
func (rs *BreakStatement) String() string
func (*BreakStatement) TokenLiteral ¶
func (rs *BreakStatement) TokenLiteral() string
type CallExpression ¶
type CallExpression struct { Token token.Token // The '(' token Function Expression // Identifier or FunctionLiteral Arguments []Expression }
func (*CallExpression) String ¶
func (ce *CallExpression) String() string
func (*CallExpression) TokenLiteral ¶
func (ce *CallExpression) TokenLiteral() string
type DeleteStatement ¶
type DeleteStatement struct { Token token.Token // the delete token Left Expression Index Expression }
func (*DeleteStatement) String ¶
func (de *DeleteStatement) String() string
func (*DeleteStatement) TokenLiteral ¶
func (de *DeleteStatement) TokenLiteral() string
type ElvisOperatorExpression ¶
type ElvisOperatorExpression struct { Token token.Token // The '?:' token Left Expression Right Expression }
func (*ElvisOperatorExpression) String ¶
func (eo *ElvisOperatorExpression) String() string
func (*ElvisOperatorExpression) TokenLiteral ¶
func (eo *ElvisOperatorExpression) TokenLiteral() string
type EnumStatement ¶
type EnumStatement struct { Token token.Token Branches map[string]Expression Identifier Expression }
func (*EnumStatement) String ¶
func (e *EnumStatement) String() string
func (*EnumStatement) TokenLiteral ¶
func (e *EnumStatement) TokenLiteral() string
type Expression ¶
type Expression interface { Node // contains filtered or unexported methods }
type ExpressionStatement ¶
type ExpressionStatement struct { Token token.Token Expression Expression }
func (*ExpressionStatement) String ¶
func (es *ExpressionStatement) String() string
func (*ExpressionStatement) TokenLiteral ¶
func (es *ExpressionStatement) TokenLiteral() string
type FloatLiteral ¶
func (*FloatLiteral) String ¶
func (il *FloatLiteral) String() string
func (*FloatLiteral) TokenLiteral ¶
func (il *FloatLiteral) TokenLiteral() string
type ForStatement ¶
type ForStatement struct { Token token.Token // The 'for' token InitialCondition *VarStatement Condition Expression Iteration Statement Body *BlockStatement }
func (*ForStatement) String ¶
func (fs *ForStatement) String() string
func (*ForStatement) TokenLiteral ¶
func (fs *ForStatement) TokenLiteral() string
type FunctionLiteral ¶
type FunctionLiteral struct { Token token.Token // The 'function' token Parameters []Expression Body *BlockStatement Name *Identifier }
func (*FunctionLiteral) String ¶
func (fl *FunctionLiteral) String() string
func (*FunctionLiteral) TokenLiteral ¶
func (fl *FunctionLiteral) TokenLiteral() string
type HashLiteral ¶
type HashLiteral struct { Token token.Token // the '{' token Pairs map[Expression]Expression }
func (*HashLiteral) String ¶
func (hl *HashLiteral) String() string
func (*HashLiteral) TokenLiteral ¶
func (hl *HashLiteral) TokenLiteral() string
type Identifier ¶
func (*Identifier) String ¶
func (i *Identifier) String() string
func (*Identifier) TokenLiteral ¶
func (i *Identifier) TokenLiteral() string
type IfExpression ¶
type IfExpression struct { Token token.Token // The 'if' token Condition Expression Consequence *BlockStatement Alternative *BlockStatement }
func (*IfExpression) String ¶
func (ie *IfExpression) String() string
func (*IfExpression) TokenLiteral ¶
func (ie *IfExpression) TokenLiteral() string
type Import ¶
type Import struct { Token token.Token Filename Expression }
func (*Import) TokenLiteral ¶
type IndexExpression ¶
type IndexExpression struct { Token token.Token // The [ token Left Expression Index Expression }
func (*IndexExpression) String ¶
func (ie *IndexExpression) String() string
func (*IndexExpression) TokenLiteral ¶
func (ie *IndexExpression) TokenLiteral() string
type InfixExpression ¶
type InfixExpression struct { Token token.Token Left Expression Operator string Right Expression }
func (*InfixExpression) String ¶
func (oe *InfixExpression) String() string
func (*InfixExpression) TokenLiteral ¶
func (oe *InfixExpression) TokenLiteral() string
type IntegerLiteral ¶
func (*IntegerLiteral) String ¶
func (il *IntegerLiteral) String() string
func (*IntegerLiteral) TokenLiteral ¶
func (il *IntegerLiteral) TokenLiteral() string
type ObjectCall ¶
type ObjectCall struct { Token token.Token Object Expression Call Expression }
func (*ObjectCall) String ¶
func (oc *ObjectCall) String() string
func (*ObjectCall) TokenLiteral ¶
func (oc *ObjectCall) TokenLiteral() string
type PostfixExpression ¶
type PostfixExpression struct { Token token.Token Operator string Left Expression }
func (*PostfixExpression) String ¶
func (pe *PostfixExpression) String() string
func (*PostfixExpression) TokenLiteral ¶
func (pe *PostfixExpression) TokenLiteral() string
type PrefixExpression ¶
type PrefixExpression struct { Token token.Token Operator string Right Expression }
func (*PrefixExpression) String ¶
func (pe *PrefixExpression) String() string
func (*PrefixExpression) TokenLiteral ¶
func (pe *PrefixExpression) TokenLiteral() string
type ReturnStatement ¶
type ReturnStatement struct { Token token.Token // the 'return' token ReturnValue Expression }
func (*ReturnStatement) String ¶
func (rs *ReturnStatement) String() string
func (*ReturnStatement) TokenLiteral ¶
func (rs *ReturnStatement) TokenLiteral() string
type Scope ¶ added in v0.2.10
Scope is a map structure that hold a identifier and if is ready or not.
type ScopeOperatorExpression ¶
type ScopeOperatorExpression struct { Token token.Token // "::" AccessIdentifier Expression PropertyIdentifier Expression }
func (*ScopeOperatorExpression) String ¶
func (so *ScopeOperatorExpression) String() string
func (*ScopeOperatorExpression) TokenLiteral ¶
func (so *ScopeOperatorExpression) TokenLiteral() string
type Stack ¶ added in v0.2.10
type Stack []*Scope
Stack will keep track frames of a program, where a specific Scope are in stack
type StringLiteral ¶
func (*StringLiteral) String ¶
func (il *StringLiteral) String() string
func (*StringLiteral) TokenLiteral ¶
func (il *StringLiteral) TokenLiteral() string
type TernaryOperatorExpression ¶
type TernaryOperatorExpression struct { Token token.Token // The '?' token Condition Expression Consequence Expression Alternative Expression }
func (*TernaryOperatorExpression) String ¶
func (to *TernaryOperatorExpression) String() string
func (*TernaryOperatorExpression) TokenLiteral ¶
func (to *TernaryOperatorExpression) TokenLiteral() string
type VarStatement ¶
type VarStatement struct { Token token.Token // the token.VAR token Name *Identifier Value Expression }
func (*VarStatement) String ¶
func (ls *VarStatement) String() string
func (*VarStatement) TokenLiteral ¶
func (ls *VarStatement) TokenLiteral() string
Source Files ¶
- array_literal.go
- ast.go
- block_statement.go
- boolean.go
- break.go
- call_expression.go
- delete_statement.go
- enum.go
- expression_statement.go
- float_literal.go
- for_statement.go
- function_literal.go
- hash_literal.go
- identifier.go
- if_expression.go
- import.go
- index_expression.go
- infix_expression.go
- integer_literal.go
- object_call.go
- posfix_expression.go
- prefix_expression.go
- return_statement.go
- stack.go
- string.go
- ternary_operator.go
- var_statement.go
Click to show internal directories.
Click to hide internal directories.