action

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: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ACCEPT = Accept(true)
	ERROR  = Error(true)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Accept

type Accept bool

func (Accept) Equal

func (Accept) Equal(act Action) bool

func (Accept) ResolveConflict

func (this Accept) ResolveConflict(that Action) Action

func (Accept) String

func (this Accept) String() string

type Action

type Action interface {
	Equal(Action) bool
	ResolveConflict(that Action) Action
	String() string
}

type Actions

type Actions []map[string]Action

One entry for each state. Each entry is a map of symbol -> action

func GetActions

func GetActions(states *states.States) (actions Actions, conflicts [][]*Conflict)

Returns: conflicts - for each state a list of conflict lists. Each conflict list contains a list of conflicts for each conflicted symbol in the state.

type Conflict

type Conflict struct {
	Symbol  string
	Actions []Action
}

func (*Conflict) AddConflict

func (this *Conflict) AddConflict(sym string, act1, act2 Action) *Conflict

func (*Conflict) NumConflicts

func (this *Conflict) NumConflicts() int

func (*Conflict) String

func (this *Conflict) String() string

type Error

type Error bool

func (Error) Equal

func (Error) Equal(act Action) bool

func (Error) ResolveConflict

func (Error) ResolveConflict(that Action) Action

func (Error) String

func (this Error) String() string

type Reduce

type Reduce int

func (Reduce) Equal

func (this Reduce) Equal(act Action) bool

func (Reduce) ResolveConflict

func (this Reduce) ResolveConflict(that Action) Action

func (Reduce) String

func (this Reduce) String() string

type Shift

type Shift int

func (Shift) Equal

func (this Shift) Equal(act Action) bool

func (Shift) ResolveConflict

func (this Shift) ResolveConflict(that Action) Action

func (Shift) String

func (this Shift) String() string

Jump to

Keyboard shortcuts

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