Package com.google.minijoe.compiler.ast

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


  }

  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

  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

TOP

Related Classes of com.google.minijoe.compiler.ast.NewExpression

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.