ast

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2022 License: BSD-2-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Walk

func Walk(visitor Visitor, node Node)

Types

type ArrayExpression

type ArrayExpression struct {
	Expression
	Values []Expression
}

type AssignStatement

type AssignStatement struct {
	Statement
	LeftHandSide   Expression // Identifiers or Selectors
	AssignOperator *lexer.Token
	RightHandSide  Expression
}

type BasicLiteralExpression

type BasicLiteralExpression struct {
	Expression
	Token       *lexer2.Token
	Kind        lexer2.Kind
	DirectValue lexer2.DirectValue
}

type BeginStatement

type BeginStatement struct {
	Statement
	Body []Node
}

type BinaryExpression

type BinaryExpression struct {
	Expression
	LeftHandSide  Expression
	Operator      *lexer2.Token
	RightHandSide Expression
}

type BreakStatement

type BreakStatement struct {
	Statement
}

type CaseBlock

type CaseBlock struct {
	Cases []Expression
	Body  []Node
}

type ClassStatement

type ClassStatement struct {
	Statement
	Name  *Identifier
	Bases []Expression // Identifiers and selectors
	Body  []Node
}

type ContinueStatement

type ContinueStatement struct {
	Statement
}

type DeferStatement

type DeferStatement struct {
	Statement
	X *MethodInvocationExpression
}

type DeleteStatement

type DeleteStatement struct {
	Statement
	X Expression
}

type DoWhileStatement

type DoWhileStatement struct {
	Statement
	Condition Expression
	Body      []Node
}

type ElifBlock

type ElifBlock struct {
	Condition Expression
	Body      []Node
}

type EndStatement

type EndStatement struct {
	Statement
	Body []Node
}

type Expression

type Expression interface {
	Node
	E()
}

type ForLoopStatement

type ForLoopStatement struct {
	Statement
	Receivers []*Identifier
	Source    Expression
	Body      []Node
}

type FunctionDefinitionStatement

type FunctionDefinitionStatement struct {
	Statement
	Name      *Identifier
	Arguments []*Identifier
	Body      []Node
}

type GeneratorDefinitionStatement

type GeneratorDefinitionStatement struct {
	Statement
	Name      *Identifier
	Arguments []*Identifier
	Body      []Node
}

type GeneratorExpression

type GeneratorExpression struct {
	Expression
	Operation Expression
	Receivers []*Identifier
	Source    Expression
}

type HashExpression

type HashExpression struct {
	Expression
	Values []*KeyValue
}

type Identifier

type Identifier struct {
	Expression
	Token *lexer2.Token
}

type IfOneLinerExpression

type IfOneLinerExpression struct {
	Expression
	Result     Expression
	Condition  Expression
	ElseResult Expression
}

type IfStatement

type IfStatement struct {
	Statement
	Condition  Expression
	Body       []Node
	ElifBlocks []ElifBlock
	Else       []Node
}

type IndexExpression

type IndexExpression struct {
	Expression
	Source Expression
	Index  Expression
}

type InterfaceStatement

type InterfaceStatement struct {
	Statement
	Name              *Identifier
	Bases             []Expression
	MethodDefinitions []*FunctionDefinitionStatement
}

type KeyValue

type KeyValue struct {
	Key   Expression
	Value Expression
}

type LambdaExpression

type LambdaExpression struct {
	Expression
	Arguments []*Identifier
	Code      Expression
}

type MethodInvocationExpression

type MethodInvocationExpression struct {
	Expression
	Function  Expression
	Arguments []Expression
}

type ModuleStatement

type ModuleStatement struct {
	Statement
	Name *Identifier
	Body []Node
}

type Node

type Node interface {
	N()
}

type ParenthesesExpression

type ParenthesesExpression struct {
	Expression
	X Expression
}

type PassStatement

type PassStatement struct {
	Statement
}

type Program

type Program struct {
	Node
	Begin *BeginStatement
	End   *EndStatement
	Body  []Node
}

type ReturnStatement

type ReturnStatement struct {
	Statement
	Results []Expression
}

type SelectorExpression

type SelectorExpression struct {
	Expression
	X          Expression
	Identifier *Identifier
}

type Statement

type Statement interface {
	S()
	Node
}

type SuperExpression

type SuperExpression struct {
	Expression
	X Expression
}

type SwitchStatement

type SwitchStatement struct {
	Statement
	Target     Expression
	CaseBlocks []*CaseBlock
	Default    []Node
}

type TupleExpression

type TupleExpression struct {
	Expression
	Values []Expression
}

type UnaryExpression

type UnaryExpression struct {
	Expression
	Operator *lexer2.Token
	X        Expression
}

type UnlessOneLinerExpression

type UnlessOneLinerExpression struct {
	Expression
	Result     Expression
	Condition  Expression
	ElseResult Expression
}

type UnlessStatement

type UnlessStatement struct {
	Statement
	Condition  Expression
	Body       []Node
	ElifBlocks []ElifBlock
	Else       []Node
}

type UntilLoopStatement

type UntilLoopStatement struct {
	Statement
	Condition Expression
	Body      []Node
}

type Visitor

type Visitor interface {
	Visit(node Node) Visitor
}

type WhileLoopStatement

type WhileLoopStatement struct {
	Statement
	Condition Expression
	Body      []Node
}

type YieldStatement

type YieldStatement struct {
	Statement
	Results []Expression
}

Jump to

Keyboard shortcuts

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