Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.jcorporate.expresso.ext.regexp
Class RECompiler  view RECompiler download RECompiler.java

java.lang.Object
  extended bycom.jcorporate.expresso.ext.regexp.RECompiler

Deprecated. since v5.6, use jakarta oro

public class RECompiler
extends java.lang.Object

A regular expression compiler class. This class compiles a pattern string into a regular expression program interpretable by the RE evaluator class. The 'recompile' command line tool uses this compiler to pre-compile regular expressions for use with RE. For a description of the syntax accepted by RECompiler and what you can do with regular expressions, see the documentation for the RE matcher class.

Version:
$Id: RECompiler.java,v 1.7 2004/11/17 20:48:15 lhamel Exp $

Nested Class Summary
(package private)  class RECompiler.RERange
          Deprecated. Local, nested class for maintaining character ranges for character classes.
 
Field Summary
(package private) static int[] bracketEnd
          Deprecated.  
(package private) static int bracketFinished
          Deprecated.  
(package private) static int[] bracketMin
          Deprecated.  
(package private) static int[] bracketOpt
          Deprecated.  
(package private) static int brackets
          Deprecated.  
(package private) static int[] bracketStart
          Deprecated.  
(package private) static int bracketUnbounded
          Deprecated.  
(package private) static char ESC_BACKREF
          Deprecated.  
(package private) static char ESC_CLASS
          Deprecated.  
(package private) static char ESC_COMPLEX
          Deprecated.  
(package private) static char ESC_MASK
          Deprecated.  
(package private) static java.util.Hashtable hashPOSIX
          Deprecated.  
(package private)  int idx
          Deprecated.  
(package private)  char[] instruction
          Deprecated.  
(package private)  int len
          Deprecated.  
(package private)  int lenInstruction
          Deprecated.  
(package private) static int maxBrackets
          Deprecated.  
(package private) static int NODE_NORMAL
          Deprecated.  
(package private) static int NODE_NULLABLE
          Deprecated.  
(package private) static int NODE_TOPLEVEL
          Deprecated.  
(package private)  int parens
          Deprecated.  
(package private)  java.lang.String pattern
          Deprecated.  
 
Constructor Summary
RECompiler()
          Deprecated. Constructor.
 
Method Summary
(package private)  void allocBrackets()
          Deprecated. Allocate storage for brackets only as needed
(package private)  int atom()
          Deprecated. Absorb an atomic character string.
(package private)  void bracket()
          Deprecated. Match bracket {m,n} expression put results in bracket member variables
(package private)  int branch(int[] flags)
          Deprecated. Compile one branch of an or operator (implements concatenation)
(package private)  int characterClass()
          Deprecated. Compile a character class
(package private)  int closure(int[] flags)
          Deprecated. Compile a possibly closured terminal
 REProgram compile(java.lang.String pattern)
          Deprecated. Compiles a regular expression pattern into a program runnable by the pattern matcher class 'RE'.
(package private)  void emit(char c)
          Deprecated. Emit a single character into the program stream.
(package private)  void ensure(int n)
          Deprecated. Ensures that n more characters can fit in the program buffer.
(package private)  char escape()
          Deprecated. Match an escape sequence.
(package private)  int expr(int[] flags)
          Deprecated. Compile an expression with possible parens around it.
(package private)  void internalError()
          Deprecated. Throws a new internal error exception
(package private)  int node(char opcode, int opdata)
          Deprecated. Adds a new node
(package private)  void nodeInsert(char opcode, int opdata, int insertAt)
          Deprecated. Inserts a node with a given opcode and opdata at insertAt.
(package private)  void setNextOfEnd(int node, int pointTo)
          Deprecated. Appends a node to the end of a node chain
(package private)  void syntaxError(java.lang.String s)
          Deprecated. Throws a new syntax error exception
(package private)  int terminal(int[] flags)
          Deprecated. Match a terminal node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instruction

char[] instruction
Deprecated. 

lenInstruction

int lenInstruction
Deprecated. 

pattern

java.lang.String pattern
Deprecated. 

len

int len
Deprecated. 

idx

int idx
Deprecated. 

parens

int parens
Deprecated. 

NODE_NORMAL

