Example #1
0
 private static Expression ResolveNamespaceExpression(Namespace parentNamespace, Expression expression)
 {
     if (expression is UnresolvedRef)
     {
         // Find any existing or create the namespace
         UnresolvedRef unresolvedRef = (UnresolvedRef)expression;
         Namespace     @namespace    = parentNamespace.FindOrCreateChildNamespace(unresolvedRef.Name);
         @namespace.SetDeclarationsInProject(true);
         expression = @namespace.CreateRef();
     }
     else if (expression is Dot)
     {
         // If multiple namespaces are specified, resolve from left to right
         Dot dot = (Dot)expression;
         dot.Left  = ResolveNamespaceExpression(parentNamespace, dot.Left);
         dot.Right = ResolveNamespaceExpression(((NamespaceRef)dot.Left.SkipPrefixes()).Namespace, dot.Right);
     }
     return(expression);
 }
 /// <summary>
 /// Create a <see cref="Lookup"/> operator.
 /// </summary>
 public Lookup(Namespace left, Expression right)
     : base(left.CreateRef(), right)
 {
 }