Documentation ¶
Overview ¶
Package ast -
Index ¶
- type ArrayLiteral
- type BlockStatement
- type Boolean
- type CallExpression
- type Expression
- type ExpressionStatement
- type FunctionLiteral
- type HashLiteral
- type Identifier
- type IfExpression
- type IndexExpression
- type InfixExpression
- type IntegerLiteral
- type LetStatement
- type Node
- type PrefixExpression
- type Program
- type ReturnStatement
- type Statement
- type StringLiteral
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 }
ArrayLiteral -
type BlockStatement ¶
BlockStatement -
func (*BlockStatement) TokenLiteral ¶
func (bs *BlockStatement) TokenLiteral() string
TokenLiteral -
type CallExpression ¶
type CallExpression struct { Token token.Token // The '(' token Function Expression // Identifier or FunctionLiteral Arguments []Expression }
CallExpression -
func (*CallExpression) TokenLiteral ¶
func (ce *CallExpression) TokenLiteral() string
TokenLiteral -
type Expression ¶
type Expression interface { Node // contains filtered or unexported methods }
Expression - expressions produce values 5 produces the value 5 ass(5, 5) produces another value
type ExpressionStatement ¶
type ExpressionStatement struct { Token token.Token // the first token of the expression Expression Expression }
ExpressionStatement -
func (*ExpressionStatement) TokenLiteral ¶
func (es *ExpressionStatement) TokenLiteral() string
TokenLiteral -
type FunctionLiteral ¶
type FunctionLiteral struct { Token token.Token // the { token Parameters []*Identifier Body *BlockStatement }
FunctionLiteral -
func (*FunctionLiteral) TokenLiteral ¶
func (fl *FunctionLiteral) TokenLiteral() string
TokenLiteral -
type HashLiteral ¶
type HashLiteral struct { Token token.Token // the '{' token Pairs map[Expression]Expression }
HashLiteral -
type Identifier ¶
Identifier -
type IfExpression ¶
type IfExpression struct { Token token.Token // The 'if' token Condition Expression Consequence *BlockStatement Alternative *BlockStatement }
IfExpression -
type IndexExpression ¶
type IndexExpression struct { Token token.Token Left Expression Index Expression }
IndexExpression -
func (*IndexExpression) TokenLiteral ¶
func (ie *IndexExpression) TokenLiteral() string
TokenLiteral -
type InfixExpression ¶
type InfixExpression struct { Token token.Token // The operator token, eg. + Left Expression Operator string Right Expression }
InfixExpression -
func (*InfixExpression) TokenLiteral ¶
func (oe *InfixExpression) TokenLiteral() string
TokenLiteral -
type IntegerLiteral ¶
IntegerLiteral -
func (*IntegerLiteral) TokenLiteral ¶
func (il *IntegerLiteral) TokenLiteral() string
TokenLiteral -
type LetStatement ¶
type LetStatement struct { Token token.Token // the token.LET token Name *Identifier Value Expression }
LetStatement -
type PrefixExpression ¶
type PrefixExpression struct { Token token.Token // The prefix token, e.g. ! Operator string Right Expression }
PrefixExpression -
func (*PrefixExpression) TokenLiteral ¶
func (pe *PrefixExpression) TokenLiteral() string
TokenLiteral -
type Program ¶
type Program struct {
Statements []Statement
}
Program - this will be the Root node of the AST
type ReturnStatement ¶
type ReturnStatement struct { Token token.Token // the 'return' token ReturnValue Expression }
ReturnStatement -
func (*ReturnStatement) TokenLiteral ¶
func (rs *ReturnStatement) TokenLiteral() string
TokenLiteral -
type Statement ¶
type Statement interface { Node // contains filtered or unexported methods }
Statement - statements do not produce values let x = 5 assigns a value, but does not produce one return; does not produce a value
type StringLiteral ¶
StringLiteral -