use autour_core::traits::repr::AbstractLanguagePrinter;
#[derive(Debug, Clone)]
pub struct TestNFAPrinter {
pub map : Vec<String>
}
impl TestNFAPrinter {
pub fn new(map: Vec<String>) -> Self {
TestNFAPrinter { map }
}
pub fn get_printer() -> Self {
let map = vec!["a","b","c","d","e","f"].iter().map(|x| x.to_string()).collect();
Self::new(map)
}
}
const SYNTAX_EMPTY_CLEAR : &str = "∅";
const SYNTAX_EMPTY_HTML : &str = "∅";
const SYNTAX_EPSILON_CLEAR : &str = "𝜀";
const SYNTAX_EPSILON_HTML : &str = "ε";
const SYNTAX_WILDCARD_DOT : &str = ".";
const SYNTAX_WILDCARD_HASHTAG : &str = "#";
const SYNTAX_CONCATENATION_EMPTY : &str = "";
const SYNTAX_CONCATENATION_DOT : &str = ".";
const SYNTAX_ALTERNATION : &str = "|";
const SYNTAX_INTERSECTION_CLEAR : &str = "∩";
const SYNTAX_INTERSECTION_HTML : &str = "∩";
const SYNTAX_NEGATION_CLEAR : &str = "¬";
const SYNTAX_NEGATION_HTML : &str = "¬";
impl AbstractLanguagePrinter<usize> for TestNFAPrinter {
fn is_letter_string_repr_atomic(&self, _letter: &usize) -> bool {
false
}
fn get_letter_string_repr(&self, letter: &usize) -> String {
self.map.get(*letter).unwrap().to_string()
}
fn get_concatenation_separator(&self, _use_html: bool) -> &'static str {
SYNTAX_CONCATENATION_DOT
}
fn get_alternation_separator(&self, _use_html: bool) -> &'static str {
SYNTAX_ALTERNATION
}
fn get_intersection_separator(&self, use_html: bool) -> &'static str {
if use_html {
SYNTAX_INTERSECTION_HTML
} else {
SYNTAX_INTERSECTION_CLEAR
}
}
fn get_wildcard_symbol(&self, _use_html: bool) -> &'static str {
SYNTAX_WILDCARD_DOT
}
fn get_negate_symbol(&self, use_html: bool) -> &'static str {
if use_html {
SYNTAX_NEGATION_HTML
} else {
SYNTAX_NEGATION_CLEAR
}
}
fn get_empty_symbol(&self, use_html: bool) -> &'static str {
if use_html {
SYNTAX_EMPTY_HTML
} else {
SYNTAX_EMPTY_CLEAR
}
}
fn get_epsilon_symbol(&self, use_html: bool) -> &'static str {
if use_html {
SYNTAX_EPSILON_HTML
} else {
SYNTAX_EPSILON_CLEAR
}
}
}