lex

package
v0.0.0-...-f7e72b4 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ScanComments bool
}

type Token

type Token rune
const (
	ERROR Token = iota
	EOF
	NUMBER
	STRING
	VARIABLE
	LET
	PRINT
	IF
	THEN
	ELSE
	FOR
	TO
	NEXT
	GOTO
	GOSUB
	RETURN
	CALL
	REM
	PEEK
	POKE
	END
	COMMA
	SEMICOLON
	PLUS
	MINUS
	AND
	OR
	XOR
	ASTR
	SLASH
	MOD
	HASH
	LPAREN
	RPAREN
	LT
	GT
	LEQ
	GEQ
	NEQ
	EQ
	CR
)

func (Token) String

func (i Token) String() string

type Tokenizer

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

func (*Tokenizer) Init

func (t *Tokenizer) Init(conf Config, name string, src []byte)

func (*Tokenizer) Next

func (t *Tokenizer) Next() (pos scanner.Position, tok Token, lit string)

Jump to

Keyboard shortcuts

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