summaryrefslogtreecommitdiff
path: root/src/ast/mod.rs
diff options
context:
space:
mode:
authorGreg Brown <gmb60@cam.ac.uk>2020-11-18 13:31:27 +0000
committerGreg Brown <gmb60@cam.ac.uk>2020-11-18 13:31:27 +0000
commit0141e8e8c7f3e295d57990fdce6019e2d777aed0 (patch)
treea98afe8bd8d8cfad984a22e2f308501b27dcb416 /src/ast/mod.rs
parent579875e0eae2866a246fdadf598b31ea50aa1da4 (diff)
Convert concrete to abstract syntax tree
Diffstat (limited to 'src/ast/mod.rs')
-rw-r--r--src/ast/mod.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/ast/mod.rs b/src/ast/mod.rs
new file mode 100644
index 0000000..1fa7d23
--- /dev/null
+++ b/src/ast/mod.rs
@@ -0,0 +1,15 @@
+pub mod convert;
+
+type Ident = String;
+
+#[derive(Clone, Debug, Eq, PartialEq)]
+pub enum Term {
+ Epsilon,
+ Bottom,
+ Literal(String),
+ Cat(Box<Term>, Box<Term>),
+ Alt(Box<Term>, Box<Term>),
+ Fix(Box<Term>), // Uses de Bruijn indices
+ Variable(usize),
+ Call(Ident, Vec<Term>),
+}