Package | Description |
---|---|
monq.jfa |
Implements Finite Automata, deterministic and
nondeterministic, with an engine for high throughput filtering of
text.
|
monq.jfa.actions |
contains general purpose classes to be used as callbacks in
finite automata created with package
monq.jfa . |
monq.jfa.ctx |
adds support for recursive parsing to jfa that in particular
allows easy XML parsing as an alternative to SAX.
|
Modifier and Type | Class and Description |
---|---|
class |
AbstractFaAction
implements the prototype of an
FaAction with initial
priority zero so that actions can be easily written as anonymous
classes. |
Modifier and Type | Field and Description |
---|---|
static FaAction |
DfaRun.EOF
returned by
next() on EOF. |
Modifier and Type | Method and Description |
---|---|
FaAction |
Dfa.match(CharSource in,
java.lang.StringBuilder out,
TextStore subMatches)
determine a matching prefix of
in and deliver
respective data. |
FaAction |
AbstractFaAction.mergeWith(FaAction _other) |
FaAction |
FaAction.mergeWith(FaAction other)
is eventually called by
Nfa.compile(monq.jfa.DfaRun.FailedMatchBehaviour, monq.jfa.FaAction) to create a
unified action from this object and another FaAction
object. |
FaAction |
DfaRun.next(java.lang.StringBuilder out)
finds the next match in the current input, appends it to
out and returns the FaAction associated with
the match. |
Modifier and Type | Method and Description |
---|---|
Nfa |
Nfa.addAction(FaAction a)
adds an action to the Nfa (expert only).
|
Dfa |
Nfa.compile(DfaRun.FailedMatchBehaviour fmb,
FaAction eofAction)
compiles this non-deterministic finite automaton into a
deterministic finite automaton.
|
Nfa |
Nfa.completeToSkip(FaAction noMatchAction)
extends the automaton with an additonal automaton which matches
everything but all non-empty prefixes of this automaton.
|
FaAction |
AbstractFaAction.mergeWith(FaAction _other) |
FaAction |
FaAction.mergeWith(FaAction other)
is eventually called by
Nfa.compile(monq.jfa.DfaRun.FailedMatchBehaviour, monq.jfa.FaAction) to create a
unified action from this object and another FaAction
object. |
Nfa |
Nfa.or(java.lang.CharSequence regex,
FaAction action)
adds the given regular expression
re to the
automaton and associates it with the given action. |
Nfa |
Nfa.seq(java.lang.CharSequence regex,
FaAction a)
extend the current automaton to recognize
regex
as a suffix of the strings already recognized and arrange for the
given action to be called if the suffix was recognized. |
static Dfa |
Misc.wrapRoi(java.lang.CharSequence reStart,
FaAction startAction,
DfaRun.FailedMatchBehaviour inRoi,
java.lang.CharSequence reEnd,
FaAction endAction,
DfaRun.FailedMatchBehaviour outsideRoi,
Nfa client)
wraps a
Nfa into another one which defines a region
of interest (ROI). |
Constructor and Description |
---|
Nfa(java.lang.CharSequence regex,
FaAction a)
creates an
Nfa from the given
regular expression and
assigns the given action to the stop state. |
Modifier and Type | Class and Description |
---|---|
class |
Call
|
class |
Copy
implements an
FaAction which merely copies matched input to
the output. |
class |
Count
counts matches and can then be used with
If to perform
conditional actions depending on whether a threshold count is
reached. |
class |
DefaultAction
provides an action that always returns the other action from
DefaultAction.mergeWith(monq.jfa.FaAction) . |
class |
Drop
implements an
FaAction which drops (deletes) matched
input. |
class |
Embed
implements an
FaAction which embeds the matched input
into two fixed strings. |
class |
Fail
implements an
FaAction which unconditionally throws a
CallbackException with the message specified in the
constructor. |
class |
Hold
hold back output until a decision can be made whether to ship or
to drop filtered output.
|
class |
If
|
class |
LowerCase
implements an
FaAction which applies
Character.toLowerCase to every character of the
match. |
class |
Printf
implements an
FaAction to apply a PrintfFormatter to the matched text. |
class |
Replace
implements an
FaAction which replaces the matched input
with a fixed string. |
class |
Run
runs several
FaAction objects, one after another. |
class |
SearchReplace
implements an
FaAction which scans the matched text for a
given regular expression and replaces those matches by applying a
PrintfFormatter . |
class |
Stop
|
class |
Store
an
FaAction to store away the match in a
Map . |
class |
SwitchDfa
|
class |
TailContextN
implements an
FaAction which pushes a trailing context back
into the input and then calls a client action. |
class |
UpperCase
implements an
FaAction which applies
Character.toUpperCase to every character of the
match. |
Modifier and Type | Field and Description |
---|---|
static FaAction |
Copy.COPY
a predefined
FaAction with priority 0 which merely copies
matched text unchanged to the output. |
static FaAction |
Unmatched.COPY
change the default behaviour of the calling
DfaRun to DfaRun.UNMATCHED_COPY . |
static FaAction |
Unmatched.DROP
change the default behaviour of the calling
DfaRun to DfaRun.UNMATCHED_DROP . |
static FaAction |
Drop.DROP
a predefined
FaAction with priority 0 which drops
(deletes) matched text such that nothing is transfered to the
output. |
static FaAction |
LowerCase.LOWERCASE
a predefined
FaAction with priority 0 which applies
Character.toLowerCase() to every character of the
match. |
static FaAction |
Stop.STOP
|
static FaAction |
Unmatched.THROW
change the default behaviour of the calling
DfaRun to DfaRun.UNMATCHED_THROW . |
static FaAction |
UpperCase.UPPERCASE
a predefined
FaAction with priority 0 which applies
Character.toUpperCase() to every character of the
match. |
Modifier and Type | Method and Description |
---|---|
FaAction |
DefaultAction.mergeWith(FaAction other)
always returns
other . |
Modifier and Type | Method and Description |
---|---|
Run |
Run.add(FaAction a)
adds the given action
a to the list of actions to
execute when invoke is called. |
FaAction |
DefaultAction.mergeWith(FaAction other)
always returns
other . |
Constructor and Description |
---|
DefaultAction(FaAction dflt) |
If(Verifier v,
FaAction thendo,
FaAction elsedo) |
Run(FaAction a0) |
Run(FaAction a0,
FaAction a1) |
Run(FaAction a0,
FaAction a1,
FaAction a2) |
Run(FaAction a0,
FaAction a1,
FaAction a2,
FaAction a3) |
SwitchDfa(FaAction action)
|
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 | Class and Description |
---|---|
class |
Context
manages a context when running a
DfaRun . |
class |
IfContext
|
Modifier and Type | Method and Description |
---|---|
FaAction |
IfContext.mergeWith(FaAction _other) |
Modifier and Type | Method and Description |
---|---|
IfContext |
IfContext.elsedo(FaAction a)
define the action to call when this object's invoke
method is called in a context for which no client action is
registered.
|
IfContext |
IfContext.ifthen(Context ctx,
FaAction a)
defines to call the given action when this object's invoke method
is called in the given context.
|
FaAction |
IfContext.mergeWith(FaAction _other) |
ContextManager |
ContextManager.setDefaultAction(FaAction a)
calls both,
setDefaultStartAction()
and setDefaultEndAction() with the
given action. |
ContextManager |
ContextManager.setDefaultEndAction(FaAction a)
defines the default action to be applied to the text matching
a context end.
|
ContextManager |
ContextManager.setDefaultStartAction(FaAction a)
defines the default action to be applied to the text matching
a context start.
|
Context |
Context.setEndAction(FaAction a)
specifies the action which takes
care of the text marking the end of the context.
|
Context |
Context.setStartAction(FaAction a)
specifies the action which shall take
care of the text marking the start of the context.
|
Constructor and Description |
---|
IfContext(Context ctx,
FaAction a)
creates an
FaAction to run the given client action if
called in the given Context . |