ast

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Argument

type Argument struct {
	Token token.Item
	Name  string
	Value Expression
}

type Attribute

type Attribute struct {
	Token token.Item
	Value string
}

func (*Attribute) Item

func (a *Attribute) Item() token.Item

func (*Attribute) String

func (a *Attribute) String() string

func (*Attribute) TokenLiteral

func (a *Attribute) TokenLiteral() string

type BlockStatement

type BlockStatement struct {
	Token      token.Item // the { token
	Statements []Statement
}

func (*BlockStatement) Item

func (bs *BlockStatement) Item() token.Item

func (*BlockStatement) String

func (bs *BlockStatement) String() string

func (*BlockStatement) TokenLiteral

func (bs *BlockStatement) TokenLiteral() string

type Boolean

type Boolean struct {
	Token token.Item
	Value bool
	Type  *Type
}

func (*Boolean) Item

func (b *Boolean) Item() token.Item

func (*Boolean) String

func (b *Boolean) String() string

func (*Boolean) TokenLiteral

func (b *Boolean) TokenLiteral() string

type CallExpression

type CallExpression struct {
	Token     token.Item // The '(' token
	Function  string     // Identifier or FunctionLiteral
	Name      string
	Arguments []Argument
}

func (*CallExpression) Item

func (ce *CallExpression) Item() token.Item

func (*CallExpression) String

func (ce *CallExpression) String() string

func (*CallExpression) TokenLiteral

func (ce *CallExpression) TokenLiteral() string

type Comma

type Comma struct {
	Token token.Item
}

Expressions

func (*Comma) Item

func (c *Comma) Item() token.Item

func (*Comma) String

func (c *Comma) String() string

func (*Comma) TokenLiteral

func (c *Comma) TokenLiteral() string

type CommentStatement

type CommentStatement struct {
	Token token.Item
	Value string
}

func (*CommentStatement) Item

func (c *CommentStatement) Item() token.Item

func (*CommentStatement) String

func (c *CommentStatement) String() string

func (*CommentStatement) TokenLiteral

func (c *CommentStatement) TokenLiteral() string

type ConstStatement

type ConstStatement struct {
	Token token.Item
	Name  string
	Type  Types
	Value Expression
}

func (*ConstStatement) Item

func (cs *ConstStatement) Item() token.Item

func (*ConstStatement) String

func (cs *ConstStatement) String() string

func (*ConstStatement) TokenLiteral

func (cs *ConstStatement) TokenLiteral() string

type DecoratorClass

type DecoratorClass struct {
	Token   token.Item // The 'class' token
	Classes []string
	Type    *TypeStatement
}

func (*DecoratorClass) Item

func (d *DecoratorClass) Item() token.Item

func (*DecoratorClass) String

func (d *DecoratorClass) String() string

func (*DecoratorClass) TokenLiteral

func (d *DecoratorClass) TokenLiteral() string

type DecoratorDefault

type DecoratorDefault struct {
	Token token.Item // The 'generic' token
	Func  Expression
}

func (*DecoratorDefault) Item

func (d *DecoratorDefault) Item() token.Item

func (*DecoratorDefault) String

func (d *DecoratorDefault) String() string

func (*DecoratorDefault) TokenLiteral

func (d *DecoratorDefault) TokenLiteral() string

type DecoratorEnvironment added in v0.0.6

type DecoratorEnvironment struct {
	Token     token.Item
	Arguments []Argument
	Type      *TypeStatement
}

func (*DecoratorEnvironment) Item added in v0.0.6

func (d *DecoratorEnvironment) Item() token.Item

func (*DecoratorEnvironment) String added in v0.0.6

func (d *DecoratorEnvironment) String() string

func (*DecoratorEnvironment) TokenLiteral added in v0.0.6

func (d *DecoratorEnvironment) TokenLiteral() string

type DecoratorFactor

type DecoratorFactor struct {
	Token     token.Item
	Arguments []Argument
	Type      *TypeStatement
}

func (*DecoratorFactor) Item

func (d *DecoratorFactor) Item() token.Item

func (*DecoratorFactor) String

func (d *DecoratorFactor) String() string

func (*DecoratorFactor) TokenLiteral

func (d *DecoratorFactor) TokenLiteral() string

type DecoratorGeneric

type DecoratorGeneric struct {
	Token token.Item // The 'generic' token
	Func  Expression
}

func (*DecoratorGeneric) Item

func (d *DecoratorGeneric) Item() token.Item

func (*DecoratorGeneric) String

func (d *DecoratorGeneric) String() string

func (*DecoratorGeneric) TokenLiteral

func (d *DecoratorGeneric) TokenLiteral() string

type DecoratorMatrix

type DecoratorMatrix struct {
	Token     token.Item
	Arguments []Argument
	Type      *TypeStatement
}

func (*DecoratorMatrix) Item

func (d *DecoratorMatrix) Item() token.Item