static final int NODE_NORMAL
Deprecated. 
See Also:
Constant Field Values

NODE_NULLABLE

static final int NODE_NULLABLE
Deprecated. 
See Also:
Constant Field Values

NODE_TOPLEVEL

static final int NODE_TOPLEVEL
Deprecated. 
See Also:
Constant Field Values

ESC_MASK

static final char ESC_MASK
Deprecated. 
See Also:
Constant Field Values

ESC_BACKREF

static final char ESC_BACKREF
Deprecated. 
See Also:
Constant Field Values

ESC_COMPLEX

static final char ESC_COMPLEX
Deprecated. 
See Also:
Constant Field Values

ESC_CLASS

static final char ESC_CLASS
Deprecated. 
See Also:
Constant Field Values

maxBrackets

static final int maxBrackets
Deprecated. 
See Also:
Constant Field Values

brackets

static int brackets
Deprecated. 

bracketStart

static int[] bracketStart
Deprecated. 

bracketEnd

static int[] bracketEnd
Deprecated. 

bracketMin

static int[] bracketMin
Deprecated. 

bracketOpt

static int[] bracketOpt
Deprecated. 

bracketUnbounded

static final int bracketUnbounded
Deprecated. 
See Also:
Constant Field Values

bracketFinished

static final int bracketFinished
Deprecated. 
See Also:
Constant Field Values

hashPOSIX

static java.util.Hashtable hashPOSIX
Deprecated. 
Constructor Detail

RECompiler

public RECompiler()
Deprecated. 
Constructor. Creates (initially empty) storage for a regular expression program.

Method Detail

allocBrackets

void allocBrackets()
Deprecated. 
Allocate storage for brackets only as needed


atom

int atom()
   throws RESyntaxException
Deprecated. 
Absorb an atomic character string. This method is a little tricky because it can un-include the last character of string if a closure operator follows. This is correct because *+? have higher precedence than concatentation (thus ABC* means AB(C*) and NOT (ABC)*).


bracket

void bracket()
       throws RESyntaxException
Deprecated. 
Match bracket {m,n} expression put results in bracket member variables


branch

int branch(int[] flags)
     throws RESyntaxException
Deprecated. 
Compile one branch of an or operator (implements concatenation)


characterClass

int characterClass()
             throws RESyntaxException
Deprecated. 
Compile a character class


closure

int closure(int[] flags)
      throws RESyntaxException
Deprecated. 
Compile a possibly closured terminal


compile

public REProgram compile(java.lang.String pattern)
                  throws RESyntaxException
Deprecated. 
Compiles a regular expression pattern into a program runnable by the pattern matcher class 'RE'.


emit

void emit(char c)
Deprecated. 
Emit a single character into the program stream.


ensure

void ensure(int n)
Deprecated. 
Ensures that n more characters can fit in the program buffer. If n more can't fit, then the size is doubled until it can.


escape

char escape()
      throws RESyntaxException
Deprecated. 
Match an escape sequence. Handles quoted chars and octal escapes as well as normal escape characters. Always advances the input stream by the right amount. This code "understands" the subtle difference between an octal escape and a backref. You can access the type of ESC_CLASS or ESC_COMPLEX or ESC_BACKREF by looking at pattern[idx - 1].


expr

int expr(int[] flags)
   throws RESyntaxException
Deprecated. 
Compile an expression with possible parens around it. Paren matching is done at this level so we can tie the branch tails together.


internalError

void internalError()
             throws java.lang.Error
Deprecated. 
Throws a new internal error exception


node

int node(char opcode,
         int opdata)
Deprecated. 
Adds a new node


nodeInsert

void nodeInsert(char opcode,
                int opdata,
                int insertAt)
Deprecated. 
Inserts a node with a given opcode and opdata at insertAt. The node relative next pointer is initialized to 0.


setNextOfEnd

void setNextOfEnd(int node,
                  int pointTo)
Deprecated. 
Appends a node to the end of a node chain


syntaxError

void syntaxError(java.lang.String s)
           throws RESyntaxException
Deprecated. 
Throws a new syntax error exception


terminal

int terminal(int[] flags)
       throws RESyntaxException
Deprecated. 
Match a terminal node.