Examples of PExpression


Examples of com.google.clearsilver.jsilver.syntax.node.PExpression

   * Optimizes a complex var command by recursively expanding its expression into a sequence of
   * simpler var commands. Currently two expressions are targetted for expansion: string
   * concatenation and escaping functions.
   */
  private PCommand optimizeVarCommands(AVarCommand varCommand) {
    PExpression expression = varCommand.getExpression();
    PPosition position = varCommand.getPosition();

    // This test relies on the type optimizer having replaced add commands
    // with numeric add commands.
    if (expression instanceof AAddExpression) {
View Full Code Here

Examples of com.google.clearsilver.jsilver.syntax.node.PExpression

  @Override
  public void caseAExistsExpression(AExistsExpression node) {
    // Special case. Exists is only ever an issue for variables, all
    // other expressions unconditionally exist.
    PExpression expression = node.getExpression();
    if (expression instanceof AVariableExpression) {
      expression.apply(this);
      if (currentJavaExpression.getType() == Type.VAR_NAME) {
        currentJavaExpression = callFindVariable(currentJavaExpression, false);
      }
      setResult(call(Type.BOOLEAN, "exists", currentJavaExpression));
    } else {
View Full Code Here

Examples of com.google.clearsilver.jsilver.syntax.node.PExpression

public class TypeResolver extends DepthFirstAdapter {

  @Override
  public void caseAAddExpression(AAddExpression node) {
    super.caseAAddExpression(node);
    PExpression lhs = node.getLeft();
    PExpression rhs = node.getRight();
    if (isNumeric(lhs) || isNumeric(rhs)) {
      node.replaceBy(new ANumericAddExpression(lhs, rhs));
    }
  }
View Full Code Here

Examples of com.google.clearsilver.jsilver.syntax.node.PExpression

  }

  @Override
  public void caseAEqExpression(AEqExpression node) {
    super.caseAEqExpression(node);
    PExpression lhs = node.getLeft();
    PExpression rhs = node.getRight();
    if (isNumeric(lhs) || isNumeric(rhs)) {
      node.replaceBy(new ANumericEqExpression(lhs, rhs));
    }
  }
View Full Code Here

Examples of com.google.clearsilver.jsilver.syntax.node.PExpression

  }

  @Override
  public void caseANeExpression(ANeExpression node) {
    super.caseANeExpression(node);
    PExpression lhs = node.getLeft();
    PExpression rhs = node.getRight();
    if (isNumeric(lhs) || isNumeric(rhs)) {
      node.replaceBy(new ANumericNeExpression(lhs, rhs));
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.