ast

package
v0.0.0-...-21786aa Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Array

type Array struct {
	Token    token.Token // The [ token
	Elements []Expression
}

func (*Array) String

func (a *Array) String() string

func (*Array) TokenLiteral

func (a *Array) TokenLiteral() string

type BlockStatement

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

func (*BlockStatement) String

func (b *BlockStatement) String() string

func (*BlockStatement) TokenLiteral

func (b *BlockStatement) TokenLiteral() string

type Boolean

type Boolean struct {
	Token token.Token
	Value bool
}

func (*Boolean) String

func (b *Boolean) String() string

func (*Boolean) TokenLiteral

func (b *Boolean) TokenLiteral() string

type CallExpression

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

func (*CallExpression) String

func (ce *CallExpression) String() string

func (*CallExpression) TokenLiteral

func (ce *CallExpression) TokenLiteral() string

type Expression

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

type ExpressionStatement

type ExpressionStatement struct {
	Token      token.Token // The first token of the statement
	Expression Expression
}

func (*ExpressionStatement) String

func (e *ExpressionStatement) String() string

func (*ExpressionStatement) TokenLiteral

func (e *ExpressionStatement) TokenLiteral() string

type FunctionLiteral

type FunctionLiteral struct {
	Token      token.Token // The fn token
	Parameters []*Identifier
	Body       *BlockStatement
}

func (*FunctionLiteral) String

func (f *FunctionLiteral) String() string

func (*FunctionLiteral) TokenLiteral

func (f *FunctionLiteral) TokenLiteral() string

type HashLiteral

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

func (*HashLiteral) String

func (h *HashLiteral) String() string

func (*HashLiteral) TokenLiteral

func (h *HashLiteral) TokenLiteral() string

type Identifier

type Identifier struct {
	Token token.Token // The token.IDENT token
	Value string
}

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 (i *IfExpression) String() string

func (*IfExpression) TokenLiteral

func (i *IfExpression) TokenLiteral() string

type IndexExpression

type IndexExpression struct {
	Token token.Token // The token.LBRACKET token
	Left  Expression
	Index Expression
}

func (*IndexExpression) String

func (i *IndexExpression) String() string

func (*IndexExpression) TokenLiteral

func (i *IndexExpression) TokenLiteral() string

type InfixExpression

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

func (*InfixExpression) String

func (i *InfixExpression) String() string

func (*InfixExpression) TokenLiteral

func (i *InfixExpression) TokenLiteral() string

type IntegerLiteral

type IntegerLiteral struct {
	Token token.Token
	Value int64
}

func (*IntegerLiteral) String

func (i *IntegerLiteral) String() string

func (*IntegerLiteral) TokenLiteral

func (i *IntegerLiteral) TokenLiteral() string

type LetStatement

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

func (*LetStatement) String

func (l *LetStatement) String() string

func (*LetStatement) TokenLiteral

func (l *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 (p *PrefixExpression) String() string

func (*PrefixExpression) TokenLiteral

func (p *PrefixExpression) TokenLiteral() string

type Program

type Program struct {
	Statements []Statement
}

func (*Program) String

func (p *Program) String() string

func (*Program) TokenLiteral

func (p *Program) TokenLiteral() string

type ReturnStatement

type ReturnStatement struct {
	Token token.Token // The token.RETURN token
	Value Expression
}

func (*ReturnStatement) String

func (r *ReturnStatement) String() string

func (*ReturnStatement) TokenLiteral

func (r *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 (s *StringLiteral) String() string

func (*StringLiteral) TokenLiteral

func (s *StringLiteral) TokenLiteral() string

Jump to

Keyboard shortcuts

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