Documentation ¶
Overview ¶
Package ir holds the intermediate representation of the Gochart, which will then permit us to generate representations from it (eg. to C++).
Index ¶
- Constants
- func CompareCaptures(t *testing.T, state *State, want, got []*StateCapture)
- func CompareGochart(t *testing.T, want, got *Gochart)
- func CompareOption(t *testing.T, want, got *Option)
- func CompareReactions(t *testing.T, state *State, want, got []*StateReaction)
- func CompareState(t *testing.T, want, got *State)
- func CompareTransition(t *testing.T, want, got *Transition)
- func CompareTrigger(t *testing.T, want, got *Trigger)
- func NewPrinter(w io.Writer) *irPrinter
- type ConcurrentHead
- type Gochart
- type GochartOptionHandler
- type Option
- type OptionDefinition
- type State
- func (s *State) DefaultChild() *State
- func (s *State) DisplayName() string
- func (s *State) Equals(other *State) bool
- func (s *State) GetCapture(trigger *Trigger) *StateCapture
- func (s *State) GetConcurrentGroup() int
- func (s *State) GetNullTransitions() []*Transition
- func (s *State) GetTransition(trigger *Trigger) *Transition
- func (s *State) HasCapture(trigger *Trigger) bool
- func (s *State) HasDefaultEnterReaction() bool
- func (s *State) HasDefaultExitReaction() bool
- func (s *State) HasDefaultReaction(reactionType string) bool
- func (s *State) HasEnterReaction(trigger *Trigger) bool
- func (s *State) HasExitReaction(trigger *Trigger) bool
- func (s *State) HasReaction(reactionType string, trigger *Trigger) bool
- func (s *State) HasTransition(trigger *Trigger) bool
- func (s *State) IsParentOf(other *State) bool
- func (s *State) IsRoot() bool
- func (s *State) SafeName() string
- type StateCapture
- type StateOptionHandler
- type StateReaction
- type StateReactionKind
- type Transition
- type Trigger
- type TriggerArgument
Constants ¶
View Source
const ( InvalidTriggerName = "__Invalid__" InvalidStateName = "__Invalid__" )
Variables ¶
This section is empty.
Functions ¶
func CompareCaptures ¶
func CompareCaptures(t *testing.T, state *State, want, got []*StateCapture)
func CompareGochart ¶
func CompareOption ¶
func CompareReactions ¶
func CompareReactions(t *testing.T, state *State, want, got []*StateReaction)
func CompareState ¶
func CompareTransition ¶
func CompareTransition(t *testing.T, want, got *Transition)
func CompareTrigger ¶
func NewPrinter ¶
Types ¶
type ConcurrentHead ¶
type Gochart ¶
type Gochart struct { Name string Namespace string Options []*Option Triggers []*Trigger // Root is the base state of the complete gochart. // Normally this is a "hidden" state created by the gochart. Root *State ConcurrentHeads []*ConcurrentHead // States are all the states, as defined in the order from the frontend. States []*State TriggerMap map[string]*Trigger StateMap map[string]*State FrontendData *frontend_common.GochartData }
Gochart represents a single gochart state machine.
func ProcessGochartData ¶
func ProcessGochartData(gcdata *frontend_common.GochartData) (*Gochart, error)
func (*Gochart) ConcurrentGroupCount ¶
type GochartOptionHandler ¶
type Option ¶
type Option struct { Definition *OptionDefinition // contains filtered or unexported fields }
Option represents the parsed option that comes from the frontend, which some getters for the types.
func (*Option) IsImplicitBool ¶
func (*Option) StringValue ¶
type OptionDefinition ¶
type OptionDefinition struct { Name string Kind frontend_common.OptionValueKind Description string Handler any TestingOption bool }
type State ¶
type State struct { Name string Default bool Concurrent bool ConcurrentGroup int Options []*Option // States represents the substates that this state has. Children []*State Transitions []*Transition EnterReactions []*StateReaction ExitReactions []*StateReaction Captures []*StateCapture Parent *State FrontendData *frontend_common.StateData // contains filtered or unexported fields }
State represents a single state withing a gochart.
func (*State) DefaultChild ¶
func (*State) DisplayName ¶
DisplayName is the name to be used for user facing displays of this state. Mostly used to give an easier time to the backend.
func (*State) GetCapture ¶
func (s *State) GetCapture(trigger *Trigger) *StateCapture
func (*State) GetConcurrentGroup ¶
func (*State) GetNullTransitions ¶
func (s *State) GetNullTransitions() []*Transition
func (*State) GetTransition ¶
func (s *State) GetTransition(trigger *Trigger) *Transition
func (*State) HasCapture ¶
func (*State) HasDefaultEnterReaction ¶
func (*State) HasDefaultExitReaction ¶
func (*State) HasDefaultReaction ¶
func (*State) HasEnterReaction ¶
func (*State) HasExitReaction ¶
func (*State) HasTransition ¶
func (*State) IsParentOf ¶
type StateCapture ¶
type StateCapture struct { Trigger *Trigger Condition string FrontendData *frontend_common.CaptureData }
func (*StateCapture) HasCondition ¶
func (sc *StateCapture) HasCondition() bool
func (*StateCapture) String ¶
func (sc *StateCapture) String() string
type StateOptionHandler ¶
type StateReaction ¶
type StateReaction struct { Trigger *Trigger Kind StateReactionKind FrontendData *frontend_common.ReactionData }
func (*StateReaction) String ¶
func (sr *StateReaction) String() string
type StateReactionKind ¶
type StateReactionKind int
const ( StateReactionKind_Enter StateReactionKind = iota StateReactionKind_Exit )
func (StateReactionKind) String ¶
func (srk StateReactionKind) String() string
type Transition ¶
type Transition struct { From *State To *State Trigger *Trigger Condition string Action string FrontendData *frontend_common.TransitionData }
Transition represents a transition from one state to another given a particular trigger.
func (*Transition) HasAction ¶
func (t *Transition) HasAction() bool
func (*Transition) HasCondition ¶
func (t *Transition) HasCondition() bool
func (*Transition) IsNullTransition ¶
func (t *Transition) IsNullTransition() bool
type Trigger ¶
type Trigger struct { Name string Args []*TriggerArgument FrontendData *frontend_common.TriggerData }
func (*Trigger) ArgsNameList ¶
ArgsNameList returns a list with only the name of the arguments.
func (*Trigger) ArgsStringList ¶
type TriggerArgument ¶
func ParseCppArguments ¶
func ParseCppArguments(argString string) ([]*TriggerArgument, error)
func (*TriggerArgument) String ¶
func (ta *TriggerArgument) String() string
Click to show internal directories.
Click to hide internal directories.