ast

package
Version: v0.0.0-...-0e32bd2 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2020 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ASSIGN       string = "assign"
	BLOCK        string = "block"
	BUILTIN      string = "builtin"
	BREAK        string = "break"
	CALL         string = "call"
	FLOAT        string = "float"
	FUNCTION     string = "function"
	FUNCTIONEXPR string = "function expression"
	IDENTIFIER   string = "identifier"
	IF           string = "if"
	IMPORT       string = "import"
	INDEX        string = "index"
	INFIX        string = "infix"
	INTEGER      string = "integer"
	LOOP         string = "loop"
	POSTFIX      string = "postfix"
	PREFIX       string = "prefix"
	PROGRAM      string = "program"
	RETURN       string = "return"
	STRING       string = "string"
	SWITCH       string = "switch"
	TERNARY      string = "ternary"
	THROW        string = "throw"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Assign

type Assign struct {
	// contains filtered or unexported fields
}

func (Assign) Debug

func (this Assign) Debug() string

func (Assign) GetLeft

func (this Assign) GetLeft() Node

func (Assign) GetLine

func (this Assign) GetLine() uint32

func (Assign) GetRight

func (this Assign) GetRight() Node

func (Assign) GetType

func (this Assign) GetType() string

func (Assign) Init

func (this Assign) Init(line uint32, operator string, left Node) Assign

func (*Assign) SetRight

func (this *Assign) SetRight(right Node)

type Block

type Block struct {
	// contains filtered or unexported fields
}

func (Block) Debug

func (this Block) Debug() string

func (Block) GetBody

func (this Block) GetBody() []Node

func (Block) GetLine

func (this Block) GetLine() uint32

func (Block) GetType

func (this Block) GetType() string

func (Block) Init

func (this Block) Init(line uint32) Block

func (Block) Set

func (this Block) Set(line uint32, body []Node) Block

func (*Block) SetBody

func (this *Block) SetBody(body []Node)

type Break

type Break struct {
	// contains filtered or unexported fields
}

func (Break) Debug

func (this Break) Debug() string

func (Break) GetLine

func (this Break) GetLine() uint32

func (Break) GetType

func (this Break) GetType() string

func (Break) Init

func (this Break) Init(line uint32, token string) Break

type Builtin

type Builtin struct {
	// contains filtered or unexported fields
}

func (Builtin) Debug

func (this Builtin) Debug() string

func (Builtin) GetLine

func (this Builtin) GetLine() uint32

func (Builtin) GetType

func (this Builtin) GetType() string

func (Builtin) GetValue

func (this Builtin) GetValue() string

func (Builtin) Init

func (this Builtin) Init(line uint32, value string) Builtin

type Call

type Call struct {
	// contains filtered or unexported fields
}

func (Call) Debug

func (this Call) Debug() string

func (Call) GetArguments

func (this Call) GetArguments() []Node

func (Call) GetCaller

func (this Call) GetCaller() Node

func (Call) GetLine

func (this Call) GetLine() uint32

func (Call) GetType

func (this Call) GetType() string

func (Call) Init

func (this Call) Init(line uint32, caller Node) Call

func (*Call) SetArguments

func (this *Call) SetArguments(arguments []Node)

type Case

type Case struct {
	// contains filtered or unexported fields
}

func (Case) Debug

func (this Case) Debug() string

func (Case) GetBody

func (this Case) GetBody() Node

func (Case) GetCase

func (this Case) GetCase() Node

func (Case) GetLine

func (this Case) GetLine() uint32

func (Case) Init

func (this Case) Init(line uint32) Case

func (*Case) SetBody

func (this *Case) SetBody(body Block)

func (*Case) SetCase

func (this *Case) SetCase(_case Node)

type Float

type Float struct {
	// contains filtered or unexported fields
}

func (Float) Debug

func (this Float) Debug() string

func (Float) GetLine

func (this Float) GetLine() uint32

func (Float) GetType

func (this Float) GetType() string

func (Float) GetValue

func (this Float) GetValue() float64

func (Float) Init

func (this Float) Init(line uint32, value float64) Float

type Function

type Function struct {
	// contains filtered or unexported fields
}

func (Function) Debug

func (this Function) Debug() string

func (Function) GetBody

func (this Function) GetBody() Block

func (Function) GetLine

func (this Function) GetLine() uint32

func (Function) GetName

func (this Function) GetName() Identifier

func (Function) GetParams

func (this Function) GetParams() []Identifier

func (Function) GetType

func (this Function) GetType() string

func (Function) Init

func (this Function) Init(line uint32, token string) Function

func (*Function) SetBody

func (this *Function) SetBody(body Block)

func (*Function) SetName

