Beispiel #1
0
  public void testPostfixExpression4() throws ANTLRException {
    setupParser("(var)--");
    defineVariable("var", false);

    PostfixExpression result = (PostfixExpression) _parser.expression();

    assertNotNull(result);
    assertTrue(!result.isIncrement());

    ParenthesizedExpression parenExpr = (ParenthesizedExpression) result.getInnerExpression();

    assertNotNull(parenExpr);
    assertEquals(result, parenExpr.getContainer());

    VariableAccess varAccess = (VariableAccess) parenExpr.getInnerExpression();

    assertNotNull(varAccess);
    assertEquals("var", varAccess.getVariableName());
    assertEquals(parenExpr, varAccess.getContainer());
  }
 public void visitParenthesizedExpression(ParenthesizedExpression node) {
   // visit expression
   visit(node.getInnerExpression());
 }