public override object Visit(UsingDeclaration usingDeclaration, object data)
        {
            ProcessSpecials(usingDeclaration.Specials);

            ((CodeNamespace)namespaceDeclarations.Peek()).Imports.Add(new CodeNamespaceImport(usingDeclaration.Namespace));
            return null;
        }
 public override object Visit(UsingDeclaration usingDeclaration, object data)
 {
     DebugOutput(usingDeclaration);
     AppendIndentation();sourceText.Append("Imports ");
     sourceText.Append(usingDeclaration.Namespace);
     AppendNewLine();
     return null;
 }
 public override object Visit(UsingDeclaration usingDeclaration, object data)
 {
     Console.WriteLine(usingDeclaration.ToString());
     return usingDeclaration.AcceptChildren(this, data);
 }
 public virtual object Visit(UsingDeclaration usingDeclaration, object data)
 {
     return data;
 }
Пример #5
0
	void UsingDirective() {

#line  548 "cs.ATG" 
		usingNamespaces = new ArrayList();
		string qualident = null, aliasident = null;
		
		Expect(120);

#line  552 "cs.ATG" 
		Point startPos = t.Location;
		INode node     = null; 
		
		if (
#line  555 "cs.ATG" 
IsAssignment()) {
			lexer.NextToken();

#line  555 "cs.ATG" 
			aliasident = t.val; 
			Expect(3);
		}
		Qualident(
#line  556 "cs.ATG" 
out qualident);

#line  556 "cs.ATG" 
		if (qualident != null && qualident.Length > 0) {
		 if (aliasident != null) {
		   node = new UsingAliasDeclaration(aliasident, qualident);
		 } else {
		     usingNamespaces.Add(qualident);
		     node = new UsingDeclaration(qualident);
		 }
		}
		
		Expect(10);

#line  565 "cs.ATG" 
		node.StartLocation = startPos;
		node.EndLocation   = t.EndLocation;
		compilationUnit.AddChild(node);
		
	}
 public override object Visit(UsingDeclaration usingDeclaration, object data)
 {
     outputFormatter.Indent();
     outputFormatter.PrintToken(Tokens.Using);
     outputFormatter.Space();
     outputFormatter.PrintIdentifier(usingDeclaration.Namespace);
     outputFormatter.PrintToken(Tokens.Semicolon);
     outputFormatter.NewLine();
     return null;
 }