Documentation
¶
Index ¶
Constants ¶
View Source
const FailState = -1
A state in every DFA that traps and is not an accept state.
Variables ¶
This section is empty.
Functions ¶
func AdvanceAll ¶
func AdvanceAll(c rune, dfas ...StateMachine) int
Types ¶
type DFA ¶
type DFA struct {
// contains filtered or unexported fields
}
func NewForwardDFA ¶
func NewForwardDFA(desc *DFADescription) DFA
type DFADescription ¶
type DFADescription struct {
Rules []TransitionRule
AcceptState uint8
}
func BinaryLiteral ¶
func BinaryLiteral() *DFADescription
func DecimalLiteral ¶
func DecimalLiteral() *DFADescription
func FloatLiteral ¶
func FloatLiteral() *DFADescription
func HexLiteral ¶
func HexLiteral() *DFADescription
func IdentifierName ¶
func IdentifierName() *DFADescription
type NFA ¶
type NFA struct {
// contains filtered or unexported fields
}
func NewBackwardNFA ¶
func NewBackwardNFA(desc *DFADescription) NFA
type StateMachine ¶
func BackwardNumLiteralMachines ¶
func BackwardNumLiteralMachines() []StateMachine
func ForwardNumLiteralMachines ¶
func ForwardNumLiteralMachines() []StateMachine
TODO refactor newFoward and newBackward to return StateMachine to get rid of duplication
type TransitionRule ¶
Click to show internal directories.
Click to hide internal directories.