/** * Returns a MinimizedCondition that represents the condition node after * minimization. */ static MinimizedCondition fromConditionNode(Node n) { checkState(n.getParent() != null); switch (n.getToken()) { case NOT: case AND: case OR: case HOOK: case COMMA: return computeMinimizedCondition(n); default: return unoptimized(n); } }
/** * Remove the passed condition node from the AST, and then return a * MinimizedCondition that represents the condition node after * minimization. */ static MinimizedCondition fromConditionNode(Node n) { switch (n.getType()) { case Token.NOT: case Token.AND: case Token.OR: case Token.HOOK: case Token.COMMA: Node placeholder = swapWithPlaceholderNode(n); return computeMinimizedCondition(n).setPlaceholder(placeholder); default: return unoptimized(n); } }