public class ArithmeticCompiler extends ToItemCompiler
| Modifier and Type | Field and Description |
|---|---|
static HashMap<Class<? extends Calculator>,CalculatorCompiler> |
map |
| Constructor and Description |
|---|
ArithmeticCompiler() |
| Modifier and Type | Method and Description |
|---|---|
void |
compileToItem(CompilerService compiler,
Expression expression)
Generate bytecode to evaluate the ArithmeticExpression
Precondition: none.
|
void |
compileToPrimitive(CompilerService compiler,
Expression expression,
Class requiredClass,
OnEmpty onEmpty)
Generate bytecode to evaluate the expression leaving a plain Java value on the stack.
|
static CalculatorCompiler |
map(Calculator calc) |
compileToBoolean, compileToIterator, compileToPush, returnZeroLengthStringIfNullallocateStatic, compileItemFromInt, compileItemFromString, compileToLoop, generateMethod, handleEmptyStringResult, throwXPathException, throwXPathException, unboxItem, verify, visitAnnotation, visitLineNumberpublic static HashMap<Class<? extends Calculator>,CalculatorCompiler> map
public void compileToItem(CompilerService compiler, Expression expression) throws CannotCompileException
compileToItem in class ExpressionCompilercompiler - the compiler serviceexpression - the expression to be compiledCannotCompileExceptionpublic void compileToPrimitive(CompilerService compiler, Expression expression, Class requiredClass, OnEmpty onEmpty) throws CannotCompileException
compileToPrimitive in class ExpressionCompilercompiler - the compiler serviceexpression - the expression to be compiledrequiredClass - the class of the Java value that is to be left on the stack if the generated code
exits normally. This must be one of Integer.TYPE, Double.TYPE, Float.TYPE, BigDecimal.class, CharSequence.class.onEmpty - a label to which control will be transferred (with nothing on the stack) if the result of theCannotCompileExceptionpublic static CalculatorCompiler map(Calculator calc) throws CannotCompileException
CannotCompileExceptionCopyright (c) 2004-2013 Saxonica Limited. All rights reserved.