Exemplo n.º 1
0
		public override void Visit(DynamicBackReference expression)
		{
			terminal.Peek().Append(@"\k<");
			terminal.Peek().Append(expression.BackReferenceName);
			terminal.Peek().Append(">");
			if (!expression.IsCaseSensitive)
			{
				terminal.Peek().Append("[");
				terminal.Peek().Append(@"\i");
				terminal.Peek().Append("]");
			}
		}
Exemplo n.º 2
0
		public override void Visit(DynamicBackReference expression)
		{
			String backreferencename = expression.BackReferenceName;
			Boolean isCaseSensitive = expression.IsCaseSensitive;

			_matchStack.Push(
				delegate(IInputIterator iterator)
				{
					var matchBytes = new Byte[1];
					if (_xmlDisableBackReferencePop.Count <= 0)
						matchBytes = _xmlBackReferenceLookup[backreferencename].Pop();
					else
						matchBytes = _xmlBackReferenceLookup[backreferencename].Peek();


					foreach (Byte c in matchBytes)
					{
						if (isCaseSensitive)
						{
							if (iterator.Current() != c)
							{
								iterator.Next();
								return false;
							}
						}
						else
						{
							var builder = new StringBuilder();
							builder.Append((Char)iterator.Current());
							if (builder.ToString().ToUpper() != c.ToString().ToUpper())
							{
								iterator.Next();
								return false;
							}
						}
						iterator.Next();
					}

					return true;
				}
				);
		}
Exemplo n.º 3
0
 public abstract void Visit(DynamicBackReference expression);