Package com.google.minijoe.compiler.ast

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


    );
  }

  public void testInstanceOfExpression() throws CompilerException {
    assertParserOutput(
        new ExpressionStatement(
            new BinaryOperatorExpression(
                new Identifier("foo"),
                new Identifier("Object"),
                Token.KEYWORD_INSTANCEOF
            )
        ),
        "foo instanceof Object;"
    );
    assertParserOutput(
        new ExpressionStatement(
            new BinaryOperatorExpression(
                new BinaryOperatorExpression(
                    new Identifier("foo"),
                    new Identifier("bar"),
                    Token.KEYWORD_INSTANCEOF
View Full Code Here


    );
  }

  public void testInExpression() throws CompilerException {
    assertParserOutput(
        new ExpressionStatement(
            new BinaryOperatorExpression(
                new Identifier("foo"),
                new Identifier("bar"),
                Token.KEYWORD_IN
            )
        ),
        "foo in bar;"
    );
    assertParserOutput(
        new ExpressionStatement(
            new BinaryOperatorExpression(
                new BinaryOperatorExpression(
                    new Identifier("foo"),
                    new Identifier("bar"),
                    Token.KEYWORD_IN
View Full Code Here

    super(name);
  }

  public void testConditionalExpression() throws CompilerException {
    assertParserOutput(
        new ExpressionStatement(
            new ConditionalExpression(
                new BinaryOperatorExpression(
                    new NumberLiteral(1.0),
                    new NumberLiteral(0.0),
                    Token.OPERATOR_EQUALEQUAL
                ),
                new IncrementExpression(
                    new Identifier("foo"), 1, true
                ),
                new IncrementExpression(
                    new Identifier("bar"), 1, true
                )
            )
        ),
        "1 == 0 ? foo ++ : bar ++;"
    );
    assertParserOutput(
        new ExpressionStatement(
            new ConditionalExpression(
                new Identifier("foo"),
                new ConditionalExpression(
                    new Identifier("a"),
                    new Identifier("b"),
View Full Code Here

  public void testWhileStatement() throws CompilerException {
    assertParserOutput(
        new WhileStatement(
            new BooleanLiteral(true),
            new ExpressionStatement(
                new Identifier("something")
            )
        ),
        "while (true) something;"
    );
    assertParserOutput(
        new WhileStatement(
            new BooleanLiteral(true),
            new BlockStatement(
                new Statement[] {
                    new ExpressionStatement(
                        new Identifier("something")
                    )
                }
            )
        ),
View Full Code Here

TOP

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

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.