ast

package
v0.1.16 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bool

type Bool struct {
	Value bool
}

Bool ...

func (*Bool) Equals

func (v *Bool) Equals(v2 Value) bool

Equals ...

func (*Bool) Interface

func (v *Bool) Interface() interface{}

Interface ...

func (*Bool) Kind

func (v *Bool) Kind() reflect.Kind

Kind ...

func (*Bool) String

func (v *Bool) String() string

String ...

type EqExpr

type EqExpr struct {
	LHS Expression
	RHS Expression
	// contains filtered or unexported fields
}

EqExpr ...

func (*EqExpr) Eval

func (e *EqExpr) Eval(ctx *EvalContext) (Value, error)

Eval ...

func (*EqExpr) Position

func (e *EqExpr) Position() scanner.Position

Position ...

func (*EqExpr) String

func (e *EqExpr) String() string

type EvalContext

type EvalContext struct {
	// contains filtered or unexported fields
}

EvalContext ...

func (*EvalContext) Get

func (c *EvalContext) Get(k string) (Value, bool)

Get ...

func (*EvalContext) Set

func (c *EvalContext) Set(k string, v Value)

Set ...

type Expression

type Expression interface {
	fmt.Stringer
	Eval(*EvalContext) (Value, error)
	Position() scanner.Position
}

Expression ...

func ParseExpr

func ParseExpr(tokens []*Token) (Expression, error)

ParseExpr ...

type IdentExpr

type IdentExpr struct {
	Name string
	// contains filtered or unexported fields
}

IdentExpr ...

func (*IdentExpr) Eval

func (e *IdentExpr) Eval(ctx *EvalContext) (Value, error)

Eval ...

func (*IdentExpr) Position

func (e *IdentExpr) Position() scanner.Position

Position ...

func (*IdentExpr) String

func (e *IdentExpr) String() string

type IneqExpr

type IneqExpr struct {
	LHS Expression
	RHS Expression
	// contains filtered or unexported fields
}

IneqExpr ...

func (*IneqExpr) Eval

func (e *IneqExpr) Eval(ctx *EvalContext) (Value, error)

Eval ...

func (*IneqExpr) Position

func (e *IneqExpr) Position() scanner.Position

Position ...

func (*IneqExpr) String

func (e *IneqExpr) String() string

type String

type String struct {
	Value string
}

String ...

func (*String) Equals

func (v *String) Equals(v2 Value) bool

Equals ...

func (*String) Interface

func (v *String) Interface() interface{}

Interface ...

func (*String) Kind

func (v *String) Kind() reflect.Kind

Kind ...

func (*String) String

func (v *String) String() string

String ...

type StringExpr

type StringExpr struct {
	Value string
	// contains filtered or unexported fields
}

StringExpr ...

func (*StringExpr) Eval

func (e *StringExpr) Eval(ctx *EvalContext) (Value, error)

Eval ...

func (*StringExpr) Position

func (e *StringExpr) Position() scanner.Position

Position ...

func (*StringExpr) String

func (e *StringExpr) String() string

type Token

type Token struct {
	Text     string
	Position scanner.Position
	// contains filtered or unexported fields
}

Token ...

func Tokenise

func Tokenise(code string) ([]*Token, error)

Tokenise ...

func (*Token) IsEOF

func (t *Token) IsEOF() bool

IsEOF ...

func (*Token) IsFloat

func (t *Token) IsFloat() bool

IsFloat ...

func (*Token) IsIdent

func (t *Token) IsIdent() bool

IsIdent ...

func (*Token) IsInt

func (t *Token) IsInt() bool

IsInt ...

func (*Token) IsString

func (t *Token) IsString() bool

IsString ...

func (*Token) IsSymbol

func (t *Token) IsSymbol() bool

IsSymbol ...

func (*Token) Kind

func (t *Token) Kind() string

Kind ...

func (*Token) Value

func (t *Token) Value() interface{}

Value ...

type Value

type Value interface {
	fmt.Stringer
	Kind() reflect.Kind
	Interface() interface{}
	Equals(Value) bool
}

Value ...

Jump to

Keyboard shortcuts

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