@@ -0,0 +1,1747 @@
+package com.romanov_v.parser;%0A%0Aimport com.romanov_v.parser.grammar.Grammar;%0Aimport com.romanov_v.parser.grammar.Rule;%0Aimport com.romanov_v.parser.grammar.Term;%0Aimport org.junit.Test;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0Aimport static org.junit.Assert.*;%0A%0A/**%0A * Created by vlad on 14/03/16.%0A */%0Apublic class EarleyParserTest %7B%0A%0A    @Test%0A    public void emptyGrammar() throws Exception %7B%0A        Grammar grammar = new Grammar(new ArrayList%3C%3E());%0A%0A        AbstractParser abstractParserEmpty = new EarleyParser(%22%22, grammar);%0A        AbstractParser abstractParserNotEmpty = new EarleyParser(%22123%22, grammar);%0A%0A        assertNull(abstractParserEmpty.parse());%0A        assertNull(abstractParserNotEmpty.parse());%0A    %7D%0A%0A    @Test%0A    public void emptyStatement() throws Exception %7B%0A        List%3CRule%3E rules = new ArrayList%3C%3E();%0A        Rule start = new Rule(%22start%22);%0A        start.addTerm(Term.createTextTerm(%220%22));%0A        rules.add(start);%0A%0A        Grammar grammar = new Grammar(rules);%0A%0A        AbstractParser parser = new EarleyParser(%22%22, grammar);%0A        assertNull(parser.parse());%0A    %7D%0A%0A    @Test%0A    public void oneZeroGrammar() throws Exception %7B%0A        List%3CRule%3E rules = new ArrayList%3C%3E();%0A        Rule start = new Rule(%22start%22);%0A        start.addTerm(Term.createTextTerm(%220%22));%0A        rules.add(start);%0A%0A        Grammar grammar = new Grammar(rules);%0A%0A        AbstractParser parser;%0A        ParserTree tree;%0A%0A        parser = new EarleyParser(%220%22, grammar);%0A        tree = parser.parse();%0A        assertNotNull(tree);%0A%0A        parser = new EarleyParser(%222%22, grammar);%0A        tree = parser.parse();%0A        assertNull(tree);%0A%0A        parser = new EarleyParser(%2200%22, grammar);%0A        assertNull(parser.parse());%0A%0A    %7D%0A%0A%7D

Add tests