コード例 #1
0
 @Test
 public void testarAnaliseCorretas() throws Throwable {
   assertEquals("E T F T2 E2 T F T2 E2", parser1.run("d + d"));
   assertEquals("E T F T2 F T2 E2", parser1.run("d * d"));
   assertEquals(
       "E T F E T F T2 E2 T F T2 E2 T2 F E T F E T F T2 E2 T2 E2 T2 E2",
       parser1.run("( d + d ) * ( ( d ) )"));
 }
コード例 #2
0
 @Test
 public void testarAnaliseIncorretaParser1() throws Throwable {
   Assert.assertContains(parser1.run(""));
   Assert.assertContains(parser1.run("( * )"));
 }
コード例 #3
0
 @Test
 public void testarAnaliseCorretasDeParser6() throws Throwable {
   assertEquals("P B K K V V C P1", parser6.run("c v"));
 }
コード例 #4
0
 @Test
 public void testarAnaliseCorretasDeParser5() throws Throwable {
   assertEquals("P D C", parser5.run("begin com end"));
   assertEquals("P D I I I C", parser5.run("begin int , id , id com end"));
 }
コード例 #5
0
 @Test
 public void testarAnaliseCorretasDeParser4() throws Throwable {
   assertEquals("S A A", parser4.run("a b"));
   assertEquals("S B B", parser4.run("b a"));
 }
コード例 #6
0
 @Test
 public void testarAnaliseCorretasDeParser3() throws Throwable {
   assertEquals("S L L1 L L", parser3.run("id = * id"));
   assertEquals("S L L1", parser3.run("id"));
 }
コード例 #7
0
 @Test
 public void testarAnaliseCorretasDeParser2() throws Throwable {
   assertEquals("A B C", parser2.run("b c"));
   assertEquals("A B C", parser2.run("c"));
 }
コード例 #8
0
 @Test
 public void testarAnaliseIncorretaParser6() throws Throwable {
   Assert.assertContains(parser6.run("e e"));
   Assert.assertContains(parser6.run("; ; e com com"));
 }
コード例 #9
0
 @Test
 public void testarAnaliseIncorretaParser5() throws Throwable {
   Assert.assertContains(parser5.run("begin , id end"));
   Assert.assertContains(parser5.run("beging [ E ] end"));
 }
コード例 #10
0
 @Test
 public void testarAnaliseIncorretaParser4() throws Throwable {
   Assert.assertContains(parser4.run("a"));
   Assert.assertContains(parser4.run("b"));
 }
コード例 #11
0
 @Test
 public void testarAnaliseIncorretaParser3() throws Throwable {
   Assert.assertContains(parser3.run("id = ="));
   Assert.assertContains(parser3.run("= id"));
 }