rust/src/grammar/README.md

21 lines
559 B
Markdown
Raw Normal View History

2014-07-14 01:52:18 -07:00
Reference grammar.
Uses [antlr4](http://www.antlr.org/) and a custom Rust tool to compare
2014-12-30 16:49:27 +01:00
ASTs/token streams generated. You can use the `check-lexer` make target to
2014-07-21 19:26:20 -07:00
run all of the available tests.
2014-07-14 01:52:18 -07:00
2014-07-21 19:26:20 -07:00
To use manually:
2014-07-14 01:52:18 -07:00
```
antlr4 RustLexer.g4
javac *.java
rustc -O verify.rs
for file in ../*/**.rs; do
echo $file;
2015-04-21 12:02:12 +02:00
grun RustLexer tokens -tokens < "$file" | ./verify "$file" RustLexer.tokens || break
2014-07-14 01:52:18 -07:00
done
```
Note That the `../*/**.rs` glob will match every `*.rs` file in the above
directory and all of its recursive children. This is a zsh extension.