10 releases (breaking)
0.8.1 | Jan 26, 2024 |
---|---|
0.8.0 | Feb 5, 2021 |
0.7.0 | Nov 29, 2020 |
0.6.0 | Feb 17, 2020 |
0.5.0 | Jul 5, 2019 |
#72 in Parser tooling
69 downloads per month
165KB
4.5K
SLoC
rflex
rflex is a fast lexical analyzer generator for Rust.
cargo install rflex
or
Write your Cargo.toml and build.rs
[package]
# ...
build = "build.rs"
[build-dependencies]
# ...
failure = "0.1.5"
rflex = "0.8"
extern crate rflex;
use std::env;
use std::path::Path;
fn main() {
let out_dir = env::var("OUT_DIR").unwrap();
let dest = Path::new(&out_dir).join("target.rs");
let path = Path::new("src").join("target.l");
if let Err(e) = rflex::process(path, Some(dest)) {
for cause in failure::Fail::iter_chain(&e) {
eprintln!("{}: {}", cause.name().unwrap_or("Error"), cause);
}
std::process::exit(1);
}
}
See tutorial.md.
Unsupported regular-expression
e{num}
... repeat enum
timese{min,max}
... repeat emin
tomax
timese/s
... lookaheads
before accepte
License
- rflex is released under MIT License.
Copyright
- Copyright (c) 2018 Preferred Networks, Inc.
- Partial original codes were written in Java under 3-clause BSD license:
- Copyright (c) Gerwin Klein, Steve Rowe, Regis Decamp. All rights reserved.
Dependent libraries
These libraries are used only rflex lexer generator, generated code doesn't depend on them.
- fixedbitset released under MIT License
- Copyright (c) 2015-2017
- liquid released under MIT License
- Copyright (c) 2014 cobalt-org
- failure released under MIT License
Dependencies
~6–8MB
~155K SLoC