Package railo.transformer.bytecode.expression.var

Examples of railo.transformer.bytecode.expression.var.FunctionMember


    }

        comments(data);
       
        if (data.cfml.isCurrent('(')) {
      FunctionMember func = getFunctionMember(data,Identifier.toIdentifier("_createComponent",Identifier.CASE_ORIGNAL,null,null), true);
      func.addArgument(new Argument(exprName,"string"));
      Variable v=new Variable(expr.getStart(),expr.getEnd());
      v.addMember(func);
            comments(data);
      return v;
    }
View Full Code Here


   
   
   
    // check function
    if (data.cfml.isCurrent('(')) {
      FunctionMember func = getFunctionMember(data,name, true);
     
      Variable var=new Variable(line,data.cfml.getPosition());
      var.addMember(func);
            comments(data);
      return var;
View Full Code Here

      if (flf == null) {
        checkLibrary = false;
      }
    }
    // Element Function
    FunctionMember fm;
    if(checkLibrary) {
      BIF bif=new BIF(name,flf);
      bif.setArgType(flf.getArgType());
      bif.setClass(flf.getClazz());
      bif.setReturnType(flf.getReturnTypeAsString());
      fm=bif;
     
      if(flf.getArgType()== FunctionLibFunction.ARG_DYNAMIC && flf.hasDefaultValues()){
            ArrayList<FunctionLibFunctionArg> args = flf.getArg();
        Iterator<FunctionLibFunctionArg> it = args.iterator();
            FunctionLibFunctionArg arg;
            while(it.hasNext()){
              arg=it.next();
              if(arg.getDefaultValue()!=null)
                bif.addArgument(
                    new NamedArgument(
                        LitString.toExprString(arg.getName()),
                        LitString.toExprString(arg.getDefaultValue()),
                        arg.getTypeAsString(),false
                        ));
            }
      }
    }
    else {
      fm = new UDF(name);
    }
   
   
   

    // Function Attributes
    ArrayList<FunctionLibFunctionArg> arrFuncLibAtt = null;
    int libLen = 0;
    if (checkLibrary) {
      arrFuncLibAtt = flf.getArg();
      libLen = arrFuncLibAtt.size();
    }
    int count = 0;
    do {
      data.cfml.next();
            comments(data);

      // finish
      if (count==0 && data.cfml.isCurrent(')'))
        break;

      // too many Attributes
      boolean isDynamic=false;
      int max=-1;
      if(checkLibrary) {
        isDynamic=flf.getArgType()==FunctionLibFunction.ARG_DYNAMIC;
        max=flf.getArgMax();
      // Dynamic
        if(isDynamic) {
          if(max!=-1 && max <= count)
            throw new TemplateException(
              data.cfml,
              "too many Attributes in function [" + ASMUtil.display(name) + "]");
        }
      // Fix
        else {
          if(libLen <= count){
           
            TemplateException te = new TemplateException(
              data.cfml,
              "too many Attributes in function call [" + ASMUtil.display(name) + "]");
            UDFUtil.addFunctionDoc(te, flf);
            throw te;
          }
        }
       
      }
     
      //Argument arg;
      if (checkLibrary && !isDynamic) {
        // current attribues from library
        FunctionLibFunctionArg funcLibAtt =arrFuncLibAtt.get(count);
        fm.addArgument(functionArgument(data,funcLibAtt.getTypeAsString(),false))
      }
      else {
        fm.addArgument(functionArgument(data,false));
      }

            comments(data);
      count++;
      if (data.cfml.isCurrent(')'))
View Full Code Here

TOP

Related Classes of railo.transformer.bytecode.expression.var.FunctionMember

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.