Package railo.runtime.interpreter.ref.cast

Examples of railo.runtime.interpreter.ref.cast.Casting


    if(member!=null){
      List<FunctionLibFunctionArg> _args = member.getArg();
      FunctionLibFunctionArg arg;
      if(args.length<_args.size()){
        ArrayList<Ref> refs=new ArrayList<Ref>();
        refs.add(new Casting(strType,type,coll));
        for(int y=0;y<args.length;y++){
          arg = _args.get(y+1);
          refs.add(new Casting(arg.getTypeAsString(),arg.getType(),args[y]));
        }
        return new BIFCall(coll, member, refs.toArray(new Ref[refs.size()])).getValue(pc);
      }
     
    }
View Full Code Here


      FunctionLibFunctionArg arg;
      if(args.size()<_args.size()){
        Object val;
        ArrayList<Ref> refs=new ArrayList<Ref>();
        arg=_args.get(0);
        refs.add(new Casting(arg.getTypeAsString(),arg.getType(),new LFunctionValue(new LString(arg.getName()),coll)));
        for(int y=1;y<_args.size();y++){
          arg = _args.get(y);
         
          // match by name
          val = args.get(arg.getName(),null);
         
          //match by alias
          if(val==null) {
            String alias=arg.getAlias();
            if(!StringUtil.isEmpty(alias,true)) {
              String[] aliases = railo.runtime.type.util.ListUtil.trimItems(railo.runtime.type.util.ListUtil.listToStringArray(alias,','));
              for(int x=0;x<aliases.length;x++){
                val = args.get(aliases[x],null);
                if(val!=null) break;
              }
            }
          }
         
          if(val==null) {
            if(arg.getRequired()) {
              throw new ExpressionException("missing required argument ["+arg.getName()+"] for member function call ["+member.getMemberName()+"]");
            }
          }
          else{
            refs.add(new Casting(arg.getTypeAsString(),arg.getType(),new LFunctionValue(new LString(arg.getName()),val)));
            //refs.add(new LFunctionValue(new LString(arg.getName()),new Casting(pc,arg.getTypeAsString(),arg.getType(),val)));
          }
         
        }
        return new BIFCall(coll,member, refs.toArray(new Ref[refs.size()])).getValue(pc);
View Full Code Here

        Ref expr = clip();
        Ref res = preciseMath?new BigPlus(expr,new LNumber(new Double(1))):new Plus(expr,new LNumber(new Double(1)));
        return new Assign(expr,res);
      }
          cfml.removeSpace();
          return new Casting("numeric",CFTypes.TYPE_NUMERIC,clip());
         
        }
        return clip();
    }
View Full Code Here

                if(type==CFTypes.TYPE_VARIABLE_STRING) {
                    arr.add(functionArgDeclarationVarString());
                }
                else {
                  ref = functionArgDeclaration();
                  arr.add(new Casting(funcLibAtt.getTypeAsString(),type,ref));
                }
            }
            else {
                arr.add(functionArgDeclaration());
            }
View Full Code Here

        while(it.hasNext()) {
          flfa =it.next();
          vt = getMatchingValueAndType(flfa,fvalues,names);
          if(vt.index!=-1)
            names[vt.index]=null;
          arguments[index++]=new Casting( vt.type, CFTypes.toShort(vt.type, false, CFTypes.TYPE_UNKNOW), vt.value).getValue(pc)
        }
       
        for(int y=0;y<names.length;y++){
          if(names[y]!=null) {
            ExpressionException ee = new InterpreterException("argument ["+names[y]+"] is not allowed for function ["+flf.getName()+"]");
View Full Code Here

    return fvalues;
  }

  private boolean isNamed(PageContext pc,Ref[] refArgs) throws PageException {
      if(ArrayUtil.isEmpty(refArgs)) return false;
    Casting cast;
    int count=0;
    for(int i=0;i<refArgs.length;i++){
      if(refArgs[i] instanceof Casting){
        cast=(Casting) refArgs[i];
        if(cast.getRef() instanceof LFunctionValue && ((LFunctionValue)cast.getRef()).getValue(pc) instanceof FunctionValue) {
          count++;
        }
      }
    }
    if(count!=0 && count!=refArgs.length){
View Full Code Here

TOP

Related Classes of railo.runtime.interpreter.ref.cast.Casting

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.