public override object VisitStateDefer(PParser.StateDeferContext context) { // annotationSet? SEMI if (context.annotationSet() != null) { throw new NotImplementedException("event defer annotations"); } // DEFER nonDefaultEventList var eventContexts = context.nonDefaultEventList()._events; var actions = new IStateAction[eventContexts.Count]; for (var i = 0; i < eventContexts.Count; i++) { var token = eventContexts[i]; if (!CurrentScope.Lookup(token.GetText(), out PEvent evt)) { throw Handler.MissingDeclaration(token, "event", token.GetText()); } actions[i] = new EventDefer(token, evt); } return(actions); }
public override object VisitStateDefer(PParser.StateDeferContext context) { if (CurrentMachine.IsSpec) { throw Handler.DeferredEventInMonitor(context, CurrentMachine); } // DEFER nonDefaultEventList var eventContexts = context.nonDefaultEventList()._events; var actions = new IStateAction[eventContexts.Count]; for (var i = 0; i < eventContexts.Count; i++) { var token = eventContexts[i]; if (!CurrentScope.Lookup(token.GetText(), out PEvent evt)) { throw Handler.MissingDeclaration(token, "event", token.GetText()); } actions[i] = new EventDefer(token, evt); } return(actions); }