public FileNamespaceEntry(NamespaceEntry namespaceEntry, FileNamespaceEntry parent, string name, FileEntry file)
            : this(namespaceEntry, file)
        {
            Children = new List<FileNamespaceEntry>();

            if (parent != null)
            {
                Parent = parent;
                Parent.Children.Add(this);
            }
        }
 public AssemblyModule()
 {
     RootNamespace = new GlobalRootNamespace();
     RootNamespaceEntry = new NamespaceEntry(RootNamespace);
 }
        private void OpenNamespace(Namespace ns)
        {
            NamespaceEntry entry = namespaceEntry.Children.Find(x => x.Name == ns.Name);

            if (entry == null)
            {
                namespaceEntry = new NamespaceEntry(ns, namespaceEntry);
            }
            else
            {
                namespaceEntry = entry;
            }

            fileNamespaceEntry = new FileNamespaceEntry(namespaceEntry, fileNamespaceEntry, string.Empty, fileEntry);
        }
        private void initialize()
        {
            //Stacks
            operatorStack = new Stack<Operator>();
            modifierStack = new Stack<Modifier>();
            tokenQueue = new Queue<TokenInfo>();

            //Tree
            GlobalNamespace = RootContext.Module.RootNamespace;
            NamespaceEntryRoot = RootContext.Module.RootNamespaceEntry;

            //ParserContext
            ns = GlobalNamespace;
            namespaceEntry = NamespaceEntryRoot;

            //Statement symbols
            statementSymbols = new TokenList();
        }
        private Namespace CloseNamespace()
        {
            //if (fileNamespaceEntry.Parent == null)
            //    throw new InternalCompilerException("");

            if (namespaceEntry.Parent == null)
            {
                namespaceEntry = null;
            }
            else
            {
                namespaceEntry = namespaceEntry.Parent;
            }

            Namespace ns = this.ns;
            this.ns = this.ns.Parent;

            return ns;
        }
 private FileNamespaceEntry(NamespaceEntry namespaceEntry, FileEntry file)
     : this(file)
 {
     NamespaceEntry = namespaceEntry;
     NamespaceEntry.FileNamespaceEntries.Add(this);
 }
 public NamespaceEntry(Namespace ns, NamespaceEntry parent)
     : this(ns)
 {
     Parent = parent;
     Parent.Children.Add(this);
 }