public abstract class ToItemCompiler extends ExpressionCompiler
Constructor and Description |
---|
ToItemCompiler() |
Modifier and Type | Method and Description |
---|---|
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.
|
allocateStatic, compileItemFromInt, compileToItem, compileToLoop, compileToPrimitive, generateMethod, handleEmptyStringResult, printStackTop, unboxItem, verify, visitAnnotation, visitLineNumber
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 expressioncompileToIterator
in class ExpressionCompiler
compiler
- the compiler serviceexpression
- the expression to be compiledCannotCompileException
public void compileToBoolean(CompilerService compiler, Expression expression) throws CannotCompileException
ExpressionCompiler
compileToBoolean
in class ExpressionCompiler
compiler
- the compiler serviceexpression
- the expression to be compiledCannotCompileException
public void compileToPush(CompilerService compiler, Expression expression) throws CannotCompileException
ExpressionCompiler
compileToPush
in class ExpressionCompiler
compiler
- the compiler serviceexpression
- the expression to be compiledCannotCompileException
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 labelCopyright (c) 2004-2018 Saxonica Limited. All rights reserved.