Documentation
¶
Overview ¶
Package machines implements the lexing algorithms.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DFAAccepting ¶
DFAAccepting represents maps from accepting DFA states to match identifiers. These both identify which states are accepting states and which matches they belong to from the AST.
type DFATrans ¶
type DFATrans [][256]int
DFATrans represents a Deterministic Finite Automatons state transition table
type EmptyMatchError ¶
EmptyMatchError is returned when a pattern would have matched the empty string
func (*EmptyMatchError) Error ¶
func (e *EmptyMatchError) Error() string
type Match ¶
type Match struct { PC int TC int StartLine int StartColumn int EndLine int EndColumn int Bytes []byte // the actual bytes matched during scanning. }
A Match represents the positional and textual information from a match.
type Scanner ¶
Scanner is a functional iterator returned by the LexerEngine. See http://hackthology.com/functional-iteration-in-go.html
func DFALexerEngine ¶
func DFALexerEngine(startState, errorState int, trans DFATrans, accepting DFAAccepting, text []byte) Scanner
DFALexerEngine does the actual tokenization of the byte slice text using the DFA state machine. If the lexing process fails the Scanner will return an UnconsumedInput error.