ast

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2023 License: AGPL-3.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 ArrayLiteral

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

func (*ArrayLiteral) String

func (il *ArrayLiteral) String() string

func (*ArrayLiteral) TokenLiteral

func (il *ArrayLiteral) TokenLiteral() string

type Boolean

type Boolean struct {
	Token token.Token
	Value bool
}

func (*Boolean) GetVal

func (il *Boolean) GetVal() interface{}

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 '(' 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 Expression

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

All expression nodes implement this

type ExpressionStatement

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

func (*ExpressionStatement) String

func (es *ExpressionStatement) String() string

func (*ExpressionStatement) TokenLiteral

func (es *ExpressionStatement) TokenLiteral() string

type FloatLiteral

type FloatLiteral struct {
	Token token.Token
	Value float64
}

func (*FloatLiteral) GetVal

func (il *FloatLiteral) GetVal() interface{}

func (*FloatLiteral) String

func (il *FloatLiteral) String() string

func (*FloatLiteral) TokenLiteral

func (il *FloatLiteral) TokenLiteral() string

type Identifier

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

Expressions

func (*Identifier) String

func (i *Identifier) String() string

func (*Identifier) TokenLiteral

func (i *Identifier) TokenLiteral() string

type InfixExpression

type InfixExpression struct {
	Token    token.Token // The operator token, e.g. +
	Left     Expression
	Operator string
	Right    Expression
}

func (*InfixExpression) String

func (oe *InfixExpression) String() string

func (*InfixExpression) TokenLiteral

func (oe *InfixExpression) TokenLiteral() string

type IntegerLiteral

type IntegerLiteral struct {
	Token token.Token
	Value int64
}

func (*IntegerLiteral) GetVal

func (il *IntegerLiteral) GetVal() interface{}

func (*IntegerLiteral) String

func (il *IntegerLiteral) String() string

func (*IntegerLiteral) TokenLiteral

func (il *IntegerLiteral) TokenLiteral() string

type Node

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

The base Node interface

type NullLiteral

type NullLiteral struct {
	Token token.Token
	Value interface{}
}

func (*NullLiteral) GetVal

func (il *NullLiteral) GetVal() interface{}

func (*NullLiteral) String

func (il *NullLiteral) String() string

func (*NullLiteral) TokenLiteral

func (il *NullLiteral) TokenLiteral() string

type ObjectLiteral added in v1.0.0

type ObjectLiteral struct {
	Token token.Token
	Elems map[string]Expression
}

func (*ObjectLiteral) String added in v1.0.0

func (il *ObjectLiteral) String() string

func (*ObjectLiteral) TokenLiteral added in v1.0.0

func (il *ObjectLiteral) TokenLiteral() string

type PrefixExpression

type PrefixExpression struct {
	Token    token.Token // The prefix token, e.g. !
	Operator string
	Right    Expression
}

func (*PrefixExpression) String

func (pe *PrefixExpression) String() string

func (*PrefixExpression) TokenLiteral

func (pe *PrefixExpression) TokenLiteral() string

type Statement

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

All statement nodes implement this

type StringLiteral

type StringLiteral struct {
	Token token.Token
	Value string
}

func (*StringLiteral) GetVal

func (il *StringLiteral) GetVal() interface{}

func (*StringLiteral) String

func (il *StringLiteral) String() string

func (*StringLiteral) TokenLiteral

func (il *StringLiteral) TokenLiteral() string

Jump to

Keyboard shortcuts

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