Example #1
0
        public void Add(object item)
        {
            if (IgnoreDecl)
            {
                return;
            }

            else if (item is P_Root.MachineSends)
            {
                MachineSends.Add(item as P_Root.MachineSends);
            }
            else if (item is P_Root.MachineReceives)
            {
                MachineReceives.Add(item as P_Root.MachineReceives);
            }
            else if (item is P_Root.MachineProtoDecl)
            {
                MachineProtoDecls.Add(item as P_Root.MachineProtoDecl);
            }
            else if (item is P_Root.FunProtoDecl)
            {
                FunProtoDecls.Add(item as P_Root.FunProtoDecl);
            }
            else if (item is P_Root.MachineExports)
            {
                MachineExports.Add(item as P_Root.MachineExports);
            }
            else if (item is P_Root.EventSetContains)
            {
                EventSetContains.Add(item as P_Root.EventSetContains);
            }
            else if (item is P_Root.EventSetDecl)
            {
                EventSetDecl.Add(item as P_Root.EventSetDecl);
            }
            else if (item is P_Root.InterfaceTypeDef)
            {
                InterfaceTypeDef.Add(item as P_Root.InterfaceTypeDef);
            }
            else if (item is P_Root.ObservesDecl)
            {
                Observes.Add(item as P_Root.ObservesDecl);
            }
            else if (item is P_Root.Annotation)
            {
                Annotations.Add(item as P_Root.Annotation);
            }
            else if (item is P_Root.DoDecl)
            {
                Dos.Add(item as P_Root.DoDecl);
            }
            else if (item is P_Root.AnonFunDecl)
            {
                AnonFunctions.Add(item as P_Root.AnonFunDecl);
            }
            else if (item is P_Root.FunDecl)
            {
                Functions.Add(item as P_Root.FunDecl);
            }
            else if (item is P_Root.TransDecl)
            {
                Transitions.Add(item as P_Root.TransDecl);
            }
            else if (item is P_Root.VarDecl)
            {
                Variables.Add(item as P_Root.VarDecl);
            }
            else if (item is P_Root.StateDecl)
            {
                States.Add(item as P_Root.StateDecl);
            }
            else if (item is P_Root.MachineDecl)
            {
                Machines.Add(item as P_Root.MachineDecl);
            }
            else if (item is P_Root.EventDecl)
            {
                Events.Add(item as P_Root.EventDecl);
            }
            else if (item is P_Root.ModelType)
            {
                ModelTypes.Add(item as P_Root.ModelType);
            }
            else if (item is P_Root.EnumTypeDef)
            {
                EnumTypeDefs.Add(item as P_Root.EnumTypeDef);
            }
            else if (item is P_Root.TypeDef)
            {
                TypeDefs.Add(item as P_Root.TypeDef);
            }
            else if (item is P_Root.DependsOn)
            {
                DependsOn.Add(item as P_Root.DependsOn);
            }
            else if (item is P_Root.FunProtoCreatesDecl)
            {
                FunProtoCreates.Add(item as P_Root.FunProtoCreatesDecl);
            }
            else
            {
                throw new Exception("Cannot add into the Program : " + item.ToString());
            }
        }
Example #2
0
 public void Add(object item)
 {
     if (item is P_Root.AnyTypeDecl)
     {
         AnyTypeDecl.Add(item as P_Root.AnyTypeDecl);
     }
     else if (item is P_Root.MachineSends)
     {
         MachineSends.Add(item as P_Root.MachineSends);
     }
     else if (item is P_Root.MachineReceives)
     {
         MachineReceives.Add(item as P_Root.MachineReceives);
     }
     else if (item is P_Root.EventSetContains)
     {
         EventSetContains.Add(item as P_Root.EventSetContains);
     }
     else if (item is P_Root.EventSetDecl)
     {
         EventSetDecl.Add(item as P_Root.EventSetDecl);
     }
     else if (item is P_Root.InterfaceDef)
     {
         InterfaceDef.Add(item as P_Root.InterfaceDef);
     }
     else if (item is P_Root.ObservesDecl)
     {
         Observes.Add(item as P_Root.ObservesDecl);
     }
     else if (item is P_Root.Annotation)
     {
         Annotations.Add(item as P_Root.Annotation);
     }
     else if (item is P_Root.DoDecl)
     {
         Dos.Add(item as P_Root.DoDecl);
     }
     else if (item is P_Root.AnonFunDecl)
     {
         AnonFunctions.Add(item as P_Root.AnonFunDecl);
     }
     else if (item is P_Root.FunDecl)
     {
         Functions.Add(item as P_Root.FunDecl);
     }
     else if (item is P_Root.TransDecl)
     {
         Transitions.Add(item as P_Root.TransDecl);
     }
     else if (item is P_Root.VarDecl)
     {
         Variables.Add(item as P_Root.VarDecl);
     }
     else if (item is P_Root.StateDecl)
     {
         States.Add(item as P_Root.StateDecl);
     }
     else if (item is P_Root.MachineDecl)
     {
         Machines.Add(item as P_Root.MachineDecl);
     }
     else if (item is P_Root.MachineCard)
     {
         MachineCards.Add(item as P_Root.MachineCard);
     }
     else if (item is P_Root.MachineKind)
     {
         MachineKinds.Add(item as P_Root.MachineKind);
     }
     else if (item is P_Root.MachineStart)
     {
         MachineStarts.Add(item as P_Root.MachineStart);
     }
     else if (item is P_Root.EventDecl)
     {
         Events.Add(item as P_Root.EventDecl);
     }
     else if (item is P_Root.EnumTypeDef)
     {
         EnumTypeDefs.Add(item as P_Root.EnumTypeDef);
     }
     else if (item is P_Root.TypeDef)
     {
         TypeDefs.Add(item as P_Root.TypeDef);
     }
     else if (item is P_Root.DependsOn)
     {
         DependsOn.Add(item as P_Root.DependsOn);
     }
     else
     {
         throw new Exception("Cannot add into the Program : " + item);
     }
 }