pub struct PrologBackend {
pub swi_mode: bool,
pub utf8_encoding: bool,
pub options: PrologBackendOptions,
}Expand description
The Prolog code generation backend.
Converts a PrologModule (or individual items) into .pl source text.
Fields§
§swi_mode: boolWhether to emit SWI-Prolog-specific pragmas (:- use_module(library(lists))).
utf8_encoding: boolWhether to add :- encoding(utf8). at the top.
options: PrologBackendOptionsExtra options reserved for future use.
Implementations§
Source§impl PrologBackend
impl PrologBackend
Sourcepub fn emit_module(&self, module: &PrologModule) -> String
pub fn emit_module(&self, module: &PrologModule) -> String
Emit a complete PrologModule as .pl source text.
Sourcepub fn emit_clause(&self, clause: &PrologClause) -> String
pub fn emit_clause(&self, clause: &PrologClause) -> String
Emit a single clause.
Sourcepub fn emit_predicate(&self, pred: &PrologPredicate) -> String
pub fn emit_predicate(&self, pred: &PrologPredicate) -> String
Emit a single predicate.
Sourcepub fn emit_directive(&self, directive: &PrologDirective) -> String
pub fn emit_directive(&self, directive: &PrologDirective) -> String
Emit a single directive.
Sourcepub fn emit_clauses(&self, clauses: &[PrologClause]) -> String
pub fn emit_clauses(&self, clauses: &[PrologClause]) -> String
Emit a list of clauses separated by newlines.
Trait Implementations§
Source§impl Debug for PrologBackend
impl Debug for PrologBackend
Source§impl Default for PrologBackend
impl Default for PrologBackend
Source§fn default() -> PrologBackend
fn default() -> PrologBackend
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PrologBackend
impl RefUnwindSafe for PrologBackend
impl Send for PrologBackend
impl Sync for PrologBackend
impl Unpin for PrologBackend
impl UnsafeUnpin for PrologBackend
impl UnwindSafe for PrologBackend
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more