Package org.apache.regexp
Class REDebugCompiler
java.lang.Object
org.apache.regexp.RECompiler
org.apache.regexp.REDebugCompiler
A subclass of RECompiler which can dump a regular expression program
for debugging purposes.
- Version:
- $Id: REDebugCompiler.java 518169 2007-03-14 15:03:35Z vgritsenko $
- Author:
- Jonathan Locke
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.regexp.RECompiler
RECompiler.RERange -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static HashtableMapping from opcodes to descriptive stringsFields inherited from class org.apache.regexp.RECompiler
bracketMin, bracketOpt, bracketUnbounded, ESC_BACKREF, ESC_CLASS, ESC_COMPLEX, ESC_MASK, hashPOSIX, idx, instruction, len, lenInstruction, NODE_NORMAL, NODE_NULLABLE, NODE_TOPLEVEL, parens, pattern -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) StringcharToString(char c) Return a string describing a (possibly unprintable) character.voidDumps the current program to aSystem.out.voidDumps the current program to aPrintWriter.(package private) StringnodeToString(int node) Returns a descriptive string for a node in a regular expression program.(package private) StringopcodeToString(char opcode) Returns a descriptive string for an opcode.Methods inherited from class org.apache.regexp.RECompiler
atom, bracket, branch, characterClass, closure, compile, emit, ensure, escape, expr, internalError, node, nodeInsert, setNextOfEnd, syntaxError, terminal
-
Field Details
-
hashOpcode
Mapping from opcodes to descriptive strings
-
-
Constructor Details
-
REDebugCompiler
public REDebugCompiler()
-
-
Method Details
-
opcodeToString
Returns a descriptive string for an opcode.- Parameters:
opcode- Opcode to convert to a string- Returns:
- Description of opcode
-
charToString
Return a string describing a (possibly unprintable) character.- Parameters:
c- Character to convert to a printable representation- Returns:
- String representation of character
-
nodeToString
Returns a descriptive string for a node in a regular expression program.- Parameters:
node- Node to describe- Returns:
- Description of node
-
dumpProgram
Dumps the current program to aPrintWriter.- Parameters:
p- PrintWriter for program dump output
-
dumpProgram
public void dumpProgram()Dumps the current program to aSystem.out.
-