expr

package module
v0.0.0-...-46cd279 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

README

expr

Documentation

Index

Constants

View Source
const (
	NumberKind = iota
	PlusKind
	MinusKind
	MultiplyKind
	ConstKind
	IdentifierKind
)
View Source
const (
	Whitespace byte = 32
	Multiply   byte = 42
	Plus       byte = 43
	Minus      byte = 45
	C          byte = 99
	O          byte = 111
	N          byte = 110
	S          byte = 115
	T          byte = 116
	EQUAL      byte = 61
)

Variables

This section is empty.

Functions

func Eval

func Eval(nodes *list.List) int

func Parse

func Parse(text []byte) *list.List

Types

type Environment

type Environment struct {
	Consts map[byte]Node
}
var Env Environment = Environment{
	Consts: map[byte]Node{},
}

type Node

type Node struct {
	Identifier byte
	Kind       int
	Value      int
	Priority   int
}

Jump to

Keyboard shortcuts

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