public void Visit(StateSpec state) { var name = state.IsAbstract ? $"({state.Name})" : state.Name; var super = state.Modifiers.Where(x => x.Kind == ModifierKind.SuperState).SelectMany(x => x.Values).Select(x => ":" + x); var entry = state.Modifiers.Where(x => x.Kind == ModifierKind.EntryAction).SelectMany(x => x.Values).Select(x => " <" + x); var exit = state.Modifiers.Where(x => x.Kind == ModifierKind.ExitAction).SelectMany(x => x.Values).Select(x => " >" + x); var modifiers = super.Concat(entry).Concat(exit); builder.Append(string.Concat(name, string.Concat(modifiers))); }
private string FormatState(StateSpec state) { var name = state.IsAbstract ? $"({state.Name})" : state.Name; var super = state.Modifiers.Where(x => x.Kind == ModifierKind.SuperState).Select(x => ":" + x.Values); var entry = state.Modifiers.Where(x => x.Kind == ModifierKind.EntryAction).Select(x => ">" + x.Values); var exit = state.Modifiers.Where(x => x.Kind == ModifierKind.ExitAction).Select(x => "<" + x.Values); var parts = new[] { name }.Concat(super).Concat(entry).Concat(exit); return(string.Join(" ", parts)); }
protected bool Equals(StateSpec other) { return(string.Equals(Name, other.Name)); }
public Transition(StateSpec state, Subtransitions subtransitions) { State = state; Subtransitions = subtransitions; }