org.apache.regexp

Class REDebugCompiler

public class REDebugCompiler extends RECompiler

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

Field Summary
static HashtablehashOpcode
Mapping from opcodes to descriptive strings
Method Summary
StringcharToString(char c)
Return a string describing a (possibly unprintable) character.
voiddumpProgram(PrintWriter p)
Dumps the current program to a PrintWriter.
voiddumpProgram()
Dumps the current program to a System.out.
StringnodeToString(int node)
Returns a descriptive string for a node in a regular expression program.
StringopcodeToString(char opcode)
Returns a descriptive string for an opcode.

Field Detail

hashOpcode

static Hashtable hashOpcode
Mapping from opcodes to descriptive strings

Method Detail

charToString

String charToString(char c)
Return a string describing a (possibly unprintable) character.

Parameters: c Character to convert to a printable representation

Returns: String representation of character

dumpProgram

public void dumpProgram(PrintWriter p)
Dumps the current program to a PrintWriter.

Parameters: p PrintWriter for program dump output

dumpProgram

public void dumpProgram()
Dumps the current program to a System.out.

nodeToString

String nodeToString(int node)
Returns a descriptive string for a node in a regular expression program.

Parameters: node Node to describe

Returns: Description of node

opcodeToString

String opcodeToString(char opcode)
Returns a descriptive string for an opcode.

Parameters: opcode Opcode to convert to a string

Returns: Description of opcode

Copyright © 2001-2007 Apache Software Foundation. All Rights Reserved.