Package com.google.gwt.thirdparty.common.css.compiler.ast

Examples of com.google.gwt.thirdparty.common.css.compiler.ast.CssBooleanExpressionNode


  private void visitConditionalRule(CssConditionalRuleNode node,
      CssConditionalBlockNode parent) {

    if (node.getType() != Type.ELSE) {
      CssBooleanExpressionNode nodeCondition = node.getCondition();
      String condition = extractRuntimeCondition(nodeCondition);

      if (condition != null) {
        CssJavaExpressionNode newNode = new CssJavaExpressionNode(condition,
            nodeCondition.getSourceCodeLocation());

        CssRuntimeConditionalRuleNode newRuleNode = new CssRuntimeConditionalRuleNode(node,
            newNode);

        // Unfortunately visitController.replaceCurrentBlockChildWith doesn't work with
View Full Code Here


      // The node can be evaluated at compile time
      BooleanExpressionEvaluator evaluator = new BooleanExpressionEvaluator(
          currentConditional.getCondition(), trueConditions);

      CssBooleanExpressionNode result = evaluator.evaluate();
      boolean isTrue = CssBooleanExpressionNode.Type.TRUE_CONSTANT.equals(result.getValue());

      if (!isTrue) {
        // any node evaluated to false can be removed
      } else if (!runtimeEvaluationNodeFound) {
        // node evaluated to true before the runtime condition, replace the conditional block by the
View Full Code Here

        childrenStack.addFirst((CssBooleanExpressionNode) children);
      }
    }

    while (!childrenStack.isEmpty()) {
      CssBooleanExpressionNode visitingNode = childrenStack.pop();
      visitBooleanExpression(visitingNode);

      if (visitingNode.getLeft() != null) {
        childrenStack.addFirst(visitingNode.getLeft());
      }
      if (visitingNode.getRight() != null) {
        childrenStack.addFirst(visitingNode.getRight());
      }
    }

    return true;
  }
View Full Code Here

TOP

Related Classes of com.google.gwt.thirdparty.common.css.compiler.ast.CssBooleanExpressionNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.