DlgpParser extends AbstractCloseableIterator<Object> implements Parser<Object> { public static CloseableIterator<Atom> parseAtomSet(String s) throws ParseException { InMemoryStream<Object> stream = new QueueStream<Object>(); Producer p = new Producer(new StringReader(s), stream); try { p.run(); } catch (Throwable t) { throw new DlgpParseException(t); } return new AtomCloseableIteratorWrapperHandlingParseException(stream); } DlgpParser(Reader reader);  DlgpParser();  DlgpParser(File file);  DlgpParser(String s);  DlgpParser(InputStream in); @Override boolean hasNext(); @Override Object next(); @Override void close(); static EffectiveConjunctiveQuery parseEffectiveQuery(String s); static ConjunctiveQuery parseQuery(String s); static Atom parseAtom(String s); static Rule parseRule(String s); static NegativeConstraint parseNegativeConstraint(String s); static CloseableIterator<Atom> parseAtomSet(String s);  }
@Test public void parseAtomSet() throws ParseException, IteratorException { CloseableIterator<Atom> it = DlgpParser.parseAtomSet("p(a). p(b), p(1)."); int cpt = 0; while (it.hasNext()) { ++cpt; Atom a = it.next(); Term t = a.getTerm(0); Assert.assertTrue(t.equals(B) || t.equals(A) || t.equals(L1)); } Assert.assertEquals(3, cpt); }