org.apache.oro.text.regex
Class Perl5Debug

java.lang.Object
  |
  +--org.apache.oro.text.regex.Perl5Debug

public final class Perl5Debug
extends Object

Untamed: The Perl5Debug class is not intended for general use and should not be instantiated, but is provided because some users may find the output of its single method to be useful. The Perl5Compiler class generates a representation of a regular expression identical to that of Perl5 in the abstract, but not in terms of actual data structures. The Perl5Debug class allows the bytecode program contained by a Perl5Pattern to be printed out for comparison with the program generated by Perl5 with the -r option.

Version:
$Id: Perl5Debug.java,v 1.5 2001/12/02 06:01:41 markm Exp $
Author:
Daniel F. Savarese
See Also:
Perl5Pattern

Constructor Summary
private Perl5Debug()
          A dummy constructor to prevent instantiation of Perl5Debug.
 
Method Summary
(package private) static void _printOperator(char[] program, int offset, StringBuffer buffer)
           
static String printProgram(Perl5Pattern regexp)
          Enabled: This method prints to a String the bytecode program contained in a Perl5Pattern._ The program byte codes are identical to those generated by Perl5 with the -r option, but the offsets are different due to the different data structures used.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Perl5Debug

private Perl5Debug()
A dummy constructor to prevent instantiation of Perl5Debug.

Method Detail

printProgram

public static String printProgram(Perl5Pattern regexp)
Enabled: This method prints to a String the bytecode program contained in a Perl5Pattern._ The program byte codes are identical to those generated by Perl5 with the -r option, but the offsets are different due to the different data structures used. This method is useful for diagnosing suspected bugs. The Perl5Compiler class is designed to produce regular expression programs identical to those produced by Perl5. By comparing the output of this method and the output of Perl5 with the -r option on the same regular expression, you can determine if Perl5Compiler correctly compiled an expression.

Parameters:
regexp - The Perl5Pattern to print.
Returns:
A string representation of the bytecode program defining the regular expression.

_printOperator

static void _printOperator(char[] program,
                           int offset,
                           StringBuffer buffer)


comments?