func (this *Function) SetName(name Identifier)

func (*Function) SetParams

func (this *Function) SetParams(params []Identifier)

type FunctionExpr

type FunctionExpr struct {
	// contains filtered or unexported fields
}

func (FunctionExpr) Debug

func (this FunctionExpr) Debug() string

func (FunctionExpr) GetBody

func (this FunctionExpr) GetBody() Node

func (FunctionExpr) GetLine

func (this FunctionExpr) GetLine() uint32

func (FunctionExpr) GetParams

func (this FunctionExpr) GetParams() []Identifier

func (FunctionExpr) GetType

func (this FunctionExpr) GetType() string

func (FunctionExpr) Init

func (this FunctionExpr) Init(line uint32, token string) FunctionExpr

func (*FunctionExpr) SetBody

func (this *FunctionExpr) SetBody(body Node)

func (*FunctionExpr) SetParams

func (this *FunctionExpr) SetParams(params []Identifier)

type Identifier

type Identifier struct {
	// contains filtered or unexported fields
}

func (Identifier) Debug

func (this Identifier) Debug() string

func (Identifier) GetLine

func (this Identifier) GetLine() uint32

func (Identifier) GetType

func (this Identifier) GetType() string

func (Identifier) GetValue

func (this Identifier) GetValue() string

func (Identifier) Init

func (this Identifier) Init(line uint32, token string) Identifier

type If

type If struct {
	// contains filtered or unexported fields
}

func (If) Debug

func (this If) Debug() string

func (If) GetAlternative

func (this If) GetAlternative() Block

func (If) GetCondition

func (this If) GetCondition() Node

func (If) GetConsequence

func (this If) GetConsequence() Block

func (If) GetLine

func (this If) GetLine() uint32

func (If) GetType

func (this If) GetType() string

func (If) HaveAlternative

func (this If) HaveAlternative() bool

func (If) Init

func (this If) Init(line uint32, token string) If

func (*If) SetAlternative

func (this *If) SetAlternative(alternative Block)

func (*If) SetCondition

func (this *If) SetCondition(condition Node)

func (*If) SetConsequence

func (this *If) SetConsequence(consequence Block)

type Import

type Import struct {
	// contains filtered or unexported fields
}

func (Import) Debug

func (this Import) Debug() string

func (Import) GetBody

func (this Import) GetBody() Node

func (Import) GetLine

func (this Import) GetLine() uint32

func (Import) GetType

func (this Import) GetType() string

func (Import) Init

func (this Import) Init(line uint32, token string) Import

func (*Import) SetAs

func (this *Import) SetAs(body Node)

func (*Import) SetBody

func (this *Import) SetBody(body Node)

type Index

type Index struct {
	// contains filtered or unexported fields
}

func (Index) Debug

func (this Index) Debug() string

func (Index) GetLeft

func (this Index) GetLeft() Node

func (Index) GetLine

func (this Index) GetLine() uint32

func (Index) GetOperator

func (this Index) GetOperator() string

func (Index) GetRight

func (this Index) GetRight() Node

func (Index) GetType

func (this Index) GetType() string

func (Index) Init

func (this Index) Init(line uint32, left Node, operator string) Index

func (*Index) SetRight

func (this *Index) SetRight(right Node)

type Infix

type Infix struct {
	// contains filtered or unexported fields
}

func (Infix) Debug

func (this Infix) Debug() string

func (Infix) GetLeft

func (this Infix) GetLeft() Node

func (Infix) GetLine

func (this Infix) GetLine() uint32

func (Infix) GetOperator

func (this Infix) GetOperator() string

func (Infix) GetRight

func (this Infix) GetRight() Node

func (Infix) GetType

func (this Infix) GetType() string

func (Infix) Init

func (this Infix) Init(line uint32, operator string, left Node) Infix

func (Infix) Set

func (this Infix) Set(line uint32, left Node, operator string, right Node) Infix

func (*Infix) SetRight

func (this *Infix) SetRight(right Node)

type Integer

type Integer struct {
	// contains filtered or unexported fields
}

func (Integer) Debug

func (this Integer) Debug() string

func (Integer) GetLine

func (this Integer) GetLine() uint32

func (Integer) GetType

func (this Integer) GetType() string

func (Integer) GetValue

func (this Integer) GetValue() int64

func (Integer) Init

func (this Integer) Init(line uint32, value int64) Integer

type Loop

type Loop struct {
	// contains filtered or unexported fields
}

func (Loop) Debug

func (this Loop) Debug() string

func (Loop) GetBody

func (this Loop) GetBody() Block

func (Loop) GetLine

func (this Loop) GetLine() uint32

func (Loop) GetType

func (this Loop) GetType() string

