Examples of LiteralExpr


Examples of com.caucho.quercus.expr.LiteralExpr

    if (_countDelegate != null)
      cl.setCountDelegate(_countDelegate);

    for (Map.Entry<String,Value> entry : _constMap.entrySet()) {
      cl.addConstant(entry.getKey(), new LiteralExpr(entry.getValue()));
    }
   
    for (Map.Entry<String,Object> entry : _constJavaMap.entrySet()) {
      cl.addJavaConstant(entry.getKey(), entry.getValue());
    }
View Full Code Here

Examples of com.caucho.quercus.expr.LiteralExpr

    if (_countDelegate != null)
      cl.setCountDelegate(_countDelegate);

    for (Map.Entry<String,Value> entry : _constMap.entrySet()) {
      cl.addConstant(entry.getKey(), new LiteralExpr(entry.getValue()));
    }
  }
View Full Code Here

Examples of com.caucho.quercus.expr.LiteralExpr

    if (_countDelegate != null)
      cl.setCountDelegate(_countDelegate);

    for (Map.Entry<String,Value> entry : _constMap.entrySet()) {
      cl.addConstant(entry.getKey(), new LiteralExpr(entry.getValue()));
    }
   
    for (Map.Entry<String,Object> entry : _constJavaMap.entrySet()) {
      cl.addJavaConstant(entry.getKey(), entry.getValue());
    }
View Full Code Here

Examples of com.google.refine.grel.ast.LiteralExpr

        }

        Evaluable eval = null;

        if (_token.type == TokenType.String) {
            eval = new LiteralExpr(_token.text);
            next(false);
        } else if (_token.type == TokenType.Regex) {
            RegexToken t = (RegexToken) _token;

            try {
                Pattern pattern = Pattern.compile(_token.text, t.caseInsensitive ? Pattern.CASE_INSENSITIVE : 0);
                eval = new LiteralExpr(pattern);
                next(false);
            } catch (Exception e) {
                throw makeException("Bad regular expression (" + e.getMessage() + ")");
            }
        } else if (_token.type == TokenType.Number) {
            eval = new LiteralExpr(((NumberToken)_token).value);
            next(false);
        } else if (_token.type == TokenType.Operator && _token.text.equals("-")) { // unary minus?
            next(true);

            if (_token != null && _token.type == TokenType.Number) {
                Number n = ((NumberToken)_token).value;

                eval = new LiteralExpr(n instanceof Long ? -n.longValue() : -n.doubleValue());

                next(false);
            } else {
                throw makeException("Bad negative number");
            }
        } else if (_token.type == TokenType.Identifier) {
            String text = _token.text;
            next(false);

            if (_token == null || _token.type != TokenType.Delimiter || !_token.text.equals("(")) {
                eval = "null".equals(text) ? new LiteralExpr(null) : new VariableExpr(text);
            } else if( "PI".equals(text) ) {
                eval = new LiteralExpr(Math.PI);
                next(false);
            } else {
                Function f = ControlFunctionRegistry.getFunction(text);
                Control c = ControlFunctionRegistry.getControl(text);
                if (f == null && c == null) {
View Full Code Here

Examples of net.jangaroo.jooc.ast.LiteralExpr

        while (annotationParameters != null) {
          AnnotationParameter annotationParameter = annotationParameters.getHead();
          Ide optNameIde = annotationParameter.getOptName();
          if (optNameIde != null) {
            String parameterName = optNameIde.getName();
            LiteralExpr annotationParameterValue = annotationParameter.getValue();
            String parameterValue = null;
            if (annotationParameterValue != null) {
              JooSymbol symbol = annotationParameterValue.getSymbol();
              if (symbol.sym != sym.STRING_LITERAL) {
                throw new CompilerError(symbol, "The " + parameterName + " parameter of an [" + EXT_CONFIG_META_NAME + "] annotation must be a string literal.");
              }
              parameterValue = (String) symbol.getJooValue();
            }
View Full Code Here

Examples of org.jaxen.expr.LiteralExpr

              cmp = compareLists(functionCallExpr1.getParameters(), functionCallExpr2.getParameters());
            }
          }
          break;
        case TYPE_LITERAL_EXPR:
          LiteralExpr literalExpr1 = (LiteralExpr)o1;
          LiteralExpr literalExpr2 = (LiteralExpr)o2;
          cmp = literalExpr1.getLiteral().compareTo(literalExpr2.getLiteral());
          break;
        case TYPE_LOCATION_PATH:
          LocationPath locationPath1 = (LocationPath)o1;
          LocationPath locationPath2 = (LocationPath)o2;
          if (locationPath1.isAbsolute() == locationPath2.isAbsolute())
View Full Code Here

Examples of org.jaxen.expr.LiteralExpr

              cmp = compareLists(functionCallExpr1.getParameters(), functionCallExpr2.getParameters());
            }
          }
          break;
        case TYPE_LITERAL_EXPR:
          LiteralExpr literalExpr1 = (LiteralExpr)o1;
          LiteralExpr literalExpr2 = (LiteralExpr)o2;
          cmp = literalExpr1.getLiteral().compareTo(literalExpr2.getLiteral());
          break;
        case TYPE_LOCATION_PATH:
          LocationPath locationPath1 = (LocationPath)o1;
          LocationPath locationPath2 = (LocationPath)o2;
          if (locationPath1.isAbsolute() == locationPath2.isAbsolute())
View Full Code Here

Examples of xbird.xquery.expr.LiteralExpr

    public void testEval() throws XQueryException {
        SequenceExpression seq = new SequenceExpression();
        AtomicValue it1 = new XString("1");
        AtomicValue it2 = new XString("2");
        seq.addExpression(new LiteralExpr(it1));
        seq.addExpression(new LiteralExpr(it2));
        Sequence<Item> res = (Sequence<Item>) seq.eval(null, new DynamicContext(new StaticContext()));
        Iterator<Item> resItor = res.iterator();
        assertTrue(resItor.hasNext());
        assertSame(it1, resItor.next());
        assertTrue(resItor.hasNext());
View Full Code Here

Examples of xbird.xquery.expr.LiteralExpr

    }

    public void testLookupFunction() throws XQueryException, IllegalAccessException,
            NoSuchFieldException, NoSuchMethodException, InvocationTargetException {
        // params
        Variable v1 = new Variable.GlobalVariable(QNameTable.instantiate("", "p1"), new LiteralExpr(new XDouble(4)));
        v1.setType(DoubleType.DOUBLE);
        VarRef p1 = new VarRef(v1);
        List<VarRef> params = new LinkedList<VarRef>();
        params.add(p1);
        // function
View Full Code Here

Examples of xbird.xquery.expr.LiteralExpr

            default:
                jj_la1[138] = jj_gen;
                jj_consume_token(-1);
                throw new ParseException();
        }
        final LiteralExpr ve = new LiteralExpr(value);
        locate(ve);
        {
            if(true)
                return ve;
        }
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.