Examples of BinaryOperatorExpression


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

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

  }

  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

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

  }

  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

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

  }

  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

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

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

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

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

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

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

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

    );
    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

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

    );
    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

Examples of com.strobel.decompiler.languages.java.ast.BinaryOperatorExpression

        if (_pattern.matches(other, match)) {
            return true;
        }

        if (other instanceof BinaryOperatorExpression) {
            final BinaryOperatorExpression binary = (BinaryOperatorExpression) other;

            if (_operator != BinaryOperatorType.ANY && binary.getOperator() != _operator) {
                return false;
            }

            final int checkPoint = match.getCheckPoint();

            if (matches(binary.getLeft(), match) && matches(binary.getRight(), match)) {
                return true;
            }

            match.restoreCheckPoint(checkPoint);
        }
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.