compiler

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2023 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Compiler

type Compiler func(*Context, ast.Terms) asm.Stream

type Context

type Context struct {
	Signs map[string]*ast.Head
	Rules Rules
	Facts map[string]vm.Generator
	Heap  Heap
	Const map[vm.Addr]xsd.Value
	Index int
}

func New

func New() *Context

Create new instance of compiler

func (*Context) Assemble

func (ctx *Context) Assemble(goal string) (*vm.VM, []vm.Addr, asm.Stream)

Assemble the goal of σ-application into executable object. It returns virtual machine, target relation and stream itself

func (*Context) Compile

func (ctx *Context) Compile(rules ast.Rules) error

type Heap

type Heap map[string]vm.Addr

type Refs

type Refs map[string]*ast.Term

type Rules

type Rules map[string]Compiler

Jump to

Keyboard shortcuts

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