wizcompiler

package
v0.0.0-...-e8c8c4a Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compile

func Compile(book wizparser.Spellbook, output string, chatty bool, emitComments bool, pkg string) error

Compile generates go code from a spellbook

Types

type BinaryOp

type BinaryOp struct {
	Operator Operator
	LHS      Expression
	RHS      Expression
}

func (*BinaryOp) Fold

func (bo *BinaryOp) Fold() Expression

func (*BinaryOp) String

func (bo *BinaryOp) String() string

type Expression

type Expression interface {
	String() string
	Fold() Expression
}

type NumberLiteral

type NumberLiteral struct {
	Value int64
}

func (*NumberLiteral) Fold

func (nl *NumberLiteral) Fold() Expression

func (*NumberLiteral) String

func (nl *NumberLiteral) String() string

type Operator

type Operator int
const (
	OperatorMul Operator = iota
	OperatorDiv
	OperatorBinaryAnd
	OperatorAdd
	OperatorSub
)

func (Operator) Evaluate

func (op Operator) Evaluate(lhs int64, rhs int64) int64

func (Operator) IsAssociative

func (op Operator) IsAssociative() bool

func (Operator) Precedence

func (op Operator) Precedence() int

func (Operator) String

func (op Operator) String() string

type PageUsage

type PageUsage struct {
	EmitNormal  bool
	EmitSwapped bool
}

type VariableAccess

type VariableAccess struct {
	Name string
}

func (*VariableAccess) Fold

func (va *VariableAccess) Fold() Expression

func (*VariableAccess) String

func (va *VariableAccess) String() string

Jump to

Keyboard shortcuts

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