Package com.saxonica.ee.bytecode
Class ValueOfCompiler
- java.lang.Object
-
public class ValueOfCompiler extends SimpleNodeConstructorCompiler
Generate code for a ValueOf instruction
-
-
Constructor Summary
Constructors Constructor Description ValueOfCompiler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
compileToItem(CompilerService compiler, Expression expression)
Generate bytecode to get the ValueOf text from the instruction Precondition: none.protected boolean
isNoNodeIfEmpty(Expression expr)
Overridable method to ask whether no node should be produced in the case that the content is emptyprotected void
pushNode(CompilerService compiler, Expression expression)
Generate code to write the node to the current receiver.-
Methods inherited from class com.saxonica.ee.bytecode.SimpleNodeConstructorCompiler
checkContent, compileNodeName, compileToPush, isNamedNodeKind
-
Methods inherited from class com.saxonica.ee.bytecode.ToPushCompiler
compilePushToSequenceCollector, compileToIterator
-
Methods inherited from class com.saxonica.ee.bytecode.ToIteratorCompiler
compileToBoolean
-
Methods inherited from class com.saxonica.ee.bytecode.ExpressionCompiler
allocateStatic, compileItemFromInt, compileToPrimitive, generateMethod, handleEmptyStringResult, printStackTop, verify, visitAnnotation, visitLineNumber
-
-
-
-
Method Detail
-
compileToItem
public void compileToItem(CompilerService compiler, Expression expression) throws CannotCompileException
Generate bytecode to get the ValueOf text from the instruction Precondition: none. Postcondition: the stack contains an item from evaluating this instruction- Overrides:
compileToItem
in classSimpleNodeConstructorCompiler
- Parameters:
compiler
- the compiler serviceexpression
- the expression to be compiled- Throws:
CannotCompileException
- if the expression cannot be compiled to bytecode
-
isNoNodeIfEmpty
protected boolean isNoNodeIfEmpty(Expression expr)
Overridable method to ask whether no node should be produced in the case that the content is empty- Overrides:
isNoNodeIfEmpty
in classSimpleNodeConstructorCompiler
- Returns:
- true if the rules for this instruction are that when the content is empty, no node is generated
-
pushNode
protected void pushNode(CompilerService compiler, Expression expression)
Generate code to write the node to the current receiver. On entry the stack holds the current receiver, the node name (for named node kinds only) and the content (for all nodes)- Specified by:
pushNode
in classSimpleNodeConstructorCompiler
- Parameters:
compiler
- the compiler serviceexpression
- the expression to be compiled
-
-