]> git.lizzy.rs Git - rust.git/blob - src/grammar/README.md
Make fields and macro defs exported
[rust.git] / src / grammar / README.md
1 Reference grammar.
2
3 Uses [antlr4](http://www.antlr.org/) and a custom Rust tool to compare
4 ASTs/token streams generated. You can use the `check-lexer` make target to
5 run all of the available tests.
6
7 To use manually:
8
9 ```
10 antlr4 RustLexer.g4
11 javac *.java
12 rustc -O verify.rs
13 for file in ../*/**.rs; do
14     echo $file;
15     grun RustLexer tokens -tokens < "$file" | ./verify "$file" RustLexer.tokens || break
16 done
17 ```
18
19 Note That the `../*/**.rs` glob will match every `*.rs` file in the above
20 directory and all of its recursive children. This is a zsh extension.