Documentation ¶
Index ¶
- func NewGoSTMMap(pkg *GoPkgSource, stms map[string]*StateMachine, states map[string]*State) ([]*GoSTMSource, map[*State][]*GoSTMSource, *State)
- func Parse(data []byte) (map[string]*StateMachine, map[string]*State)
- type Event
- type GoPkgSource
- type GoSTMSource
- func (g *GoSTMSource) BaseHeader(w *Writer)
- func (g *GoSTMSource) BaseStateDefinition(w *Writer, names map[string]string)
- func (g *GoSTMSource) BaseStateInitialize(w *Writer, names map[string]string)
- func (g *GoSTMSource) BaseTransDefinition(w *Writer, names map[string]string)
- func (g *GoSTMSource) BaseTransDefinitionWithExternal(w *Writer, names map[string]string)
- func (g *GoSTMSource) ImplFunctions(w *Writer, sttree map[*State][]*GoSTMSource, names map[string]string)
- func (g *GoSTMSource) ImplFunctionsWithExternal(w *Writer, sttree map[*State][]*GoSTMSource, names map[string]string)
- func (g *GoSTMSource) ImplHeader(w *Writer)
- func (g *GoSTMSource) UpdateDefinition(w *Writer, sttree map[*State][]*GoSTMSource, names map[string]string)
- type MxElement
- type State
- type StateMachine
- type Transition
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewGoSTMMap ¶
func NewGoSTMMap(pkg *GoPkgSource, stms map[string]*StateMachine, states map[string]*State) ([]*GoSTMSource, map[*State][]*GoSTMSource, *State)
A function to make map between a parent state and a state machine
Types ¶
type GoPkgSource ¶
type GoPkgSource struct { Fullpkgname string `json: "fullpkgname"` Domain string `json: "domain"` Pkgname string `json: "pkgname"` }
func NewGoPkgSource ¶
func NewGoPkgSource(domain string, pkgname string) *GoPkgSource
A function to create GoSource
out: io.Writer (e.g. os.Stdout) domain: domain name for package pkgname: package name
func (*GoPkgSource) GenMain ¶
func (g *GoPkgSource) GenMain(w *Writer, stms []*GoSTMSource, names map[string]string)
A function to generate an example of main
func (*GoPkgSource) TestGen ¶
func (g *GoPkgSource) TestGen(w *Writer, stms []*GoSTMSource, names map[string]string)
A function to generate an example of test code
type GoSTMSource ¶
type GoSTMSource struct { Id string // contains filtered or unexported fields }
func NewGoSTMSource ¶
func NewGoSTMSource(name string, ss []*State, ts []*Transition, ex []*Transition, initial *State, pkg *GoPkgSource, root bool) *GoSTMSource
A function to create GoSTMSource
out: io.Writer name: name of STM ss: Slice of States states: Set for states ts: Slice of Transitions ex: Slice of ExTransitions initial: Initial State pkg: GoSource for Pkg root: Indicator whether the stm is root or not
func (*GoSTMSource) BaseHeader ¶
func (g *GoSTMSource) BaseHeader(w *Writer)
A function to generate the string of header
func (*GoSTMSource) BaseStateDefinition ¶
func (g *GoSTMSource) BaseStateDefinition(w *Writer, names map[string]string)
A function to generate Enum for states
func (*GoSTMSource) BaseStateInitialize ¶
func (g *GoSTMSource) BaseStateInitialize(w *Writer, names map[string]string)
A function to generate init function
func (*GoSTMSource) BaseTransDefinition ¶
func (g *GoSTMSource) BaseTransDefinition(w *Writer, names map[string]string)
A function to generate base for a given STM
func (*GoSTMSource) BaseTransDefinitionWithExternal ¶ added in v0.4.0
func (g *GoSTMSource) BaseTransDefinitionWithExternal(w *Writer, names map[string]string)
A function to generate base for a given STM
func (*GoSTMSource) ImplFunctions ¶
func (g *GoSTMSource) ImplFunctions(w *Writer, sttree map[*State][]*GoSTMSource, names map[string]string)
A function to generate template functions
func (*GoSTMSource) ImplFunctionsWithExternal ¶ added in v0.4.0
func (g *GoSTMSource) ImplFunctionsWithExternal(w *Writer, sttree map[*State][]*GoSTMSource, names map[string]string)
A function to generate template functions
func (*GoSTMSource) ImplHeader ¶
func (g *GoSTMSource) ImplHeader(w *Writer)
A function to generate the string of header for impl
func (*GoSTMSource) UpdateDefinition ¶ added in v0.4.0
func (g *GoSTMSource) UpdateDefinition(w *Writer, sttree map[*State][]*GoSTMSource, names map[string]string)
A function to generate base for a given STM
type MxElement ¶
type MxElement struct { Id string Type string Parent string Value string Properties map[string]string Geometry mxGeometry }
func GetGraphModel ¶
type StateMachine ¶
type StateMachine struct { Parent string States []*State Events []*Event Transitions []*Transition ExTransitions []*Transition Initial *State }
func NewStateMachine ¶
func NewStateMachine(parent string) *StateMachine
type Transition ¶
Click to show internal directories.
Click to hide internal directories.