Examples of NewExpression


Examples of com.google.minijoe.compiler.ast.NewExpression

      readToken(Token.KEYWORD_NEW);
      name = parseMemberExpression(true);

      if (nextToken == Token.OPERATOR_OPENPAREN) {
        Expression[] arguments = parseArgumentList();
        expression = new NewExpression(name, arguments);
      } else {
        expression = new NewExpression(name, null);
      }

    } else if (nextToken == Token.KEYWORD_FUNCTION) {
      expression = parseFunctionLiteral(false);
View Full Code Here

Examples of com.google.minijoe.compiler.ast.NewExpression

  }

  public void testNewExpression() throws CompilerException {
    assertParserOutput(
        new ExpressionStatement(
            new NewExpression(
                new Identifier("Object"),
                new Expression[] {
                }
            )
        ),
        "new Object();"
    );
    assertParserOutput(
        new ExpressionStatement(
            new NewExpression(
                new Identifier("Object"),
                new Expression[] {
                  new NumberLiteral(1.0)
                }
            )
        ),
        "new Object(1.0);"
    );
    assertParserOutput(
        new ExpressionStatement(
            new NewExpression(
                new Identifier("Object"),
                new Expression[] {
                  new NumberLiteral(1.0),
                  new StringLiteral("hatstand")
                }
View Full Code Here

Examples of com.google.minijoe.compiler.ast.NewExpression

  public void testExpressionStatement() throws CompilerException {
    assertParserOutput(
        new ExpressionStatement(
            new PropertyExpression(
                new NewExpression(
                    new PropertyExpression(
                        new NewExpression(
                            new Identifier("foo"),
                            new Expression[] {
                              new Identifier("String"),
                              new NumberLiteral(2.0)
                            }
View Full Code Here

Examples of net.hydromatic.linq4j.expressions.NewExpression

    if ((method.getModifiers() & Modifier.STATIC) != 0) {
      return Expressions.call(method, translatedOperands);
    } else {
      // The UDF class must have a public zero-args constructor.
      // Assume that the validator checked already.
      final NewExpression target =
          Expressions.new_(method.getDeclaringClass());
      return Expressions.call(target, method, translatedOperands);
    }
  }
View Full Code Here

Examples of net.hydromatic.linq4j.expressions.NewExpression

    if ((method.getModifiers() & Modifier.STATIC) != 0) {
      return Expressions.call(method, translatedOperands);
    } else {
      // The UDF class must have a public zero-args constructor.
      // Assume that the validator checked already.
      final NewExpression target =
          Expressions.new_(method.getDeclaringClass());
      return Expressions.call(target, method, translatedOperands);
    }
  }
View Full Code Here

Examples of net.hydromatic.linq4j.expressions.NewExpression

    if ((method.getModifiers() & Modifier.STATIC) != 0) {
      return Expressions.call(method, translatedOperands);
    } else {
      // The UDF class must have a public zero-args constructor.
      // Assume that the validator checked already.
      final NewExpression target =
          Expressions.new_(method.getDeclaringClass());
      return Expressions.call(target, method, translatedOperands);
    }
  }
View Full Code Here

Examples of net.hydromatic.linq4j.expressions.NewExpression

    if ((method.getModifiers() & Modifier.STATIC) != 0) {
      return Expressions.call(method, translatedOperands);
    } else {
      // The UDF class must have a public zero-args constructor.
      // Assume that the validator checked already.
      final NewExpression target =
          Expressions.new_(method.getDeclaringClass());
      return Expressions.call(target, method, translatedOperands);
    }
  }
View Full Code Here

Examples of org.codehaus.jparsec.examples.java.ast.expression.NewExpression

  // new a class instance
  static Parser<Expression> simpleNewExpression(Parser<Expression> arg, Parser<DefBody> body) {
    return new Mapper<Expression>() {
      @SuppressWarnings("unused")
      Expression map(TypeLiteral type, List<Expression> args, DefBody defBody) {
        return new NewExpression(null, type, args, defBody);
      }
    }.sequence(term("new"), TypeLiteralParser.ELEMENT_TYPE_LITERAL,
        argumentList(arg), body.optional());
  }
View Full Code Here

Examples of org.codehaus.jparsec.examples.java.ast.expression.NewExpression

  // new a class instance
  static Parser<Expression> simpleNewExpression(Parser<Expression> arg, Parser<DefBody> body) {
    return new Mapper<Expression>() {
      @SuppressWarnings("unused")
      Expression map(TypeLiteral type, List<Expression> args, DefBody defBody) {
        return new NewExpression(null, type, args, defBody);
      }
    }.sequence(term("new"), TypeLiteralParser.ELEMENT_TYPE_LITERAL,
        argumentList(arg), body.optional());
  }
View Full Code Here

Examples of org.mozilla.javascript.ast.NewExpression

          break;
        }

        case NEW: {
          // complain if we have references to classes with 'new' and missing requires
          NewExpression expr = (NewExpression) node;
          String className = nameOf(expr.getTarget());
          maybeWarnMissingRequires(className, "new");
          break;
        }
      }
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.