@Test public void expression() throws Exception { ActionParser<Tree> parser = PHPParserBuilder.createParser(PHPLexicalGrammar.EXPRESSION); BinaryExpressionTree tree = (BinaryExpressionTree) parser.parse("$a + $b + $c"); Assertions.assertThat(tree.getParent()).isNull(); Assertions.assertThat(tree.leftOperand().getParent()).isSameAs(tree); Assertions.assertThat(tree.rightOperand().getParent()).isSameAs(tree); BinaryExpressionTree subExpression = (BinaryExpressionTree) tree.leftOperand(); Assertions.assertThat(subExpression.leftOperand().getParent()).isSameAs(subExpression); Assertions.assertThat(subExpression.rightOperand().getParent()).isSameAs(subExpression); }
@Override public Tree parse(File file) { return setParents(super.parse(file)); }
PHPParser extends ActionParser<Tree> { @Override public Tree parse(File file) { return setParents(super.parse(file)); } }
PHPParser extends ActionParser<Tree> { @Override public Tree parse(File file) { return setParents(super.parse(file)); } PHPParser(GrammarRuleKey rootRule, int lineOffset); }
PHPParser extends ActionParser<Tree> { @Override public Tree parse(File file) { return setParents(super.parse(file)); } PHPParser(GrammarRuleKey rootRule, int lineOffset); @Override Tree parse(File file); @Override Tree parse(String source); }
PHPParser extends ActionParser<Tree> { @Override public Tree parse(File file) { return setParents(super.parse(file)); } PHPParser(GrammarRuleKey rootRule, int lineOffset); @Override Tree parse(File file); @Override Tree parse(String source);  }