public override object VisitArchelement([NotNull] ArchelementContext context) { // Console.WriteLine("VisitArchelement "); if (context.component() != null) { // generate component // Console.WriteLine("component found!"); return(VisitComponent(context)); } else if (context.connector() != null) { // generate connector // Console.WriteLine("connector found!"); return(VisitConnector(context)); } else if (context.system() != null) { // generate connector // Console.WriteLine("system found!"); return(VisitSystem(context)); } else { return(null); } }
public object VisitSystem([NotNull] ArchelementContext context) { // Console.WriteLine("VisitSystem: "+ context.system().ID()); SystemConfig systemCfg = new SystemConfig(context.system().ID().GetText()); if (context.feature() != null) { // parsing each define FeatureContext[] defines = context.feature(); foreach (var ctx in defines) { // visit declare if (ctx.declare() != null) { ConfigDeclaration declare = (ConfigDeclaration)VisitDeclare(ctx.declare()); if (declare != null) { systemCfg.declareList.Add(declare); } // visit attach } else if (ctx.attach() != null) { Attachment attach = (Attachment)VisitAttach(ctx.attach()); if (attach != null) { systemCfg.attachList.Add(attach); } // visit glue } else if (ctx.execute() != null) { systemCfg.Exec = (SysProcess)VisitExecute(ctx.execute()); } } // parsing each attach } return(systemCfg); }