ast

package
v1.0.0-early-alpha Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block struct {
	Stmts []Statement
}

func (*Block) String

func (b *Block) String() string

type Call

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

func (*Call) Line

func (c *Call) Line() int

func (*Call) String

func (c *Call) String() string

type Expression

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

Expression represents an expression

type ExpressionStatement

type ExpressionStatement struct {
	Es Expression
	Tk token.Token
}

func (ExpressionStatement) Line

func (e ExpressionStatement) Line() int

func (ExpressionStatement) String

func (e ExpressionStatement) String() string

type GetVar

type GetVar struct {
	Name string
	Tk   token.Token
}

func (*GetVar) Line

func (g *GetVar) Line() int

func (*GetVar) String

func (g *GetVar) String() string

type IfElse

type IfElse struct {
	Condition Expression
	If        *Block
	Else      *Block
	Tk        token.Token
}

func (*IfElse) Line

func (ie *IfElse) Line() int

func (*IfElse) String

func (ie *IfElse) String() string

type Infix

type Infix struct {
	Left  Expression
	Right Expression
	Op    token.Token
}

func (*Infix) Line

func (i *Infix) Line() int

func (*Infix) String

func (i *Infix) String() string

type Integer

type Integer struct {
	Value int64
	Tk    token.Token
}

func (*Integer) Line

func (i *Integer) Line() int

func (*Integer) String

func (i *Integer) String() string

type Node

type Node interface {
	String() string
	Line() int
}

All ast nodes inherits from Node

type SetVar

type SetVar struct {
	Name  string
	Value Expression
	Tk    token.Token
}

func (*SetVar) Line

func (s *SetVar) Line() int

func (*SetVar) String

func (s *SetVar) String() string

type Statement

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

Statement represents a statement

type String

type String struct {
	Value string
	Tk    token.Token
}

func (*String) Line

func (s *String) Line() int

func (*String) String

func (s *String) String() string

Jump to

Keyboard shortcuts

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