farm parser out to a crate, remove it as a git submodule.

This commit is contained in:
Mark Thom
2018-09-03 21:58:07 -06:00
parent 4be20e48e6
commit ff9d2662e6
29 changed files with 471 additions and 1300 deletions

View File

@@ -1,3 +1,5 @@
use prolog_parser::ast::*;
use prolog::ast::*;
use prolog::iterators::*;
@@ -32,7 +34,7 @@ impl<'a> CompilationTarget<'a> for FactInstruction {
type Iterator = FactIterator<'a>;
fn iter(term: &'a Term) -> Self::Iterator {
term.breadth_first_iter(false) // do not iterate over the root clause if one exists.
breadth_first_iter(term, false) // do not iterate over the root clause if one exists.
}
fn to_constant(lvl: Level, constant: Constant, reg: RegType) -> Self {
@@ -99,7 +101,7 @@ impl<'a> CompilationTarget<'a> for QueryInstruction {
type Iterator = QueryIterator<'a>;
fn iter(term: &'a Term) -> Self::Iterator {
term.post_order_iter()
post_order_iter(term)
}
fn to_structure(ct: ClauseType, arity: usize, r: RegType) -> Self