Package railo.transformer.bytecode.expression

Examples of railo.transformer.bytecode.expression.ExprBoolean


   * <code>TemplateException::expression;</code>
   * @return condition
   * @throws TemplateException
   */
  private final ExprBoolean condition(ExprData data) throws TemplateException {
    ExprBoolean condition=null;
    comments(data);
    condition=CastBoolean.toExprBoolean(super.expression(data));
    comments(data);
    return condition;
  }
View Full Code Here


        }
        boolean useType=!canHaveKey || _type!=CFTypes.TYPE_ANY;
        //boolean useStrType=useType && (_type==CFTypes.TYPE_UNDEFINED || _type==CFTypes.TYPE_UNKNOW || CFTypes.toString(_type, null)==null);
       
        // required
        ExprBoolean _req = arg.getRequired();
        boolean useReq=!canHaveKey || toBoolean(_req,null)!=Boolean.FALSE;
       
        // default-type
        Expression _def = arg.getDefaultValueType();
        boolean useDef=!canHaveKey || toInt(_def,-1)!=FunctionArgument.DEFAULT_TYPE_NULL;
       
        // pass by reference
        ExprBoolean _pass = arg.isPassByReference();
        boolean usePass=!canHaveKey || toBoolean(_pass,null)!=Boolean.TRUE;
       
        // display-hint
        ExprString _dsp = arg.getDisplayName();
        boolean useDsp=!canHaveKey || !isLiteralEmptyString(_dsp);
       
        // hint
        ExprString _hint = arg.getHint();
        boolean useHint=!canHaveKey || !isLiteralEmptyString(_hint);
       
        // meta
        Map _meta = arg.getMetaData();
        boolean useMeta=!canHaveKey || (_meta!=null && !_meta.isEmpty());
        int functionIndex=7;
        if(!useMeta) {
          functionIndex--;
          if(!useHint) {
            functionIndex--;
            if(!useDsp){
                functionIndex--;
                if(!usePass) {
                  functionIndex--;
                  if(!useDef) {
                    functionIndex--;
                    if(!useReq) {
                      functionIndex--;
                      if(!useType){
                        functionIndex--;
                      }
                    }
                  }
                }
            }
          }
        }
      // write out arguments 
        ga.dup();
            ga.push(i);
             
            // new FunctionArgument(...)
            ga.newInstance(canHaveKey && functionIndex<INIT_FAI_KEY_LIGHT.length?FUNCTION_ARGUMENT_LIGHT:FUNCTION_ARGUMENT_IMPL);
        ga.dup();
        Variable.registerKey(bc,arg.getName(),false);
       
        // type
        if(functionIndex>=INIT_FAI_KEY.length-7) {
          _strType.writeOut(bc, Expression.MODE_REF);
          bc.getAdapter().push(_type);
        }
        // required
        if(functionIndex>=INIT_FAI_KEY.length-6)_req.writeOut(bc, Expression.MODE_VALUE);
        // default value
        if(functionIndex>=INIT_FAI_KEY.length-5)_def.writeOut(bc, Expression.MODE_VALUE);
        // pass by reference
        if(functionIndex>=INIT_FAI_KEY.length-4)_pass.writeOut(bc, Expression.MODE_VALUE);
        // display-name
        if(functionIndex>=INIT_FAI_KEY.length-3)_dsp.writeOut(bc, Expression.MODE_REF);
        // hint
        if(functionIndex>=INIT_FAI_KEY.length-2)_hint.writeOut(bc, Expression.MODE_REF);
        //meta
View Full Code Here

      throw new BytecodeException("value of attribute ["+name+"] must have a literal/constant value",getStart());
    return (LitString) es;
  }
 
  private final LitBoolean toLitBoolean(String name, Expression value) throws BytecodeException {
     ExprBoolean eb = CastBoolean.toExprBoolean(value);
    if(!(eb instanceof LitBoolean))
      throw new BytecodeException("value of attribute ["+name+"] must have a literal/constant value",getStart());
    return (LitBoolean) eb;
  }
View Full Code Here

    // template
    getAttribute("template").getValue().writeOut(bc, Expression.MODE_REF);
   
    // run Once
    Attribute attr = getAttribute("runonce");
    ExprBoolean expr = (attr==null)?
        LitBoolean.FALSE:
        CastBoolean.toExprBoolean(attr.getValue());
    expr.writeOut(bc, Expression.MODE_VALUE);
   
    adapter.invokeVirtual(Types.PAGE_CONTEXT,DO_INCLUDE_RUN_ONCE);
  }
View Full Code Here

  }

  private static Label writeOutElseIfStart(BytecodeContext bc, Tag tag) throws BytecodeException {
    GeneratorAdapter adapter = bc.getAdapter();

    ExprBoolean cont = CastBoolean.toExprBoolean(tag.getAttribute("condition").getValue());
   
    Label endIf = new Label();
       
    ExpressionUtil.visitLine(bc, tag.getStart());
        cont.writeOut(bc,Expression.MODE_VALUE);
        adapter.ifZCmp(Opcodes.IFEQ, endIf);
        return endIf;
  }
View Full Code Here

TOP

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

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.