Package eu.bandm.tools.ramus.runtime2
Class Reducer
java.lang.Object
eu.bandm.tools.ramus.runtime2.Reducer
Framework factories for procedural AST construction.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Indicates that the creation of an AST node has been aborted deliberately due to semantic errors in the input.(package private) static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
Abstract base of all AST node-constructor functional interfaces.static interface
Functional interface for AST node constructors with one parsed argument.static interface
static interface
static interface
static interface
static interface
static interface
static class
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <D,
T, A1> Expression<D, T, Unit> collect
(Reducer.Collector1<D, A1> coll, AbstractExpression<D, T, ? extends A1> arg1) static <D,
T, A1, A2>
Expression<D,T, Unit> collect
(Reducer.Collector2<D, A1, A2> coll, AbstractExpression<D, T, ? extends A1> arg1, AbstractExpression<D, T, ? extends A2> arg2) static <D,
T, A1, A2, A3>
Expression<D,T, Unit> collect
(Reducer.Collector3<D, A1, A2, A3> coll, AbstractExpression<D, T, ? extends A1> arg1, AbstractExpression<D, T, ? extends A2> arg2, AbstractExpression<D, T, ? extends A3> arg3) static <D,
T, A1, A2, A3, A4>
Expression<D,T, Unit> collect
(Reducer.Collector4<D, A1, A2, A3, A4> coll, AbstractExpression<D, T, ? extends A1> arg1, AbstractExpression<D, T, ? extends A2> arg2, AbstractExpression<D, T, ? extends A3> arg3, AbstractExpression<D, T, ? extends A4> arg4) static <D,
T, A1, A2, A3, A4, A5>
Expression<D,T, Unit> collect
(Reducer.Collector5<D, A1, A2, A3, A4, A5> coll, AbstractExpression<D, T, ? extends A1> arg1, AbstractExpression<D, T, ? extends A2> arg2, AbstractExpression<D, T, ? extends A3> arg3, AbstractExpression<D, T, ? extends A4> arg4, AbstractExpression<D, T, ? extends A5> arg5) static <D,
T, A1, A2, A3, A4, A5, A6>
Expression<D,T, Unit> collect
(Reducer.Collector6<D, A1, A2, A3, A4, A5, A6> coll, AbstractExpression<D, T, ? extends A1> arg1, AbstractExpression<D, T, ? extends A2> arg2, AbstractExpression<D, T, ? extends A3> arg3, AbstractExpression<D, T, ? extends A4> arg4, AbstractExpression<D, T, ? extends A5> arg5, AbstractExpression<D, T, ? extends A6> arg6) static <D,
T, A1, A2, A3, A4, A5, A6, A7>
Expression<D,T, Unit> collect
(Reducer.Collector7<D, A1, A2, A3, A4, A5, A6, A7> coll, AbstractExpression<D, T, ? extends A1> arg1, AbstractExpression<D, T, ? extends A2> arg2, AbstractExpression<D, T, ? extends A3> arg3, AbstractExpression<D, T, ? extends A4> arg4, AbstractExpression<D, T, ? extends A5> arg5, AbstractExpression<D, T, ? extends A6> arg6, AbstractExpression<D, T, ? extends A7> arg7) static <D,
T, A1, R> Expression<D, T, R> reduce
(@Opt Class<R> type, Reducer.Constructor1<D, A1, ? extends R> cons, AbstractExpression<D, T, ? extends A1> arg1) Creates a compound expression for AST nodes with one parsed argument.static <D,
T, A1, R> Expression<D, T, R> reduce
(@Opt Class<R> type, Reducer.Constructor1<D, A1, ? extends R> cons, Fragment<D, T, ? extends A1> arg1) Creates a compound expression for AST nodes with one parsed argument.static <D,
T, A1, A2, R>
Expression<D,T, R> reduce
(@Opt Class<R> type, Reducer.Constructor2<D, A1, A2, R> cons, AbstractExpression<D, T, ? extends A1> arg1, AbstractExpression<D, T, ? extends A2> arg2) static <D,
T, A1, A2, R>
Expression<D,T, R> reduce
(@Opt Class<R> type, Reducer.Constructor2<D, A1, A2, R> cons, Fragment<D, T, ? extends A1> arg1, Fragment<D, T, ? extends A2> arg2) static <D,
T, A1, A2, A3, R>
Expression<D,T, R> reduce
(@Opt Class<R> type, Reducer.Constructor3<D, A1, A2, A3, R> cons, AbstractExpression<D, T, ? extends A1> arg1, AbstractExpression<D, T, ? extends A2> arg2, AbstractExpression<D, T, ? extends A3> arg3) static <D,
T, A1, A2, A3, R>
Expression<D,T, R> reduce
(@Opt Class<R> type, Reducer.Constructor3<D, A1, A2, A3, R> cons, Fragment<D, T, ? extends A1> arg1, Fragment<D, T, ? extends A2> arg2, Fragment<D, T, ? extends A3> arg3) static <D,
T, A1, A2, A3, A4, R>
Expression<D,T, R> reduce
(@Opt Class<R> type, Reducer.Constructor4<D, A1, A2, A3, A4, R> cons, AbstractExpression<D, T, ? extends A1> arg1, AbstractExpression<D, T, ? extends A2> arg2, AbstractExpression<D, T, ? extends A3> arg3, AbstractExpression<D, T, ? extends A4> arg4) static <D,
T, A1, A2, A3, A4, R>
Expression<D,T, R> reduce
(@Opt Class<R> type, Reducer.Constructor4<D, A1, A2, A3, A4, R> cons, Fragment<D, T, ? extends A1> arg1, Fragment<D, T, ? extends A2> arg2, Fragment<D, T, ? extends A3> arg3, Fragment<D, T, ? extends A4> arg4) static <D,
T, A1, A2, A3, A4, A5, R>
Expression<D,T, R> reduce
(@Opt Class<R> type, Reducer.Constructor5<D, A1, A2, A3, A4, A5, R> cons, AbstractExpression<D, T, ? extends A1> arg1, AbstractExpression<D, T, ? extends A2> arg2, AbstractExpression<D, T, ? extends A3> arg3, AbstractExpression<D, T, ? extends A4> arg4, AbstractExpression<D, T, ? extends A5> arg5) static <D,
T, A1, A2, A3, A4, A5, R>
Expression<D,T, R> reduce
(@Opt Class<R> type, Reducer.Constructor5<D, A1, A2, A3, A4, A5, R> cons, Fragment<D, T, ? extends A1> arg1, Fragment<D, T, ? extends A2> arg2, Fragment<D, T, ? extends A3> arg3, Fragment<D, T, ? extends A4> arg4, Fragment<D, T, ? extends A5> arg5) static <D,
T, A1, A2, A3, A4, A5, A6, R>
Expression<D,T, R> reduce
(@Opt Class<R> type, Reducer.Constructor6<D, A1, A2, A3, A4, A5, A6, R> cons, AbstractExpression<D, T, ? extends A1> arg1, AbstractExpression<D, T, ? extends A2> arg2, AbstractExpression<D, T, ? extends A3> arg3, AbstractExpression<D, T, ? extends A4> arg4, AbstractExpression<D, T, ? extends A5> arg5, AbstractExpression<D, T, ? extends A6> arg6) static <D,
T, A1, A2, A3, A4, A5, A6, R>
Expression<D,T, R> reduce
(@Opt Class<R> type, Reducer.Constructor6<D, A1, A2, A3, A4, A5, A6, R> cons, Fragment<D, T, ? extends A1> arg1, Fragment<D, T, ? extends A2> arg2, Fragment<D, T, ? extends A3> arg3, Fragment<D, T, ? extends A4> arg4, Fragment<D, T, ? extends A5> arg5, Fragment<D, T, ? extends A6> arg6) static <D,
T, A1, A2, A3, A4, A5, A6, A7, R>
Expression<D,T, R> reduce
(@Opt Class<R> type, Reducer.Constructor7<D, A1, A2, A3, A4, A5, A6, A7, R> cons, AbstractExpression<D, T, ? extends A1> arg1, AbstractExpression<D, T, ? extends A2> arg2, AbstractExpression<D, T, ? extends A3> arg3, AbstractExpression<D, T, ? extends A4> arg4, AbstractExpression<D, T, ? extends A5> arg5, AbstractExpression<D, T, ? extends A6> arg6, AbstractExpression<D, T, ? extends A7> arg7) static <D,
T, A1, A2, A3, A4, A5, A6, A7, R>
Expression<D,T, R> reduce
(@Opt Class<R> type, Reducer.Constructor7<D, A1, A2, A3, A4, A5, A6, A7, R> cons, Fragment<D, T, ? extends A1> arg1, Fragment<D, T, ? extends A2> arg2, Fragment<D, T, ? extends A3> arg3, Fragment<D, T, ? extends A4> arg4, Fragment<D, T, ? extends A5> arg5, Fragment<D, T, ? extends A6> arg6, Fragment<D, T, ? extends A7> arg7) static <D,
T, A1, R> Expression<D, T, R> reduce
(Reducer.Constructor1<D, A1, ? extends R> cons, AbstractExpression<D, T, ? extends A1> arg1) Creates a compound expression for AST nodes with one parsed argument.static <D,
T, A1, A2, R>
Expression<D,T, R> reduce
(Reducer.Constructor2<D, A1, A2, R> cons, AbstractExpression<D, T, ? extends A1> arg1, AbstractExpression<D, T, ? extends A2> arg2) static <D,
T, A1, A2, A3, R>
Expression<D,T, R> reduce
(Reducer.Constructor3<D, A1, A2, A3, R> cons, AbstractExpression<D, T, ? extends A1> arg1, AbstractExpression<D, T, ? extends A2> arg2, AbstractExpression<D, T, ? extends A3> arg3) static <D,
T, A1, A2, A3, A4, R>
Expression<D,T, R> reduce
(Reducer.Constructor4<D, A1, A2, A3, A4, R> cons, AbstractExpression<D, T, ? extends A1> arg1, AbstractExpression<D, T, ? extends A2> arg2, AbstractExpression<D, T, ? extends A3> arg3, AbstractExpression<D, T, ? extends A4> arg4) static <D,
T, A1, A2, A3, A4, A5, R>
Expression<D,T, R> reduce
(Reducer.Constructor5<D, A1, A2, A3, A4, A5, R> cons, AbstractExpression<D, T, ? extends A1> arg1, AbstractExpression<D, T, ? extends A2> arg2, AbstractExpression<D, T, ? extends A3> arg3, AbstractExpression<D, T, ? extends A4> arg4, AbstractExpression<D, T, ? extends A5> arg5) static <D,
T, A1, A2, A3, A4, A5, A6, R>
Expression<D,T, R> reduce
(Reducer.Constructor6<D, A1, A2, A3, A4, A5, A6, R> cons, AbstractExpression<D, T, ? extends A1> arg1, AbstractExpression<D, T, ? extends A2> arg2, AbstractExpression<D, T, ? extends A3> arg3, AbstractExpression<D, T, ? extends A4> arg4, AbstractExpression<D, T, ? extends A5> arg5, AbstractExpression<D, T, ? extends A6> arg6) static <D,
T, A1, A2, A3, A4, A5, A6, A7, R>
Expression<D,T, R> reduce
(Reducer.Constructor7<D, A1, A2, A3, A4, A5, A6, A7, R> cons, AbstractExpression<D, T, ? extends A1> arg1, AbstractExpression<D, T, ? extends A2> arg2, AbstractExpression<D, T, ? extends A3> arg3, AbstractExpression<D, T, ? extends A4> arg4, AbstractExpression<D, T, ? extends A5> arg5, AbstractExpression<D, T, ? extends A6> arg6, AbstractExpression<D, T, ? extends A7> arg7) static <D> void
setGlobalMessageHook
(@Opt MessageReceiver<? super SimpleMessage<D>> hook) Sets the global message hook that is called for every messsge that is emitted during AST construction.
-
Constructor Details
-
Reducer
public Reducer()
-
-
Method Details
-
reduce
public static <D,T, Expression<D,A1, R> T, reduceR> (Reducer.Constructor1<D, A1, ? extends R> cons, AbstractExpression<D, T, ? extends A1> arg1) Creates a compound expression for AST nodes with one parsed argument.- Type Parameters:
D
- the type of source document identifiersT
- the type of token typesA1
- the type of the (first) parsed argument valueR
- the type of resulting AST nodes- Parameters:
cons
- the AST node constructorarg1
- the expression for the (first) parsed argument- Returns:
- a compound expression using the AST node constructor for its root
-
collect
public static <D,T, Expression<D,A1> T, collectUnit> (Reducer.Collector1<D, A1> coll, AbstractExpression<D, T, ? extends A1> arg1) -
reduce
public static <D,T, Expression<D,A1, R> T, reduceR> (@Opt @Opt Class<R> type, Reducer.Constructor1<D, A1, ? extends R> cons, AbstractExpression<D, T, ? extends A1> arg1) Creates a compound expression for AST nodes with one parsed argument.- Type Parameters:
D
- the type of source document identifiersT
- the type of token typesA1
- the type of the (first) parsed argument valueR
- the type of resulting AST nodes- Parameters:
type
- the type of resulting AST nodes, ornull
if uncheckedcons
- the AST node constructorarg1
- the expression for the (first) parsed argument- Returns:
- a compound expression using the AST node constructor for its root
-
reduce
public static <D,T, Expression<D,A1, R> T, reduceR> (@Opt @Opt Class<R> type, Reducer.Constructor1<D, A1, ? extends R> cons, Fragment<D, T, ? extends A1> arg1) Creates a compound expression for AST nodes with one parsed argument.- Type Parameters:
D
- the type of source document identifiersT
- the type of token typesA1
- the type of the (first) parsed argument valueR
- the type of resulting AST nodes- Parameters:
type
- the type of resulting AST nodes, ornull
if uncheckedcons
- the AST node constructorarg1
- the expression for the (first) parsed argument- Returns:
- a compound expression using the AST node constructor for its root
-
reduce
public static <D,T, Expression<D,A1, A2, R> T, reduceR> (Reducer.Constructor2<D, A1, A2, R> cons, AbstractExpression<D, T, ? extends A1> arg1, AbstractExpression<D, T, ? extends A2> arg2) -
collect
public static <D,T, Expression<D,A1, A2> T, collectUnit> (Reducer.Collector2<D, A1, A2> coll, AbstractExpression<D, T, ? extends A1> arg1, AbstractExpression<D, T, ? extends A2> arg2) -
reduce
public static <D,T, Expression<D,A1, A2, R> T, reduceR> (@Opt @Opt Class<R> type, Reducer.Constructor2<D, A1, A2, R> cons, AbstractExpression<D, T, ? extends A1> arg1, AbstractExpression<D, T, ? extends A2> arg2) -
reduce
public static <D,T, Expression<D,A1, A2, R> T, reduceR> (@Opt @Opt Class<R> type, Reducer.Constructor2<D, A1, A2, R> cons, Fragment<D, T, ? extends A1> arg1, Fragment<D, T, ? extends A2> arg2) -
reduce
public static <D,T, Expression<D,A1, A2, A3, R> T, reduceR> (Reducer.Constructor3<D, A1, A2, A3, R> cons, AbstractExpression<D, T, ? extends A1> arg1, AbstractExpression<D, T, ? extends A2> arg2, AbstractExpression<D, T, ? extends A3> arg3) -
collect
public static <D,T, Expression<D,A1, A2, A3> T, collectUnit> (Reducer.Collector3<D, A1, A2, A3> coll, AbstractExpression<D, T, ? extends A1> arg1, AbstractExpression<D, T, ? extends A2> arg2, AbstractExpression<D, T, ? extends A3> arg3) -
reduce
public static <D,T, Expression<D,A1, A2, A3, R> T, reduceR> (@Opt @Opt Class<R> type, Reducer.Constructor3<D, A1, A2, A3, R> cons, AbstractExpression<D, T, ? extends A1> arg1, AbstractExpression<D, T, ? extends A2> arg2, AbstractExpression<D, T, ? extends A3> arg3) -
reduce
public static <D,T, Expression<D,A1, A2, A3, R> T, reduceR> (@Opt @Opt Class<R> type, Reducer.Constructor3<D, A1, A2, A3, R> cons, Fragment<D, T, ? extends A1> arg1, Fragment<D, T, ? extends A2> arg2, Fragment<D, T, ? extends A3> arg3) -
reduce
public static <D,T, Expression<D,A1, A2, A3, A4, R> T, reduceR> (Reducer.Constructor4<D, A1, A2, A3, A4, R> cons, AbstractExpression<D, T, ? extends A1> arg1, AbstractExpression<D, T, ? extends A2> arg2, AbstractExpression<D, T, ? extends A3> arg3, AbstractExpression<D, T, ? extends A4> arg4) -
collect
public static <D,T, Expression<D,A1, A2, A3, A4> T, collectUnit> (Reducer.Collector4<D, A1, A2, A3, A4> coll, AbstractExpression<D, T, ? extends A1> arg1, AbstractExpression<D, T, ? extends A2> arg2, AbstractExpression<D, T, ? extends A3> arg3, AbstractExpression<D, T, ? extends A4> arg4) -
reduce
public static <D,T, Expression<D,A1, A2, A3, A4, R> T, reduceR> (@Opt @Opt Class<R> type, Reducer.Constructor4<D, A1, A2, A3, A4, R> cons, AbstractExpression<D, T, ? extends A1> arg1, AbstractExpression<D, T, ? extends A2> arg2, AbstractExpression<D, T, ? extends A3> arg3, AbstractExpression<D, T, ? extends A4> arg4) -
reduce
public static <D,T, Expression<D,A1, A2, A3, A4, R> T, reduceR> (@Opt @Opt Class<R> type, Reducer.Constructor4<D, A1, A2, A3, A4, R> cons, Fragment<D, T, ? extends A1> arg1, Fragment<D, T, ? extends A2> arg2, Fragment<D, T, ? extends A3> arg3, Fragment<D, T, ? extends A4> arg4) -
reduce
public static <D,T, Expression<D,A1, A2, A3, A4, A5, R> T, reduceR> (Reducer.Constructor5<D, A1, A2, A3, A4, A5, R> cons, AbstractExpression<D, T, ? extends A1> arg1, AbstractExpression<D, T, ? extends A2> arg2, AbstractExpression<D, T, ? extends A3> arg3, AbstractExpression<D, T, ? extends A4> arg4, AbstractExpression<D, T, ? extends A5> arg5) -
collect
public static <D,T, Expression<D,A1, A2, A3, A4, A5> T, collectUnit> (Reducer.Collector5<D, A1, A2, A3, A4, A5> coll, AbstractExpression<D, T, ? extends A1> arg1, AbstractExpression<D, T, ? extends A2> arg2, AbstractExpression<D, T, ? extends A3> arg3, AbstractExpression<D, T, ? extends A4> arg4, AbstractExpression<D, T, ? extends A5> arg5) -
reduce
public static <D,T, Expression<D,A1, A2, A3, A4, A5, R> T, reduceR> (@Opt @Opt Class<R> type, Reducer.Constructor5<D, A1, A2, A3, A4, A5, R> cons, AbstractExpression<D, T, ? extends A1> arg1, AbstractExpression<D, T, ? extends A2> arg2, AbstractExpression<D, T, ? extends A3> arg3, AbstractExpression<D, T, ? extends A4> arg4, AbstractExpression<D, T, ? extends A5> arg5) -
reduce
public static <D,T, Expression<D,A1, A2, A3, A4, A5, R> T, reduceR> (@Opt @Opt Class<R> type, Reducer.Constructor5<D, A1, A2, A3, A4, A5, R> cons, Fragment<D, T, ? extends A1> arg1, Fragment<D, T, ? extends A2> arg2, Fragment<D, T, ? extends A3> arg3, Fragment<D, T, ? extends A4> arg4, Fragment<D, T, ? extends A5> arg5) -
reduce
public static <D,T, Expression<D,A1, A2, A3, A4, A5, A6, R> T, reduceR> (Reducer.Constructor6<D, A1, A2, A3, A4, A5, A6, R> cons, AbstractExpression<D, T, ? extends A1> arg1, AbstractExpression<D, T, ? extends A2> arg2, AbstractExpression<D, T, ? extends A3> arg3, AbstractExpression<D, T, ? extends A4> arg4, AbstractExpression<D, T, ? extends A5> arg5, AbstractExpression<D, T, ? extends A6> arg6) -
collect
public static <D,T, Expression<D,A1, A2, A3, A4, A5, A6> T, collectUnit> (Reducer.Collector6<D, A1, A2, A3, A4, A5, A6> coll, AbstractExpression<D, T, ? extends A1> arg1, AbstractExpression<D, T, ? extends A2> arg2, AbstractExpression<D, T, ? extends A3> arg3, AbstractExpression<D, T, ? extends A4> arg4, AbstractExpression<D, T, ? extends A5> arg5, AbstractExpression<D, T, ? extends A6> arg6) -
reduce
public static <D,T, Expression<D,A1, A2, A3, A4, A5, A6, R> T, reduceR> (@Opt @Opt Class<R> type, Reducer.Constructor6<D, A1, A2, A3, A4, A5, A6, R> cons, AbstractExpression<D, T, ? extends A1> arg1, AbstractExpression<D, T, ? extends A2> arg2, AbstractExpression<D, T, ? extends A3> arg3, AbstractExpression<D, T, ? extends A4> arg4, AbstractExpression<D, T, ? extends A5> arg5, AbstractExpression<D, T, ? extends A6> arg6) -
reduce
public static <D,T, Expression<D,A1, A2, A3, A4, A5, A6, R> T, reduceR> (@Opt @Opt Class<R> type, Reducer.Constructor6<D, A1, A2, A3, A4, A5, A6, R> cons, Fragment<D, T, ? extends A1> arg1, Fragment<D, T, ? extends A2> arg2, Fragment<D, T, ? extends A3> arg3, Fragment<D, T, ? extends A4> arg4, Fragment<D, T, ? extends A5> arg5, Fragment<D, T, ? extends A6> arg6) -
reduce
public static <D,T, Expression<D,A1, A2, A3, A4, A5, A6, A7, R> T, reduceR> (Reducer.Constructor7<D, A1, A2, A3, A4, A5, A6, A7, R> cons, AbstractExpression<D, T, ? extends A1> arg1, AbstractExpression<D, T, ? extends A2> arg2, AbstractExpression<D, T, ? extends A3> arg3, AbstractExpression<D, T, ? extends A4> arg4, AbstractExpression<D, T, ? extends A5> arg5, AbstractExpression<D, T, ? extends A6> arg6, AbstractExpression<D, T, ? extends A7> arg7) -
collect
public static <D,T, Expression<D,A1, A2, A3, A4, A5, A6, A7> T, collectUnit> (Reducer.Collector7<D, A1, A2, A3, A4, A5, A6, A7> coll, AbstractExpression<D, T, ? extends A1> arg1, AbstractExpression<D, T, ? extends A2> arg2, AbstractExpression<D, T, ? extends A3> arg3, AbstractExpression<D, T, ? extends A4> arg4, AbstractExpression<D, T, ? extends A5> arg5, AbstractExpression<D, T, ? extends A6> arg6, AbstractExpression<D, T, ? extends A7> arg7) -
reduce
public static <D,T, Expression<D,A1, A2, A3, A4, A5, A6, A7, R> T, reduceR> (@Opt @Opt Class<R> type, Reducer.Constructor7<D, A1, A2, A3, A4, A5, A6, A7, R> cons, AbstractExpression<D, T, ? extends A1> arg1, AbstractExpression<D, T, ? extends A2> arg2, AbstractExpression<D, T, ? extends A3> arg3, AbstractExpression<D, T, ? extends A4> arg4, AbstractExpression<D, T, ? extends A5> arg5, AbstractExpression<D, T, ? extends A6> arg6, AbstractExpression<D, T, ? extends A7> arg7) -
reduce
public static <D,T, Expression<D,A1, A2, A3, A4, A5, A6, A7, R> T, reduceR> (@Opt @Opt Class<R> type, Reducer.Constructor7<D, A1, A2, A3, A4, A5, A6, A7, R> cons, Fragment<D, T, ? extends A1> arg1, Fragment<D, T, ? extends A2> arg2, Fragment<D, T, ? extends A3> arg3, Fragment<D, T, ? extends A4> arg4, Fragment<D, T, ? extends A5> arg5, Fragment<D, T, ? extends A6> arg6, Fragment<D, T, ? extends A7> arg7) -
setGlobalMessageHook
public static <D> void setGlobalMessageHook(@Opt @Opt MessageReceiver<? super SimpleMessage<D>> hook) Sets the global message hook that is called for every messsge that is emitted during AST construction.- Parameters:
hook
- a messge receiver to be used as the global message hook, ornull
for deactivation
-