Skip to content

Commit

Permalink
feat: dfa methods
Browse files Browse the repository at this point in the history
  • Loading branch information
0xVikasRushi committed Jun 3, 2024
1 parent d1bdc0f commit a4d2b53
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/dfa.rs
Original file line number Diff line number Diff line change
@@ -1 +1,28 @@
use crate::{nfa::CELL, state::State};
use std::{cell::RefCell, collections::HashMap, rc::Rc};
use uuid::Uuid;

#[derive(Clone, Debug)]
pub struct DFA {
pub in_state: Rc<RefCell<State>>,
pub out_state: Rc<RefCell<State>>,
}

impl DFA {
pub fn new() -> DFA {
DFA {
in_state: Rc::new(RefCell::new(State::new(false))),
out_state: Rc::new(RefCell::new(State::new(true))),
}
}

pub fn get_transition_table(nfa_table: HashMap<Uuid, Vec<CELL>>) -> HashMap<Uuid, Vec<CELL>> {
let ans: HashMap<Uuid, Vec<CELL>> = HashMap::new();
return ans;
}

pub fn test(_string: &str) -> bool {
return false;
}
pub fn get_accepting_states() {}
}
1 change: 1 addition & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
mod dfa;
mod nfa;
mod state;

Expand Down

0 comments on commit a4d2b53

Please sign in to comment.