expr

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2021 License: MIT Imports: 1 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Binary

type Binary struct {
	Left     Expr
	Right    Expr
	Operator *token.Token
}

Binary #

func (*Binary) Accept

func (b *Binary) Accept(visitor Visitor) (interface{}, error)

Accept binary operation

type Expr

type Expr interface {
	Accept(Visitor) (interface{}, error)
}

Expr interface

type FunctionCall

type FunctionCall struct {
	Name string
	Args []Expr
}

FunctionCall #

func (*FunctionCall) Accept

func (f *FunctionCall) Accept(visitor Visitor) (interface{}, error)

Accept #

type Group

type Group struct {
	Expression Expr
}

Group #

func (*Group) Accept

func (g *Group) Accept(visitor Visitor) (interface{}, error)

Accept Group exp

type Literal

type Literal struct {
	Value interface{}
}

Literal #

func (*Literal) Accept

func (l *Literal) Accept(visitor Visitor) (interface{}, error)

Accept Literal expression

type Logical

type Logical struct {
	Left     Expr
	Right    Expr
	Operator *token.Token
}

Logical operation

func (*Logical) Accept

func (t *Logical) Accept(visitor Visitor) (interface{}, error)

Accept #

type Ternary

type Ternary struct {
	Condition Expr
	True      Expr
	False     Expr
}

Ternary #

func (*Ternary) Accept

func (t *Ternary) Accept(visitor Visitor) (interface{}, error)

Accept #

type Unary

type Unary struct {
	Operator *token.Token
	Right    Expr
}

Unary #

func (*Unary) Accept

func (u *Unary) Accept(visitor Visitor) (interface{}, error)

Accept Unary expr

type Variable

type Variable struct {
	Name string
}

Variable #

func (*Variable) Accept

func (v *Variable) Accept(visitor Visitor) (interface{}, error)

Accept variable expression

type Visitor

type Visitor interface {
	VisitBinaryExpr(binaryExpression *Binary) (interface{}, error)
	VisitGroupExpr(groupExpression *Group) (interface{}, error)
	VisitLiteralExpr(LiteralExpression *Literal) (interface{}, error)
	VisitUnaryExpr(unaryExpr *Unary) (interface{}, error)
	VisitVariableExpr(variableExpr *Variable) (interface{}, error)
	VisitFunctionCall(functionCallExpr *FunctionCall) (interface{}, error)
	VisitTernary(ternaryExpr *Ternary) (interface{}, error)
	VisitLogicalExpr(logicalExpr *Logical) (interface{}, error)
}

Visitor interface

Jump to

Keyboard shortcuts

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