Package railo.transformer.bytecode.expression

Examples of railo.transformer.bytecode.expression.Expression


  private Expression _plusMinusOp(ExprData data,Expression expr,int opr) throws TemplateException {
    // +=
    if (data.cfml.isCurrent('=') && expr instanceof Variable) {
      data.cfml.next();
      comments(data);
      Expression right = assignOp(data);
      ExprDouble res = OpDouble.toExprDouble(expr, right,opr);
      expr=new OpVariable((Variable)expr,res);
    }
    /*/ ++
    else if (data.cfml.isCurrent(opr==OpDouble.PLUS?'+':'-') && expr instanceof Variable) {
View Full Code Here


    }

  }

  static String variableToString(Tag tag, Attribute attrLabel, String defaultValue) {
    Expression value = attrLabel.getValue();
    while(value instanceof Cast) value=((Cast)value).getExpr();
    if(value instanceof Variable) {
      Variable var=(Variable)value;
      try {
        return VariableString.variableToString(var, true);
View Full Code Here

  * <code>divMultiOp {("mod" | "%") spaces divMultiOp}; (* modulus operator , "%" Existiert in CFMX nicht *)</code>
  * @return CFXD Element
  * @throws TemplateException
  */
  private Expression modOp(ExprData data) throws TemplateException {
    Expression expr = divMultiOp(data);
   
    // Modulus Operation
    while(data.cfml.forwardIfCurrent('%') || data.cfml.forwardIfCurrentAndNoWordAfter("mod")) {
      expr=_modOp(data,expr);
      //comments(data);
View Full Code Here

 
  private Expression _modOp(ExprData data,Expression expr) throws TemplateException {
    if (data.cfml.isCurrent('=') && expr instanceof Variable) {
      data.cfml.next();
      comments(data);
      Expression right = assignOp(data);
      ExprDouble res = OpDouble.toExprDouble(expr, right,OpDouble.MODULUS);
      return new OpVariable((Variable)expr,res);
    }
        comments(data);
        return OpDouble.toExprDouble(expr, expoOp(data), OpDouble.MODULUS);
View Full Code Here

  * <code>expoOp {("*"|"/") spaces expoOp};</code>
  * @return CFXD Element
  * @throws TemplateException
  */
  private Expression divMultiOp(ExprData data) throws TemplateException {
    Expression expr = expoOp(data);

    while (!data.cfml.isLast()) {
     
        // Multiply Operation
        if(data.cfml.forwardIfCurrent('*')) {
View Full Code Here

  private Expression _divMultiOp(ExprData data,Expression expr, int iOp) throws TemplateException {
    if (data.cfml.isCurrent('=') && expr instanceof Variable) {
      data.cfml.next();
      comments(data);
      Expression right = assignOp(data);
      ExprDouble res = OpDouble.toExprDouble(expr, right,iOp);
      return new OpVariable((Variable)expr,res);
    }
        comments(data);
        return OpDouble.toExprDouble(expr, expoOp(data), iOp);
View Full Code Here

  * <code>clip {("exp"|"^") spaces clip};</code>
  * @return CFXD Element
  * @throws TemplateException
  */
  private Expression expoOp(ExprData data) throws TemplateException {
    Expression expr = unaryOp(data);

    // Modulus Operation
    while(data.cfml.forwardIfCurrent('^') || data.cfml.forwardIfCurrentAndNoWordAfter("exp")) {
      comments(data);
            expr=OpDouble.toExprDouble(expr, unaryOp(data), OpDouble.EXP);
View Full Code Here

    }
    return expr;
  }
 
  private Expression unaryOp(ExprData data) throws TemplateException {
    Expression expr = negatePlusMinusOp(data);
   
    // Plus Operation
    if (data.cfml.forwardIfCurrent("++") && expr instanceof Variable)     
      expr=_unaryOp(data,expr,OpDouble.PLUS);
    // Minus Operation
View Full Code Here

    // And Operation
    Position line=data.cfml.getPosition();
    if (data.cfml.forwardIfCurrent('-')) {
      if (data.cfml.forwardIfCurrent('-')) {
        comments(data);
        Expression expr = clip(data);
        ExprDouble res = OpDouble.toExprDouble(expr, LitDouble.toExprDouble(1D),OpDouble.MINUS);
        return new OpVariable((Variable)expr,res);
      }
      comments(data);
      return OpNegateNumber.toExprDouble(clip(data),OpNegateNumber.MINUS,line,data.cfml.getPosition());
     
    }
    else if (data.cfml.forwardIfCurrent('+')) {
      if (data.cfml.forwardIfCurrent('+')) {
        comments(data);
        Expression expr = clip(data);
        ExprDouble res = OpDouble.toExprDouble(expr, LitDouble.toExprDouble(1D),OpDouble.PLUS);
        return new OpVariable((Variable)expr,res);
      }
      comments(data);
      return CastDouble.toExprDouble(clip(data));//OpNegateNumber.toExprDouble(clip(),OpNegateNumber.PLUS,line);
View Full Code Here

  * <code>string | number | dynamic | sharp;</code>
  * @return CFXD Element
  * @throws TemplateException
  */
  private Expression checker(ExprData data) throws TemplateException {
    Expression expr=null;
      // String
      if((expr=string(data))!=null) {
        expr = subDynamic(data,expr);
        data.mode=STATIC;//(expr instanceof Literal)?STATIC:DYNAMIC;// STATIC
        return expr;
View Full Code Here

TOP

Related Classes of railo.transformer.bytecode.expression.Expression

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.