com.saxonica.bytecode
Class ValueComparisonCompiler
java.lang.Object
com.saxonica.bytecode.ExpressionCompiler
com.saxonica.bytecode.ToBooleanCompiler
com.saxonica.bytecode.ValueComparisonCompiler
public class ValueComparisonCompiler
- extends ToBooleanCompiler
Generate code for a ValueComparison
| Methods inherited from class com.saxonica.bytecode.ExpressionCompiler |
allocateStatic, compileItemFromInt, compileItemFromString, 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 |
ValueComparisonCompiler
public ValueComparisonCompiler()
compileToItem
public void compileToItem(CompilerService compiler,
Expression expression)
throws CannotCompileException
- Generate bytecode to evaluate the expression as an Item
Precondition: none.
Postcondition: the stack contains either an item (the result of the expression), or null
(representing an empty sequence).
- Overrides:
compileToItem in class ToBooleanCompiler
- Parameters:
compiler - the compiler serviceexpression - the expression to be compiled
- Throws:
CannotCompileException
compileToBoolean
public void compileToBoolean(CompilerService compiler,
Expression expression)
throws CannotCompileException
- Generate bytecode to evaluate the ValueComparison as a boolean value
Precondition: none.
Postcondition: the stack contains an boolean value representing the result of the expression
- Specified by:
compileToBoolean in class ExpressionCompiler
- Parameters:
compiler - the compiler serviceexpression - the expression to be compiled
- Throws:
CannotCompileException
compile
public static void compile(CompilerService compiler,
Expression expression,
Expression[] operands,
int op,
AtomicComparer comparer,
boolean toItem)
throws CannotCompileException
- This method handles both compileToBoolean and compileToItem. The difference is that in some circumstances
compileToItem returns an empty sequence when compileToBoolean returns false;
- Parameters:
compiler - the compiler serviceexpression - the expression to be compiledoperands - op - the Operatorcomparer - the AtomicComparer used to compare the two atomic valuestoItem - true if compiling to an Item rather than to a boolean
- Throws:
CannotCompileException - if the expression cannot be compiled
translateOperator
public static int translateOperator(int op)
Copyright (c) 2004-2011 Saxonica Limited. All rights reserved.