ast

package
v0.0.0-...-3085ebc Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BooleanLiteral

type BooleanLiteral struct {
	Token token.Token
	Value bool
}

func (*BooleanLiteral) End

func (b *BooleanLiteral) End() token.Position

func (*BooleanLiteral) Pos

func (b *BooleanLiteral) Pos() token.Position

func (*BooleanLiteral) String

func (b *BooleanLiteral) String() string

func (*BooleanLiteral) TokenLiteral

func (b *BooleanLiteral) 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) End

func (*ExpressionStatement) Pos

func (*ExpressionStatement) String

func (es *ExpressionStatement) String() string

func (*ExpressionStatement) TokenLiteral

func (es *ExpressionStatement) TokenLiteral() string

type Identifier

type Identifier struct {
	Token token.Token
	Value string
}

func (*Identifier) End

func (i *Identifier) End() token.Position

func (*Identifier) Pos

func (i *Identifier) Pos() token.Position

func (*Identifier) String

func (i *Identifier) String() string

func (*Identifier) TokenLiteral

func (i *Identifier) TokenLiteral() string

type InfixExpression

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

1 + 2 * 3

func (*InfixExpression) End

func (ie *InfixExpression) End() token.Position

func (*InfixExpression) Pos

func (ie *InfixExpression) Pos() token.Position

func (*InfixExpression) String

func (ie *InfixExpression) String() string

func (*InfixExpression) TokenLiteral

func (ie *InfixExpression) TokenLiteral() string

type LetStatement

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

let <identifier> = <expression>

func (*LetStatement) End

func (ls *LetStatement) End() token.Position

func (*LetStatement) Pos

func (ls *LetStatement) Pos() token.Position

func (*LetStatement) String

func (ls *LetStatement) String() string

func (*LetStatement) TokenLiteral

func (ls *LetStatement) TokenLiteral() string

type NilLiteral

type NilLiteral struct {
	Token token.Token
}

func (*NilLiteral) End

func (n *NilLiteral) End() token.Position

func (*NilLiteral) Pos

func (n *NilLiteral) Pos() token.Position

func (*NilLiteral) String

func (n *NilLiteral) String() string

func (*NilLiteral) TokenLiteral

func (n *NilLiteral) TokenLiteral() string

type Node

type Node interface {
	Pos() token.Position // position of first character belonging to the node
	End() token.Position // position of first character immediately after the node

	TokenLiteral() string
	String() string
}

type NumberLiteral

type NumberLiteral struct {
	Token token.Token
	Value float64
}

func (*NumberLiteral) End

func (nl *NumberLiteral) End() token.Position

func (*NumberLiteral) Pos

func (nl *NumberLiteral) Pos() token.Position

func (*NumberLiteral) String

func (nl *NumberLiteral) String() string

func (*NumberLiteral) TokenLiteral

func (nl *NumberLiteral) TokenLiteral() string

type PrefixExpression

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

-2, -3

func (*PrefixExpression) End

func (pe *PrefixExpression) End() token.Position

func (*PrefixExpression) Pos

func (pe *PrefixExpression) Pos() token.Position

func (*PrefixExpression) String

func (pe *PrefixExpression) String() string

func (*PrefixExpression) TokenLiteral

func (pe *PrefixExpression) TokenLiteral() string

type Program

type Program struct {
	Statements []Statement
}

func (*Program) End

func (p *Program) End() token.Position

func (*Program) Pos

func (p *Program) Pos() token.Position

func (*Program) String

func (p *Program) String() string

func (*Program) TokenLiteral

func (p *Program) TokenLiteral() string

type Statement

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

Jump to

Keyboard shortcuts

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