Package anvil.script.expression

Examples of anvil.script.expression.Expression.eval()


            }
          }
         
          Expression expr = Grammar.parseExpression(buffer.toString(), getLocation(), parser);
          if (expr.isConstant()) {
            addChild(new CharacterDataStatement(this, parser.getLocation(), expr.eval().toString()));
          } else {
            addChild(new PrintStatement(this, parser.getLocation(), expr));
          }
          buffer.setLength(0);
         
View Full Code Here


      Parameter param = params[i];
      Expression expr = param.expression;
      if (expr != null) {
        expr.check(context);
        if (expr.isConstant()) {
          param.value = expr.eval();
        } else {
          context.error(expr.getLocation(), "Default value for parameter '"+param.name+"' is not a constant");
        }
      }
    }
View Full Code Here

            new NestedParser(parser, location, buffer.toString(), startIndex);
           
          Expression expression = expressionParser.parseExpression();
         
          if (expression.isConstant()) {
            sections.add(new ConstantNode(expression.eval().toString()));
          } else {
            Node child = expression.getChild(0);
            if (child != null) {
              sections.add(child);
            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.