Package | Description |
---|---|
eu.bandm.tscore.base |
Generic and low level data types and transformation algorithms,
to be used by very different applications of the
tscore
framework. |
Modifier and Type | Field and Description |
---|---|
(package private) @Opt Translet.State<?> |
Translet.State.pre
The preceding state.
|
protected Translet.State<?> |
Translet.Alternative.pre
The parsing state in which these alternatives have been considered.
|
Modifier and Type | Field and Description |
---|---|
static Predicate<Translet.State> |
Translet.State.p_atEnd |
protected Multimap<Translet.Parser<?>,Translet.State<?>> |
Translet.PermutationParser.parser2state
Maps all sub-parsers to all states the created during all parsing apptempts.
|
Modifier and Type | Method and Description |
---|---|
static Translet.State<Object> |
Translet.State.initState(String s,
int pos)
Create an initial state with only the input data, no parser or result yet.
|
protected @Opt Translet.State<?> |
Translet.Parser.parseEpsilon(Translet.State<?> inState)
Find one parse result which consumes no characters.
|
<N,M extends N> |
Translet.State.succ(Translet.Parser<N> parser,
int pos,
M result)
Return a new State, which is successor of "this", and
in which "parser" has delivered "result" and consumed input up to "pos".
|
<N,M extends N> |
Translet.State.succ(Translet.Parser<N> parser,
M result)
Return a new State, which is successor of "this", and
in which "parser" has delivered "result", but no input has been consumed.
|
Modifier and Type | Method and Description |
---|---|
protected static <R> Set<Translet.State<R>> |
Translet.__SET_CAST(Set<? extends Translet.State<?>> set)
Aux function for casting a "Set
|
Set<Translet.State<R>> |
Translet.Parser.mparse(Set<? extends Translet.State<?>> inStates,
Set<Translet.Alternative> alternatives)
"*M*ultiple Parse" means to apply the parser to a set of incoming
Translet.State s, which represent the parsing situations reached so far. |
Set<Translet.State<R>> |
TransletLib._TEST.parseOneState(Translet.State<?> inState,
Set<Translet.Alternative> alternatives) |
protected abstract Set<Translet.State<R>> |
Translet.Parser.parseOneState(Translet.State<?> inState,
Set<Translet.Alternative> alternatives)
Calculate a set of possible successor states by applying this parser
to the incoming state and append all altenatives found underways to
the parameter "alternatives".
|
Set<Translet.State<R>> |
Translet.Recursive.parseOneState(Translet.State<?> inState,
Set<Translet.Alternative> alternatives) |
protected Set<Translet.State<R>> |
Translet._CONST.parseOneState(Translet.State<?> st,
Set<Translet.Alternative> alternatives) |
protected Set<Translet.State<String>> |
Translet._REGEX.parseOneState(Translet.State<?> st,
Set<Translet.Alternative> alternatives) |
protected Set<Translet.State<R>> |
Translet._CAT.parseOneState(Translet.State<?> st,
Set<Translet.Alternative> alternatives)
Return the longest possible match of catalog entries.
|
Set<Translet.State<S>> |
Translet.StorageWrapper.parseOneState(Translet.State<?> inState,
Set<Translet.Alternative> alternatives)
Simply memorizes this parser by inserting a new state after the
states resulting from the sub-parser.
|
Set<Translet.State<A>> |
Translet.FramedParser.parseOneState(Translet.State<?> inState,
Set<Translet.Alternative> alternatives) |
Set<Translet.State<A>> |
Translet.HeadParser.parseOneState(Translet.State<?> inState,
Set<Translet.Alternative> alternatives) |
Set<Translet.State<R>> |
Translet.SequParser.parseOneState(Translet.State<?> inState,
Set<Translet.Alternative> alternatives)
Parse breadth-first the list of sub-parsers and memorize all
resulting states for later result retrieval.
|
Set<Translet.State<R>> |
Translet.PermutationParser.parseOneState(Translet.State<?> inState,
Set<Translet.Alternative> alternatives) |
Set<Translet.State<CoTuple<A,B,C,D>>> |
Translet.OrCoTupleParser.parseOneState(Translet.State<?> inState,
Set<Translet.Alternative> alternatives)
Try to parse all sub-parsers by
Translet.disj_testOneBranch(Parser,Parser,List,int,State,Set,Set) . |
Set<Translet.State<CoTuple<A,B,C,D>>> |
Translet.PriorCoTupleParser.parseOneState(Translet.State<?> inState,
Set<Translet.Alternative> alternatives)
Try to parse all sub-parsers by
Translet.disj_testOneBranch(Parser,Parser,List,int,State,Set,Set) . |
Set<Translet.State<A>> |
Translet.OrLimesParser.parseOneState(Translet.State<?> inState,
Set<Translet.Alternative> alternatives)
Try to parse all sub-parsers by
Translet.disj_testOneBranch(Parser,Parser,List,int,State,Set,Set) . |
Set<Translet.State<A>> |
Translet.PriorLimesParser.parseOneState(Translet.State<?> inState,
Set<Translet.Alternative> alternatives)
Try to parse all sub-parsers by
Translet.disj_testOneBranch(Parser,Parser,List,int,State,Set,Set) . |
Set<Translet.State<List<D>>> |
Translet.RepParser.parseOneState(Translet.State<?> inState,
Set<Translet.Alternative> alternatives)
Calculate a set of possible successor states by applying this parser
to the incoming state and append all altenatives found underways to
the parameter "alternatives".
|
Set<Translet.State<D>> |
Translet.OptionParser.parseOneState(Translet.State<?> inState,
Set<Translet.Alternative> alternatives) |
protected Set<? extends Translet.State<?>> |
Translet.PermutationParser.test2(Translet.State<?> oneState,
BitSet tested,
BitSet toEpsilon,
Set<Translet.Alternative> alternatives)
Tests all permutations by breadth first search: first testing all sub-parsers
once, and then calling this function recursively for all states resulting
from these calls.
|
Modifier and Type | Method and Description |
---|---|
protected Object[] |
Translet.PermutationParser.args(Translet.State<?> s)
Collects results of sub-parsers out of the selected parse tree "s"
and stores them in one array for constructor application by reflection.
|
protected Object[] |
Translet.SequParser.collectResults(Translet.State<?> s,
List<Set<? extends Translet.State<?>>> afterSubRess)
Returns the arguments for function application for one particular result
Translet.State by searching the chain of predecessor states and cutting them
with those related to the sub-parsers in the different positions in
"afterSubRess". |
protected static void |
Translet.disj_makeAlternative(Translet.disj_flavour flavour,
Translet.State<?> inState,
Set<Translet.Alternative> alternatives,
List<Translet.Parser<?>> notHit,
Set<Translet.Alternative> subAlts)
Constructs a new disjunction parser of the given kind with all failed
sub-parser, to add this new expression to alternatives.
|
protected static <R,S> void |
Translet.disj_testOneBranch(Translet.Parser<S> disj_parser,
Translet.Parser<R> parser,
List<Translet.Parser<?>> notHit,
int index,
Translet.State<?> inState,
Set<Translet.State<S>> outStates,
Set<Translet.Alternative> alternatives)
Tests one of the branch-parsers (with the given index) of the disj_parser,
with the given start state.
|
static <R> void |
Translet.displayBindings(CatalogByString cat,
List<String> prefs,
PrintStream ps,
int width,
boolean full,
Object locationtext,
Translet.Parser<?> parser,
Set<Translet.State<R>> results,
@Opt Translet.State<R> selected,
@Opt Set<Translet.State<R>> rests,
@Opt Set<Translet.Alternative> alts,
Modifiers modifiers,
boolean showAlts,
boolean showRests)
Presents all collected prefixes of possible parse trees to the user for error diagnosis.
|
static <R> void |
Translet.displayBindings(CatalogByString cat,
List<String> prefs,
PrintWriter pw,
int width,
boolean full,
@Opt Object locationtext,
Translet.Parser<?> parser,
@Opt Set<Translet.State<R>> results,
@Opt Translet.State<R> selected,
Set<Translet.State<R>> rests,
Set<Translet.Alternative> alts,
Modifiers modifiers,
boolean showAlts,
boolean showRests)
Show complete parsing situation on a PrintStream, possibly multi-lingual.
|
static int |
Translet.displayOneBinding(PrintWriter pw,
Translet.FormatPrinter_memo positions,
@Opt Translet.State<?> result,
Modifiers modifiers)
Prints one prefix of a parse tree, i.e.
|
void |
Translet.Parser.executeStoring(Translet.State<R> s,
Event e,
Location<XMLDocumentIdentifier> loc,
MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg)
Execute the store operation represented by "this" parser.
|
void |
Translet.Recursive.executeStoring(Translet.State<R> s,
Event e,
Location<XMLDocumentIdentifier> loc,
MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg) |
void |
Translet.Store_1.executeStoring(Translet.State<S> s,
Event e,
Location<XMLDocumentIdentifier> loc,
MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg)
Execute the storing operation.
|
void |
Translet.Store_M.executeStoring(Translet.State<S> s,
Event e,
Location<XMLDocumentIdentifier> loc,
MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg)
Execute the storing operation.
|
protected <R> R |
Translet.PermutationParser.findResult_p(Translet.State<?> s,
Translet.Parser<R> p)
Aux function for casting only: find the result of the application of
parser "p" in the (successful) parse tree ending in state "s".
|
protected static Object |
Translet.findResult_untyp(Translet.State<?> start,
Set<? extends Translet.State<?>> set)
Provide "deflt=null" for
Translet.findResult_untyp(State, Set, Object) . |
protected static @Opt Object |
Translet.findResult_untyp(Translet.State<?> start,
Set<? extends Translet.State<?>> set,
@Opt Object deflt)
|
protected static <R> R |
Translet.findResult(Translet.State<?> start,
Set<Translet.State<R>> set)
Provide "deflt=null" for
Translet.findResult(State, Set, Object) . |
protected static <R> R |
Translet.findResult(Translet.State<?> start,
Set<Translet.State<R>> set,
R deflt)
Search the chain of all predecessors starting with "start" and return
the ".result" value of the first state which is contained in "set".
|
protected @Opt Translet.State<?> |
Translet.Parser.parseEpsilon(Translet.State<?> inState)
Find one parse result which consumes no characters.
|
Set<Translet.State<R>> |
TransletLib._TEST.parseOneState(Translet.State<?> inState,
Set<Translet.Alternative> alternatives) |
protected abstract Set<Translet.State<R>> |
Translet.Parser.parseOneState(Translet.State<?> inState,
Set<Translet.Alternative> alternatives)
Calculate a set of possible successor states by applying this parser
to the incoming state and append all altenatives found underways to
the parameter "alternatives".
|
Set<Translet.State<R>> |
Translet.Recursive.parseOneState(Translet.State<?> inState,
Set<Translet.Alternative> alternatives) |
protected Set<Translet.State<R>> |
Translet._CONST.parseOneState(Translet.State<?> st,
Set<Translet.Alternative> alternatives) |
protected Set<Translet.State<String>> |
Translet._REGEX.parseOneState(Translet.State<?> st,
Set<Translet.Alternative> alternatives) |
protected Set<Translet.State<R>> |
Translet._CAT.parseOneState(Translet.State<?> st,
Set<Translet.Alternative> alternatives)
Return the longest possible match of catalog entries.
|
Set<Translet.State<S>> |
Translet.StorageWrapper.parseOneState(Translet.State<?> inState,
Set<Translet.Alternative> alternatives)
Simply memorizes this parser by inserting a new state after the
states resulting from the sub-parser.
|
Set<Translet.State<A>> |
Translet.FramedParser.parseOneState(Translet.State<?> inState,
Set<Translet.Alternative> alternatives) |
Set<Translet.State<A>> |
Translet.HeadParser.parseOneState(Translet.State<?> inState,
Set<Translet.Alternative> alternatives) |
Set<Translet.State<R>> |
Translet.SequParser.parseOneState(Translet.State<?> inState,
Set<Translet.Alternative> alternatives)
Parse breadth-first the list of sub-parsers and memorize all
resulting states for later result retrieval.
|
Set<Translet.State<R>> |
Translet.PermutationParser.parseOneState(Translet.State<?> inState,
Set<Translet.Alternative> alternatives) |
Set<Translet.State<CoTuple<A,B,C,D>>> |
Translet.OrCoTupleParser.parseOneState(Translet.State<?> inState,
Set<Translet.Alternative> alternatives)
Try to parse all sub-parsers by
Translet.disj_testOneBranch(Parser,Parser,List,int,State,Set,Set) . |
Set<Translet.State<CoTuple<A,B,C,D>>> |
Translet.PriorCoTupleParser.parseOneState(Translet.State<?> inState,
Set<Translet.Alternative> alternatives)
Try to parse all sub-parsers by
Translet.disj_testOneBranch(Parser,Parser,List,int,State,Set,Set) . |
Set<Translet.State<A>> |
Translet.OrLimesParser.parseOneState(Translet.State<?> inState,
Set<Translet.Alternative> alternatives)
Try to parse all sub-parsers by
Translet.disj_testOneBranch(Parser,Parser,List,int,State,Set,Set) . |
Set<Translet.State<A>> |
Translet.PriorLimesParser.parseOneState(Translet.State<?> inState,
Set<Translet.Alternative> alternatives)
Try to parse all sub-parsers by
Translet.disj_testOneBranch(Parser,Parser,List,int,State,Set,Set) . |
Set<Translet.State<List<D>>> |
Translet.RepParser.parseOneState(Translet.State<?> inState,
Set<Translet.Alternative> alternatives)
Calculate a set of possible successor states by applying this parser
to the incoming state and append all altenatives found underways to
the parameter "alternatives".
|
Set<Translet.State<D>> |
Translet.OptionParser.parseOneState(Translet.State<?> inState,
Set<Translet.Alternative> alternatives) |
protected void |
Translet.RepParser.parseProlongation(List<D> prefix,
Translet.State<?> inState,
Set<Translet.Alternative> alternatives,
Set<Translet.State<List<D>>> allResults)
Basic parser procedure for all four kinds of RepParsers.
|
protected Set<? extends Translet.State<?>> |
Translet.PermutationParser.test2(Translet.State<?> oneState,
BitSet tested,
BitSet toEpsilon,
Set<Translet.Alternative> alternatives)
Tests all permutations by breadth first search: first testing all sub-parsers
once, and then calling this function recursively for all states resulting
from these calls.
|
protected R |
Translet.Parser.wrapResult(int index,
Translet.State<?> resultState)
Only needed for disjunction parsers, simulates multiple inheritance
by creating an instance of a subclass of
CoTuple |
protected CoTuple<A,B,C,D> |
Translet.CoTupleParser.wrapResult(int index,
Translet.State<?> resultState)
Wraps the result of a successful sub-parser into the CoTuple typ.e
|
protected A |
Translet.LimesParser.wrapResult(int index,
Translet.State<?> resultState)
Cast the result of a successful sub-parser to the limes type
|
Modifier and Type | Method and Description |
---|---|
protected static <R> Set<Translet.State<R>> |
Translet.__SET_CAST(Set<? extends Translet.State<?>> set)
Aux function for casting a "Set
|
protected Object[] |
Translet.SequParser.collectResults(Translet.State<?> s,
List<Set<? extends Translet.State<?>>> afterSubRess)
Returns the arguments for function application for one particular result
Translet.State by searching the chain of predecessor states and cutting them
with those related to the sub-parsers in the different positions in
"afterSubRess". |
protected static <R,S> void |
Translet.disj_testOneBranch(Translet.Parser<S> disj_parser,
Translet.Parser<R> parser,
List<Translet.Parser<?>> notHit,
int index,
Translet.State<?> inState,
Set<Translet.State<S>> outStates,
Set<Translet.Alternative> alternatives)
Tests one of the branch-parsers (with the given index) of the disj_parser,
with the given start state.
|
static <R> void |
Translet.displayBindings(CatalogByString cat,
List<String> prefs,
PrintStream ps,
int width,
boolean full,
Object locationtext,
Translet.Parser<?> parser,
Set<Translet.State<R>> results,
@Opt Translet.State<R> selected,
@Opt Set<Translet.State<R>> rests,
@Opt Set<Translet.Alternative> alts,
Modifiers modifiers,
boolean showAlts,
boolean showRests)
Presents all collected prefixes of possible parse trees to the user for error diagnosis.
|
static <R> void |
Translet.displayBindings(CatalogByString cat,
List<String> prefs,
PrintWriter pw,
int width,
boolean full,
@Opt Object locationtext,
Translet.Parser<?> parser,
@Opt Set<Translet.State<R>> results,
@Opt Translet.State<R> selected,
Set<Translet.State<R>> rests,
Set<Translet.Alternative> alts,
Modifiers modifiers,
boolean showAlts,
boolean showRests)
Show complete parsing situation on a PrintStream, possibly multi-lingual.
|
protected static Object |
Translet.findResult_untyp(Translet.State<?> start,
Set<? extends Translet.State<?>> set)
Provide "deflt=null" for
Translet.findResult_untyp(State, Set, Object) . |
protected static @Opt Object |
Translet.findResult_untyp(Translet.State<?> start,
Set<? extends Translet.State<?>> set,
@Opt Object deflt)
|
protected static <R> R |
Translet.findResult(Translet.State<?> start,
Set<Translet.State<R>> set)
Provide "deflt=null" for
Translet.findResult(State, Set, Object) . |
protected static <R> R |
Translet.findResult(Translet.State<?> start,
Set<Translet.State<R>> set,
R deflt)
Search the chain of all predecessors starting with "start" and return
the ".result" value of the first state which is contained in "set".
|
Set<Translet.State<R>> |
Translet.Parser.mparse(Set<? extends Translet.State<?>> inStates,
Set<Translet.Alternative> alternatives)
"*M*ultiple Parse" means to apply the parser to a set of incoming
Translet.State s, which represent the parsing situations reached so far. |
protected void |
Translet.RepParser.parseProlongation(List<D> prefix,
Translet.State<?> inState,
Set<Translet.Alternative> alternatives,
Set<Translet.State<List<D>>> allResults)
Basic parser procedure for all four kinds of RepParsers.
|
Constructor and Description |
---|
Alternative(Translet.State pre,
Translet.Parser<?> parser)
Set state and a first parser.
|