Documentation
¶
Index ¶
- Variables
- func NewAction(r *Registry, name string, args []string, fn any)
- func NewTrigger[T any](r *Registry, name string)
- type Action
- type ActionSpec
- type Arg
- type Call
- type CompiledMachine
- type CompiledState
- type CompiledTrigger
- type Condition
- type ConstValue
- type Entry
- type File
- type MoveStmt
- type ParseError
- type ReferenceValue
- type Registry
- type SetStmt
- type State
- type StateMachine
- type Statement
- type Trigger
- type TriggerCond
- type TypeDummyValue
- type Value
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrDummyNotEvaluable = errors.New("Dummy Value not evaluable.")
View Source
var ErrEmptyMachine = errors.New("empty state machine")
Functions ¶
func NewTrigger ¶
Types ¶
type ActionSpec ¶
type CompiledMachine ¶
type CompiledMachine struct {
// contains filtered or unexported fields
}
func BuildMachine ¶
func (*CompiledMachine) New ¶
func (cm *CompiledMachine) New() (*StateMachine, error)
type CompiledState ¶
type CompiledState struct {
Init []Action
Triggers []CompiledTrigger
}
type CompiledTrigger ¶
type CompiledTrigger struct {
// contains filtered or unexported fields
}
type Entry ¶
type Entry interface {
EvalToplevel(*CompiledMachine) error
}
type MoveStmt ¶
type MoveStmt struct {
Dest string
}
func (*MoveStmt) CheckType ¶
func (ms *MoveStmt) CheckType(_ map[string]Value, m *CompiledMachine) error
func (*MoveStmt) Execute ¶
func (ms *MoveStmt) Execute(*CompiledMachine) Action
type ParseError ¶
type ParseError struct {
Filename string
Expected []string
Line, Offset, Length int
Type, Value string
}
func (*ParseError) Error ¶
func (perr *ParseError) Error() string
type SetStmt ¶
func (*SetStmt) EvalToplevel ¶
func (ss *SetStmt) EvalToplevel(m *CompiledMachine) error
type State ¶
func (*State) EvalToplevel ¶
func (st *State) EvalToplevel(m *CompiledMachine) error
type StateMachine ¶
type StateMachine struct {
CompiledMachine
// contains filtered or unexported fields
}
type Statement ¶
type Statement interface {
CheckType(map[string]Value, *CompiledMachine) error
Execute(*CompiledMachine) Action
}
type Trigger ¶
type Trigger struct {
Cond []TriggerCond
Actions []Statement
}
type TriggerCond ¶
type TypeDummyValue ¶
type TypeDummyValue struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.