Package railo.transformer.bytecode.expression.var

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


import railo.transformer.library.function.FunctionLibFunction;

public class IsDefined implements FunctionEvaluator{

  public void evaluate(BIF bif, FunctionLibFunction flf) throws TemplateException {
    Argument arg = bif.getArguments()[0];
    Expression value = arg.getValue();
    if(value instanceof LitString) {
      String str=((LitString)value).getString();
      StringList sl = VariableInterpreter.parse(str,false);
      if(sl!=null){
        // scope
        str=sl.next();
        int scope = VariableInterpreter.scopeString2Int(str);
        if(scope==Scope.SCOPE_UNDEFINED)sl.reset();
       
        // keys
        String[] arr=sl.toArray();
        ArrayUtil.trim(arr);
       
        // update first arg
        arg.setValue(LitDouble.toExprDouble(scope),"number");
       
        // add second argument
       
        if(arr.length==1){
          Expression expr = new CollectionKey(arr[0]);//LitString.toExprString(str);
          arg=new Argument(expr,Collection.Key.class.getName());
          bif.addArgument(arg)
        }
        else {
          CollectionKeyArray expr=new CollectionKeyArray(arr);
          //LiteralStringArray expr = new LiteralStringArray(arr);
          arg=new Argument(expr,Collection.Key[].class.getName());
          bif.addArgument(arg);
        }
       
      }
     
View Full Code Here


import railo.transformer.library.function.FunctionLibFunction;

public class StructKeyExists implements FunctionEvaluator{

  public void evaluate(BIF bif, FunctionLibFunction flf) throws TemplateException {
    Argument arg = bif.getArguments()[1];
    Expression value = arg.getValue();
    if(value instanceof LitString) {
      String str=((LitString)value).getString();
     
      // update first arg
      arg.setValue(new CollectionKey(str),Collection.Key.class.getName());
    }
    //print.out("bif:"+arg.getValue().getClass().getName());
  }
View Full Code Here

import railo.transformer.library.function.FunctionLibFunction;

public class IsNull implements FunctionEvaluator{

  public void evaluate(BIF bif, FunctionLibFunction flf) throws TemplateException {
    Argument arg = bif.getArguments()[0];
    Expression value = arg.getValue();
   
   
   
    if(value instanceof Variable){
      ((Variable)value).setDefaultValue(NullExpression.NULL_EXPRESSION);
View Full Code Here

  public void evaluate(BIF bif, FunctionLibFunction flf) throws TemplateException {
    Argument[] args = bif.getArguments();
    if(ArrayUtil.isEmpty(args)) return;
   
    Argument arg = args[0];
    Expression value = arg.getValue();
    if(value instanceof LitString) {
      String unit=((LitString)value).getString();
      if("nano".equalsIgnoreCase(unit))
        arg.setValue(LitDouble.toExprDouble(railo.runtime.functions.other.GetTickCount.UNIT_NANO), "number");
      else if("milli".equalsIgnoreCase(unit))
        arg.setValue(LitDouble.toExprDouble(railo.runtime.functions.other.GetTickCount.UNIT_MILLI), "number");
      else if("micro".equalsIgnoreCase(unit))
        arg.setValue(LitDouble.toExprDouble(railo.runtime.functions.other.GetTickCount.UNIT_MICRO), "number");
      else if("second".equalsIgnoreCase(unit))
        arg.setValue(LitDouble.toExprDouble(railo.runtime.functions.other.GetTickCount.UNIT_SECOND), "number");
    }
  }
View Full Code Here

public class ArrayToList implements FunctionEvaluator{

  public void evaluate(BIF bif, FunctionLibFunction flf) throws TemplateException {
    Argument[] args = bif.getArguments();
   
    Argument arg = args[0];
    Expression value = arg.getValue();
    if(value instanceof Cast) {
      value=((Cast)value).getExpr();
    }
    if(value instanceof Variable) {
      ((Variable)value).setAsCollection(Boolean.TRUE);
View Full Code Here

               
                // first get existing arguments
                arr.add(args[0]);
                arr.add(args[1]);
                if(args.length>=3)arr.add(args[2]);
                else arr.add(new Argument(LitString.toExprString(","),"string"));
                if(args.length>=4)arr.add(args[3]);
                else arr.add(new Argument(LitString.toExprString("all"),"string"));
                if(args.length>=5)arr.add(args[4]);
                else arr.add(new Argument(LitBoolean.toExprBoolean(false),"boolean"));
               
               
                // PSQ-BIF DO NOT REMOVE THIS COMMENT
                arr.add(new Argument(LitBoolean.toExprBoolean(true),"boolean"));
                bif.setArguments(arr.toArray(new Argument[arr.size()]));
                continue;
              }
              else if(
                bif.getClazz().getName().equals(QuotedValueList.class.getName()) ||
View Full Code Here

      }
    }
    catch(BytecodeException be) {
      throw new TemplateException(data.cfml,be.getMessage());
    }
    return new Argument(expr,type);
  }
View Full Code Here

        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

TOP

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

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.