Package railo.transformer.bytecode.expression

Examples of railo.transformer.bytecode.expression.ExprString


      String name=null;
      Invoker invoker=null;
    // Loop over nested Variables
    while (data.cfml.isValidIndex()) {
      ExprString nameProp = null,namePropUC = null;
      // .
      if (data.cfml.forwardIfCurrent('.')) {
        // Extract next Var String
                comments(data);
                Position line=data.cfml.getPosition();
View Full Code Here


    if(!(expr instanceof Variable)) return expr;
    Variable var=(Variable) expr;
    Member m= var.getFirstMember();
    if(!(m instanceof DataMember)) return expr;
   
    ExprString n = ((DataMember)m).getName();
    if(!(n instanceof LitString)) return expr;
   
    LitString ls=(LitString) n;
   
   
    if(!"new".equalsIgnoreCase(ls.getString())) return expr;
   
    int start=data.cfml.getPos();
      String name=null;
     
     
      // first identifier
      name = identifier(data,true);
     
   
    ExprString exprName;
    if(name!=null)  {
      StringBuilder fullName=new StringBuilder();
      fullName.append(name);
      // Loop over addional identifier
      while (data.cfml.isValidIndex()) {
View Full Code Here

  * @return CFXD Element
  * @throws TemplateException
  */
  private ExprString structElement(ExprData data) throws TemplateException {
        comments(data);
        ExprString name = CastString.toExprString(assignOp(data));
    if(name instanceof LitString)((LitString)name).fromBracket(true);
        comments(data);
    return name;
  }
View Full Code Here

           
          boolean canHaveKey = Variable.canRegisterKey(arg.getName());
       
      // CHECK if default values
        // type
        ExprString _strType = arg.getType();
        short _type=CFTypes.TYPE_UNKNOW;
        if(_strType instanceof LitString){
          _type=CFTypes.toShortStrict(((LitString)_strType).getString(),CFTypes.TYPE_UNKNOW);
        }
        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
        if(functionIndex==INIT_FAI_KEY.length-1)Page.createMetaDataStruct(bc,_meta,null);
       
        if(functionIndex<INIT_FAI_KEY_LIGHT.length)
            ga.invokeConstructor(FUNCTION_ARGUMENT_LIGHT, INIT_FAI_KEY[functionIndex]);
View Full Code Here

      metadata.put(attr.getName(), attr);
    }
  }

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

        catch(Throwable t){}
      }
     
     
      if(str.length()>MAX_SIZE) {
          ExprString expr=_toExpr(str);
          expr.writeOut(bc, mode);
        }
        else {
          bc.getAdapter().push(str);
        }
        return Types.STRING;
View Full Code Here

        return _writeOut(bc, mode, str);
    }

    private static ExprString _toExpr(String str) {
      int size=MAX_SIZE-1;
      ExprString left = LitString.toExprString(str.substring(0,size));
      str = str.substring(size);
     
      ExprString right = (str.length()>size)?_toExpr(str):toExprString(str);

      return OpString.toExprString(left, right, false);
  }
View Full Code Here

TOP

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

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.