add transition label parser
This commit is contained in:
parent
58a75ddd8b
commit
e009f718d2
8 changed files with 1399 additions and 74 deletions
|
|
@ -1,3 +1,5 @@
|
|||
import { TransitionLabel } from "./label_ast";
|
||||
|
||||
export type AbstractState = {
|
||||
uid: string;
|
||||
children: ConcreteState[];
|
||||
|
|
@ -20,37 +22,9 @@ export type Transition = {
|
|||
uid: string;
|
||||
src: ConcreteState;
|
||||
tgt: ConcreteState;
|
||||
trigger: Trigger;
|
||||
guard: Expression;
|
||||
actions: Action[];
|
||||
label: TransitionLabel[];
|
||||
}
|
||||
|
||||
export type EventTrigger = {
|
||||
kind: "event";
|
||||
event: string;
|
||||
}
|
||||
|
||||
export type AfterTrigger = {
|
||||
kind: "after";
|
||||
delay_ms: number;
|
||||
}
|
||||
|
||||
export type Trigger = EventTrigger | AfterTrigger;
|
||||
|
||||
export type RaiseEvent = {
|
||||
kind: "raise";
|
||||
event: string;
|
||||
}
|
||||
|
||||
export type Assign = {
|
||||
lhs: string;
|
||||
rhs: Expression;
|
||||
}
|
||||
|
||||
export type Expression = {};
|
||||
|
||||
export type Action = RaiseEvent | Assign;
|
||||
|
||||
export type Statechart = {
|
||||
root: ConcreteState;
|
||||
transitions: Map<string, Transition[]>; // key: source state uid
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue