Package railo.transformer.bytecode.expression

Examples of railo.transformer.bytecode.expression.Expression


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);
View Full Code Here


    tagLibTag.setParseBody(false);
   
    Attribute attrOutput = tag.getAttribute("output");
    if(attrOutput==null) return tagLibTag;
   
    Expression expr = CastBoolean.toExprBoolean(attrOutput.getValue());
   
    if(!(expr instanceof LitBoolean))
      throw new AttributeEvaluatorException("Attribute output of the Tag Function, must be a literal boolean value (true or false)");
    boolean output = ((LitBoolean)expr).getBooleanValue();
    if(output)
View Full Code Here

   
    // output
    // "output=true" wird in "railo.transformer.cfml.attributes.impl.Function" geh�ndelt
    Attribute attr = tag.getAttribute("output");
    if(attr!=null) {
      Expression expr = CastBoolean.toExprBoolean(attr.getValue());
      if(!(expr instanceof LitBoolean))
        throw new EvaluatorException("Attribute output of the Tag "+tlt.getFullName()+", must contain a static boolean value (true or false, yes or no)");
      //boolean output = ((LitBoolean)expr).getBooleanValue();
      //if(!output) ASMUtil.removeLiterlChildren(tag, true);
    }
   
    // extends
    attr = tag.getAttribute("extends");
    if(attr!=null) {
      Expression expr = CastString.toExprString(attr.getValue());
      if(!(expr instanceof LitString)) throw new EvaluatorException("Attribute extends of the Tag "+tlt.getFullName()+", must contain a literal string value");
    }
   
    // implements
    if(isComponent){
      attr = tag.getAttribute("implements");
      if(attr!=null) {
        Expression expr = CastString.toExprString(attr.getValue());
        if(!(expr instanceof LitString)) throw new EvaluatorException("Attribute implements of the Tag "+tlt.getFullName()+", must contain a literal string value");
      }
    }
  }
View Full Code Here

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());
View Full Code Here

     */
    public TagLibTag evaluate( TagLibTag tagLibTag, Tag tag) throws AttributeEvaluatorException {
    tagLibTag.setParseBody(false);
    Attribute attr = tag.getAttribute("output");
    if(attr!=null) {
      Expression expr = attr.getValue();
     
      if(!(expr instanceof LitBoolean))
        throw new AttributeEvaluatorException("Attribute output of the Tag Component, must be a static boolean value (true or false)");
      if(((LitBoolean)expr).getBooleanValue())
        tagLibTag.setParseBody(true);
View Full Code Here

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();

    for (Argument arg : args) {
      Expression value = arg.getValue();
      if (value instanceof OpDouble) {
        arg.setValue(CastString.toExprString(toOpBigDecimal(((OpDouble)value))), "any");
      }
    }
  }
View Full Code Here

      }
    }
  }

  private OpBigDecimal toOpBigDecimal(OpDouble op) {
    Expression left = op.getLeft();
    Expression right = op.getRight();
    if(left instanceof OpDouble) left=toOpBigDecimal((OpDouble) left);
    if(right instanceof OpDouble) right=toOpBigDecimal((OpDouble) right);
    return new OpBigDecimal(left, right, op.getOperation());
  }
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))
View Full Code Here

  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

TOP

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

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.