public override object VisitInterfaceDecl(PParser.InterfaceDeclContext context) { // TYPE name=Iden var mInterface = (Interface)nodesToDeclarations.Get(context); // LPAREN type? RPAREN mInterface.PayloadType = ResolveType(context.type()); IEventSet eventSet; if (context.RECEIVES() == null) { eventSet = UniversalEventSet.Instance; } else { eventSet = new EventSet(); if (context.nonDefaultEventList()?._events is IList <PParser.NonDefaultEventContext> events) { foreach (var eventContext in events) { eventSet.AddEvent((PEvent)Visit(eventContext)); } } } mInterface.ReceivableEvents = eventSet; return(mInterface); }
public override object VisitInterfaceDecl(PParser.InterfaceDeclContext context) { string symbolName = context.name.GetText(); Interface decl = CurrentScope.Put(symbolName, context); nodesToDeclarations.Put(context, decl); return(null); }
public Interface Put(string name, PParser.InterfaceDeclContext tree) { Interface machineInterface = new Interface(name, tree); CheckConflicts( machineInterface, Namespace(interfaces), Namespace(enums), Namespace(typedefs), Namespace(machines)); interfaces.Add(name, machineInterface); return(machineInterface); }