1#![doc = include_str!("readme.md")]
2
3#[derive(Debug, Clone)]
5pub struct PrologRoot;
6
7pub type PrologToken = crate::lexer::PrologTokenType;
9
10#[derive(Debug, Clone)]
12pub struct SourceFile {
13 pub clauses: Vec<Clause>,
15}
16
17#[derive(Debug, Clone)]
19pub enum Clause {
20 Rule(Rule),
22 Fact(Fact),
24 Query(Query),
26 Directive(Directive),
28}
29
30#[derive(Debug, Clone)]
32pub struct Rule {
33 pub head: Term,
35 pub body: Term,
37}
38
39#[derive(Debug, Clone)]
41pub struct Fact {
42 pub term: Term,
44}
45
46#[derive(Debug, Clone)]
48pub struct Query {
49 pub term: Term,
51}
52
53#[derive(Debug, Clone)]
55pub struct Directive {
56 pub term: Term,
58}
59
60#[derive(Debug, Clone)]
62pub enum Term {
63 Atom(String),
65 Variable(String),
67 Number(String),
69 String(String),
71 Compound {
73 functor: String,
75 args: Vec<Term>,
77 },
78 List(Vec<Term>),
80}