token

package module
v0.0.0-...-ca0e709 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2020 License: BSD-3-Clause Imports: 2 Imported by: 3

Documentation

Index

Constants

View Source
const (
	LowestPrec  = 0
	UnaryPrec   = 6
	HighestPrec = 7
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Pos

type Pos int
const NoPos Pos = 0

func (Pos) IsValid

func (p Pos) IsValid() bool

type Position

type Position struct {
	Offset int
	Line   int
}

func (Position) String

func (pos Position) String() string

type Token

type Token int
const (
	ILLEGAL Token = iota
	EOF

	IDENT // Identifier
	FRML  // =
	BOOL  // TRUE|FALSE
	CELL  // Cell reference
	ERR   // #ERROR!
	ERREF // #REF!
	//FUNC  // Built-in functions
	RNG
	REF
	SHEET  // Sheet name
	INT    // 12345
	FLOAT  // 123.45
	IMAG   // 123.45i
	STRING // "abc"

	ADD // +
	SUB // -
	MUL // *
	QUO // /
	EXP // ^

	LAND // And
	LOR  // Or

	EQL // =
	LSS // <
	GTR // >
	NOT // <>

	LEQ // <=
	GEQ // >=

	LPAREN // (
	LBRACK // [
	LBRACE // {
	COMMA  // ,
	PERIOD // .

	RPAREN    // )
	RBRACK    // ]
	RBRACE    // }
	SEMICOLON // ;
	COLON     // :

)

func SingleRune

func SingleRune(r rune) (t Token)

func (Token) IsLiteral

func (tok Token) IsLiteral() bool

func (Token) IsOperator

func (tok Token) IsOperator() bool

func (Token) Precedence

func (op Token) Precedence() int

func (Token) String

func (tok Token) String() string

Jump to

Keyboard shortcuts

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