func (Loop) Init

func (this Loop) Init(line uint32, token string) Loop

func (*Loop) SetBody

func (this *Loop) SetBody(body Block)

type Node

type Node interface {
	GetType() string
	GetLine() uint32
	Debug() string
}

type Postfix

type Postfix struct {
	// contains filtered or unexported fields
}

func (Postfix) Debug

func (this Postfix) Debug() string

func (Postfix) GetLeft

func (this Postfix) GetLeft() Node

func (Postfix) GetLine

func (this Postfix) GetLine() uint32

func (Postfix) GetOperator

func (this Postfix) GetOperator() string

func (Postfix) GetType

func (this Postfix) GetType() string

func (Postfix) Init

func (this Postfix) Init(line uint32, operator string, left Node) Postfix

type Prefix

type Prefix struct {
	// contains filtered or unexported fields
}

func (Prefix) Debug

func (this Prefix) Debug() string

func (Prefix) GetLine

func (this Prefix) GetLine() uint32

func (Prefix) GetOperator

func (this Prefix) GetOperator() string

func (Prefix) GetRight

func (this Prefix) GetRight() Node

func (Prefix) GetType

func (this Prefix) GetType() string

func (Prefix) Init

func (this Prefix) Init(line uint32, operator string) Prefix

func (*Prefix) SetRight

func (this *Prefix) SetRight(right Node)

type Program

type Program struct {
	// contains filtered or unexported fields
}

func (Program) Debug

func (this Program) Debug() string

func (Program) GetBody

func (this Program) GetBody() []Function

func (Program) GetLine

func (this Program) GetLine() uint32

func (Program) GetType

func (this Program) GetType() string

func (Program) Init

func (this Program) Init(line uint32) Program

func (*Program) SetBody

func (this *Program) SetBody(body []Function)

type Return

type Return struct {
	// contains filtered or unexported fields
}

func (Return) Debug

func (this Return) Debug() string

func (Return) GetBody

func (this Return) GetBody() Node

func (Return) GetLine

func (this Return) GetLine() uint32

func (Return) GetType

func (this Return) GetType() string

func (Return) Init

func (this Return) Init(line uint32, token string) Return

func (*Return) SetBody

func (this *Return) SetBody(body Node)

type String

type String struct {
	// contains filtered or unexported fields
}

func (String) Debug

func (this String) Debug() string

func (String) GetLine

func (this String) GetLine() uint32

func (String) GetType

func (this String) GetType() string

func (String) GetValue

func (this String) GetValue() string

func (String) Init

func (this String) Init(line uint32, value string) String

type Switch

type Switch struct {
	// contains filtered or unexported fields
}

func (Switch) Debug

func (this Switch) Debug() string

func (Switch) GetCases

func (this Switch) GetCases() []Case

func (Switch) GetCondition

func (this Switch) GetCondition() Node

func (Switch) GetLine

func (this Switch) GetLine() uint32

func (Switch) GetType

func (this Switch) GetType() string

func (Switch) Init

func (this Switch) Init(line uint32, token string) Switch

func (*Switch) SetCases

func (this *Switch) SetCases(cases []Case)

func (*Switch) SetCondition

func (this *Switch) SetCondition(condition Node)

type Ternary

type Ternary struct {
	// contains filtered or unexported fields
}

func (Ternary) Debug

func (this Ternary) Debug() string

func (Ternary) GetAlternative

func (this Ternary) GetAlternative() Node

func (Ternary) GetCondition

func (this Ternary) GetCondition() Node

func (Ternary) GetConsequence

func (this Ternary) GetConsequence() Node

func (Ternary) GetLine

func (this Ternary) GetLine() uint32

func (Ternary) GetType

func (this Ternary) GetType() string

func (Ternary) HaveAlternative

func (this Ternary) HaveAlternative() bool

func (Ternary) Init

func (this Ternary) Init(line uint32, token string) Ternary

func (*Ternary) SetAlternative

func (this *Ternary) SetAlternative(alternative Node)

func (*Ternary) SetCondition

func (this *Ternary) SetCondition(condition Node)

func (*Ternary) SetConsequence

func (this *Ternary) SetConsequence(consequence Node)

type Throw

type Throw struct {
	// contains filtered or unexported fields
}

func (Throw) Debug

func (this Throw) Debug() string

func (Throw) GetBody

func (this Throw) GetBody() Node

func (Throw) GetLine

func (this Throw) GetLine() uint32

func (Throw) GetType

func (this Throw) GetType() string

func (Throw) Init

func (this Throw) Init(line uint32, token string) Throw

func (*Throw) SetBody

func (this *Throw) SetBody(body Node)

Jump to

Keyboard shortcuts

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