lojix/logic/src/main/com/thesett/aima/logic/fol/isoprologparser/PrologParser.java
public List<Clause> sentences() throws SourceCodeException
    {
        List<Clause> results = new LinkedList<Clause>();

        // Loop consuming clauses until end of file is encounterd.
        while (true)
        {
            if (peekAndConsumeEof())
            {
                break;
            }
            else
            {
                results.add(sentence());
            }
        }

        return results;
    }
public List<Clause> sentences() throws SourceCodeException
    {
        List<Clause> results = new LinkedList<Clause>();

        // Loop consuming clauses until end of file is encounterd.
        while (true)
        {
            if (peekAndConsumeEof())
            {
                break;
            }
            else
            {
                results.add(sentence());
            }
        }

        return results;
    }
Parses many consecutive sentences, until an <EOF> is reached. This method is intended to aid with consulting
files.

@return A list of parsed clauses.

@throws SourceCodeException If the token sequence does not parse into a sequence of clauses terminted by <EOF>.