| Crates.io | lrlex |
| lib.rs | lrlex |
| version | 0.13.10 |
| created_at | 2018-12-13 18:32:29.514942+00 |
| updated_at | 2025-02-28 14:15:29.40779+00 |
| description | Simple lexer generator |
| homepage | |
| repository | https://github.com/softdevteam/grmtools |
| max_upload_size | |
| id | 101776 |
| size | 153,997 |
lrlexlrlex is a partial replacement for
lex /
flex. It takes an input string and
splits it into lexemes based on a .l file. Unfortunately, many real-world
languages have corner cases which exceed the power that lrlex can provide.
However, when it is suitable, it is a very convenient way of expressing lexing.
lrlex also has a simple command-line interface, allowing you to check whether
your lexing rules are working as expected:
$ cat C.java
class C {
int x = 0;
}
$ cargo run --lrlex java.l /tmp/C.java
Finished dev [unoptimized + debuginfo] target(s) in 0.18s
Running `target/debug/lrlex ../grammars/java7/java.l /tmp/C.java`
CLASS class
IDENTIFIER C
LBRACE {
INT int
IDENTIFIER x
EQ =
INTEGER_LITERAL 0
SEMICOLON ;
RBRACE }