Documentation
¶
Index ¶
- type ConfigGroup
- func (this *ConfigGroup) AddContext(c ...string) *ConfigGroup
- func (this *ConfigGroup) Compare(that *ConfigGroup) int
- func (this *ConfigGroup) Core() *lr0items.Item
- func (this *ConfigGroup) Equal(that *ConfigGroup) bool
- func (this *ConfigGroup) HashKey() string
- func (this *ConfigGroup) IsNucleus() bool
- func (this *ConfigGroup) String() string
- type ConfigGroupSet
- func (this *ConfigGroupSet) Add(c ...*ConfigGroup) *ConfigGroupSet
- func (this *ConfigGroupSet) Clone() *ConfigGroupSet
- func (this *ConfigGroupSet) CloneFromCore() *ConfigGroupSet
- func (this *ConfigGroupSet) ContainCore(cfgrp *ConfigGroup) bool
- func (this *ConfigGroupSet) ContextDiff(that *ConfigGroupSet) *ConfigGroupSet
- func (this *ConfigGroupSet) Core() []*lr0items.Item
- func (this *ConfigGroupSet) CoreEqual(that *ConfigGroupSet) bool
- func (this *ConfigGroupSet) Equal(that *ConfigGroupSet) bool
- func (this *ConfigGroupSet) GetGroup(cg *ConfigGroup) *ConfigGroup
- func (this *ConfigGroupSet) GetGroupByCore(item *lr0items.Item) *ConfigGroup
- func (this *ConfigGroupSet) Len() int
- func (this *ConfigGroupSet) Less(i, j int) bool
- func (this *ConfigGroupSet) List() []*ConfigGroup
- func (this *ConfigGroupSet) SelectNextSubset(configGroups ...*ConfigGroup) (selectedSet *ConfigGroupSet)
- func (this *ConfigGroupSet) String() string
- func (this *ConfigGroupSet) Swap(i, j int)
- type ContextSet
- func (this *ContextSet) Add(symbol ...string) (newContext bool)
- func (this *ContextSet) AddSet(that *ContextSet)
- func (this *ContextSet) Clone() *ContextSet
- func (this *ContextSet) Diff(that *ContextSet) *ContextSet
- func (this *ContextSet) Equal(that *ContextSet) bool
- func (this *ContextSet) Intersection(that *ContextSet) []string
- func (this *ContextSet) Size() int
- func (this *ContextSet) String() string
- type State
- func (this *State) Add(cg ...*ConfigGroup) *State
- func (this *State) CanRecover() bool
- func (this *State) Closure() *State
- func (this *State) ConfigGroups() *ConfigGroupSet
- func (this *State) Core() []*lr0items.Item
- func (this *State) Equal(that *State) bool
- func (this *State) GetGroup(cg *ConfigGroup) *ConfigGroup
- func (this *State) Next() *Transitions
- func (this *State) NextSymbol(sym string) *State
- func (this *State) String() string
- type States
- type Transition
- type Transitions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigGroup ¶
type ConfigGroup struct { Item *lr0items.Item *ContextSet // contains filtered or unexported fields }
func NewConfigGroup ¶
func NewConfigGroup(item *lr0items.Item, context ...string) *ConfigGroup
func (*ConfigGroup) AddContext ¶
func (this *ConfigGroup) AddContext(c ...string) *ConfigGroup
func (*ConfigGroup) Compare ¶
func (this *ConfigGroup) Compare(that *ConfigGroup) int
Return:
-1 if this < that 0 if this == that 1 if this > that
func (*ConfigGroup) Core ¶
func (this *ConfigGroup) Core() *lr0items.Item
func (*ConfigGroup) Equal ¶
func (this *ConfigGroup) Equal(that *ConfigGroup) bool
func (*ConfigGroup) HashKey ¶
func (this *ConfigGroup) HashKey() string
func (*ConfigGroup) IsNucleus ¶
func (this *ConfigGroup) IsNucleus() bool
func (*ConfigGroup) String ¶
func (this *ConfigGroup) String() string
type ConfigGroupSet ¶
type ConfigGroupSet struct {
// contains filtered or unexported fields
}
func NewConfigGroupSet ¶
func NewConfigGroupSet() *ConfigGroupSet
func (*ConfigGroupSet) Add ¶
func (this *ConfigGroupSet) Add(c ...*ConfigGroup) *ConfigGroupSet
func (*ConfigGroupSet) Clone ¶
func (this *ConfigGroupSet) Clone() *ConfigGroupSet
func (*ConfigGroupSet) CloneFromCore ¶
func (this *ConfigGroupSet) CloneFromCore() *ConfigGroupSet
func (*ConfigGroupSet) ContainCore ¶
func (this *ConfigGroupSet) ContainCore(cfgrp *ConfigGroup) bool
Return true iff this contains a config group with the same core as cfgrp.
func (*ConfigGroupSet) ContextDiff ¶
func (this *ConfigGroupSet) ContextDiff(that *ConfigGroupSet) *ConfigGroupSet
Return the difference in context of each config group in both sets.
func (*ConfigGroupSet) Core ¶
func (this *ConfigGroupSet) Core() []*lr0items.Item
func (*ConfigGroupSet) CoreEqual ¶
func (this *ConfigGroupSet) CoreEqual(that *ConfigGroupSet) bool
func (*ConfigGroupSet) Equal ¶
func (this *ConfigGroupSet) Equal(that *ConfigGroupSet) bool
func (*ConfigGroupSet) GetGroup ¶
func (this *ConfigGroupSet) GetGroup(cg *ConfigGroup) *ConfigGroup
func (*ConfigGroupSet) GetGroupByCore ¶
func (this *ConfigGroupSet) GetGroupByCore(item *lr0items.Item) *ConfigGroup
func (*ConfigGroupSet) Len ¶
func (this *ConfigGroupSet) Len() int
Len is the number of elements in the collection.
func (*ConfigGroupSet) Less ¶
func (this *ConfigGroupSet) Less(i, j int) bool
Less returns whether the element with index i should sort before the element with index j.
func (*ConfigGroupSet) List ¶
func (this *ConfigGroupSet) List() []*ConfigGroup
func (*ConfigGroupSet) SelectNextSubset ¶
func (this *ConfigGroupSet) SelectNextSubset(configGroups ...*ConfigGroup) (selectedSet *ConfigGroupSet)
Select from this all config groups with item matching those in configGroups.
func (*ConfigGroupSet) String ¶
func (this *ConfigGroupSet) String() string
func (*ConfigGroupSet) Swap ¶
func (this *ConfigGroupSet) Swap(i, j int)
Swap swaps the elements with indexes i and j.
type ContextSet ¶
func NewContextSet ¶
func NewContextSet() *ContextSet
func (*ContextSet) Add ¶
func (this *ContextSet) Add(symbol ...string) (newContext bool)
Return true if symbol was new and added to this.
func (*ContextSet) AddSet ¶
func (this *ContextSet) AddSet(that *ContextSet)
func (*ContextSet) Clone ¶
func (this *ContextSet) Clone() *ContextSet
func (*ContextSet) Diff ¶
func (this *ContextSet) Diff(that *ContextSet) *ContextSet
Returns set difference: this-that
func (*ContextSet) Equal ¶
func (this *ContextSet) Equal(that *ContextSet) bool
func (*ContextSet) Intersection ¶
func (this *ContextSet) Intersection(that *ContextSet) []string
func (*ContextSet) Size ¶
func (this *ContextSet) Size() int
Return the number of items in the context set
func (*ContextSet) String ¶
func (this *ContextSet) String() string
type State ¶
type State struct { Number int Nucleus *ConfigGroupSet NonNucleus *ConfigGroupSet Transitions *Transitions // assigned in states.NewStates() // contains filtered or unexported fields }
func (*State) Add ¶
func (this *State) Add(cg ...*ConfigGroup) *State
func (*State) CanRecover ¶
func (*State) ConfigGroups ¶
func (this *State) ConfigGroups() *ConfigGroupSet
func (*State) GetGroup ¶
func (this *State) GetGroup(cg *ConfigGroup) *ConfigGroup
func (*State) Next ¶
func (this *State) Next() *Transitions
func (*State) NextSymbol ¶
type Transition ¶
func (Transition) String ¶
func (this Transition) String() string
type Transitions ¶
type Transitions struct {
// contains filtered or unexported fields
}
The set of transitions of a state.
func NewTransitions ¶
func NewTransitions(symbols []string) *Transitions
func NewTransitionsList ¶
func NewTransitionsList(trans []Transition, symbols []string) *Transitions
func (*Transitions) List ¶
func (this *Transitions) List() []Transition
func (*Transitions) Replace ¶
func (this *Transitions) Replace(sym string, state *State)
func (*Transitions) String ¶
func (this *Transitions) String() string
func (*Transitions) Transition ¶
func (this *Transitions) Transition(sym string) *State
Click to show internal directories.
Click to hide internal directories.