Examples of arguments()


Examples of io.crate.planner.symbol.Function.arguments()

        Function whereClause = (Function)analysis.whereClause().query();
        assertEquals(EqOperator.NAME, whereClause.info().ident().name());
        assertFalse(whereClause.info().type() == FunctionInfo.Type.AGGREGATE);

        assertThat(whereClause.arguments().get(0), IsInstanceOf.instanceOf(Reference.class));

        assertLiteralSymbol(whereClause.arguments().get(1), "Trillian");
    }

    @Test( expected = UnsupportedOperationException.class)
View Full Code Here

Examples of loop.ast.script.FunctionDecl.arguments()

  }

  public Object main(String[] commandLine) {
    FunctionDecl main = scope.resolveFunction("main", false);
    if (main != null) {
      int args = main.arguments().children().size();
      if(commandLine == null)
        commandLine = new String[] {};
      try {
        if (args == 0)
          return compiled.getDeclaredMethod("main").invoke(null);
View Full Code Here

Examples of loop.ast.script.FunctionDecl.arguments()

    FunctionDecl exceptionHandler = resolveCall(functionDecl.exceptionHandler);
    if (exceptionHandler == null)
      addError("Cannot resolve exception handler: " + functionDecl.exceptionHandler,
          functionDecl.sourceLine, functionDecl.sourceColumn);
    else {
      int argsSize = exceptionHandler.arguments().children().size();
      // Verify exception handler template.
      if (!exceptionHandler.patternMatching)
        addError("Exception handler must be a pattern-matching function (did you mean '=>')",
            exceptionHandler.sourceLine, exceptionHandler.sourceColumn);
      else if (argsSize != 1) {
View Full Code Here

Examples of loop.ast.script.FunctionDecl.arguments()

      FunctionDecl targetFunction = resolveCall(call.name);
      if (targetFunction == null)
        addError("Cannot resolve function: " + call.name, call.sourceLine, call.sourceColumn);
      else {
        // Check that the args are correct.
        int targetArgs = targetFunction.arguments().children().size();
        int calledArgs = call.args().children().size();
        if (calledArgs != targetArgs)
          addError("Incorrect number of arguments to: " + targetFunction.name()
              + " (expected " + targetArgs + ", found "
              + calledArgs + ")",
View Full Code Here

Examples of loop.ast.script.FunctionDecl.arguments()

      PatternRule patternRule = (PatternRule) node;
      verifyNode(patternRule.rhs);

      // Some sanity checking of pattern rules.
      FunctionDecl function = functionStack.peek().function;
      int argsSize = function.arguments().children().size();
      int patternsSize = patternRule.patterns.size();
      if (patternsSize != argsSize)
        addError("Incorrect number of patterns in: '" + function.name() + "' (expected " + argsSize
            + " found " + patternsSize + ")", patternRule.sourceLine, patternRule.sourceColumn);
View Full Code Here

Examples of org.eclipse.jdt.core.dom.ClassInstanceCreation.arguments()

    public NewInstanceBuilder newInstanceFromString(String type, String value) {
        ClassInstanceCreation create = getAST().newClassInstanceCreation();
        create.setType(createType(type));
        StringLiteral literal = getAST().newStringLiteral();
        literal.setLiteralValue(value);
        create.arguments().add(literal);
        return new NewInstanceBuilder(this, create);
    }

    /**
     * Build new instance creator of a simple type using a constructor that takes a pair of string values.
View Full Code Here

Examples of org.eclipse.jdt.core.dom.ClassInstanceCreation.arguments()

    public NewInstanceBuilder newInstanceFromStrings(String type, String value1, String value2) {
        ClassInstanceCreation create = getAST().newClassInstanceCreation();
        create.setType(createType(type));
        StringLiteral literal = getAST().newStringLiteral();
        literal.setLiteralValue(value1);
        create.arguments().add(literal);
        literal = getAST().newStringLiteral();
        literal.setLiteralValue(value2);
        create.arguments().add(literal);
        return new NewInstanceBuilder(this, create);
    }
View Full Code Here

Examples of org.eclipse.jdt.core.dom.ClassInstanceCreation.arguments()

        StringLiteral literal = getAST().newStringLiteral();
        literal.setLiteralValue(value1);
        create.arguments().add(literal);
        literal = getAST().newStringLiteral();
        literal.setLiteralValue(value2);
        create.arguments().add(literal);
        return new NewInstanceBuilder(this, create);
    }

    /**
     * Add field declaration.
View Full Code Here

Examples of org.eclipse.jdt.core.dom.ClassInstanceCreation.arguments()

     */
    public void addThrowException(String type, String text) {
        ThrowStatement thrwstmt = m_ast.newThrowStatement();
        ClassInstanceCreation exexpr = m_ast.newClassInstanceCreation();
        exexpr.setType(m_ast.newSimpleType(m_ast.newSimpleName(type)));
        exexpr.arguments().add(stringLiteral(text));
        thrwstmt.setExpression(exexpr);
        m_block.statements().add(thrwstmt);
    }
   
    /**
 
View Full Code Here

Examples of org.eclipse.jdt.core.dom.ClassInstanceCreation.arguments()

     */
    public void addThrowException(String type, ExpressionBuilderBase expr) {
        ThrowStatement thrwstmt = m_ast.newThrowStatement();
        ClassInstanceCreation exexpr = m_ast.newClassInstanceCreation();
        exexpr.setType(m_ast.newSimpleType(m_ast.newSimpleName(type)));
        exexpr.arguments().add(expr.getExpression());
        thrwstmt.setExpression(exexpr);
        m_block.statements().add(thrwstmt);
    }
   
    /**
 
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.