|
Parser v2.1 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Parser.REProcessor
The REProcessor class handles processing of regular expression groups. For instance, it is often useful to match regular expression A and not match regular expression B, or match A as many times as possible. In other words, this class allows rules to be treated as elements of a regular expression. (i.e. English ::= Sentence*). Unary operations include: star (A*), plus (A+), maybe (A?), and follow (A). Binary operations include: andnot (A-B), or (A|B), and follow (AB).
Field Summary | |
protected static byte |
ANDNOT
Denotes the and-not option. |
protected static byte |
FOLLOW
Denotes the follow option. |
protected static byte |
MAYBE
Denotes the ? option. |
protected static byte |
OR
Denotes the or option. |
protected static byte |
PLUS
Denotes the + option. |
protected static byte |
STAR
Denotes the * option. |
Constructor Summary | |
REProcessor()
Empty constructor |
|
REProcessor(java.lang.Object A,
java.lang.Object B,
byte mode)
Constructs a new REProcessor with the specified objects to be matched and a specified mode of operation. |
Method Summary | |
RETree |
beginningMatches(java.lang.String input)
Returns a tree if the beginning of the specified string is matched, otherwise returns null. |
protected RETree |
evaluate(java.lang.Object automaton,
java.lang.String input)
Returns the result of beginningMatches for the appropriate type (RE or REProcessor). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final byte ANDNOT
protected static final byte OR
protected static final byte FOLLOW
protected static final byte STAR
protected static final byte PLUS
protected static final byte MAYBE
Constructor Detail |
public REProcessor()
public REProcessor(java.lang.Object A, java.lang.Object B, byte mode)
A
- the left hand side of the operation.B
- the right hand side of the operation.mode
- the mode of operation.Method Detail |
public RETree beginningMatches(java.lang.String input) throws java.lang.Exception
input
- the string to be tested and parsed.protected RETree evaluate(java.lang.Object automaton, java.lang.String input) throws java.lang.Exception
automaton
- the RE or REProcessor to call beginningMatches on.input
- the string to be tested and parsed.
|
Parser v2.1 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |