Modifier and Type | Field and Description |
---|---|
(package private) int |
type
The type of the regular expression.
|
Constructor and Description |
---|
RegExp(int type)
Create a new regular expression of the specified type.
|
Modifier and Type | Method and Description |
---|---|
RegExp |
anyChar()
Returns a regexp that matches any character:
[^] |
boolean |
isCharClass(Macros macros)
Find out if this regexp is a char class or equivalent to one.
|
java.lang.String |
print(java.lang.String tab)
Returns a String-representation of this regular expression with the specified indentation.
|
RegExp |
resolveTilde(Macros macros)
Recursively convert tilde (upto) expressions into negation and star.
|
RegExp |
rev(Macros macros)
Create a new regexp that matches the reverse text of this one.
|
static java.lang.String |
revString(java.lang.String s)
revString.
|
int |
size(Macros macros)
The approximate number of NFA states this expression will need (only works correctly after
macro expansion and without negation)
|
java.lang.String |
toString()
Returns a String-representation of this regular expression
|
int type
public RegExp(int type)
type
- a value from the cup generated class sym.sym
public java.lang.String print(java.lang.String tab)
tab
- a String that should contain only space characters and that is inserted in front of
standard String-representation pf this object.String
object.public java.lang.String toString()
toString
in class java.lang.Object
String
object.public boolean isCharClass(Macros macros)
macros
- for macro expansionpublic int size(Macros macros)
macros
- macro table for expansionpublic static final java.lang.String revString(java.lang.String s)
s
- a String
object.String
object.public final RegExp resolveTilde(Macros macros)
macros
- the macro table for expansion.public RegExp anyChar()
[^]
[^]