Versions in this module Expand all Collapse all v0 v0.1.0 Sep 11, 2018 Changes in this version + const EOF + func MakeSymbolTable(def Definition, types ...string) (map[rune]bool, error) + func NameOfReader(r io.Reader) string + func Panic(pos Position, message string) + func Panicf(pos Position, format string, args ...interface{}) + func SymbolsByRune(def Definition) map[rune]string + type Definition interface + Lex func(io.Reader) Lexer + Symbols func() map[string]rune + var DefaultDefinition = TextScannerLexer + var TextScannerLexer Definition = &defaultDefinition{} + func EBNF(grammar string) (Definition, error) + func Must(def Definition, err error) Definition + func Regexp(pattern string) (Definition, error) + type Error struct + Message string + Pos Position + func Errorf(pos Position, format string, args ...interface{}) *Error + func (e *Error) Error() string + type Lexer interface + Next func() Token + func Lex(r io.Reader) Lexer + func LexBytes(b []byte) Lexer + func LexString(s string) Lexer + func LexWithScanner(r io.Reader, scan *scanner.Scanner) Lexer + type PeekingLexer interface + Peek func(n int) Token + func Upgrade(lexer Lexer) PeekingLexer + type Position struct + Column int + Filename string + Line int + Offset int + func (p Position) GoString() string + func (p Position) String() string + type Stateful struct + type Token struct + Pos Position + Type rune + Value string + func ConsumeAll(lexer Lexer) (tokens []Token, err error) + func EOFToken(pos Position) Token + func RuneToken(r rune) Token + func (t Token) EOF() bool + func (t Token) GoString() string + func (t Token) String() string