Ejemplo n.º 1
0
 // cannot override OnNamespaceDeclaration - it's visited too late (after the type definitions)
 void HandleNamespaceDeclaration(AST.NamespaceDeclaration node)
 {
     if (node == null)
     {
         return;
     }
     string[] namespaceName = node.Name.Split(new char[] { '.' }, StringSplitOptions.RemoveEmptyEntries);
     foreach (string namePart in namespaceName)
     {
         _cu.UsingScope = new DefaultUsingScope {
             NamespaceName = PrependCurrentNamespace(namePart),
             Parent        = _cu.UsingScope
         };
     }
 }
Ejemplo n.º 2
0
 public override void OnNamespaceDeclaration(NamespaceDeclaration node)
 {
     CheckName(node,node.Name);
 }
Ejemplo n.º 3
0
	protected void namespace_directive(
		Module container
	) //throws RecognitionException, TokenStreamException
{
		
		IToken  t = null;
		
				IToken id;
				NamespaceDeclaration p = null;
			
		
		try {      // for error handling
			t = LT(1);
			match(NAMESPACE);
			id=identifier();
			if (0==inputState.guessing)
			{
				
						p = new NamespaceDeclaration(ToLexicalInfo(t));
						p.Name = id.getText();
						container.Namespace = p; 
					
			}
			eos();
			docstring(p);
		}
		catch (RecognitionException ex)
		{
			if (0 == inputState.guessing)
			{
				reportError(ex, "namespace_directive");
				recover(ex,tokenSet_12_);
			}
			else
			{
				throw ex;
			}
		}
	}
Ejemplo n.º 4
0
 public override void OnNamespaceDeclaration(NamespaceDeclaration node)
 {
     base.OnNamespaceDeclaration(node);
 }
Ejemplo n.º 5
0
		override public object Clone()
		{
		
			NamespaceDeclaration clone = new NamespaceDeclaration();
			clone._lexicalInfo = _lexicalInfo;
			clone._endSourceLocation = _endSourceLocation;
			clone._documentation = _documentation;
			clone._isSynthetic = _isSynthetic;
			clone._entity = _entity;
			if (_annotations != null) clone._annotations = (Hashtable)_annotations.Clone();
			clone._name = _name;
			return clone;


		}
Ejemplo n.º 6
0
		public override void OnNamespaceDeclaration(NamespaceDeclaration node)
		{
			_namespace = new CodeNamespace(node.Name);
			_compileUnit.Namespaces.Add(_namespace);
		}
Ejemplo n.º 7
0
 public override void OnNamespaceDeclaration(NamespaceDeclaration node)
 {
     WriteKeyword("namespace");
     WriteLine(" {0}", node.Name);
     WriteLine();
 }