func (*DecoratorMatrix) String

func (d *DecoratorMatrix) String() string

func (*DecoratorMatrix) TokenLiteral

func (d *DecoratorMatrix) TokenLiteral() string

type DeferStatement

type DeferStatement struct {
	Token token.Item
	Func  Expression
}

func (*DeferStatement) Item

func (ds *DeferStatement) Item() token.Item

func (*DeferStatement) String

func (ds *DeferStatement) String() string

func (*DeferStatement) TokenLiteral

func (ds *DeferStatement) TokenLiteral() string

type Expression

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

type ExpressionStatement

type ExpressionStatement struct {
	Token      token.Item // the first token of the expression
	Expression Expression
}

func (*ExpressionStatement) Item

func (es *ExpressionStatement) Item() token.Item

func (*ExpressionStatement) String

func (es *ExpressionStatement) String() string

func (*ExpressionStatement) TokenLiteral

func (es *ExpressionStatement) TokenLiteral() string

type FloatLiteral

type FloatLiteral struct {
	Token token.Item
	Value string
	Type  *Type
}

func (*FloatLiteral) Item

func (fl *FloatLiteral) Item() token.Item

func (*FloatLiteral) String

func (fl *FloatLiteral) String() string

func (*FloatLiteral) TokenLiteral

func (fl *FloatLiteral) TokenLiteral() string

type For

type For struct {
	Token  token.Item
	Name   *LetStatement
	Vector Expression
	Value  *BlockStatement
}

func (*For) Item

func (f *For) Item() token.Item

func (*For) String

func (f *For) String() string

func (*For) TokenLiteral

func (f *For) TokenLiteral() string

type FunctionLiteral

type FunctionLiteral struct {
	Token          token.Item // The 'func' token
	Name           string
	NameToken      token.Item
	Operator       string
	MethodVariable string
	Method         *Type
	ReturnType     Types
	Parameters     []*Parameter
	Body           *BlockStatement
}

func (*FunctionLiteral) Item

func (fl *FunctionLiteral) Item() token.Item

func (*FunctionLiteral) String

func (fl *FunctionLiteral) String() string

func (*FunctionLiteral) TokenLiteral

func (fl *FunctionLiteral) TokenLiteral() string

type Identifier

type Identifier struct {
	Token token.Item // the token.IDENT token
	Type  Types
	Value string
}

func (*Identifier) Item

func (i *Identifier) Item() token.Item

func (*Identifier) String

func (i *Identifier) String() string

func (*Identifier) TokenLiteral

func (i *Identifier) TokenLiteral() string

type IfExpression

type IfExpression struct {
	Token       token.Item // The 'if' token
	Condition   Expression
	Consequence *BlockStatement
	Alternative *BlockStatement
}

func (*IfExpression) Item

func (ie *IfExpression) Item() token.Item

func (*IfExpression) String

func (ie *IfExpression) String() string

func (*IfExpression) TokenLiteral

func (ie *IfExpression) TokenLiteral() string

type InfixExpression

type InfixExpression struct {
	Token    token.Item // The operator token, e.g. +
	Left     Expression
	Operator string
	Right    Expression
}

func (*InfixExpression) Item

func (ie *InfixExpression) Item() token.Item

func (*InfixExpression) String

func (ie *InfixExpression) String() string

func (*InfixExpression) TokenLiteral

func (ie *InfixExpression) TokenLiteral() string

type IntegerLiteral

type IntegerLiteral struct {
	Token token.Item
	Value string
	Type  *Type
}

func (*IntegerLiteral) Item

func (il *IntegerLiteral) Item() token.Item

func (*IntegerLiteral) String

func (il *IntegerLiteral) String() string

func (*IntegerLiteral) TokenLiteral

func (il *IntegerLiteral) TokenLiteral() string

type Keyword

type Keyword struct {
	Token token.Item
	Value string
	Type  *Type
}

func (*Keyword) Item

func (kw *Keyword) Item() token.Item

func (*Keyword) String

func (kw *Keyword) String() string

func (*Keyword) TokenLiteral

func (kw *Keyword) TokenLiteral() string

type LetStatement

type LetStatement struct {
	Token token.Item
	Name  string
	Type  Types
	Value Expression
}

Statements

func (*LetStatement) Item

func (ls *LetStatement) Item() token.Item

func (*LetStatement) String

func (ls *LetStatement) String() string

func (*LetStatement) TokenLiteral

func (ls *LetStatement) TokenLiteral() string

type NewLine

type NewLine struct {
	Token token.Item
}

func (*NewLine) Item

func (nl *NewLine) Item() token.Item

func (*NewLine) String

func (nl *NewLine) String() string

func (*NewLine) TokenLiteral

func (nl *NewLine) TokenLiteral() string

type Node

type Node interface {
	TokenLiteral() string
	String() string
	Item() token.Item
}

