public class Replace extends AbstractFaAction
FaAction
which replaces the matched input
with a fixed string.Constructor and Description |
---|
Replace(java.lang.String s)
calls the 2 parameter constructor with
priority==0 . |
Replace(java.lang.String s,
int prio)
creates an
FaAction with the given priority which
replaces the matched text with the string given. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object _o) |
int |
hashCode() |
void |
invoke(java.lang.StringBuilder out,
int start,
DfaRun runner)
is called by methods of
DfaRun in case of a
match. |
java.lang.String |
toString() |
mergeWith, setPriority
public Replace(java.lang.String s)
priority==0
.public Replace(java.lang.String s, int prio)
FaAction
with the given priority which
replaces the matched text with the string given.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
.
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object _o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object