parser

package
v0.0.2-alpha Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2021 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RuneEOF = -1
)

end of file rune character

Variables

This section is empty.

Functions

This section is empty.

Types

type Scanner

type Scanner interface {
	Init(src []byte)
	Finalize()
	Scan() (line, column, offset int, tok Token, lit string, err error)
	RegisterSingleCharacterToken(r rune, tok Token)

	Peek() byte
	Next() (rune, error)
	Offset() int
	NextOffset() int
}

func NewSimpleScanner

func NewSimpleScanner(singleCharacter bool) Scanner

type Token

type Token uint
const (
	ILLEGAL Token = iota
	EOF
	COMMENT

	INTEGER // 123
	FLOAT   // 1.2
	BOOLEAN // true/false

	ADD // +
	SUB // -
	MUL // *
	QUO // /
	REM // %

	EQL // =
	NOT // !

	COMMA  // ,
	COLON  // :
	OPTION // ?

	CUSTOM // any custom register token should start from here
)

Jump to

Keyboard shortcuts

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