public virtual object VisitNamespaceDeclaration(NamespaceDeclaration namespaceDeclaration, object data) {
			throw new global::System.NotImplementedException("NamespaceDeclaration");
		}
		public virtual object VisitNamespaceDeclaration(NamespaceDeclaration namespaceDeclaration, object data) {
			Debug.Assert((namespaceDeclaration != null));
			return namespaceDeclaration.AcceptChildren(this, data);
		}
		public virtual object VisitNamespaceDeclaration(NamespaceDeclaration namespaceDeclaration, object data) {
			Debug.Assert((namespaceDeclaration != null));
			for (int i = 0; i < namespaceDeclaration.Children.Count; i++) {
				INode o = namespaceDeclaration.Children[i];
				Debug.Assert(o != null);
				nodeStack.Push(o);
				o.AcceptVisitor(this, data);
				o = nodeStack.Pop();
				if (o == null)
					namespaceDeclaration.Children.RemoveAt(i--);
				else
					namespaceDeclaration.Children[i] = o;
			}
			return null;
		}
Example #4
0
	void NamespaceMemberDecl() {
		ModifierList m = new ModifierList();
		AttributeSection section;
		List<AttributeSection> attributes = new List<AttributeSection>();
		string qualident;

		if (la.kind == 160) {
			Get();
			Location startPos = t.Location;

			Qualident(out qualident);
			INode node =  new NamespaceDeclaration(qualident);
				node.StartLocation = startPos;
				AddChild(node);
				BlockStart(node);

			EndOfStmt();
			NamespaceBody();
			node.EndLocation = t.Location;
				BlockEnd();

		} else if (StartOf(3)) {
			while (la.kind == 40) {
				AttributeSection(out section);
				attributes.Add(section);
			}
			while (StartOf(4)) {
				TypeModifier(m);
			}
			NonModuleDeclaration(m, attributes);
		} else SynErr(245);
	}
		public sealed override object VisitNamespaceDeclaration(NamespaceDeclaration namespaceDeclaration, object data) {
			this.BeginVisit(namespaceDeclaration);
			object result = this.TrackedVisitNamespaceDeclaration(namespaceDeclaration, data);
			this.EndVisit(namespaceDeclaration);
			return result;
		}
		public virtual object TrackedVisitNamespaceDeclaration(NamespaceDeclaration namespaceDeclaration, object data) {
			return base.VisitNamespaceDeclaration(namespaceDeclaration, data);
		}
		public override object VisitNamespaceDeclaration(NamespaceDeclaration namespaceDeclaration, object data)
		{
			CodeNamespace currentNamespace = new CodeNamespace(namespaceDeclaration.Name);
			//namespaces.Add(currentNamespace);
			// add imports from mother namespace
			foreach (CodeNamespaceImport import in ((CodeNamespace)namespaceDeclarations.Peek()).Imports) {
				currentNamespace.Imports.Add(import);
			}
			namespaceDeclarations.Push(currentNamespace);
			namespaceDeclaration.AcceptChildren(this, data);
			namespaceDeclarations.Pop();
			codeCompileUnit.Namespaces.Add(currentNamespace);
			
			// Nested namespaces are not allowed in CodeDOM
			return null;
		}