예제 #1
0
        /// <summary>
        /// Visists the given visitor with the specified reference.
        /// </summary>
        public static bool Accept(IReferenceNode reference, ISolutionVisitor visitor)
        {
            if (visitor.VisitEnter(reference))
            {
                foreach (var node in reference.Nodes)
                {
                    if (!node.Accept(visitor))
                    {
                        break;
                    }
                }
            }

            return(visitor.VisitLeave(reference));
        }
예제 #2
0
 /// <summary>
 /// Adapts a <see cref="IReferenceNode"/> to an <see cref="IVsHierarchy"/>.
 /// </summary>
 /// <returns>The <see cref="IVsHierarchy"/> or <see langword="null"/> if conversion is not possible.</returns>
 public static IVsHierarchy AsVsHierarchy(this IReferenceNode reference) => reference.As <IVsHierarchy>();
예제 #3
0
        /// <summary>
        /// Visists the given visitor with the specified reference.
        /// </summary>
        public static bool Accept(IReferenceNode reference, ISolutionVisitor visitor)
        {
            if (visitor.VisitEnter(reference))
            {
                foreach (var node in reference.Nodes)
                {
                    if (!node.Accept(visitor))
                        break;
                }
            }

            return visitor.VisitLeave(reference);
        }
예제 #4
0
 /// <summary>
 /// Ends visiting a project reference.
 /// </summary>
 /// <param name="reference">The project reference being visited.</param>
 /// <returns>
 ///   <see langword="true" /> if the project reference siblings should be visited; <see langword="false" /> otherwise.
 /// </returns>
 public virtual bool VisitLeave(IReferenceNode reference)
 {
     return(true);
 }
예제 #5
0
 /// <summary>
 /// Begins visiting a project reference.
 /// </summary>
 /// <param name="reference">The project reference being visited.</param>
 /// <returns>
 ///   <see langword="true" /> if the project reference children should be visited; <see langword="false" /> otherwise.
 /// </returns>
 public virtual bool VisitEnter(IReferenceNode reference)
 {
     return(true);
 }
예제 #6
0
 /// <summary>
 /// Begins visiting a project reference.
 /// </summary>
 /// <param name="reference">The project reference being visited.</param>
 /// <returns>
 ///   <see langword="true" /> if the project reference children should be visited; <see langword="false" /> otherwise.
 /// </returns>
 public virtual bool VisitEnter(IReferenceNode reference) => true;
예제 #7
0
 public bool VisitEnter(IReferenceNode reference) => false;
		public bool VisitEnter(IReferenceNode reference) => false;
예제 #9
0
 /// <summary>
 /// Begins visiting a project reference.
 /// </summary>
 /// <param name="reference">The project reference being visited.</param>
 /// <returns>
 ///   <see langword="true" /> if the project reference children should be visited; <see langword="false" /> otherwise.
 /// </returns>
 public virtual bool VisitEnter(IReferenceNode reference)
 {
     return true;
 }
예제 #10
0
 public bool VisitLeave(IReferenceNode reference)
 {
     throw new NotSupportedException();
 }
예제 #11
0
		public bool VisitLeave (IReferenceNode reference)
		{
			throw new NotSupportedException ();
		}
예제 #12
0
		/// <summary>
		/// Ends visiting a project reference.
		/// </summary>
		/// <param name="reference">The project reference being visited.</param>
		/// <returns>
		///   <see langword="true" /> if the project reference siblings should be visited; <see langword="false" /> otherwise.
		/// </returns>
		public virtual bool VisitLeave (IReferenceNode reference) => true;
예제 #13
0
		/// <summary>
		/// Begins visiting a project reference.
		/// </summary>
		/// <param name="reference">The project reference being visited.</param>
		/// <returns>
		///   <see langword="true" /> if the project reference children should be visited; <see langword="false" /> otherwise.
		/// </returns>
		public virtual bool VisitEnter (IReferenceNode reference) => true;
예제 #14
0
 /// <summary>
 /// Ends visiting a project reference.
 /// </summary>
 /// <param name="reference">The project reference being visited.</param>
 /// <returns>
 ///   <see langword="true" /> if the project reference siblings should be visited; <see langword="false" /> otherwise.
 /// </returns>
 public virtual bool VisitLeave(IReferenceNode reference) => true;
예제 #15
0
 /// <summary>
 /// Adapts a <see cref="IReferenceNode"/> to a VsLang <see cref="Reference"/>.
 /// </summary>
 /// <returns>The <see cref="Reference"/> or <see langword="null"/> if conversion is not possible.</returns>
 public static Reference AsReference(this IReferenceNode reference) => reference.As <Reference>();
예제 #16
0
 /// <summary>
 /// Ends visiting a project reference.
 /// </summary>
 /// <param name="reference">The project reference being visited.</param>
 /// <returns>
 ///   <see langword="true" /> if the project reference siblings should be visited; <see langword="false" /> otherwise.
 /// </returns>
 public virtual bool VisitLeave(IReferenceNode reference)
 {
     return true;
 }
예제 #17
0
 /// <summary>
 /// Adapts a <see cref="IReferenceNode"/> to an <see cref="IVsHierarchyItem"/>.
 /// </summary>
 /// <returns>The <see cref="IVsHierarchyItem"/> or <see langword="null"/> if conversion is not possible.</returns>
 public static IVsHierarchyItem AsVsHierarchyItem(this IReferenceNode reference) => reference.As <IVsHierarchyItem>();
예제 #18
0
 private void AddrOfLocalVariableNode(IReferenceNode value)
 {
     VarInfo vi = helper.GetVariable(value.Variable);
     if (vi.kind == VarKind.vkLocal)
     {
         LocalBuilder lb = vi.lb;
         il.Emit(OpCodes.Ldloca, lb);
     }
     else if (vi.kind == VarKind.vkNonLocal)
     {
         FieldBuilder fb = vi.fb;
         MethInfo cur_mi = smi.Peek();
         int dist = (smi.Peek()).num_scope - vi.meth.num_scope;
         il.Emit(OpCodes.Ldloc, cur_mi.frame);
         for (int i = 0; i < dist; i++)
         {
             il.Emit(OpCodes.Ldfld, cur_mi.disp.parent);
             cur_mi = cur_mi.up_meth;
         }
         il.Emit(OpCodes.Ldflda, fb);
     }
 }
		public bool VisitLeave(IReferenceNode reference) => false;
 public virtual void Visit(IReferenceNode node)
 {
    DefaultVisit(node);
 }
예제 #21
0
 public bool VisitLeave(IReferenceNode reference) => false;
예제 #22
0
 /// <summary>
 /// Adapts the specified reference to supported target types.
 /// </summary>
 /// <param name="reference">The reference to adapt.</param>
 /// <returns>The entry point that exposes supported target types.</returns>
 public static IAdaptable <IReferenceNode> Adapt(this IReferenceNode reference)
 {
     return(new TreeNodeAdaptable <IReferenceNode>(reference));
 }