public class UpperCase extends AbstractFaAction
implements an FaAction
which applies
Character.toUpperCase
to every character of the
match.
Hint: Instead of attaching this callback to the regular
expression "[a-z]"
, rather use "[a-z]+"
to save some callbacks.
Modifier and Type | Field and Description |
---|---|
static FaAction |
UPPERCASE
a predefined
FaAction with priority 0 which applies
Character.toUpperCase() to every character of the
match. |
Constructor and Description |
---|
UpperCase(int prio) |
Modifier and Type | Method and Description |
---|---|
void |
invoke(java.lang.StringBuilder out,
int start,
DfaRun runner)
is called by methods of
DfaRun in case of a
match. |
mergeWith, setPriority
public static final FaAction UPPERCASE
public void invoke(java.lang.StringBuilder out, int start, DfaRun runner)
FaAction
is called by methods of DfaRun
in case of a
match. Parameter yytext
contains the matching text
from position start
onwards. The callback may change
the whole of yytext
, but the under most
circumstances, only the matching text should be
changed. Parameter runner
is the DfaRun
object which called this function. Of interest are its fields
DfaRun.clientData
and DfaRun.collect
.