interpreter

package
v0.0.0-...-44c2662 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package interpreter is the core of iGo. interpreter uses the parse package to parse Go Structs into meaningful information. the core interpreter is independent of any input source

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EvalData

type EvalData struct {
	M string
	F []string
}

EvalData is

type Interpreter

type Interpreter struct {
	Functions map[string]*parse.Function
	History   []string
}

Interpreter houses the function references and input history

func (*Interpreter) Eval

func (i *Interpreter) Eval(text string) string

Eval will evaluate the text

func (*Interpreter) Interpret

func (i *Interpreter) Interpret(text string) string

Interpret will take some text and Classify it as either an expression or a function If it is a function it will store the reference of the Function in a map If the text is classified as an expression, it will evaluate the expression, using the function reference map if needed

Jump to

Keyboard shortcuts

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