Documentation ¶
Index ¶
- Variables
- type DFA
- func (dfa *DFA) Accept(s string) (RegexID, bool)
- func (dfa *DFA) GetFinStates() *collection.Set[StateID]
- func (dfa *DFA) GetInitState() StateID
- func (dfa *DFA) GetRegexID(sid StateID) RegexID
- func (dfa *DFA) GetStates() []StateID
- func (dfa *DFA) GetTransitionTable() *DFATransition
- func (dfa *DFA) LexerMinimize() *DFA
- func (dfa DFA) ToDot() (string, error)
- type DFATransition
- type EpsilonTransition
- type ImdDFATransition
- type ImdEpsilonTransition
- type ImdNFA
- type ImdNFATransition
- type Interval
- type NFA
- type NFATransition
- type Nothing
- type RegexID
- type Sha
- type State
- type StateID
- type StateIDToRegexID
- type StateSet
- func (ss *StateSet) Contains(x StateID) bool
- func (ss *StateSet) Copy() *StateSet
- func (ss *StateSet) Insert(x StateID) *StateSet
- func (ss *StateSet) Intersection(other *StateSet) *StateSet
- func (ss *StateSet) IsAny() bool
- func (ss *StateSet) IsEmpty() bool
- func (ss *StateSet) Union(other *StateSet) *StateSet
- type StateSetDict
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotImplemented = errors.New("not implemented")
View Source
var SupportedChars = []byte{}
View Source
var UnicodeRange = []Interval{ NewInterval(0, int(unicode.MaxRune)), }
Functions ¶
This section is empty.
Types ¶
type DFA ¶
type DFA struct {
// contains filtered or unexported fields
}
func (*DFA) GetFinStates ¶
func (dfa *DFA) GetFinStates() *collection.Set[StateID]
func (*DFA) GetInitState ¶
func (*DFA) GetRegexID ¶ added in v0.4.0
func (*DFA) GetTransitionTable ¶
func (dfa *DFA) GetTransitionTable() *DFATransition
func (*DFA) LexerMinimize ¶
type DFATransition ¶
type DFATransition struct {
// contains filtered or unexported fields
}
func NewDFATransition ¶
func NewDFATransition() *DFATransition
type EpsilonTransition ¶ added in v0.4.0
type EpsilonTransition struct {
// contains filtered or unexported fields
}
func NewEpsilonTransition ¶ added in v0.4.0
func NewEpsilonTransition() EpsilonTransition
func (EpsilonTransition) Set ¶ added in v0.4.0
func (t EpsilonTransition) Set(from, to StateID) EpsilonTransition
type ImdDFATransition ¶ added in v0.4.0
type ImdDFATransition struct {
// contains filtered or unexported fields
}
func NewImdDFATransition ¶ added in v0.4.0
func NewImdDFATransition() *ImdDFATransition
type ImdEpsilonTransition ¶ added in v0.4.0
type ImdEpsilonTransition struct {
// contains filtered or unexported fields
}
func NewImdEpsilonTransition ¶ added in v0.4.0
func NewImdEpsilonTransition(size int, mp map[StateID]*StateSet) ImdEpsilonTransition
type ImdNFA ¶
type ImdNFA struct {
// contains filtered or unexported fields
}
func (*ImdNFA) SubsetConstruction ¶ added in v0.4.0
func (nfa *ImdNFA) SubsetConstruction() (states *StateSetDict[StateID], trans *ImdDFATransition, initState *StateSet, finStates *StateSetDict[Nothing])
type ImdNFATransition ¶
type ImdNFATransition struct {
// contains filtered or unexported fields
}
func NewImdNFATransition ¶ added in v0.4.0
func NewImdNFATransition(mp map[StateID]map[Interval]*StateSet) ImdNFATransition
type Interval ¶ added in v0.4.0
func NewInterval ¶ added in v0.4.0
func (Interval) Difference ¶ added in v0.4.0
type NFA ¶
type NFA struct {
// contains filtered or unexported fields
}
func NewNFA ¶
func NewNFA(states *collection.Set[StateID], etrans EpsilonTransition, trans NFATransition, initStates *collection.Set[StateID], finStates *collection.Set[StateID]) *NFA
func (*NFA) SetRegexID ¶
type NFATransition ¶
type NFATransition struct {
// contains filtered or unexported fields
}
func NewNFATransition ¶ added in v0.4.0
func NewNFATransition() NFATransition
func (NFATransition) Set ¶ added in v0.4.0
func (trans NFATransition) Set(from StateID, intv Interval, to StateID) NFATransition
type StateIDToRegexID ¶ added in v0.4.0
func NewStateIDToRegexID ¶ added in v0.4.0
func NewStateIDToRegexID() StateIDToRegexID
func (StateIDToRegexID) Get ¶ added in v0.4.0
func (mp StateIDToRegexID) Get(sid StateID) RegexID
func (StateIDToRegexID) Set ¶ added in v0.4.0
func (mp StateIDToRegexID) Set(sid StateID, rid RegexID)
type StateSet ¶
type StateSet struct {
// contains filtered or unexported fields
}
func NewStateSet ¶
func (*StateSet) Intersection ¶
type StateSetDict ¶
type StateSetDict[T any] struct { // contains filtered or unexported fields }
func NewStateSetDict ¶
func NewStateSetDict[T any]() *StateSetDict[T]
func (*StateSetDict[T]) Contains ¶
func (d *StateSetDict[T]) Contains(ss *StateSet) bool
func (*StateSetDict[T]) Get ¶
func (d *StateSetDict[T]) Get(ss *StateSet) (T, bool)
func (*StateSetDict[T]) Set ¶
func (d *StateSetDict[T]) Set(ss *StateSet, v T) *StateSetDict[T]
func (*StateSetDict[T]) Size ¶ added in v0.4.0
func (d *StateSetDict[T]) Size() int
Click to show internal directories.
Click to hide internal directories.