public abstract class SimpleNodeConstructorCompiler extends ToPushCompiler
Constructor and Description |
---|
SimpleNodeConstructorCompiler() |
Modifier and Type | Method and Description |
---|---|
protected void |
checkContent(CompilerService compiler,
Expression expression)
Compile code to check the content of the node, and adjust it if necessary
On entry the proposed content is on the stack as a CharSequence; on exit the revised content
must be on the stack as a CharSequence.
|
protected void |
compileNodeName(CompilerService compiler,
Expression expression)
Compile code to generate the node name (if any) and leave it on the top of the stack.
|
void |
compileToItem(CompilerService compiler,
Expression expression)
Generate bytecode to evaluate the expression as an Item
Precondition: none.
|
void |
compileToPush(CompilerService compiler,
Expression expression)
Generate bytecode to evaluate the expression in push mode
Precondition: none.
|
protected boolean |
isNamedNodeKind()
Ask whether this instruction generates a kind of node that is named
|
protected boolean |
isNoNodeIfEmpty(Expression expr)
Overridable method to ask whether no node should be produced in the case that the content is empty
|
protected abstract void |
pushNode(CompilerService compiler,
Expression expression)
Generate code to write the node to the current receiver.
|
compileToIterator
compileToBoolean
allocateStatic, compileItemFromInt, compileToLoop, compileToPrimitive, generateMethod, handleEmptyStringResult, printStackTop, unboxItem, verify, visitAnnotation, visitLineNumber
public void compileToPush(CompilerService compiler, Expression expression) throws CannotCompileException
ExpressionCompiler
compileToPush
in class ToIteratorCompiler
compiler
- the compiler serviceexpression
- the expression to be compiledCannotCompileException
protected boolean isNoNodeIfEmpty(Expression expr)
protected void checkContent(CompilerService compiler, Expression expression)
compiler
- expression
- protected void compileNodeName(CompilerService compiler, Expression expression) throws CannotCompileException
CannotCompileException
protected abstract void pushNode(CompilerService compiler, Expression expression)
compiler
- expression
- protected boolean isNamedNodeKind()
public void compileToItem(CompilerService compiler, Expression expression) throws CannotCompileException
ExpressionCompiler
compileToItem
in class ToPushCompiler
compiler
- the compiler serviceexpression
- the expression to be compiledCannotCompileException
Copyright (c) 2004-2018 Saxonica Limited. All rights reserved.