Exemplo n.º 1
0
        public virtual object VisitUsingDirective(UsingDirectiveNode @using, object data)
        {
            stackMap.Push(@using);
            if (@using.AliasName != null)
            {
                @using.AliasName.AcceptVisitor(this, data);
            }
            @using.Target.AcceptVisitor(this, data);

            stackMap.Pop();
            return(null);
        }
Exemplo n.º 2
0
		private void ParseUsingDirectives()									
		{
			do
			{
				Advance();
                UsingDirectiveNode node = new UsingDirectiveNode(curtok);

				QualifiedIdentifierExpression nameOrAlias = ParseQualifiedIdentifier(true, false, false);
				if (curtok.ID == TokenID.Equal)
				{
					Advance();

                    // an alias could be write like 
                    // using alias = path.identifier
                    //
                    // or like
                    // using alias = path.identifier<object>
                    //
                    // is not possible to know before if this a type or an qualified identifier
                    // so we always parse it as a Qualified expression, and if the result is not a type
                    // we keep only the identifier part

                    QualifiedIdentifierExpression target = ParseQualifiedIdentifier(true, false, false);

                    if (target.IsType)
                    {
                        node.Target = new TypeNode( target );
                    }
                    else
                    {
                        // it does not mean that this is not a type.
                        // it only means that actually we can not resolve the type
                        // but in a next stage, we wiil probably resolve it as a type.
                        node.Target = target;
                    }
                    

					node.AliasName = nameOrAlias;
				}
				else
				{
					node.Target = nameOrAlias;
				}

				AssertAndAdvance(TokenID.Semi);

                namespaceStack.Peek().UsingDirectives.Add(node);

                this.currentContext.AddUsingDirective(node);

			} while (curtok.ID == TokenID.Using);
		}
Exemplo n.º 3
0
        public virtual object VisitUsingDirective(UsingDirectiveNode @using, object data)
        {
            stackMap.Push(@using);
            if (@using.AliasName != null)
            {
                @using.AliasName.AcceptVisitor(this, data);
            }
             @using.Target.AcceptVisitor(this, data);

             stackMap.Pop();
             return null;

        }