diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2015-04-06 20:13:20 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2015-04-06 20:13:36 +0200 |
commit | fda24d9c220b8288c297922793f933897d8fa28c (patch) | |
tree | 9ccf17e5ffb6e8e474271174f6d9a7f523e37e4a | |
parent | d6deff997e4f882d9fa46b109fd32e713f054a6d (diff) | |
download | solar-fda24d9c220b8288c297922793f933897d8fa28c.tar solar-fda24d9c220b8288c297922793f933897d8fa28c.zip |
Set output files from command line
-rw-r--r-- | src/output.cpp | 2 | ||||
-rw-r--r-- | src/solar.cpp | 6 |
2 files changed, 3 insertions, 5 deletions
diff --git a/src/output.cpp b/src/output.cpp index 7e9029b..6d090d0 100644 --- a/src/output.cpp +++ b/src/output.cpp @@ -287,8 +287,6 @@ void output_t::emit_source() { void output_t::write() { emit_header(); - std::fflush(header_file); - emit_source(); } diff --git a/src/solar.cpp b/src/solar.cpp index 8d876d0..f3b04f6 100644 --- a/src/solar.cpp +++ b/src/solar.cpp @@ -78,8 +78,8 @@ bool read_grammar(const char *filename, parser_state_t *state) { int main(int argc, char *argv[]) { using namespace solar; - if (argc < 2) { - std::fprintf(stderr, "Usage: solar FILE\n"); + if (argc < 4) { + std::fprintf(stderr, "Usage: solar INPUT SOURCE HEADER\n"); return 1; } @@ -89,7 +89,7 @@ int main(int argc, char *argv[]) { generator_t generator(state.get_rules(), state.get_nonterm_types(), state.get_term_types()); - output_t output(&generator, "/dev/stdout", "/dev/stdout"); + output_t output(&generator, argv[3], argv[2]); output.write(); return 0; |