Class ReducerFactory
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classIndicates that the creation of an AST node has been aborted deliberately due to semantic errors in the input.static interfaceBase of all AST node-constructor functional interfaces.static interfaceFunctional interface for constructors where all syntactic arguments are given, and only context is yet unknown.static interfaceFunctional interface for AST node constructors with one parsed argument.static interfaceFunctional interface for AST node constructors with two parsed arguments.static interfaceFunctional interface for AST node constructors with three parsed arguments.static interfaceFunctional interface for AST node constructors with four parsed arguments.static interfaceFunctional interface for AST node constructors with five parsed arguments.static interfaceFunctional interface for AST node constructors with six parsed arguments.static interfaceFunctional interface for AST node constructors with seven parsed arguments.classContext server for AST reduction.Nested classes/interfaces inherited from class eu.bandm.tools.ramus.ogma.Factory
Factory.Configuration -
Field Summary
Fields inherited from class eu.bandm.tools.ramus.ogma.Factory
configuration, MODULE_NAME, PACKAGE_PREFIX -
Method Summary
Modifier and TypeMethodDescriptionderive(UnaryOperator<Factory.Configuration> evolution) Creates a new variant of this factory with a modified configuration.static ReducerFactoryReturns a factory with default configuration (factory settings).final ParserFactoryReturns the parser factory used by this factory.final ReadingFactoryReturns the reading factory used by this factory.final <D,T, A1, R>
Reading<D, T, R> reduce(ReducerFactory.Constructor1<D, A1, ? extends R> cons, Reading<D, T, ? extends A1> arg1) Creates a compound reading for AST nodes with one parsed argument.final <D,T, A1, A2, R>
Reading<D, T, R> reduce(ReducerFactory.Constructor2<D, A1, A2, R> cons, Reading<D, T, ? extends A1> arg1, Reading<D, T, ? extends A2> arg2) Creates a compound reading for AST nodes with two parsed arguments.final <D,T, A1, A2, A3, R>
Reading<D, T, R> reduce(ReducerFactory.Constructor3<D, A1, A2, A3, R> cons, Reading<D, T, ? extends A1> arg1, Reading<D, T, ? extends A2> arg2, Reading<D, T, ? extends A3> arg3) Creates a compound reading for AST nodes with three parsed arguments.final <D,T, A1, A2, A3, A4, R>
Reading<D, T, R> reduce(ReducerFactory.Constructor4<D, A1, A2, A3, A4, R> cons, Reading<D, T, ? extends A1> arg1, Reading<D, T, ? extends A2> arg2, Reading<D, T, ? extends A3> arg3, Reading<D, T, ? extends A4> arg4) Creates a compound reading for AST nodes with four parsed arguments.final <D,T, A1, A2, A3, A4, A5, R>
Reading<D, T, R> reduce(ReducerFactory.Constructor5<D, A1, A2, A3, A4, A5, R> cons, Reading<D, T, ? extends A1> arg1, Reading<D, T, ? extends A2> arg2, Reading<D, T, ? extends A3> arg3, Reading<D, T, ? extends A4> arg4, Reading<D, T, ? extends A5> arg5) Creates a compound reading for AST nodes with five parsed arguments.final <D,T, A1, A2, A3, A4, A5, A6, R>
Reading<D, T, R> reduce(ReducerFactory.Constructor6<D, A1, A2, A3, A4, A5, A6, R> cons, Reading<D, T, ? extends A1> arg1, Reading<D, T, ? extends A2> arg2, Reading<D, T, ? extends A3> arg3, Reading<D, T, ? extends A4> arg4, Reading<D, T, ? extends A5> arg5, Reading<D, T, ? extends A6> arg6) Creates a compound reading for AST nodes with six parsed arguments.final <D,T, A1, A2, A3, A4, A5, A6, A7, R>
Reading<D, T, R> reduce(ReducerFactory.Constructor7<D, A1, A2, A3, A4, A5, A6, A7, R> cons, Reading<D, T, ? extends A1> arg1, Reading<D, T, ? extends A2> arg2, Reading<D, T, ? extends A3> arg3, Reading<D, T, ? extends A4> arg4, Reading<D, T, ? extends A5> arg5, Reading<D, T, ? extends A6> arg6, Reading<D, T, ? extends A7> arg7) Creates a compound reading for AST nodes with seven parsed arguments.Methods inherited from class eu.bandm.tools.ramus.ogma.Factory
construct, defaultConfiguration, getConfiguration, serviceFilterByModule, serviceFilterByPackage
-
Method Details
-
derive
Creates a new variant of this factory with a modified configuration.- Parameters:
evolution- the modification to apply to the configuration- Returns:
- a new factory with a modified configuration
- Throws:
NullPointerException- ifevolutionis null
-
getReadingFactory
Returns the reading factory used by this factory.- Returns:
- the reading factory used by this factory
-
getParserFactory
Returns the parser factory used by this factory.- Returns:
- the parser factory used by this factory
-
getDefault
Returns a factory with default configuration (factory settings).- Returns:
- a factory with default configuration
- See Also:
-
reduce
public final <D,T, Reading<D,A1, R> T, reduceR> (ReducerFactory.Constructor1<D, A1, ? extends R> cons, Reading<D, T, ? extends A1> arg1) Creates a compound reading for AST nodes with one parsed argument.The argument is parsed in a location-tracking context. Then the given constructor is invoked to create an AST node.
- 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 reading for the (first) parsed argument- Returns:
- a compound reading using the AST node constructor for its root
-
reduce
public final <D,T, Reading<D,A1, A2, R> T, reduceR> (ReducerFactory.Constructor2<D, A1, A2, R> cons, Reading<D, T, ? extends A1> arg1, Reading<D, T, ? extends A2> arg2) Creates a compound reading for AST nodes with two parsed arguments.The arguments are parsed sequentially in a location-tracking context. Then the given constructor is invoked to create an AST node.
- Type Parameters:
D- the type of source document identifiersT- the type of token typesA1- the type of the first parsed argument valueA2- the type of the second parsed argument valueR- the type of resulting AST nodes- Parameters:
cons- the AST node constructorarg1- the reading for the first parsed argumentarg2- the reading for the second parsed argument- Returns:
- a compound reading using the AST node constructor for its root
-
reduce
public final <D,T, Reading<D,A1, A2, A3, R> T, reduceR> (ReducerFactory.Constructor3<D, A1, A2, A3, R> cons, Reading<D, T, ? extends A1> arg1, Reading<D, T, ? extends A2> arg2, Reading<D, T, ? extends A3> arg3) Creates a compound reading for AST nodes with three parsed arguments.The arguments are parsed sequentially in a location-tracking context. Then the given constructor is invoked to create an AST node.
- Type Parameters:
D- the type of source document identifiersT- the type of token typesA1- the type of the first parsed argument valueA2- the type of the second parsed argument valueA3- the type of the third parsed argument valueR- the type of resulting AST nodes- Parameters:
cons- the AST node constructorarg1- the reading for the first parsed argumentarg2- the reading for the second parsed argumentarg3- the reading for the third parsed argument- Returns:
- a compound reading using the AST node constructor for its root
-
reduce
public final <D,T, Reading<D,A1, A2, A3, A4, R> T, reduceR> (ReducerFactory.Constructor4<D, A1, A2, A3, A4, R> cons, Reading<D, T, ? extends A1> arg1, Reading<D, T, ? extends A2> arg2, Reading<D, T, ? extends A3> arg3, Reading<D, T, ? extends A4> arg4) Creates a compound reading for AST nodes with four parsed arguments.The arguments are parsed sequentially in a location-tracking context. Then the given constructor is invoked to create an AST node.
- Type Parameters:
D- the type of source document identifiersT- the type of token typesA1- the type of the first parsed argument valueA2- the type of the second parsed argument valueA3- the type of the third parsed argument valueA4- the type of the fourth parsed argument valueR- the type of resulting AST nodes- Parameters:
cons- the AST node constructorarg1- the reading for the first parsed argumentarg2- the reading for the second parsed argumentarg3- the reading for the third parsed argumentarg4- the reading for the fourth parsed argument- Returns:
- a compound reading using the AST node constructor for its root
-
reduce
public final <D,T, Reading<D,A1, A2, A3, A4, A5, R> T, reduceR> (ReducerFactory.Constructor5<D, A1, A2, A3, A4, A5, R> cons, Reading<D, T, ? extends A1> arg1, Reading<D, T, ? extends A2> arg2, Reading<D, T, ? extends A3> arg3, Reading<D, T, ? extends A4> arg4, Reading<D, T, ? extends A5> arg5) Creates a compound reading for AST nodes with five parsed arguments.The arguments are parsed sequentially in a location-tracking context. Then the given constructor is invoked to create an AST node.
- Type Parameters:
D- the type of source document identifiersT- the type of token typesA1- the type of the first parsed argument valueA2- the type of the second parsed argument valueA3- the type of the third parsed argument valueA4- the type of the fourth parsed argument valueA5- the type of the fifth parsed argument valueR- the type of resulting AST nodes- Parameters:
cons- the AST node constructorarg1- the reading for the first parsed argumentarg2- the reading for the second parsed argumentarg3- the reading for the third parsed argumentarg4- the reading for the fourth parsed argumentarg5- the reading for the fifth parsed argument- Returns:
- a compound reading using the AST node constructor for its root
-
reduce
public final <D,T, Reading<D,A1, A2, A3, A4, A5, A6, R> T, reduceR> (ReducerFactory.Constructor6<D, A1, A2, A3, A4, A5, A6, R> cons, Reading<D, T, ? extends A1> arg1, Reading<D, T, ? extends A2> arg2, Reading<D, T, ? extends A3> arg3, Reading<D, T, ? extends A4> arg4, Reading<D, T, ? extends A5> arg5, Reading<D, T, ? extends A6> arg6) Creates a compound reading for AST nodes with six parsed arguments.The arguments are parsed sequentially in a location-tracking context. Then the given constructor is invoked to create an AST node.
- Type Parameters:
D- the type of source document identifiersT- the type of token typesA1- the type of the first parsed argument valueA2- the type of the second parsed argument valueA3- the type of the third parsed argument valueA4- the type of the fourth parsed argument valueA5- the type of the fifth parsed argument valueA6- the type of the sixth parsed argument valueR- the type of resulting AST nodes- Parameters:
cons- the AST node constructorarg1- the reading for the first parsed argumentarg2- the reading for the second parsed argumentarg3- the reading for the third parsed argumentarg4- the reading for the fourth parsed argumentarg5- the reading for the fifth parsed argumentarg6- the reading for the sixth parsed argument- Returns:
- a compound reading using the AST node constructor for its root
-
reduce
public final <D,T, Reading<D,A1, A2, A3, A4, A5, A6, A7, R> T, reduceR> (ReducerFactory.Constructor7<D, A1, A2, A3, A4, A5, A6, A7, R> cons, Reading<D, T, ? extends A1> arg1, Reading<D, T, ? extends A2> arg2, Reading<D, T, ? extends A3> arg3, Reading<D, T, ? extends A4> arg4, Reading<D, T, ? extends A5> arg5, Reading<D, T, ? extends A6> arg6, Reading<D, T, ? extends A7> arg7) Creates a compound reading for AST nodes with seven parsed arguments.The arguments are parsed sequentially in a location-tracking context. Then the given constructor is invoked to create an AST node.
- Type Parameters:
D- the type of source document identifiersT- the type of token typesA1- the type of the first parsed argument valueA2- the type of the second parsed argument valueA3- the type of the third parsed argument valueA4- the type of the fourth parsed argument valueA5- the type of the fifth parsed argument valueA6- the type of the sixth parsed argument valueA7- the type of the seventh parsed argument valueR- the type of resulting AST nodes- Parameters:
cons- the AST node constructorarg1- the reading for the first parsed argumentarg2- the reading for the second parsed argumentarg3- the reading for the third parsed argumentarg4- the reading for the fourth parsed argumentarg5- the reading for the fifth parsed argumentarg6- the reading for the sixth parsed argumentarg7- the reading for the seventh parsed argument- Returns:
- a compound reading using the AST node constructor for its root
-