-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.rs
26 lines (24 loc) · 1004 Bytes
/
build.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
use std::process;
use parol::{build::Builder, ParolErrorReporter};
use parol_runtime::Report;
fn main() {
// CLI equivalent is:
// parol -f ./la_dfa_2_dot.par -e ./la_dfa_2_dot-exp.par -p ./src/la_dfa_2_dot_parser.rs -a ./src/la_dfa_2_dot_grammar_trait.rs -t LaDfa2DotGrammar -m la_dfa_2_dot_grammar -b --disable-recovery
if let Err(err) = Builder::with_explicit_output_dir("src")
.max_lookahead(7)
.unwrap()
.grammar_file("la_dfa_2_dot.par")
.expanded_grammar_output_file("../la_dfa_2_dot-exp.par")
.parser_output_file("la_dfa_2_dot_parser.rs")
.actions_output_file("la_dfa_2_dot_grammar_trait.rs")
.minimize_boxed_types()
.user_type_name("LaDfa2DotGrammar")
.user_trait_module_name("la_dfa_2_dot_grammar")
.disable_recovery()
.trim_parse_tree()
.generate_parser()
{
ParolErrorReporter::report_error(&err, "la_dfa_2_dot.par").unwrap_or_default();
process::exit(1);
}
}