Examples of AssignmentExpression


Examples of com.google.dart.engine.ast.AssignmentExpression

        }
      }
    }
    // OK, remember the type
    if (parent instanceof AssignmentExpression) {
      AssignmentExpression assignment = (AssignmentExpression) parent;
      Expression rhs = assignment.getRightHandSide();
      location = getLocationWithExpressionType(location, rhs);
    }
    // done
    return location;
  }
View Full Code Here

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

    Expression left = parseConditionalExpression(inFlag);

    // assignment expressions are right associative
    if (nextToken == Token.OPERATOR_ASSIGNMENT) {
      readToken();
      return new AssignmentExpression(left, parseAssignmentExpression(inFlag));
    } else if (nextToken == Token.OPERATOR_ASSIGNMENT
            || nextToken == Token.OPERATOR_MULTIPLYASSIGNMENT
            || nextToken == Token.OPERATOR_DIVIDEASSIGNMENT
            || nextToken == Token.OPERATOR_MODULOASSIGNMENT
            || nextToken == Token.OPERATOR_PLUSASSIGNMENT
View Full Code Here

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

    if (variableVector != null) {
      addVariable(identifier);
    }

    if (initializer != null) {
      result = new AssignmentExpression(identifier, initializer);
    } else {
      result = identifier;
    }

    return result;
View Full Code Here

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

  }

  public void testAssignmentExpression() throws CompilerException {
    assertParserOutput(
        new ExpressionStatement(
            new AssignmentExpression(
                new Identifier("foo"),
                new Identifier("bar")
            )
        ),
        "foo = bar;"
    );
    assertParserOutput(
        new ExpressionStatement(
            new AssignmentExpression(
                new Identifier("foo"),
                new AssignmentExpression(
                    new Identifier("bar"),
                    new Identifier("baz")
                )
            )
        ),
        "foo = bar = baz;"
    );
    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.AssignmentExpression

  }

  public void testObjectLiteral() throws CompilerException {
    assertParserOutput(
        new ExpressionStatement(
            new AssignmentExpression(
                new Identifier("foo"),
                new ObjectLiteral(
                    new ObjectLiteralProperty[] {}
                )
            )
        ),
        "foo = {};"
    );
    assertParserOutput(
        new ExpressionStatement(
            new AssignmentExpression(
                new Identifier("foo"),
                new ObjectLiteral(
                    new ObjectLiteralProperty[] {
                        new ObjectLiteralProperty(
                            new StringLiteral("name"),
                            new StringLiteral("wibble")
                        )
                    }
                )
            )
        ),
        "foo = {name: \"wibble\"};"
    );
    assertParserOutput(
        new ExpressionStatement(
            new AssignmentExpression(
                new Identifier("foo"),
                new ObjectLiteral(
                    new ObjectLiteralProperty[] {
                        new ObjectLiteralProperty(
                            new StringLiteral("name"),
View Full Code Here

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

    );
    assertParserOutput(
        new BlockStatement(
            new Statement[] {
                new ExpressionStatement(
                    new AssignmentExpression(
                        new Identifier("foo"),
                        new NumberLiteral(1.0)
                    )
                )
            }
        ),
        "{foo = 1.0;};"
    );
    assertParserOutput(
        new BlockStatement(
            new Statement[] {
                new ExpressionStatement(
                    new AssignmentExpression(
                        new Identifier("foo"),
                        new NumberLiteral(1.0)
                    )
                ),
                new ExpressionStatement(
                    new AssignmentExpression(
                        new Identifier("bar"),
                        new NumberLiteral(2.0)
                    )
                )
            }
View Full Code Here

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

        ),
        "for (; x < 4; x++);"
    );
    assertParserOutput(
        new ForStatement(
            new AssignmentExpression(
                new Identifier("x"),
                new NumberLiteral(0.0)
            ),
            new BinaryOperatorExpression(
                new Identifier("x"),
View Full Code Here

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

                            null
                        )
                    }
                ),
                new ExpressionStatement(
                    new AssignmentExpression(
                        new Identifier("bar"),
                        new NumberLiteral(1.0)
                    )
                )
            }
View Full Code Here

Examples of com.google.test.metric.cpp.dom.AssignmentExpression

  @Override
  public void beginAssignmentExpression(int line) {
    int index = nodes.size() - 1;
    Expression leftSide = nodes.get(index);
    nodes.remove(index);
    AssignmentExpression assignment = new AssignmentExpression(line);
    nodes.add(assignment);
    assignment.addExpression(leftSide);
    pushBuilder(new AssignmentExpressionBuilder(assignment));
  }
View Full Code Here

Examples of com.google.test.metric.cpp.dom.AssignmentExpression

    VariableDeclaration variableB = functionMain.getChild(1);
    assertEquals("b", variableB.getName());
    ExpressionStatement statement = functionMain.getChild(2);
    Expression expression = statement.getExpression(0);
    assertTrue(expression instanceof AssignmentExpression);
    AssignmentExpression assignment = (AssignmentExpression) expression;
    Name leftSide = assignment.getExpression(0);
    Name rightSide = assignment.getExpression(1);
    assertEquals("a", leftSide.getIdentifier());
    assertEquals("b", rightSide.getIdentifier());
  }
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.