ast

package
v0.0.0-...-08386a5 Latest Latest
Warning

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

Go to latest
Published: May 10, 2016 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Assignment

type Assignment struct {
	Variable Node
	Expr     Node
	Statement
}

type Class

type Class struct {
	Name string
	// Properties []Node
	// Methods    []Node
	Super      *string
	Interfaces []string
	Body       *StatementList
}

func (*Class) AddInterface

func (self *Class) AddInterface(inf string)

func (*Class) SetInterfaces

func (self *Class) SetInterfaces(infs []string)

func (*Class) SetSuper

func (self *Class) SetSuper(className string)

type ClassMember

type ClassMember struct {
	Name  string
	Value Node
}

func CreateClassMember

func CreateClassMember(name string) ClassMember

func (*ClassMember) SetValue

func (self *ClassMember) SetValue(val Node)

type ElseIfStatement

type ElseIfStatement struct {
	Expr Expr
	Body *StatementList
}

type Expr

type Expr struct {
	Op          int
	Left        Node
	Right       Node
	Parenthesis bool
}

func CreateExpr

func CreateExpr(op int, left, right Node) Expr

type ExprStatement

type ExprStatement struct {
	Expr Node
}

type FloatingNumber

type FloatingNumber struct {
	Val float64
}

type Function

type Function struct {
	Name   string
	Params []FunctionParam
	Body   *StatementList
}

func CreateFunction

func CreateFunction(name string, params []FunctionParam, stmts *StatementList) Function

type FunctionCall

type FunctionCall struct {
	Name   string
	Params []Node
}

func CreateFunctionCall

func CreateFunctionCall(name string, params []Node) FunctionCall

type FunctionParam

type FunctionParam struct {
	Name    string
	Type    string
	Default Node
}

type IfElseStatement

type IfElseStatement struct {
	Expr     Expr
	Body     *StatementList
	ElseBody *StatementList
}

type IfStatement

type IfStatement struct {
	Expr       Expr
	Body       *StatementList
	ElseIfList []ElseIfStatement
	ElseBody   *StatementList
}

func (*IfStatement) AddElseIf

func (self *IfStatement) AddElseIf(expr Expr, body *StatementList)

func (*IfStatement) SetElse

func (self *IfStatement) SetElse(body *StatementList)

type Interface

type Interface struct {
	Name string
}

type Node

type Node interface {
}

func CreateAssignment

func CreateAssignment(variable Node, expr Node) Node

func CreateClass

func CreateClass(className string) Node

func CreateExprStatement

func CreateExprStatement(expr Node) Node

func CreateFloatingNumber

func CreateFloatingNumber(token string) Node

func CreateIfElseStatement

func CreateIfElseStatement(expr Expr, body *StatementList, elseBody *StatementList) Node

func CreateIfStatement

func CreateIfStatement(expr Expr, body *StatementList) Node

func CreateInterface

func CreateInterface(name string) Node

func CreateNumber

func CreateNumber(token string) Node

func CreateReturnStatement

func CreateReturnStatement(expr Node) Node

func CreateVariable

func CreateVariable(identifier string) Node

type Number

type Number struct {
	Val int64
}

type ReturnStatement

type ReturnStatement struct {
	Expr Node
}

type Statement

type Statement struct {
}

type StatementList

type StatementList []Node

func CreateStatementList

func CreateStatementList() *StatementList

func (*StatementList) Append

func (self *StatementList) Append(node Node)

type UnaryExpr

type UnaryExpr struct {
	Op  int
	Val Node
}

func CreateUnaryExpr

func CreateUnaryExpr(op int, val Node) UnaryExpr

type Variable

type Variable struct {
	Identifier string
}

Jump to

Keyboard shortcuts

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