type Null

type Null struct {
	Token token.Item
	Value string
	Type  *Type
}

func (*Null) Item

func (n *Null) Item() token.Item

func (*Null) String

func (n *Null) String() string

func (*Null) TokenLiteral

func (n *Null) TokenLiteral() string

type Parameter

type Parameter struct {
	Token    token.Item // The 'func' token
	Name     string
	Operator string
	Type     Types
	Default  *ExpressionStatement
	Method   bool
}

func (*Parameter) Item

func (p *Parameter) Item() token.Item

func (*Parameter) String

func (p *Parameter) String() string

func (*Parameter) TokenLiteral

func (p *Parameter) TokenLiteral() string

type PrefixExpression

type PrefixExpression struct {
	Token    token.Item // The prefix token, e.g. !
	Operator string
	Right    Expression
}

func (*PrefixExpression) Item

func (pe *PrefixExpression) Item() token.Item

func (*PrefixExpression) String

func (pe *PrefixExpression) String() string

func (*PrefixExpression) TokenLiteral

func (pe *PrefixExpression) TokenLiteral() string

type Program

type Program struct {
	Statements []Statement
}

func (*Program) Item

func (p *Program) Item() token.Item

func (*Program) String

func (p *Program) String() string

func (*Program) TokenLiteral

func (p *Program) TokenLiteral() string

type ReturnStatement

type ReturnStatement struct {
	Token       token.Item
	ReturnValue Expression
}

func (*ReturnStatement) Item

func (rs *ReturnStatement) Item() token.Item

func (*ReturnStatement) String

func (rs *ReturnStatement) String() string

func (*ReturnStatement) TokenLiteral

func (rs *ReturnStatement) TokenLiteral() string

type Square

type Square struct {
	Token token.Item
}

func (*Square) Item

func (s *Square) Item() token.Item

func (*Square) String

func (s *Square) String() string

func (*Square) TokenLiteral

func (s *Square) TokenLiteral() string

type SquareRightLiteral

type SquareRightLiteral struct {
	Token token.Item
	Value string
}

func (*SquareRightLiteral) Item

func (s *SquareRightLiteral) Item() token.Item

func (*SquareRightLiteral) String

func (s *SquareRightLiteral) String() string

func (*SquareRightLiteral) TokenLiteral

func (s *SquareRightLiteral) TokenLiteral() string

type Statement

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

type StringLiteral

type StringLiteral struct {
	Token token.Item
	Str   string
	Type  *Type
}

func (*StringLiteral) Item

func (sl *StringLiteral) Item() token.Item

func (*StringLiteral) String

func (sl *StringLiteral) String() string

func (*StringLiteral) TokenLiteral

func (sl *StringLiteral) TokenLiteral() string

type Type

type Type struct {
	Name    string
	Package string
	List    bool
}

func (*Type) String

func (t *Type) String() string

type TypeAttributesStatement

type TypeAttributesStatement struct {
	Token token.Item // type token
	Name  string
	Type  Types
}

func (*TypeAttributesStatement) Item

func (ta *TypeAttributesStatement) Item() token.Item

func (*TypeAttributesStatement) String

func (ta *TypeAttributesStatement) String() string

func (*TypeAttributesStatement) TokenLiteral

func (ta *TypeAttributesStatement) TokenLiteral() string

type TypeFunction

type TypeFunction struct {
	Token     token.Item // type token
	Name      string
	Arguments []Types
	Return    Types
}

func (*TypeFunction) Item

func (tf *TypeFunction) Item() token.Item

func (*TypeFunction) String

func (tf *TypeFunction) String() string

func (*TypeFunction) TokenLiteral

func (tf *TypeFunction) TokenLiteral() string

type TypeStatement

type TypeStatement struct {
	Token      token.Item // type token
	Name       string
	Object     string
	Type       Types
	Attributes []*TypeAttributesStatement
}

func (*TypeStatement) Item

func (ts *TypeStatement) Item() token.Item

func (*TypeStatement) String

func (ts *TypeStatement) String() string

func (*TypeStatement) TokenLiteral

func (ts *TypeStatement) TokenLiteral() string

type Types

type Types []*Type

func (Types) String

func (types Types) String() string

type VectorLiteral

type VectorLiteral struct {
	Token token.Item
	Value []Expression
}

func (*VectorLiteral) Item

func (v *VectorLiteral) Item() token.Item

func (*VectorLiteral) String

func (v *VectorLiteral) String() string

func (*VectorLiteral) TokenLiteral

func (v *VectorLiteral) TokenLiteral() string

type While

type While struct {
	Token     token.Item
	Statement Statement
	Value     *BlockStatement
}

func (*While) Item

func (w *While) Item() token.Item

func (*While) String

func (w *While) String() string

func (*While) TokenLiteral

func (w *While) TokenLiteral() string

Jump to

Keyboard shortcuts

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