Documentation ¶
Index ¶
- type ArrayLiteral
- type AssignmentStatement
- type BlockStatement
- type Boolean
- type CallExpression
- type DotExpression
- type Expression
- type ExpressionStatement
- type FunctionLiteral
- type HashLiteral
- type Identifier
- type IfExpression
- type IndexExpression
- type InfixExpression
- type IntegerLiteral
- type Node
- type PrefixExpression
- type Program
- type ReturnStatement
- type Statement
- type StringLiteral
- type WhileExpression
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArrayLiteral ¶
type ArrayLiteral struct { Token token.Token // token.BRACKET Elements []Expression }
func (*ArrayLiteral) String ¶
func (al *ArrayLiteral) String() string
func (*ArrayLiteral) TokenLiteral ¶
func (al *ArrayLiteral) TokenLiteral() string
type AssignmentStatement ¶
type AssignmentStatement struct { Token token.Token // token.LET AssignmentOperator token.Token Name *Identifier Value Expression }
LET STATEMENT -> "let <identifier> = <expression>;"
func (*AssignmentStatement) String ¶
func (aStatement *AssignmentStatement) String() string
func (*AssignmentStatement) TokenLiteral ¶
func (aStatement *AssignmentStatement) TokenLiteral() string
type BlockStatement ¶
BLOCK STATEMENT: A SERIES OF STATEMENTS
func (*BlockStatement) String ¶
func (bs *BlockStatement) String() string
func (*BlockStatement) TokenLiteral ¶
func (bs *BlockStatement) TokenLiteral() string
type Boolean ¶
func (*Boolean) TokenLiteral ¶
type CallExpression ¶
type CallExpression struct { Token token.Token // token.LPAREN Function Expression // Identifier of function OR FunctionLiteral Arguments []Expression }
FUNCTION CALL EXPRESSION -> <expression>(<comma seperated expressions>)
func (*CallExpression) String ¶
func (ce *CallExpression) String() string
func (*CallExpression) TokenLiteral ¶
func (ce *CallExpression) TokenLiteral() string
type DotExpression ¶
type DotExpression struct { Token token.Token // token.DOT Left Expression Attribute Expression }
func (*DotExpression) String ¶
func (de *DotExpression) String() string
func (*DotExpression) TokenLiteral ¶
func (de *DotExpression) TokenLiteral() string
type Expression ¶
type Expression interface { Node // contains filtered or unexported methods }
type ExpressionStatement ¶
type ExpressionStatement struct { Token token.Token Expression Expression }
EXPRESSION STATEMENT -> "<expression>;"
func (*ExpressionStatement) String ¶
func (exp *ExpressionStatement) String() string
func (*ExpressionStatement) TokenLiteral ¶
func (exp *ExpressionStatement) TokenLiteral() string
type FunctionLiteral ¶
type FunctionLiteral struct { Token token.Token // token.FUNCTION Parameters []*Identifier Body *BlockStatement }
func (*FunctionLiteral) String ¶
func (fl *FunctionLiteral) String() string
func (*FunctionLiteral) TokenLiteral ¶
func (fl *FunctionLiteral) TokenLiteral() string
type HashLiteral ¶
type HashLiteral struct { Token token.Token // token.LBRACE 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 (ident *Identifier) String() string
func (*Identifier) TokenLiteral ¶
func (ident *Identifier) TokenLiteral() string
type IfExpression ¶
type IfExpression struct { Token token.Token // token.IF Condition Expression Consequence *BlockStatement Alternative *BlockStatement }
IF EXPRESSION -> "if (<condition>) <consequence> else <alternative>"
func (*IfExpression) String ¶
func (ifexp *IfExpression) String() string
func (*IfExpression) TokenLiteral ¶
func (ifexp *IfExpression) TokenLiteral() string
type IndexExpression ¶
type IndexExpression struct { Token token.Token // token.LBRACE Left Expression Index Expression }
INDEX EXPRESSION -> <expression>[<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 // Infix Operator Token Operator string Right Expression Left Expression }
INFIX EXPRESSION -> <right expression> <operator> <left expression>
func (*InfixExpression) String ¶
func (inexp *InfixExpression) String() string
func (*InfixExpression) TokenLiteral ¶
func (inexp *InfixExpression) TokenLiteral() string
type IntegerLiteral ¶
func (*IntegerLiteral) String ¶
func (il *IntegerLiteral) String() string
func (*IntegerLiteral) TokenLiteral ¶
func (il *IntegerLiteral) TokenLiteral() string
type PrefixExpression ¶
type PrefixExpression struct { Token token.Token // Prefix Operator Token Operator string Right Expression }
PREFIX EXPRESSION -> <prefix operator> <expression>
func (*PrefixExpression) String ¶
func (prexp *PrefixExpression) String() string
func (*PrefixExpression) TokenLiteral ¶
func (prexp *PrefixExpression) TokenLiteral() string
type Program ¶
type Program struct {
Statements []Statement
}
Program will be the root node of every AST
func (*Program) TokenLiteral ¶
type ReturnStatement ¶
type ReturnStatement struct { Token token.Token // token.RETURN ReturnValue Expression }
RETURN STATEMENT -> "return <expression>;"
func (*ReturnStatement) String ¶
func (rS *ReturnStatement) String() string
func (*ReturnStatement) TokenLiteral ¶
func (rS *ReturnStatement) TokenLiteral() string
type StringLiteral ¶
func (*StringLiteral) String ¶
func (sl *StringLiteral) String() string
func (*StringLiteral) TokenLiteral ¶
func (sl *StringLiteral) TokenLiteral() string
type WhileExpression ¶
type WhileExpression struct { Token token.Token // token.WHILE Condition Expression Body *BlockStatement }
WHILE EXPRESSION -> "while (<condition>) <consequence> "
func (*WhileExpression) String ¶
func (whileExp *WhileExpression) String() string
func (*WhileExpression) TokenLiteral ¶
func (whileExp *WhileExpression) TokenLiteral() string
Click to show internal directories.
Click to hide internal directories.