Documentation
¶
Overview ¶
Package deferred writes the standard SysML v2 encoding of a deferred signal: an ordered buffer item, a do action whose accept loop keeps each occurrence while the state is active, and an exit action that sends each kept occurrence to self. The SysML v1 migrator and the PSSM referee write it through this one package, so the two never spell the encoding apart.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Encoding ¶
type Encoding struct {
// Buffer and Flush name the do and exit actions; Split names the fork that
// runs the accept loops beside each other and the state's own do behavior.
Buffer, Split, Flush string
// Including refers to SequenceFunctions::including from the state's scope;
// Keeper to MigrationMetadata::DeferredKeeper, the annotation marking each
// accept loop's accept as the one keeping the signal for the state.
Including, Keeper string
Signals []Signal
}
Encoding is a state's deferred signals with the members encoding them.
func (*Encoding) Do ¶
Do writes the do action that keeps each deferred signal while the state is active: one endless accept loop per route, run beside the state's own do behavior when own renders one. own is called inside the action's body, so its text is rendered at that indentation.
func (*Encoding) Exit ¶
Exit writes the exit action that sends each kept occurrence to the state's own object once the state exits, after the state's own exit behavior when own renders one, and empties each buffer so a later visit replays only what it kept. own is called inside the action's body.
type Loop ¶
Loop is one accept loop of a kept signal: from the object itself when Via is "", via the port Via names otherwise. Its names are spelled as written; Accept names the signal as the accept's payload type, qualified past the payload's own name where that would shadow it.
type Own ¶
type Own struct {
// Text is the rendering, at the body's indentation; "" for no behavior.
Text string
// Written reports whether Text declares the nested action the encoding
// then runs: a rendering of comments alone does not.
Written bool
// Run names the nested action; MadeUp is that name when the rendering
// made it up for a behavior its source left anonymous, "" otherwise.
Run, MadeUp string
}
Own is a state's own do or exit behavior rendered as the nested action the encoding runs beside its loops or ahead of its flush.
type Signal ¶
type Signal struct {
// Ref names the signal as the buffer's type; Kind is the usage keyword
// the buffer is declared with, `item` when "", `attribute` for a signal
// that is an attribute definition.
Ref, Kind string
Buffer string
Item, Clear string
Loops []Loop
}
Signal is one signal a state keeps: the buffer item its occurrences fill, the accept loops that fill it, and the flush loop's members, every name spelled as written.
type Writer ¶
type Writer interface {
Line(s string)
Block(header string, body func())
Raw(text string)
MadeUp(name string)
}
Writer is the sink an encoding is written into: a line at the current indentation, a brace-delimited block whose body is one level deeper, text already rendered at the current indentation, and a name the encoding made up for the block being written, which a sink with no use for it ignores.