parser

package
v0.0.0-...-c87e9c3 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2019 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// OpTypeAssign is for assigning the value of one variable to another variable.
	OpTypeAssign = iota

	// OpTypeInt is an integer assignment to a variable.
	OpTypeInt = iota

	// OpTypeFunc is for executing a function.
	OpTypeFunc = iota

	// OpTypeFuncCreate is for the creation of a function.
	OpTypeFuncCreate = iota
)

Variables

View Source
var (
	// ErrEndOfFunction is for symmetry to io.EOF and denotes the end of a
	// function was found.
	ErrEndOfFunction = errors.New("end of function was found")
)

Functions

This section is empty.

Types

type Statement

type Statement struct {
	OpType   int
	Var      string
	VarInt   int
	VarVar   string
	VarStmts []Statement
}

Statement is the internal representation of a line of cookie code.

func GetFunction

func GetFunction(t *tokenizer.Tokenizer) []Statement

GetFunction parses up to the end of the current function and returns the set of statements contained within. It determines the end of the function either by finding the closing '}' or the end-of-file.

Jump to

Keyboard shortcuts

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