/** * Verify that parent pointers are correct throughout the subtree rooted at this expression * @throws IllegalStateException if invalid parent pointers are found * @return the expression */ public Expression verifyParentPointers() throws IllegalStateException { for (Operand o : operands()) { Expression parent = o.getChildExpression().getParentExpression(); if (parent != this) { throw new IllegalStateException("Invalid parent pointer in " + parent.toShortString() + " subexpression " + o.getChildExpression().toShortString()); } if (o.getParentExpression() != this) { throw new IllegalStateException("Invalid parent pointer in operand object " + parent.toShortString() + " subexpression " + o.getChildExpression().toShortString()); } if (ExpressionTool.findOperand(parent, o.getChildExpression()) == null) { throw new IllegalStateException("Incorrect parent pointer in " + parent.toShortString() + " subexpression " + o.getChildExpression().toShortString()); } o.getChildExpression().verifyParentPointers(); } return this; }
public static void trace(Configuration config, String message, Expression exp) { if (config.getBooleanProperty(Feature.TRACE_OPTIMIZER_DECISIONS)) { Logger err = config.getLogger(); err.info("OPT : At line " + exp.getLocation().getLineNumber() + " of " + exp.getLocation().getSystemId()); err.info("OPT : " + message); err.info("OPT : Expression after rewrite: " + exp.toString()); exp.verifyParentPointers(); } }
/** * Verify that parent pointers are correct throughout the subtree rooted at this expression * @throws IllegalStateException if invalid parent pointers are found * @return the expression */ public Expression verifyParentPointers() throws IllegalStateException { for (Operand o : operands()) { Expression parent = o.getChildExpression().getParentExpression(); if (parent != this) { throw new IllegalStateException("Invalid parent pointer in " + parent.toShortString() + " subexpression " + o.getChildExpression().toShortString()); } if (o.getParentExpression() != this) { throw new IllegalStateException("Invalid parent pointer in operand object " + parent.toShortString() + " subexpression " + o.getChildExpression().toShortString()); } if (ExpressionTool.findOperand(parent, o.getChildExpression()) == null) { throw new IllegalStateException("Incorrect parent pointer in " + parent.toShortString() + " subexpression " + o.getChildExpression().toShortString()); } o.getChildExpression().verifyParentPointers(); } return this; }
public static void trace(Configuration config, String message, Expression exp) { if (config.getBooleanProperty(Feature.TRACE_OPTIMIZER_DECISIONS)) { Logger err = config.getLogger(); err.info("OPT : At line " + exp.getLocation().getLineNumber() + " of " + exp.getLocation().getSystemId()); err.info("OPT : " + message); err.info("OPT : Expression after rewrite: " + exp.toString()); exp.verifyParentPointers(); } }
/** * Trace optimization actions * * @param message the message to be displayed * @param exp the expression after being rewritten */ public void trace(String message, Expression exp) { if (tracing) { Logger err = getConfiguration().getLogger(); err.info("OPT : At line " + exp.getLocation().getLineNumber() + " of " + exp.getLocation().getSystemId()); err.info("OPT : " + message); err.info("OPT : Expression after rewrite: " + exp.toString()); exp.verifyParentPointers(); } }
/** * Trace optimization actions * * @param message the message to be displayed * @param exp the expression after being rewritten */ public void trace(String message, Expression exp) { if (tracing) { Logger err = getConfiguration().getLogger(); err.info("OPT : At line " + exp.getLocation().getLineNumber() + " of " + exp.getLocation().getSystemId()); err.info("OPT : " + message); err.info("OPT : Expression after rewrite: " + exp.toString()); exp.verifyParentPointers(); } }