예제 #1
0
 /**
  * Prints this element to the specified output stream.
  *
  * @param output         the output stream to use
  * @param indent         the current indentation
  */
 public override void PrintTo(TextWriter output, string indent)
 {
     output.WriteLine(indent + "Alternative 1");
     elem1.PrintTo(output, indent + "  ");
     output.WriteLine(indent + "Alternative 2");
     elem2.PrintTo(output, indent + "  ");
 }
예제 #2
0
 /**
  * Prints this element to the specified output stream.
  *
  * @param output         the output stream to use
  * @param indent         the current indentation
  */
 public override void PrintTo(TextWriter output, string indent)
 {
     output.Write(indent + "Repeat (" + min + "," + max + ")");
     if (type == RepeatType.RELUCTANT)
     {
         output.Write("?");
     }
     else if (type == RepeatType.POSSESSIVE)
     {
         output.Write("+");
     }
     output.WriteLine();
     elem.PrintTo(output, indent + "  ");
 }
예제 #3
0
        /**
         * Returns a string representation of the regular expression.
         *
         * @return a string representation of the regular expression
         */
        public override string ToString()
        {
            StringWriter str;

            str = new StringWriter();
            str.WriteLine("Regular Expression");
            str.WriteLine("  Pattern: " + pattern);
            str.Write("  Flags:");
            if (ignoreCase)
            {
                str.Write(" caseignore");
            }
            str.WriteLine();
            str.WriteLine("  Compiled:");
            element.PrintTo(str, "    ");
            return(str.ToString());
        }
예제 #4
0
 /**
  * Prints this element to the specified output stream.
  *
  * @param output         the output stream to use
  * @param indent         the current indentation
  */
 public override void PrintTo(TextWriter output, string indent)
 {
     elem1.PrintTo(output, indent);
     elem2.PrintTo(output, indent);
 }