public class TailContextN extends AbstractFaAction
FaAction
which pushes a trailing context back
into the input and then calls a client action.
into two fixed strings.Constructor and Description |
---|
TailContextN(int n)
creates an
FaAction to push back the given number of
characters into the input and leaves the rest of the match
untouched. |
TailContextN(int n,
FaAction client)
creates an
FaAction to push back the given number of
characters into the input and then calls the given action. |
Modifier and Type | Method and Description |
---|---|
void |
invoke(java.lang.StringBuilder out,
int start,
DfaRun r)
is called by methods of
DfaRun in case of a
match. |
mergeWith, setPriority
public TailContextN(int n, FaAction client)
creates an FaAction
to push back the given number of
characters into the input and then calls the given action.
n
- is the number of characters to push back. This must
≥0. While n==0
is allowed, it is obviously a
waste of time.client
- is the action to call. It may be null
which is equivalent to Copy
.public TailContextN(int n)
creates an FaAction
to push back the given number of
characters into the input and leaves the rest of the match
untouched. When the callback is called, there must be enough
characters to push back.
public void invoke(java.lang.StringBuilder out, int start, DfaRun r) throws CallbackException
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
.
CallbackException