lex

package
v0.0.0-...-80e9d33 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2022 License: CC0-1.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Lexer

type Lexer struct {
	NumErrors int
	// contains filtered or unexported fields
}

func (*Lexer) Init

func (l *Lexer) Init(name string, r io.Reader, errh func(scanner.Position, error))

func (*Lexer) Next

func (l *Lexer) Next() (pos scanner.Position, tok Token, lit string)

type Token

type Token int
const (
	EOF Token = iota

	COMMENT
	SYMBOL
	INTEGER
	STRING

	ADD
	SUB
	MUL
	DIV
	AND
	OR
	XOR
	SEMI
	COMMA
	LPAREN
	RPAREN
	LBRACK
	RBRACK
	LBRACE
	RBRACE
	ADDROF
	UNOP
	COLON
	BYTEOP
	LNOT
	INV
	DISJ
	NEQ
	LT
	LE
	SHL
	SHR
	GT
	GE
	EQ
	ASSIGN
	COND
	CONJ

	CONST
	DO
	DECL
	ELSE
	END
	FOR
	HALT
	IF
	IE
	LEAVE
	LOOP
	MOD
	MODULE
	OBJECT
	PACKED
	RETURN
	STRUCT
	VAR
	WHILE
)

func (Token) IsBinary

func (t Token) IsBinary() bool

func (Token) IsUnary

func (t Token) IsUnary() bool

func (Token) Precedence

func (t Token) Precedence() int

func (Token) String

func (i Token) String() string

Jump to

Keyboard shortcuts

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