ZipLex: lexicon-driven lexical engine per paper specification.
No dependencies
No dependents
pub enum Regex { REmpty REps RChar(Char) RRange(Char, Char) RUnion(Array[Regex]) RConcat(Regex, Regex) RStar(Regex)} derive(Eq, Hash, @moonbitlang/core/debug.DebugDebug)
fn Regex::equal(Regex, Regex) -> Bool
fn Regex::hash(self : Regex) -> Int
fn Regex::hash_combine(Regex, Hasher) -> Unit
fn Regex::not_equal(x : Regex, y : Regex) -> Bool
fn Regex::to_repr(Regex) -> @moonbitlang/core/debug.ReprRepr
pub struct Rule { name : String re : Regex}
fn Rule::new(name : String, re : Regex) -> Rule
pub struct Token { rule : String lexeme : String}
fn alt(rs : Array[Regex]) -> Regex
fn chars(s : String) -> Regex
fn concat(r1 : Regex, r2 : Regex) -> Regex
fn lex(rules : Array[Rule], input : String) -> Result[Array[Token], String]
fn plus(r : Regex) -> Regex
fn print(tokens : Array[Token]) -> String
fn range(lo : Char, hi : Char) -> Regex
fn str(s : String) -> Regex
Install