public class ForExpressionCompiler extends ToIteratorCompiler
Constructor and Description |
---|
ForExpressionCompiler() |
Modifier and Type | Method and Description |
---|---|
void |
compileToIterator(CompilerService compiler,
Expression expression)
Generate bytecode to evaluate the ForExpression as an iterator
Precondition: none.
|
void |
compileToPush(CompilerService compiler,
Expression expression)
Generate bytecode to evaluate the ForExpression in push mode
Precondition: none.
|
static java.lang.Class |
generateSequenceMappingAction(CompilerService compiler,
ForExpression expression,
Expression action,
int slotNumber)
Generate a mapping function with a map() method that returns an iterator over the results of
one iteration of the loop
|
compileToBoolean, compileToItem
allocateStatic, compileItemFromInt, compileToPrimitive, generateMethod, handleEmptyStringResult, printStackTop, verify, visitAnnotation, visitLineNumber
public void compileToPush(CompilerService compiler, Expression expression) throws CannotCompileException
compileToPush
in class ToIteratorCompiler
compiler
- the compiler serviceexpression
- the expression to be compiledCannotCompileException
- if the expression cannot be compiled to bytecodepublic void compileToIterator(CompilerService compiler, Expression expression) throws CannotCompileException
compileToIterator
in class ExpressionCompiler
compiler
- the compiler serviceexpression
- the expression to be compiledCannotCompileException
- if the expression cannot be compiled to bytecodepublic static java.lang.Class generateSequenceMappingAction(CompilerService compiler, ForExpression expression, Expression action, int slotNumber) throws CannotCompileException
compiler
- the CompilerServiceexpression
- the "for" expression itselfaction
- the body of the "for" loop, which represents the expression to be compiledslotNumber
- the slot numberCannotCompileException
- if the expression cannot be compiled to bytecodeCopyright (c) 2004-2020 Saxonica Limited. All rights reserved.