Package ru.bmstu.datalog.data

Examples of ru.bmstu.datalog.data.DatalogData


   */
  public static DatalogData parseDatalogFromString(String datalogProgram) {
    currentSymbol = 0;
    stringForParse = datalogProgram.replaceAll("[ \t\n]", "");
   
    DatalogData answer = new DatalogData();
    try {
      answer = parseProgram();
    } catch (Exception e) {
      e.printStackTrace();
    }
View Full Code Here


   * 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;   
View Full Code Here

TOP

Related Classes of ru.bmstu.datalog.data.DatalogData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.