lexer

package
v0.0.0-...-55795c3 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2021 License: GPL-3.0 Imports: 5 Imported by: 3

Documentation

Index

Constants

View Source
const (
	LEXMODE_NORMAL lexmode = iota
	LEXMODE_QUOTE
	LEXMODE_QUASIQUOTE
)
View Source
const LexBufferMax = 20
View Source
const LexBufferMin = 12
View Source
const ReadCountMax = 10

Variables

This section is empty.

Functions

This section is empty.

Types

type ReeLexer

type ReeLexer struct {
	Tok Token
	// contains filtered or unexported fields
}

func (ReeLexer) Column

func (l ReeLexer) Column() int

func (*ReeLexer) EOF

func (l *ReeLexer) EOF() bool

func (*ReeLexer) Errorf

func (l *ReeLexer) Errorf(msg string)

func (*ReeLexer) Init

func (l *ReeLexer) Init(r io.Reader)

func (*ReeLexer) IsEscape

func (l *ReeLexer) IsEscape(quote rune) bool

func (ReeLexer) Line

func (l ReeLexer) Line() int

func (*ReeLexer) Next

func (l *ReeLexer) Next() *Token

type ReeToken

type ReeToken uint
const (
	TOK_UNDEF ReeToken = iota
	TOK_SHEBANG
	TOK_LPAREN
	TOK_RPAREN
	TOK_LITINT
	TOK_LITNUM
	TOK_LITSTR
	TOK_IDENT
	TOK_KEYWORD
	TOK_KEYOP
	TOK_EMPTY
	TOK_TRUE
	TOK_FALSE
	TOK_LITCHAR
	TOK_SUPRESS
	SYM_LITCHAR
	SYM_LITINT
	SYM_LITSTR
	SYM_TRUE
	SYM_FALSE
	SYM_EMPTY
	TOK_SYMBOL
	TOK_PERIOD

	KEY_UNDEF
	KEY_TYPE
	KEY_LET
	KEY_LETREC
	KEY_IF
	KEY_DEFINE
	KEY_COND
	KEY_MATCH
	KEY_ELSE
	KEY_LAMBDA

	OP_UNDEF
	OP_ADD
	OP_SUB
	OP_MUL
	OP_DIV
	OP_ZERO
	OP_ABS
	OP_GT
	OP_GTEQ
	OP_LTEQ
	OP_LT
	OP_INC
	OP_DEC
	OP_EQ
	OP_NEQ
	OP_PRINT
	OP_BOX
	OP_UNBOX
	OP_CONS
	OP_CAR
	OP_CDR
	OP_QUOTE
	OP_QUASIQUOTE
	OP_UNQUOTE
	OP_UNQUOTESPLICE
	OP_CHECKTYPE
	OP_MOD
	OP_NOT
	OP_BITAND
	OP_BITOR
	OP_BITXOR
	OP_BITSHL
	OP_BITSHR
	OP_QUESTION

	TOK_EOF
)

func (ReeToken) String

func (i ReeToken) String() string

type Token

type Token struct {
	L, C  int    //line and column
	Value string //value of character
	IVal  int64  //used for integers
	CVal  rune   //used for characters
	Tok   ReeToken
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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