public class RegExpConcat extends RegExpTwo
NN, NO, NP, NR, NS, NX, ON, OO, OP, OR, OS, OX, PN, PO, PP, PR, PS, PX, RN, RO, RP, RR, RS, RX, SN, SO, SP, SR, SS, SX, XN, XO, XP, XR, XS, XXBINARY_EXP, CHOICE_EXP, CONCAT_EXP, EMPTY, EMPTY_EXP, OPTION_EXP, PLUS_EXP, POWER_EXP, RANGE_EXP, STAR_EXP, SYMBOL_EXP, UNARY_EXP| Constructor and Description |
|---|
RegExpConcat(RegExp left,
RegExp right)
Constructs a RegExpConcat with the two specified
RegExp's.
|
| Modifier and Type | Method and Description |
|---|---|
RegExp |
deepCopy()
This returns a deep copy of this RegExp.
|
RegExp |
normalize()
This returns this RegExpConcat's
normal form according to the following (conditional) rewrite rules.
|
RegExp |
shallowCopy()
This returns a shallow copy of this RegExp.
|
java.lang.String |
toString()
Returns a printable form for this RegExpConcat.
|
int |
type()
This returns the specific type identifying this RegExp.
|
equals, getLeft, getRight, normalLeft, normalRightpublic final RegExp shallowCopy()
RegExpshallowCopy in class RegExppublic final RegExp deepCopy()
RegExppublic final int type()
RegExppublic RegExp normalize()
These rules are categorized into three subgroups, depending on the nature of this RegExpConcat's left() and right() components, corresponding to the three following cases:
| _._ | X | X? | X+ | X\* | X^q | X_p^q | ||||||||||||
| X |
|
|
|
|
|
|
||||||||||||
| X? |
|
|
|
|
|
|
||||||||||||
| X+ |
|
|
|
|
|
|
||||||||||||
| X\* |
|
|
|
|
|
|
||||||||||||
| X^n |
|
|
|
|
|
|
||||||||||||
| X_m^n |
|
|
|
|
|
|
The entries in red are never used as they are systematically preempted earlier by the the X/X case. Indeed, it is never possible for matchingPairCode() to return any of the values OO, PP, SS, NN, nor RR. Therefore, the 10 corresponding rules [CO:OO1], [CO:OO2], [CO:PP1], [CO:PP2], [CO:SS1], [CO:SS2], [CO:NN1], [CO:NN2], [CO:RR1], and [CO:RR2] are redundant and could be eliminated altogether. As a matter of fact, each is confluent with the effect of applying the CO:XX rule followed by the appropriate PW:_ rule. This can be trivially verified by looking at the appropriate rules. The redundant rules are given here for the sake of completeness and for the justification of correctness of this specification. ********************************************************************
public final java.lang.String toString()
toString in class java.lang.Object