com.saxonica.bytecode
Class ContainsCompiler
java.lang.Object
com.saxonica.bytecode.ExpressionCompiler
com.saxonica.bytecode.ToBooleanCompiler
com.saxonica.bytecode.ContainsCompiler
public class ContainsCompiler
- extends ToBooleanCompiler
Generate bytecode for a call on fn:contains
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 |
ContainsCompiler
public ContainsCompiler()
compileToBoolean
public void compileToBoolean(CompilerService compiler,
Expression expression)
throws CannotCompileException
- Description copied from class:
ExpressionCompiler
- Generate bytecode to evaluate the expression as a boolean
Precondition: none.
Postcondition: at execution time, the stack contains an integer (0=false, 1=true) representing the result of the expression
- Specified by:
compileToBoolean
in class ExpressionCompiler
- Parameters:
compiler
- the compiler serviceexpression
- the expression to be compiled
- Throws:
CannotCompileException
returnIfEmpty
protected static void returnIfEmpty(CompilerService compiler,
Expression arg,
LabelInfo returnLabel,
int popsNeeded)
- Utility method for use by subclasses to generate code that causes an boolean result to be returned
if the first argument is an empty sequence or zero-length string.
Precondition: the value of the first argument is on the stack, as a CharSequence
Postcondition: either the control has jumped to the return label with the given result on the
stack, or control drops through with the value of the first argument still on the stack (as supplied).
- Parameters:
compiler
- the compilerarg
- the first argumentreturnLabel
- the label to jump to if the argument is an empty sequence or zero-length stringpopsNeeded
- the number of items to pop from the stack if jumping to the return label
useDynamicCollation
public static void useDynamicCollation(CompilerService compiler,
CollatingFunction function,
StringCollator stringCollator)
throws CannotCompileException
- Common code for handling non-standard collations in starts-with and similar functions. This
is used both when the collation is explicitly specified and when it is dynamically computed.
On exit a StringCollator will have been added to the stack.
- Parameters:
compiler
- function
- stringCollator
-
- Throws:
CannotCompileException
Copyright (c) 2004-2011 Saxonica Limited. All rights reserved.