Example #1
0
 private void testSuccessfulParse(String s, TreeNode tn) {
   SyntaxTree t = TestParseHelper.earleyParseBuildTree(g, s, null, diagnostics);
   assert !diagnostics.hasError()
       : "Got parser errors: " + TestParseHelper.getParseOutput(diagnostics);
   if (tn != null)
     assert tn.equals(t.getRoot()) : "Got unexpected tree: " + t.getRoot() + ", expected: " + tn;
 }
Example #2
0
 @BeforeClass
 public void createLRParser() throws IOException {
   g = TestParseHelper.getJavaGrammarFromFile("Block", false);
 }