Package railo.transformer.bytecode.expression

Examples of railo.transformer.bytecode.expression.Expression


  * @return CFXD Element
  * @throws TemplateException
  */
  protected Expression assignOp(ExprData data) throws TemplateException {
       
    Expression expr = conditionalOp(data);
        if (data.cfml.forwardIfCurrent('=')) {
         
            comments(data);
            if(data.mode==STATIC) expr=new DynAssign(expr,assignOp(data));
      else {
        if(expr instanceof Variable)
          expr=new Assign((Variable)expr,assignOp(data));
        else if(expr instanceof Null) {
          expr=new Assign(((Null)expr).toVariable(),assignOp(data));
        }
        else
          throw new TemplateException(data.cfml,"invalid assignment left-hand side ("+expr.getClass().getName()+")");
      }
    }
    return expr;
  }
View Full Code Here


    return expr;
  }
 
  private Expression conditionalOp(ExprData data) throws TemplateException {
       
    Expression expr = impOp(data);
        if (data.cfml.forwardIfCurrent('?')) {
          comments(data);
          // Elvis
          if(data.cfml.forwardIfCurrent(':')) {
            comments(data);
              Expression right = assignOp(data);
           
            if(!(expr instanceof Variable) )
              throw new TemplateException(data.cfml,"left operant of the Elvis operator has to be a variable or a function call");
           
            return OpElvis.toExpr((Variable)expr, right);
          }
         
          Expression left = assignOp(data);
          comments(data);
          if(!data.cfml.forwardIfCurrent(':'))throw new TemplateException("invalid conditional operator");
          comments(data);
          Expression right = assignOp(data);
         
            expr=OpContional.toExpr(expr, left, right);
    }
    return expr;
  }
View Full Code Here

  * <code>eqvOp {"imp" spaces eqvOp};</code>
  * @return CFXD Element
  * @throws TemplateException
  */
  private Expression impOp(ExprData data) throws TemplateException {
    Expression expr = eqvOp(data);
    while(data.cfml.forwardIfCurrentAndNoWordAfter("imp")) {
      comments(data);
            expr=OpBool.toExprBoolean(expr, eqvOp(data), OpBool.IMP);
    }
    return expr;
View Full Code Here

  * <code>xorOp {"eqv" spaces xorOp};</code>
  * @return CFXD Element
  * @throws TemplateException
  */
  private Expression eqvOp(ExprData data) throws TemplateException {
    Expression expr = xorOp(data);
    while(data.cfml.forwardIfCurrentAndNoWordAfter("eqv")) {
      comments(data);
            expr=OpBool.toExprBoolean(expr, xorOp(data), OpBool.EQV);
    }
    return expr;
View Full Code Here

  * <code>orOp {"xor" spaces  orOp};</code>
  * @return CFXD Element
  * @throws TemplateException
  */
  private Expression xorOp(ExprData data) throws TemplateException {
    Expression expr = orOp(data);
    while(data.cfml.forwardIfCurrentAndNoWordAfter("xor")) {
      comments(data);
            expr=OpBool.toExprBoolean(expr, orOp(data), OpBool.XOR);
    }
    return expr;
View Full Code Here

  * <code>andOp {("or" | "||") spaces andOp}; (* "||" Existiert in CFMX nicht *)</code>
  * @return CFXD Element
  * @throws TemplateException
  */
  private Expression orOp(ExprData data) throws TemplateException {
    Expression expr = andOp(data);
   
    while(data.cfml.forwardIfCurrent("||") || data.cfml.forwardIfCurrentAndNoWordAfter("or")) {
      comments(data);
            expr=OpBool.toExprBoolean(expr, andOp(data), OpBool.OR);
    }
View Full Code Here

  * <code>notOp {("and" | "&&") spaces notOp}; (* "&&" Existiert in CFMX nicht *)</code>
  * @return CFXD Element
  * @throws TemplateException
  */
  private Expression andOp(ExprData data) throws TemplateException {
    Expression expr = notOp(data);
   
    while(data.cfml.forwardIfCurrent("&&") || data.cfml.forwardIfCurrentAndNoWordAfter("and")) {
      comments(data);
          expr=OpBool.toExprBoolean(expr, notOp(data), OpBool.AND);
    }
View Full Code Here

  * @return CFXD Element
  * @throws TemplateException
  */
  private Expression decsionOp(ExprData data) throws TemplateException {

    Expression expr = concatOp(data);
    boolean hasChanged=false;
    // ct, contains
    do {
      hasChanged=false;
      if(data.cfml.isCurrent('c')) {
View Full Code Here

  * <code>plusMinusOp {"&" spaces concatOp};</code>
  * @return CFXD Element
  * @throws TemplateException
  */
  private Expression concatOp(ExprData data) throws TemplateException {
    Expression expr = plusMinusOp(data);
   
    while(data.cfml.isCurrent('&') && !data.cfml.isCurrent("&&")) {
      data.cfml.next();
     
      // &=
      if (data.cfml.isCurrent('=') && expr instanceof Variable) {
        data.cfml.next();
        comments(data);
        Expression right = assignOp(data);
        ExprString res = OpString.toExprString(expr, right);
        expr=new OpVariable((Variable)expr,res);
      }
      else {
              comments(data);
View Full Code Here

  * <code>modOp [("-"|"+") spaces plusMinusOp];</code>
  * @return CFXD Element
  * @throws TemplateException
  */
  private Expression plusMinusOp(ExprData data) throws TemplateException {
    Expression expr = modOp(data);
   
    while(!data.cfml.isLast()) {
     
      // Plus Operation
      if (data.cfml.forwardIfCurrent('+'))      expr=_plusMinusOp(data,expr,OpDouble.PLUS);
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.