summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/output.cpp2
-rw-r--r--src/solar.cpp6
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;