states

package
v0.0.0-...-d977049 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 17, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

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

type ContextSet struct {
	List    []string
	Contain map[string]bool
}

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 NewState

func NewState(symbols []string, items *lr0items.Items, ff *first.First) *State

func (*State) Add

func (this *State) Add(cg ...*ConfigGroup) *State

func (*State) CanRecover

func (this *State) CanRecover() bool

func (*State) Closure

func (this *State) Closure() *State

func (*State) ConfigGroups

func (this *State) ConfigGroups() *ConfigGroupSet

func (*State) Core

func (this *State) Core() []*lr0items.Item

func (*State) Equal

func (this *State) Equal(that *State) bool

func (*State) GetGroup

func (this *State) GetGroup(cg *ConfigGroup) *ConfigGroup

func (*State) Next

func (this *State) Next() *Transitions

func (*State) NextSymbol

func (this *State) NextSymbol(sym string) *State

func (*State) String

func (this *State) String() string

type States

type States struct {
	List []*State
}

func (*States) NewState0

func (this *States) NewState0(symbols []string, items *items.Items, first *first.First, cg ...*ConfigGroup) *States

func (*States) Size

func (this *States) Size() int

Return the number of states

func (*States) String

func (this *States) String() string

type Transition

type Transition struct {
	Sym   string
	State *State
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL