internal Namespace_Cast(AUsingDecl obj)
 {
     this.obj = obj;
 }
 public virtual void InAUsingDecl(AUsingDecl node)
 {
     DefaultIn(node);
 }
 public virtual void OutAUsingDecl(AUsingDecl node)
 {
     DefaultOut(node);
 }
 public override void CaseAUsingDecl(AUsingDecl node)
 {
     InAUsingDecl(node);
     {
         Object[] temp = new Object[node.GetNamespace().Count];
         node.GetNamespace().CopyTo(temp, 0);
         for (int i = temp.Length - 1; i >= 0; i--)
         {
             ((TIdentifier)temp[i]).Apply(this);
         }
     }
     OutAUsingDecl(node);
 }
 public virtual void CaseAUsingDecl(AUsingDecl node)
 {
     DefaultCase(node);
 }
 ArrayList New8()
 {
     ArrayList nodeList = new ArrayList();
     ArrayList nodeArrayList2 = (ArrayList) Pop();
     ArrayList nodeArrayList1 = (ArrayList) Pop();
     TypedList listNode3 = new TypedList();
     TypedList listNode2 = (TypedList)nodeArrayList2[0];
     if ( listNode2 != null )
     {
     listNode3.AddAll(listNode2);
     }
     AUsingDecl pdeclNode1 = new AUsingDecl (
       listNode3
     );
     nodeList.Add(pdeclNode1);
     return nodeList;
 }
        public override void OutAUsingDecl(AUsingDecl node)
        {
            //Check that what it points to actually exists
            AAProgram program = Util.GetAncestor<AAProgram>(node);

            bool found = false;

            foreach (AASourceFile sourceFile in program.GetSourceFiles())
            {
                List<TIdentifier> searchForIdentifiers = new List<TIdentifier>();
                foreach (TIdentifier identifier in node.GetNamespace())
                {
                    searchForIdentifiers.Add(identifier);
                }
                List<IList> nextDecls = new List<IList>();
                List<IList> currentDecls = new List<IList>();
                currentDecls.Add(sourceFile.GetDecl());
                while (searchForIdentifiers.Count > 0)
                {
                    string name = searchForIdentifiers[0].Text;
                    searchForIdentifiers.RemoveAt(0);
                    foreach (IList currentDeclList in currentDecls)
                    {
                        foreach (PDecl decl in currentDeclList)
                        {
                            if (decl is ANamespaceDecl)
                            {
                                ANamespaceDecl aDecl = (ANamespaceDecl) decl;
                                if (aDecl.GetName().Text == name)
                                {
                                    nextDecls.Add(aDecl.GetDecl());
                                }
                            }
                        }
                    }
                    currentDecls = nextDecls;
                    nextDecls = new List<IList>();
                }
                if (currentDecls.Count > 0)
                {
                    found = true;
                    break;
                }
            }
            if (!found)
            {
                string identifierName = "";
                foreach (TIdentifier identifier in node.GetNamespace())
                {
                    if (identifierName != "")
                        identifierName += ".";
                    identifierName += identifier.Text;
                }
                errors.Add(new ErrorCollection.Error((Token)node.GetNamespace()[0], "No namespace found matching " + identifierName, true));
            }
        }
 public override void InAUsingDecl(AUsingDecl node)
 {
     List<string> ns = new List<string>();
     foreach (TIdentifier identifier in node.GetNamespace())
     {
         ns.Add(identifier.Text);
     }
     foreach (List<string> list in Usings)
     {
         if (list.Count != ns.Count)
             continue;
         bool equal = true;
         for (int i = 0; i < ns.Count; i++)
         {
             if (list[i] != ns[i])
             {
                 equal = false;
                 break;
             }
         }
         if (equal)
             return;
     }
     Usings.Add(ns);
 }