aboutsummaryrefslogtreecommitdiff
path: root/bird-machine-macros/src/nfa.rs
diff options
context:
space:
mode:
authorMelody Horn <melody@boringcactus.com>2021-03-31 23:04:09 -0600
committerMelody Horn <melody@boringcactus.com>2021-03-31 23:04:09 -0600
commit24207feb7726bd2db97693eb8fdd155d33612574 (patch)
treeaa0ee9c2deb20105db7239c2de75593f8b25256f /bird-machine-macros/src/nfa.rs
downloadbird-machine-24207feb7726bd2db97693eb8fdd155d33612574.tar.gz
bird-machine-24207feb7726bd2db97693eb8fdd155d33612574.zip
basic sketch of general vibe
Diffstat (limited to 'bird-machine-macros/src/nfa.rs')
-rw-r--r--bird-machine-macros/src/nfa.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/bird-machine-macros/src/nfa.rs b/bird-machine-macros/src/nfa.rs
new file mode 100644
index 0000000..b7b3612
--- /dev/null
+++ b/bird-machine-macros/src/nfa.rs
@@ -0,0 +1,15 @@
+use std::collections::{HashMap, HashSet};
+
+#[derive(Default)]
+pub struct NFA {
+ state_count: usize,
+ transition_table: HashMap<Option<char>, HashSet<usize>>,
+}
+
+impl NFA {
+ pub fn new_state(&mut self) -> usize {
+ let result = self.state_count;
+ self.state_count += 1;
+ result
+ }
+}