aboutsummaryrefslogtreecommitdiff
path: root/bird-machine-macros/src/nfa.rs
blob: b7b3612b5a7dcf90b895ea70f36fa7505922f3db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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
    }
}