Methods Summary |
---|
public void | display(int indent)Display the contents of this element
indent(indent);
Util.println("If");
indent(indent + IndentIncrement);
System.out.print("test ");
Util.println(_test.toString());
displayContents(indent + IndentIncrement);
|
public void | parseContents(com.sun.org.apache.xalan.internal.xsltc.compiler.Parser parser)Parse the "test" expression and contents of this element.
// Parse the "test" expression
_test = parser.parseExpression(this, "test", null);
// Make sure required attribute(s) have been set
if (_test.isDummy()) {
reportError(this, parser, ErrorMsg.REQUIRED_ATTR_ERR, "test");
return;
}
// Ignore xsl:if when test is false (function-available() and
// element-available())
Object result = _test.evaluateAtCompileTime();
if (result != null && result instanceof Boolean) {
_ignore = !((Boolean) result).booleanValue();
}
parseChildren(parser);
|
public void | translate(com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator classGen, com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator methodGen)Translate the "test" expression and contents of this element.
The contents will be ignored if we know the test will always fail.
final InstructionList il = methodGen.getInstructionList();
_test.translateDesynthesized(classGen, methodGen);
// remember end of condition
final InstructionHandle truec = il.getEnd();
if (!_ignore) {
translateContents(classGen, methodGen);
}
_test.backPatchFalseList(il.append(NOP));
_test.backPatchTrueList(truec.getNext());
|
public com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type | typeCheck(com.sun.org.apache.xalan.internal.xsltc.compiler.SymbolTable stable)Type-check the "test" expression and contents of this element.
The contents will be ignored if we know the test will always fail.
// Type-check the "test" expression
if (_test.typeCheck(stable) instanceof BooleanType == false) {
_test = new CastExpr(_test, Type.Boolean);
}
// Type check the element contents
if (!_ignore) {
typeCheckContents(stable);
}
return Type.Void;
|