|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.saxonica.bytecode.util.LoopBodyGenerator
public abstract class LoopBodyGenerator
LoopBodyGenerator is code to generate the body of a loop, for example of a ForExpression. When the ForExpression is compiled as a loop, this callback specifies how to generate code for the loop body. For example, if the caller is the compiler for the sum() function, the callback will increment the local variable holding the total so far.
Constructor Summary | |
---|---|
LoopBodyGenerator()
|
Method Summary | |
---|---|
abstract void |
generateLoopBody(CompilerService compiler)
Generate the code to process each item delivered by the looping expression. |
Class |
getExpectedItemClass()
Say in what form the loop body generator expects the items to be delivered. |
boolean |
isSmallAmountOfCode()
Say whether the amount of code generated is sufficiently small that we don't mind it being generated more than once. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LoopBodyGenerator()
Method Detail |
---|
public abstract void generateLoopBody(CompilerService compiler) throws CannotCompileException
compiler
- the compiler service
CannotCompileException
- if the expression cannot be compiledpublic Class getExpectedItemClass()
Item
. The alternative is to ask for it to be placed as a primitive value,
for example of type Double.TYPE or Boolean.TYPE, or as a Java String or BigDecimal object
public boolean isSmallAmountOfCode()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |