コード例 #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
         };
     }
 }
コード例 #2
0
ファイル: CheckIdentifiers.cs プロジェクト: w4x/boolangstudio
 public override void OnNamespaceDeclaration(NamespaceDeclaration node)
 {
     CheckName(node,node.Name);
 }
コード例 #3
0
ファイル: BooParserBase.cs プロジェクト: hlizard/boo
	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;
			}
		}
	}
コード例 #4
0
 public override void OnNamespaceDeclaration(NamespaceDeclaration node)
 {
     base.OnNamespaceDeclaration(node);
 }
コード例 #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;


		}
コード例 #6
0
		public override void OnNamespaceDeclaration(NamespaceDeclaration node)
		{
			_namespace = new CodeNamespace(node.Name);
			_compileUnit.Namespaces.Add(_namespace);
		}
コード例 #7
0
 public override void OnNamespaceDeclaration(NamespaceDeclaration node)
 {
     WriteKeyword("namespace");
     WriteLine(" {0}", node.Name);
     WriteLine();
 }