* Program ::= (Request | Rule | Fact)*
* @return {@link DatalogData}
* @throws Exception
*/
private static DatalogData parseProgram() throws Exception {
DatalogData data = new DatalogData();
while (currentSymbol < stringForParse.length()-1) {
int cur = currentSymbol;
try {
data.addRequest(parseQuery());
} catch (Exception eQuery) {
currentSymbol = cur;
try {
data.addRule(parseRule());
} catch (Exception eRulle) {
currentSymbol = cur;
data.addFact(parseFact());
}
}
}
return data;