Versions in this module Expand all Collapse all v0 v0.7.5 Feb 28, 2021 Changes in this version + type AssertEdge struct + Asserts EdgeAssert + func NewAssertEdge(target *NfaState, asserts EdgeAssert) *AssertEdge + func (e *AssertEdge) Accepts(s *ScannerSource) bool + func (e *AssertEdge) String() (s string) + type EOFReader int + func (r EOFReader) ReadRune() (arune rune, size int, err error) + type EdgeAssert int + const LineEnd + const LineStart + const TextEnd + const TextStart + type Edger interface + Accepts func(s *ScannerSource) bool + Priority func() int + SetTarget func(s *NfaState) *NfaState + String func() string + Target func() *NfaState + type EpsilonEdge struct + Prio int + Targ *NfaState + func (e *EpsilonEdge) Accepts(s *ScannerSource) bool + func (e *EpsilonEdge) Priority() int + func (e *EpsilonEdge) SetTarget(s *NfaState) (old *NfaState) + func (e *EpsilonEdge) String() (s string) + func (e *EpsilonEdge) Target() *NfaState + type Lexer struct + func CompileLexer(starts [][]int, tokdefs map[string]int, grammar, start string) (lexer *Lexer, err error) + func MustCompileLexer(starts [][]int, tokdefs map[string]int, grammar, start string) (lexer *Lexer) + func (lx *Lexer) Scanner(fname string, r io.RuneReader) *Scanner + func (lx *Lexer) String() (s string) + type Nfa []*NfaState + func (n *Nfa) AddState(s *NfaState) *NfaState + func (n *Nfa) NewState() (s *NfaState) + func (n *Nfa) OneOrMore(in, out *NfaState) (from, to *NfaState) + func (n *Nfa) ParseRE(name, re string) (in, out *NfaState, err error) + func (n *Nfa) ZeroOrMore(in, out *NfaState) (from, to *NfaState) + func (n *Nfa) ZeroOrOne(in, out *NfaState) (from, to *NfaState) + func (n Nfa) String() (s string) + type NfaState struct + Consuming []Edger + Index uint + NonConsuming []Edger + func (n *NfaState) AddConsuming(edge Edger) Edger + func (n *NfaState) AddNonConsuming(edge Edger) Edger + func (n *NfaState) String() (s string) + type RangesEdge struct + Invert bool + Ranges *unicode.RangeTable + func NewRangesEdge(target *NfaState, invert bool, ranges *unicode.RangeTable) *RangesEdge + func (e *RangesEdge) Accepts(s *ScannerSource) bool + func (e *RangesEdge) String() (s string) + type RuneEdge struct + Rune rune + func NewRuneEdge(target *NfaState, arune rune) *RuneEdge + func (e *RuneEdge) Accepts(s *ScannerSource) bool + func (e *RuneEdge) String() string + type Scanner struct + func (s *Scanner) Begin(state StartSetID) + func (s *Scanner) Include(fname string, r io.RuneReader) + func (s *Scanner) PopState() + func (s *Scanner) Position() token.Position + func (s *Scanner) PushState(newState StartSetID) + func (s *Scanner) Scan() (arune rune, ok bool) + func (s *Scanner) Token() []rune + func (s *Scanner) TokenStart() token.Position + func (s *Scanner) TopState() StartSetID + type ScannerRune struct + Err error + Position token.Position + Rune rune + Size int + type ScannerSource struct + func NewScannerSource(fname string, r io.RuneReader) *ScannerSource + func (s *ScannerSource) Accept(arune rune) bool + func (s *ScannerSource) Collect() (arunes []rune) + func (s *ScannerSource) CollectString() string + func (s *ScannerSource) Current() rune + func (s *ScannerSource) CurrentRune() ScannerRune + func (s *ScannerSource) Include(fname string, r io.RuneReader) + func (s *ScannerSource) Move() + func (s *ScannerSource) Next() rune + func (s *ScannerSource) NextRune() ScannerRune + func (s *ScannerSource) Position() token.Position + func (s *ScannerSource) Prev() rune + func (s *ScannerSource) PrevRune() ScannerRune + type Source struct + func NewSource(fname string, r io.RuneReader) *Source + func (s *Source) Include(fname string, r io.RuneReader) + func (s *Source) Position() token.Position + func (s *Source) Read() (r ScannerRune) + type StartSetID int