forge

package
v0.1.19 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2023 License: MIT Imports: 9 Imported by: 3

Documentation

Overview

Package forge implements a stack-base interpreter using language elements from Forth.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Callable

type Callable func(*ForgeEnv, *Item)

type DataItem

type DataItem interface{}

type ForgeEnv

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

func NewCoreFE

func NewCoreFE(sd Sysdata) *ForgeEnv

func NewFE

func NewFE() *ForgeEnv

func (*ForgeEnv) CP

func (f *ForgeEnv) CP() Ptr

func (*ForgeEnv) CState

func (f *ForgeEnv) CState() bool

func (*ForgeEnv) Call

func (f *ForgeEnv) Call(it XT)

func (*ForgeEnv) ChildFE

func (f *ForgeEnv) ChildFE() *ForgeEnv

func (*ForgeEnv) Compile

func (f *ForgeEnv) Compile(it DataItem)

func (*ForgeEnv) DS

func (f *ForgeEnv) DS() Stack

func (*ForgeEnv) Evaluate

func (f *ForgeEnv) Evaluate(s string)

func (*ForgeEnv) EvaluateMap

func (f *ForgeEnv) EvaluateMap(data m.Map)

func (*ForgeEnv) Exec

func (f *ForgeEnv) Exec(t string)

func (*ForgeEnv) Execute

func (f *ForgeEnv) Execute(it XT)

func (*ForgeEnv) Here

func (f *ForgeEnv) Here() Ptr

func (*ForgeEnv) IP

func (f *ForgeEnv) IP() Ptr

func (*ForgeEnv) Include

func (f *ForgeEnv) Include(fn string)

func (*ForgeEnv) InitCode

func (f *ForgeEnv) InitCode() Ptr

func (*ForgeEnv) Input

func (f *ForgeEnv) Input() input.Input

func (*ForgeEnv) LatestXT

func (f *ForgeEnv) LatestXT() XT

func (*ForgeEnv) Lookup

func (f *ForgeEnv) Lookup(name string) *Item

func (*ForgeEnv) Output

func (f *ForgeEnv) Output() io.Writer

func (*ForgeEnv) Pop

func (f *ForgeEnv) Pop() interface{}

func (*ForgeEnv) Push

func (f *ForgeEnv) Push(v interface{})

func (*ForgeEnv) RS

func (f *ForgeEnv) RS() Stack

func (*ForgeEnv) Register

func (f *ForgeEnv) Register(t string, fct Callable) *Item

func (*ForgeEnv) Return

func (f *ForgeEnv) Return()

func (*ForgeEnv) Run

func (f *ForgeEnv) Run()

func (*ForgeEnv) RunLine

func (f *ForgeEnv) RunLine()

func (*ForgeEnv) SetCState

func (f *ForgeEnv) SetCState(s bool)

func (*ForgeEnv) SetCode

func (f *ForgeEnv) SetCode(p Ptr)

func (*ForgeEnv) SetIP

func (f *ForgeEnv) SetIP(p Ptr)

func (*ForgeEnv) SetInput

func (f *ForgeEnv) SetInput(inp input.Input) input.Input

func (*ForgeEnv) SetOutput

func (f *ForgeEnv) SetOutput(w io.Writer) io.Writer

func (*ForgeEnv) Substring

func (f *ForgeEnv) Substring(s string) string

func (*ForgeEnv) Sysdata

func (f *ForgeEnv) Sysdata() Sysdata

func (*ForgeEnv) Token

func (f *ForgeEnv) Token() string

func (*ForgeEnv) UserVars

func (f *ForgeEnv) UserVars() Ptr

type Item

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

func GlobalRegister

func GlobalRegister(name string, fct Callable) *Item

func Register

func Register(voc *Voc, name string, fct Callable) *Item

func (*Item) Body

func (it *Item) Body() Ptr

func (*Item) Immediate

func (it *Item) Immediate()

func (*Item) IsImmediate

func (it *Item) IsImmediate() bool

func (*Item) Name

func (it *Item) Name() string

type Ptr

type Ptr ptr.Ptr[DataItem]

type Stack

type Stack = stack.Stack[DataItem]

type Sysdata

type Sysdata interface {
	FindFCode(fn string) string
	Status() int
	SetStatus(st int)
}

type Voc

type Voc = voc.Vocabulary[XT]

func NewVoc

func NewVoc(parent *Voc) *Voc

type XT

type XT = *Item

Directories

Path Synopsis
Package main is the top-level command line starter.
Package main is the top-level command line starter.
Package input provides functionalities for reading streams and files into lines, and splitting up lines and streams into tokens and other substrings.
Package input provides functionalities for reading streams and files into lines, and splitting up lines and streams into tokens and other substrings.
Package prim provides the primitive words that have to be defined in Go.
Package prim provides the primitive words that have to be defined in Go.
Package syslib provides OS-specific facilities.
Package syslib provides OS-specific facilities.

Jump to

Keyboard shortcuts

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