Ejemplo n.º 1
0
 public override bool Contains(ParserContainsArgs args)
 {
     if (base.Contains(args))
         return true;
     if (Inner != null && args.Push(this))
     {
         var ret = Inner.Contains(args);
         args.Pop();
         return ret;
     }
     return false;
 }
Ejemplo n.º 2
0
 public override bool Contains(ParserContainsArgs args)
 {
     if (base.Contains(args))
     {
         return(true);
     }
     if (Inner != null && args.Push(this))
     {
         var ret = Inner.Contains(args);
         args.Pop();
         return(ret);
     }
     return(false);
 }
Ejemplo n.º 3
0
 public override bool IsLeftRecursive(ParserContainsArgs args)
 {
     if (base.IsLeftRecursive(args))
     {
         return(true);
     }
     if (Inner != null)
     {
         if (args.Push(this))
         {
             var ret = Inner.IsLeftRecursive(args);
             args.Pop();
             return(ret);
         }
         return(false);
     }
     return(false);
 }
Ejemplo n.º 4
0
		public override bool Contains(ParserContainsArgs args)
		{
			if (base.Contains(args))
				return true;
			if (args.Push(this))
			{
				foreach (var item in Items)
				{
					if (item != null && item.Contains(args))
					{
						args.Pop();
						return true;
					}
				}
				args.Pop();
			}
			return false;
		}
Ejemplo n.º 5
0
 public override bool Contains(ParserContainsArgs args)
 {
     if (base.Contains(args))
     {
         return(true);
     }
     if (args.Push(this))
     {
         foreach (var item in Items)
         {
             if (item != null && item.Contains(args))
             {
                 args.Pop();
                 return(true);
             }
         }
         args.Pop();
     }
     return(false);
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Determines whether this instance is left recursive with the specified parser
 /// </summary>
 /// <remarks>
 /// This variant can be overridden by implementors to determine left recursion. Use the <paramref name="args"/>
 /// to ensure infinite recursion does not occur using Push/Pop.
 /// </remarks>
 /// <returns><c>true</c> if this instance is left recursive the specified parser; otherwise, <c>false</c>.</returns>
 /// <param name="args">Arguments for finding the left recursion</param>
 public virtual bool IsLeftRecursive(ParserContainsArgs args)
 {
     return(object.ReferenceEquals(args.Parser, this));
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Gets a value indicating that a parser is contained within this instance
 /// </summary>
 /// <param name="args">Arguments specifying which parser to search for and recursion</param>
 public virtual bool Contains(ParserContainsArgs args)
 {
     return(args.Parser == this);
 }
Ejemplo n.º 8
0
 public override bool IsLeftRecursive(ParserContainsArgs args)
 {
     if (base.IsLeftRecursive(args))
         return true;
     if (Inner != null)
     {
         if (args.Push(this))
         {
             var ret = Inner.IsLeftRecursive(args);
             args.Pop();
             return ret;
         }
         return false;
     }
     return false;
 }