ast

package
v0.0.0-...-5957b22 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AssignmentExpression

type AssignmentExpression struct {
	Name  token.Token
	Value Expression
}

Expressions

func (*AssignmentExpression) String

func (ae *AssignmentExpression) String() string

type AssignmentIndexExpression

type AssignmentIndexExpression struct {
	Name  token.Token
	Index Expression
	Value Expression
}

func (*AssignmentIndexExpression) String

func (aie *AssignmentIndexExpression) String() string

type AssignmentStruct

type AssignmentStruct struct {
	Name      token.Token
	Attribute Expression
	Value     Expression
}

func (*AssignmentStruct) String

func (as *AssignmentStruct) String() string

type AstNode

type AstNode interface{}

type BinaryExpression

type BinaryExpression struct {
	Left     Expression
	Right    Expression
	Operator token.Token
}

func (*BinaryExpression) String

func (be *BinaryExpression) String() string

type BlockStatement

type BlockStatement struct {
	Statements []Statement
}

type BoolExpression

type BoolExpression struct {
	Value bool
}

func (*BoolExpression) String

func (be *BoolExpression) String() string

type CallExpression

type CallExpression struct {
	Callee    Expression
	Arguments []Expression
}

func (*CallExpression) String

func (ce *CallExpression) String() string

type Expression

type Expression interface {
	AstNode

	String() string
	// contains filtered or unexported methods
}

type ForStatement

type ForStatement struct {
	Variable  Statement
	Condition Expression
	Effect    Expression
	Body      Statement
}

type FunctionStatement

type FunctionStatement struct {
	Name   token.Token
	Params []token.Token
	Body   BlockStatement
}

type GetExpression

type GetExpression struct {
	Callee    Expression
	Caller    Expression
	Arguments []Expression
	IsMethod  bool
}

This is almost the same as CallExpression except that the use-case for this is variable.{attribute} or in the future when methods are supported : variable.method()

func (*GetExpression) String

func (ge *GetExpression) String() string

type GroupExpression

type GroupExpression struct {
	Expr Expression
}

func (*GroupExpression) String

func (ge *GroupExpression) String() string

type HashMapExpression

type HashMapExpression struct {
	Values map[Expression]Expression
}

func (*HashMapExpression) String

func (hme *HashMapExpression) String() string

type IfStatement

type IfStatement struct {
	Condition Expression
	Then      Statement
	Else      Statement
}

type ListExpression

type ListExpression struct {
	Values []Expression
}

func (*ListExpression) String

func (le *ListExpression) String() string

type LogicalExpression

type LogicalExpression struct {
	Left     Expression
	Right    Expression
	Operator token.Token
}

func (*LogicalExpression) String

func (le *LogicalExpression) String() string

type NumberExpression

type NumberExpression struct {
	Value int
}

func (*NumberExpression) String

func (ne *NumberExpression) String() string

type PrintStatement

type PrintStatement struct {
	Expr Expression
}

type ReturnStatement

type ReturnStatement struct {
	Keyword token.Token
	Value   Expression
}

type Statement

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

type StatementExpression

type StatementExpression struct {
	Expr Expression
}

Statements

type StringExpression

type StringExpression struct {
	Value string
}

func (*StringExpression) String

func (se *StringExpression) String() string

type StructStatement

type StructStatement struct {
	Name       token.Token
	Attributes map[token.Token]Statement
	Methods    map[token.Token]Statement
}

type UnaryExpression

type UnaryExpression struct {
	Right    Expression
	Operator token.Token
}

func (*UnaryExpression) String

func (ue *UnaryExpression) String() string

type VariableExpression

type VariableExpression struct {
	Name token.Token
}

func (*VariableExpression) String

func (ve *VariableExpression) String() string

type VariableStatement

type VariableStatement struct {
	Name        token.Token
	Initializer Expression
}

type WhileStatement

type WhileStatement struct {
	Condition Expression
	Body      Statement
}

Jump to

Keyboard shortcuts

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