예제 #1
0
 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);
     }
 }
예제 #2
0
        public Connector VisitConnector([NotNull] ArchelementContext context)
        {
            if (context.connector().ID() == null)
            {
                return(null);
            }
            Connector connector = new Connector(context.connector().ID().GetText());

            if (context.feature() != null)
            {
                // parsing each role
                FeatureContext[] roles = context.feature();
                foreach (var ctx in roles)
                {
                    Feature ftr = (Feature)Visit(ctx);
                    if (ftr != null)
                    {
                        connector.roleList.Add(ftr);
                    }
                }
            }
            return(connector);
        }