ql

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2017 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

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

Error provides details of a syntax error

func (Error) Error

func (err Error) Error() string

type Op

type Op map[OpType]int

type OpSet

type OpSet map[string]Op

func (OpSet) Infix

func (os OpSet) Infix(s string) (int, int, int, bool)

Infix returns left, op, and right priorities

func (OpSet) Prefix

func (os OpSet) Prefix(s string) (int, int, bool)

type OpType

type OpType int
const (
	XFX OpType = iota
	FX
	XFY
	FY
	YFX
	XF
	YF
)

type Parser

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

Parser stores the state for the ivy parser.

type Scanner

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

Scanner holds the state of the scanner.

func (*Scanner) Next

func (l *Scanner) Next() Token

Next returns the next token.

type Token

type Token struct {
	Type Type   // The type of this item.
	Line int    // The line number on which this token appears
	Text string // The text of this item.
}

Token represents a token or text string returned from the scanner.

func (Token) String

func (i Token) String() string

type Type

type Type int

Type identifies the type of lex items.

const (
	EOF      Type = iota // zero value so closed channel delivers EOF
	TokError             // error occurred; value is text of error
	Newline
	Atom
	QuotedString
	SpecialAtom
)

func (Type) String

func (i Type) String() string

Jump to

Keyboard shortcuts

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