Package com.google.minijoe.compiler.ast

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


  }

  public void testStrictNotEqualsExpression() throws CompilerException {
    assertParserOutput(
        new ExpressionStatement(
            new BinaryOperatorExpression(
                new Identifier("foo"),
                new Identifier("bar"),
                Token.OPERATOR_NOTEQUALEQUAL
            )
        ),
        "foo !== bar;"
    );
    assertParserOutput(
        new ExpressionStatement(
            new BinaryOperatorExpression(
                new BinaryOperatorExpression(
                    new Identifier("foo"),
                    new Identifier("bar"),
                    Token.OPERATOR_NOTEQUALEQUAL
                ),
                new Identifier("baz"),
                Token.OPERATOR_NOTEQUALEQUAL
            )
        ),
        "foo !== bar !== baz;"
    );
    assertParserOutput(
        new ExpressionStatement(
            new BinaryOperatorExpression(
                new Identifier("foo"),
                new BinaryOperatorExpression(
                    new Identifier("bar"),
                    new NumberLiteral(1.0),
                    Token.OPERATOR_PLUS
                ),
                Token.OPERATOR_NOTEQUALEQUAL
View Full Code Here


  }

  public void testBitwiseAndExpression() throws CompilerException {
    assertParserOutput(
        new ExpressionStatement(
            new BinaryOperatorExpression(
                new Identifier("foo"),
                new Identifier("bar"),
                Token.OPERATOR_BITWISEAND
            )
        ),
        "foo & bar;"
    );
    assertParserOutput(
        new ExpressionStatement(
            new BinaryOperatorExpression(
                new BinaryOperatorExpression(
                    new Identifier("foo"),
                    new Identifier("bar"),
                    Token.OPERATOR_BITWISEAND
                ),
                new Identifier("baz"),
                Token.OPERATOR_BITWISEAND
            )
        ),
        "foo & bar & baz;"
    );
    assertParserOutput(
        new ExpressionStatement(
            new BinaryOperatorExpression(
                new Identifier("foo"),
                new BinaryOperatorExpression(
                    new Identifier("bar"),
                    new NumberLiteral(1.0),
                    Token.OPERATOR_PLUS
                ),
                Token.OPERATOR_BITWISEAND
View Full Code Here

  }

  public void testBitwiseOrExpression() throws CompilerException {
    assertParserOutput(
        new ExpressionStatement(
            new BinaryOperatorExpression(
                new Identifier("foo"),
                new Identifier("bar"),
                Token.OPERATOR_BITWISEOR
            )
        ),
        "foo | bar;"
    );
    assertParserOutput(
        new ExpressionStatement(
            new BinaryOperatorExpression(
                new BinaryOperatorExpression(
                    new Identifier("foo"),
                    new Identifier("bar"),
                    Token.OPERATOR_BITWISEOR
                ),
                new Identifier("baz"),
                Token.OPERATOR_BITWISEOR
            )
        ),
        "foo | bar | baz;"
    );
    assertParserOutput(
        new ExpressionStatement(
            new BinaryOperatorExpression(
                new Identifier("foo"),
                new BinaryOperatorExpression(
                    new Identifier("bar"),
                    new NumberLiteral(1.0),
                    Token.OPERATOR_PLUS
                ),
                Token.OPERATOR_BITWISEOR
View Full Code Here

  }

  public void testBitwiseXorExpression() throws CompilerException {
    assertParserOutput(
        new ExpressionStatement(
            new BinaryOperatorExpression(
                new Identifier("foo"),
                new Identifier("bar"),
                Token.OPERATOR_BITWISEXOR
            )
        ),
        "foo ^ bar;"
    );
    assertParserOutput(
        new ExpressionStatement(
            new BinaryOperatorExpression(
                new BinaryOperatorExpression(
                    new Identifier("foo"),
                    new Identifier("bar"),
                    Token.OPERATOR_BITWISEXOR
                ),
                new Identifier("baz"),
                Token.OPERATOR_BITWISEXOR
            )
        ),
        "foo ^ bar ^ baz;"
    );
    assertParserOutput(
        new ExpressionStatement(
            new BinaryOperatorExpression(
                new Identifier("foo"),
                new BinaryOperatorExpression(
                    new Identifier("bar"),
                    new NumberLiteral(1.0),
                    Token.OPERATOR_PLUS
                ),
                Token.OPERATOR_BITWISEXOR
View Full Code Here

    );
    assertParserOutput(
        new ExpressionStatement(
            new LogicalAndExpression(
                new Identifier("foo"),
                new BinaryOperatorExpression(
                    new Identifier("bar"),
                    new NumberLiteral(1.0),
                    Token.OPERATOR_EQUALEQUAL
                )
            )
View Full Code Here

    );
    assertParserOutput(
        new ExpressionStatement(
            new LogicalOrExpression(
                new Identifier("foo"),
                new BinaryOperatorExpression(
                    new Identifier("bar"),
                    new NumberLiteral(1.0),
                    Token.OPERATOR_EQUALEQUAL
                )
            )
View Full Code Here

    );
    assertParserOutput(
        new ExpressionStatement(
            new AssignmentExpression(
                new Identifier("foo"),
                new BinaryOperatorExpression(
                    new Identifier("bar"),
                    new NumberLiteral(1.0),
                    Token.OPERATOR_PLUS
                )
            )
View Full Code Here

    );
    assertParserOutput(
        new ExpressionStatement(
            new AssignmentOperatorExpression(
                new Identifier("foo"),
                new BinaryOperatorExpression(
                    new Identifier("bar"),
                    new NumberLiteral(1.0),
                    Token.OPERATOR_PLUS
                ),
                Token.OPERATOR_MULTIPLYASSIGNMENT
View Full Code Here

    );
    assertParserOutput(
        new ExpressionStatement(
            new AssignmentOperatorExpression(
                new Identifier("foo"),
                new BinaryOperatorExpression(
                    new Identifier("bar"),
                    new NumberLiteral(1.0),
                    Token.OPERATOR_PLUS
                ),
                Token.OPERATOR_DIVIDEASSIGNMENT
View Full Code Here

    );
    assertParserOutput(
        new ExpressionStatement(
            new AssignmentOperatorExpression(
                new Identifier("foo"),
                new BinaryOperatorExpression(
                    new Identifier("bar"),
                    new NumberLiteral(1.0),
                    Token.OPERATOR_PLUS
                ),
                Token.OPERATOR_MODULOASSIGNMENT
View Full Code Here

TOP

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

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.