ast

package
v0.0.0-...-56748ea Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArrayLiteral

type ArrayLiteral struct {
	Token    token.Token
	Elements []Expression
}

func (*ArrayLiteral) String

func (arrayLiteral *ArrayLiteral) String() string

func (*ArrayLiteral) TokenLiteral

func (arrayLiteral *ArrayLiteral) TokenLiteral() string

type AssignExpression

type AssignExpression struct {
	Token    token.Token
	Variable *Identifier
	Value    Expression
}

func (*AssignExpression) String

func (assignExpression *AssignExpression) String() string

func (*AssignExpression) TokenLiteral

func (assignExpression *AssignExpression) TokenLiteral() string

type BlockStatement

type BlockStatement struct {
	Token      token.Token
	Statements []Statement
}

func (*BlockStatement) String

func (blockStatement *BlockStatement) String() string

func (*BlockStatement) TokenLiteral

func (blockStatement *BlockStatement) TokenLiteral() string

type BooleanLiteral

type BooleanLiteral struct {
	Token token.Token
	Value bool
}

func (*BooleanLiteral) String

func (booleanLiteral *BooleanLiteral) String() string

func (*BooleanLiteral) TokenLiteral

func (booleanLiteral *BooleanLiteral) TokenLiteral() string

type BreakStatement

type BreakStatement struct {
	Token token.Token
}

func (*BreakStatement) String

func (breakStatement *BreakStatement) String() string

func (*BreakStatement) TokenLiteral

func (breakStatement *BreakStatement) TokenLiteral() string

type CallExpression

type CallExpression struct {
	Token     token.Token
	Function  Expression
	Arguments []Expression
}

func (*CallExpression) String

func (callExpression *CallExpression) String() string

func (*CallExpression) TokenLiteral

func (callExpression *CallExpression) TokenLiteral() string

type ContinueStatement

type ContinueStatement struct {
	Token token.Token
}

func (*ContinueStatement) String

func (continueStatement *ContinueStatement) String() string

func (*ContinueStatement) TokenLiteral

func (continueStatement *ContinueStatement) 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 (expressionStatement *ExpressionStatement) String() string

func (*ExpressionStatement) TokenLiteral

func (expressionStatement *ExpressionStatement) TokenLiteral() string

type FloatLiteral

type FloatLiteral struct {
	Token token.Token
	Value float64
}

func (*FloatLiteral) String

func (floatLiteral *FloatLiteral) String() string

func (*FloatLiteral) TokenLiteral

func (floatLiteral *FloatLiteral) TokenLiteral() string

type ForStatement

type ForStatement struct {
	Token    token.Token
	Element  *Identifier
	Iterator Expression
	Body     *BlockStatement
}

func (*ForStatement) String

func (forStatement *ForStatement) String() string

func (*ForStatement) TokenLiteral

func (forStatement *ForStatement) TokenLiteral() string

type FunctionLiteral

type FunctionLiteral struct {
	Token      token.Token
	Name       string
	Parameters []*Identifier
	Body       *BlockStatement
}

func (*FunctionLiteral) String

func (functionLiteral *FunctionLiteral) String() string

func (*FunctionLiteral) TokenLiteral

func (functionLiteral *FunctionLiteral) TokenLiteral() string

type HashLiteral

type HashLiteral struct {
	Token token.Token
	Pairs map[Expression]Expression
}

func (*HashLiteral) String

func (hashLiteral *HashLiteral) String() string

func (*HashLiteral) TokenLiteral

func (hashLiteral *HashLiteral) TokenLiteral() string

type Identifier

type Identifier struct {
	Token token.Token
	Value string
}

func (*Identifier) String

func (identifier *Identifier) String() string

func (*Identifier) TokenLiteral

func (identifier *Identifier) TokenLiteral() string

type IfExpression

type IfExpression struct {
	Token       token.Token
	Condition   Expression
	Consequence *BlockStatement
	Alternate   *BlockStatement
}

func (*IfExpression) String

func (ifExpression *IfExpression) String() string

func (*IfExpression) TokenLiteral

func (ifExpression *IfExpression) TokenLiteral() string

type IndexExpression

type IndexExpression struct {
	Token token.Token
	Array Expression
	Index Expression
}

func (*IndexExpression) String

func (indexExpression *IndexExpression) String() string

func (*IndexExpression) TokenLiteral

func (indexExpression *IndexExpression) TokenLiteral() string

type InfixExpression

type InfixExpression struct {
	Token    token.Token
	Left     Expression
	Operator string
	Right    Expression
}

func (*InfixExpression) String

func (infixExpression *InfixExpression) String() string

func (*InfixExpression) TokenLiteral

func (infixExpression *InfixExpression) TokenLiteral() string

type IntegerLiteral

type IntegerLiteral struct {
	Token token.Token
	Value int
}

func (*IntegerLiteral) String

func (integerLiteral *IntegerLiteral) String() string

func (*IntegerLiteral) TokenLiteral

func (integerLiteral *IntegerLiteral) TokenLiteral() string

type LetStatement

type LetStatement struct {
	Token token.Token
	Name  *Identifier
	Value Expression
}

func (*LetStatement) String

func (letStatement *LetStatement) String() string

func (*LetStatement) TokenLiteral

func (letStatement *LetStatement) TokenLiteral() string

type Node

type Node interface {
	TokenLiteral() string
	String() string
}

type PrefixExpression

type PrefixExpression struct {
	Token    token.Token
	Operator string
	Right    Expression
}

func (*PrefixExpression) String

func (prefixExpression *PrefixExpression) String() string

func (*PrefixExpression) TokenLiteral

func (prefixExpression *PrefixExpression) TokenLiteral() string

type Program

type Program struct {
	Node
	Statements []Statement
}

func (*Program) String

func (program *Program) String() string

func (*Program) TokenLiteral

func (program *Program) TokenLiteral() string

type ReturnStatement

type ReturnStatement struct {
	Token       token.Token
	ReturnValue Expression
}

func (*ReturnStatement) String

func (returnStatement *ReturnStatement) String() string

func (*ReturnStatement) TokenLiteral

func (returnStatement *ReturnStatement) TokenLiteral() string

type Statement

type Statement interface {
	Node
	// contains filtered or unexported methods
}

type StringLiteral

type StringLiteral struct {
	Token token.Token
	Value string
}

func (*StringLiteral) String

func (stringLiteral *StringLiteral) String() string

func (*StringLiteral) TokenLiteral

func (stringLiteral *StringLiteral) TokenLiteral() string

type TryStatement

type TryStatement struct {
	Token   token.Token
	Try     *BlockStatement
	Catch   *BlockStatement
	Error   *Identifier
	Finally *BlockStatement
}

func (*TryStatement) String

func (tryStatement *TryStatement) String() string

func (*TryStatement) TokenLiteral

func (tryStatement *TryStatement) TokenLiteral() string

type WhileStatement

type WhileStatement struct {
	Token     token.Token
	Condition Expression
	Body      *BlockStatement
}

func (*WhileStatement) String

func (whileStatement *WhileStatement) String() string

func (*WhileStatement) TokenLiteral

func (whileStatement *WhileStatement) TokenLiteral() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL