|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.saxonica.bytecode.ExpressionCompiler com.saxonica.bytecode.ToItemCompiler
public abstract class ToItemCompiler
Abstract superclass for expression compilers that handle expressions returning a single item (or nothing). The compilers for such expressions must implement the compileToItem() method; they may optionally implement other methods such as compileToIterator().
Constructor Summary | |
---|---|
ToItemCompiler()
|
Method Summary | |
---|---|
void |
compileToBoolean(CompilerService compiler,
Expression expression)
Generate bytecode to evaluate the expression as a boolean Precondition: none. |
void |
compileToIterator(CompilerService compiler,
Expression expression)
Generate bytecode to evaluate the expression as a SequenceIterator
Precondition: none. |
void |
compileToPush(CompilerService compiler,
Expression expression)
Generate bytecode to evaluate the expression in push mode Precondition: none. |
protected void |
returnZeroLengthStringIfNull(Expression arg,
Generator ga,
GeneratedMethodInfo methodInfo,
LabelInfo returnLabel,
int extraPops)
Utility method for use by subclasses to generate code that causes an empty string to be returned if the first argument is an empty sequence. |
Methods inherited from class com.saxonica.bytecode.ExpressionCompiler |
---|
allocateStatic, compileItemFromInt, compileItemFromString, compileToItem, compileToLoop, compileToPrimitive, generateMethod, getConfiguration, handleEmptyStringResult, setConfiguration, throwXPathException, throwXPathException, unboxItem, verify, visitAnnotation, visitLineNumber |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ToItemCompiler()
Method Detail |
---|
public void compileToIterator(CompilerService compiler, Expression expression) throws CannotCompileException
ExpressionCompiler
SequenceIterator
Precondition: none.
Postcondition: at execution time, the stack contains a SequenceIterator representing the result of the expression
compileToIterator
in class ExpressionCompiler
compiler
- the compiler serviceexpression
- the expression to be compiled
CannotCompileException
public void compileToBoolean(CompilerService compiler, Expression expression) throws CannotCompileException
ExpressionCompiler
compileToBoolean
in class ExpressionCompiler
compiler
- the compiler serviceexpression
- the expression to be compiled
CannotCompileException
public void compileToPush(CompilerService compiler, Expression expression) throws CannotCompileException
ExpressionCompiler
compileToPush
in class ExpressionCompiler
compiler
- the compiler serviceexpression
- the expression to be compiled
CannotCompileException
protected void returnZeroLengthStringIfNull(Expression arg, Generator ga, GeneratedMethodInfo methodInfo, LabelInfo returnLabel, int extraPops)
arg
- the first argumentga
- the GeneratormethodInfo
- the method informationreturnLabel
- the label to jump to on completionextraPops
- items (other than the string being tested) that need to be popped of the stack if jumping to
the return label
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |