add string table, StringList representation

This commit is contained in:
Mark Thom
2018-08-21 00:22:16 -06:00
parent 01d6ef099f
commit 013eb29e2b
11 changed files with 36 additions and 18 deletions

View File

@@ -1,6 +1,7 @@
use prolog::ast::*;
use prolog::compile::*;
use prolog::heap_print::*;
use prolog::string_list::StringListWrapper;
use prolog::tabled_rc::*;
mod machine_errors;
@@ -11,8 +12,7 @@ mod system_calls;
use prolog::machine::machine_state::*;
use std::cell::RefCell;
use std::collections::{HashMap, HashSet};
use std::collections::HashMap;
use std::mem::swap;
use std::ops::Index;
use std::rc::Rc;
@@ -99,7 +99,7 @@ static QUEUES: &str = include_str!("../lib/queues.pl");
impl Machine {
pub fn new() -> Self {
let mut wam = Machine {
ms: MachineState::new(Rc::new(RefCell::new(HashSet::new()))),
ms: MachineState::new(),
call_policy: Box::new(DefaultCallPolicy {}),
cut_policy: Box::new(DefaultCutPolicy {}),
code: Code::new(),
@@ -177,6 +177,10 @@ impl Machine {
self.ms.atom_tbl.clone()
}
pub fn string_tbl(&self) -> TabledData<StringListWrapper> {
self.ms.string_tbl.clone()
}
pub fn use_qualified_module_in_toplevel(&mut self, name: ClauseName, exports: Vec<PredicateKey>)
-> EvalSession
{