evaluator

package
v0.0.0-...-b5cb46a Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Stores all basic operators which could exist

Functions

func HasVariadic

func HasVariadic(args []lexer.TokenType) bool

func ToValue

func ToValue(token *lexer.Token, wants []lexer.TokenType, args []Pointer) (*reflect.Value, error)

Types

type CreatedFunction

type CreatedFunction struct {
	Keyword    lexer.Token                 // Stores the keyword
	ArgsWants  []lexer.Token               // Stores all the arguments needed
	ReturnArgs []lexer.Token               // Stores all the return arguments
	Bodys      []formatter.FormattedPacket // Stores the body of the function
}

type Evaluator

type Evaluator struct {
	Lexer     *lexer.Lexer      // Past tense lexer
	Parser    *parse.Parser     // Past tenser parser
	Formatter *formatter.Format // Past tense formatter
	// contains filtered or unexported fields
}

func NewEvaluator

func NewEvaluator(wr io.Writer, Format *formatter.Format, memory ...[]Pointer) *Evaluator

Makes the new evaluator

func (*Evaluator) AccessSTD

func (e *Evaluator) AccessSTD() error

AccessSTD will access all STD objects

func (*Evaluator) EvoScriptEngineDriverEngineDriver

func (eval *Evaluator) EvoScriptEngineDriverEngineDriver(tag string, wr io.Writer) (int, error)

EvoScriptEngineDriver will execute the tags inside this engine driver

func (*Evaluator) Execute

func (E *Evaluator) Execute(wr io.Writer, tags ...string) ([]lexer.Token, error)

Run will execute the evaluator on the formatted output

func (*Evaluator) ExecuteString

func (E *Evaluator) ExecuteString(tags ...string) (string, error)

ExecuteString will execute EvoScript and log into a string

func (*Evaluator) Go2Evo

func (eval *Evaluator) Go2Evo(name string, module any) (*Pointer, error)

Go2Evo acts as an interface between golang and EvoScript values

func (*Evaluator) Include

func (e *Evaluator) Include(path []string)

Include will try to include packages and register them inside memory

func (*Evaluator) MultiValues

func (E *Evaluator) MultiValues(values formatter.DeclareLine) error

Allows function to return multiply values and hold in memory

func (*Evaluator) NewPackage

func (e *Evaluator) NewPackage(name string, packages any)

NewPackage will register the package inside packages map

func (*Evaluator) ReturnStatement

func (E *Evaluator) ReturnStatement(returns []lexer.Token) ([]lexer.Token, error)

ReturnStatement will take what it should return and work the args out

func (*Evaluator) Writer

func (E *Evaluator) Writer() io.Writer

type GoFunction

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

type Object

type Object struct {
	Value any
	// contains filtered or unexported fields
}

type Pointer

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

type Var

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

Jump to

Keyboard shortcuts

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