C source lexer in Rust
This is a fast and robust C source lexer in Rust. For example it can be used to extract some metadata from sources like comments or strings.
Library usage
use ;
let src = r#"
static const char *s = "world";
int main() {
// Hello world
printf("Hello %s\n", s);
return 0;
}
"#;
for lexeme in from
This example prints the following:
string: "world"
comment: "Hello world"
string: "Hello %s\n"
Command-line usage
Currently command-line tool is used to test this library. You can use it to analyze variuos C-sources and extract data.