public class Reducer extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Reducer.Abort
Indicates that the creation of an AST node has been aborted
deliberately due to semantic errors in the input.
|
static interface |
Reducer.Collector1<D,A1> |
static interface |
Reducer.Collector2<D,A1,A2> |
static interface |
Reducer.Collector3<D,A1,A2,A3> |
static interface |
Reducer.Collector4<D,A1,A2,A3,A4> |
static interface |
Reducer.Collector5<D,A1,A2,A3,A4,A5> |
static interface |
Reducer.Collector6<D,A1,A2,A3,A4,A5,A6> |
static interface |
Reducer.Collector7<D,A1,A2,A3,A4,A5,A6,A7> |
static interface |
Reducer.Constructor
Abstract base of all AST node-constructor functional interfaces.
|
static interface |
Reducer.Constructor1<D,A1,R>
Functional interface for AST node constructors with one parsed argument.
|
static interface |
Reducer.Constructor2<D,A1,A2,R> |
static interface |
Reducer.Constructor3<D,A1,A2,A3,R> |
static interface |
Reducer.Constructor4<D,A1,A2,A3,A4,R> |
static interface |
Reducer.Constructor5<D,A1,A2,A3,A4,A5,R> |
static interface |
Reducer.Constructor6<D,A1,A2,A3,A4,A5,A6,R> |
static interface |
Reducer.Constructor7<D,A1,A2,A3,A4,A5,A6,A7,R> |
static class |
Reducer.Context<D> |
Constructor and Description |
---|
Reducer() |
Modifier and Type | Method and Description |
---|---|
static <D,T,A1> Expression<D,T,Unit> |
collect(Reducer.Collector1<D,A1> coll,
AbstractExpression<D,T,? extends A1> arg1) |
static <D,T,A1,A2> |
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> |
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> |
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> |
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> |
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> |
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> |
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> |
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> |
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> |
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> |
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> |
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> |
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> |
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> |
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> |
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> |
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> |
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> |
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> |
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> |
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> |
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> |
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> |
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.
|
public static <D,T,A1,R> Expression<D,T,R> reduce(Reducer.Constructor1<D,A1,? extends R> cons, AbstractExpression<D,T,? extends A1> arg1)
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 nodescons
- the AST node constructorarg1
- the expression for the (first) parsed argumentpublic static <D,T,A1> Expression<D,T,Unit> collect(Reducer.Collector1<D,A1> coll, AbstractExpression<D,T,? extends A1> arg1)
public static <D,T,A1,R> Expression<D,T,R> reduce(@Opt @Opt Class<R> type, Reducer.Constructor1<D,A1,? extends R> cons, AbstractExpression<D,T,? extends A1> arg1)
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 nodestype
- the type of resulting AST nodes, or null
if
uncheckedcons
- the AST node constructorarg1
- the expression for the (first) parsed argumentpublic static <D,T,A1,R> Expression<D,T,R> reduce(@Opt @Opt Class<R> type, Reducer.Constructor1<D,A1,? extends R> cons, Fragment<D,T,? extends A1> arg1)
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 nodestype
- the type of resulting AST nodes, or null
if
uncheckedcons
- the AST node constructorarg1
- the expression for the (first) parsed argumentpublic 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)
public 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)
public static <D,T,A1,A2,R> Expression<D,T,R> reduce(@Opt @Opt Class<R> type, Reducer.Constructor2<D,A1,A2,R> cons, AbstractExpression<D,T,? extends A1> arg1, AbstractExpression<D,T,? extends A2> arg2)
public static <D,T,A1,A2,R> Expression<D,T,R> reduce(@Opt @Opt Class<R> type, Reducer.Constructor2<D,A1,A2,R> cons, Fragment<D,T,? extends A1> arg1, Fragment<D,T,? extends A2> arg2)
public 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)
public 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)
public static <D,T,A1,A2,A3,R> Expression<D,T,R> reduce(@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)
public static <D,T,A1,A2,A3,R> Expression<D,T,R> reduce(@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)
public 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)
public 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)
public static <D,T,A1,A2,A3,A4,R> Expression<D,T,R> reduce(@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)
public static <D,T,A1,A2,A3,A4,R> Expression<D,T,R> reduce(@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)
public 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)
public 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)
public static <D,T,A1,A2,A3,A4,A5,R> Expression<D,T,R> reduce(@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)
public static <D,T,A1,A2,A3,A4,A5,R> Expression<D,T,R> reduce(@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)
public 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)
public 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)
public static <D,T,A1,A2,A3,A4,A5,A6,R> Expression<D,T,R> reduce(@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)
public static <D,T,A1,A2,A3,A4,A5,A6,R> Expression<D,T,R> reduce(@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)
public 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)
public 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)
public static <D,T,A1,A2,A3,A4,A5,A6,A7,R> Expression<D,T,R> reduce(@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)
public static <D,T,A1,A2,A3,A4,A5,A6,A7,R> Expression<D,T,R> reduce(@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)
public static <D> void setGlobalMessageHook(@Opt @Opt MessageReceiver<? super SimpleMessage<D>> hook)
hook
- a messge receiver to be used as the global message
hook, or null
for deactivationsee also the complete user documentation .