JFlex
Class RegExp
public class RegExp
extends java.lang.Object
Stores a regular expression of rules section in a JFlex-specification.
This base class has no content other than its type.
RegExp(int type) - Create a new regular expression of the specified type.
|
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.
|
String | print(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 String | revString(String s)
|
int | size(Macros macros) - The approximate number of NFA states this expression will need (only
works correctly after macro expansion and without negation)
|
String | toString() - Returns a String-representation of this regular expression
|
RegExp
public RegExp(int type)
Create a new regular expression of the specified type.
type
- a value from the cup generated class sym.
anyChar
public RegExp anyChar()
Returns a regexp that matches any character: [^]
isCharClass
public boolean isCharClass(Macros macros)
Find out if this regexp is a char class or equivalent to one.
macros
- for macro expansion
- true if the regexp is equivalent to a char class.
print
public String print(String tab)
Returns a String-representation of this regular expression
with the specified indentation.
tab
- a String that should contain only space characters and
that is inserted in front of standard String-representation
pf this object.
resolveTilde
public final RegExp resolveTilde(Macros macros)
Recursively convert tilde (upto) expressions into negation and star.
macros
- the macro table for expansion.
- new RegExp equivalent to the current one, but without upto expressions.
rev
public final RegExp rev(Macros macros)
Create a new regexp that matches the reverse text of this one.
revString
public static final String revString(String s)
- the reverse of the specified string.
size
public int size(Macros macros)
The approximate number of NFA states this expression will need (only
works correctly after macro expansion and without negation)
macros
- macro table for expansion
toString
public String toString()
Returns a String-representation of this regular expression