1 /** @file ginsh_parser.yy
3 * Input grammar definition for ginsh.
4 * This file must be processed with yacc/bison.
6 * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
31 #include <sys/resource.h>
34 #include <sys/types.h>
42 // Original readline settings
43 static int orig_completion_append_character;
44 static char *orig_basic_word_break_characters;
46 // Expression stack for ", "" and """
47 static void push(const ex &e);
50 // Start and end time for the time() function
51 static struct rusage start_time, end_time;
53 // Table of functions (a multimap, because one function may appear with different
54 // numbers of parameters)
55 typedef ex (*fcnp)(const exprseq &e);
56 typedef ex (*fcnp2)(const exprseq &e, int serial);
59 fcn_desc() : p(NULL), num_params(0) {}
60 fcn_desc(fcnp func, int num) : p(func), num_params(num), is_ginac(false) {}
61 fcn_desc(fcnp2 func, int num, int ser) : p((fcnp)func), num_params(num), is_ginac(true), serial(ser) {}
63 fcnp p; // Pointer to function
64 int num_params; // Number of parameters (0 = arbitrary)
65 bool is_ginac; // Flag: function is GiNaC function
66 int serial; // GiNaC function serial number (if is_ginac == true)
69 typedef multimap<string, fcn_desc> fcn_tab;
72 static fcn_tab::const_iterator find_function(const ex &sym, int req_params);
74 // Table to map help topics to help strings
75 typedef multimap<string, string> help_tab;
78 static void print_help(const string &topic);
79 static void print_help_topics(void);
81 static ex lst2matrix(const ex &l);
84 /* Tokens (T_LITERAL means a literal value returned by the parser, but not
85 of class numeric or symbol (e.g. a constant or the FAIL object)) */
86 %token T_NUMBER T_SYMBOL T_LITERAL T_DIGITS T_QUOTE T_QUOTE2 T_QUOTE3
87 %token T_EQUAL T_NOTEQ T_LESSEQ T_GREATEREQ T_MATRIX_BEGIN T_MATRIX_END
89 %token T_QUIT T_PRINT T_TIME T_XYZZY T_INVENTORY T_LOOK T_SCORE
91 /* Operator precedence and associativity */
94 %left '<' '>' T_LESSEQ T_GREATEREQ
118 } catch (exception &e) {
119 cerr << e.what() << endl;
126 } catch (exception &e) {
127 cerr << e.what() << endl;
131 | T_PRINT '(' exp ')' ';' {
134 } catch (exception &e) {
135 cerr << e.what() << endl;
139 | '?' T_SYMBOL {print_help(ex_to_symbol($2).getname());}
140 | '?' '?' {print_help_topics();}
142 | T_XYZZY {cout << "Nothing happens.\n";}
143 | T_INVENTORY {cout << "You're not carrying anything.\n";}
144 | T_LOOK {cout << "You're in a twisty little maze of passages, all alike.\n";}
146 cout << "If you were to quit now, you would score ";
147 cout << (syms.size() > 350 ? 350 : syms.size());
148 cout << " out of a possible 350.\n";
150 | error ';' {yyclearin; yyerrok;}
151 | error ':' {yyclearin; yyerrok;}
154 exp : T_NUMBER {$$ = $1;}
155 | T_SYMBOL {$$ = $1.eval();}
156 | '\'' T_SYMBOL '\'' {$$ = $2;}
157 | T_LITERAL {$$ = $1;}
158 | T_DIGITS {$$ = $1;}
159 | T_QUOTE {$$ = exstack[0];}
160 | T_QUOTE2 {$$ = exstack[1];}
161 | T_QUOTE3 {$$ = exstack[2];}
162 | T_TIME {getrusage(RUSAGE_SELF, &start_time);} '(' exp ')' {
163 getrusage(RUSAGE_SELF, &end_time);
164 $$ = (end_time.ru_utime.tv_sec - start_time.ru_utime.tv_sec) +
165 (end_time.ru_stime.tv_sec - start_time.ru_stime.tv_sec) +
166 double(end_time.ru_utime.tv_usec - start_time.ru_utime.tv_usec) / 1e6 +
167 double(end_time.ru_stime.tv_usec - start_time.ru_stime.tv_usec) / 1e6;
169 | T_SYMBOL '(' exprseq ')' {
170 fcn_tab::const_iterator i = find_function($1, $3.nops());
171 if (i->second.is_ginac) {
172 $$ = ((fcnp2)(i->second.p))(static_cast<const exprseq &>(*($3.bp)), i->second.serial);
174 $$ = (i->second.p)(static_cast<const exprseq &>(*($3.bp)));
177 | T_DIGITS '=' T_NUMBER {$$ = $3; Digits = ex_to_numeric($3).to_int();}
178 | T_SYMBOL '=' exp {$$ = $3; const_cast<symbol *>(&ex_to_symbol($1))->assign($3);}
179 | exp T_EQUAL exp {$$ = $1 == $3;}
180 | exp T_NOTEQ exp {$$ = $1 != $3;}
181 | exp '<' exp {$$ = $1 < $3;}
182 | exp T_LESSEQ exp {$$ = $1 <= $3;}
183 | exp '>' exp {$$ = $1 > $3;}
184 | exp T_GREATEREQ exp {$$ = $1 >= $3;}
185 | exp '+' exp {$$ = $1 + $3;}
186 | exp '-' exp {$$ = $1 - $3;}
187 | exp '*' exp {$$ = $1 * $3;}
188 | exp '/' exp {$$ = $1 / $3;}
189 | exp '%' exp {$$ = $1 % $3;}
190 | '-' exp %prec NEG {$$ = -$2;}
191 | '+' exp %prec NEG {$$ = $2;}
192 | exp '^' exp {$$ = power($1, $3);}
193 | exp '!' {$$ = factorial($1);}
194 | '(' exp ')' {$$ = $2;}
195 | '[' list_or_empty ']' {$$ = $2;}
196 | T_MATRIX_BEGIN matrix T_MATRIX_END {$$ = lst2matrix($2);}
199 exprseq : exp {$$ = exprseq($1);}
200 | exprseq ',' exp {exprseq es(static_cast<exprseq &>(*($1.bp))); $$ = es.append($3);}
203 list_or_empty: /* empty */ {$$ = *new lst;}
207 list : exp {$$ = lst($1);}
208 | list ',' exp {lst l(static_cast<lst &>(*($1.bp))); $$ = l.append($3);}
211 matrix : T_MATRIX_BEGIN row T_MATRIX_END {$$ = lst($2);}
212 | matrix ',' T_MATRIX_BEGIN row T_MATRIX_END {lst l(static_cast<lst &>(*($1.bp))); $$ = l.append($4);}
215 row : exp {$$ = lst($1);}
216 | row ',' exp {lst l(static_cast<lst &>(*($1.bp))); $$ = l.append($3);}
225 // Error print routine
228 cerr << s << " at " << yytext << endl;
232 // Push expression "e" onto the expression stack (for ", "" and """)
233 static void push(const ex &e)
235 exstack[2] = exstack[1];
236 exstack[1] = exstack[0];
245 static ex f_beta(const exprseq &e) {return gamma(e[0])*gamma(e[1])/gamma(e[0]+e[1]);}
246 static ex f_denom(const exprseq &e) {return e[0].denom();}
247 static ex f_eval1(const exprseq &e) {return e[0].eval();}
248 static ex f_evalf1(const exprseq &e) {return e[0].evalf();}
249 static ex f_expand(const exprseq &e) {return e[0].expand();}
250 static ex f_gcd(const exprseq &e) {return gcd(e[0], e[1]);}
251 static ex f_lcm(const exprseq &e) {return lcm(e[0], e[1]);}
252 static ex f_lsolve(const exprseq &e) {return lsolve(e[0], e[1]);}
253 static ex f_nops(const exprseq &e) {return e[0].nops();}
254 static ex f_normal1(const exprseq &e) {return e[0].normal();}
255 static ex f_numer(const exprseq &e) {return e[0].numer();}
256 static ex f_power(const exprseq &e) {return power(e[0], e[1]);}
257 static ex f_sqrt(const exprseq &e) {return sqrt(e[0]);}
258 static ex f_subs2(const exprseq &e) {return e[0].subs(e[1]);}
260 #define CHECK_ARG(num, type, fcn) if (!is_ex_of_type(e[num], type)) throw(std::invalid_argument("argument " #num " to " #fcn " must be a " #type))
262 static ex f_charpoly(const exprseq &e)
264 CHECK_ARG(0, matrix, charpoly);
265 CHECK_ARG(1, symbol, charpoly);
266 return ex_to_matrix(e[0]).charpoly(ex_to_symbol(e[1]));
269 static ex f_coeff(const exprseq &e)
271 CHECK_ARG(1, symbol, coeff);
272 CHECK_ARG(2, numeric, coeff);
273 return e[0].coeff(ex_to_symbol(e[1]), ex_to_numeric(e[2]).to_int());
276 static ex f_collect(const exprseq &e)
278 CHECK_ARG(1, symbol, collect);
279 return e[0].collect(ex_to_symbol(e[1]));
282 static ex f_content(const exprseq &e)
284 CHECK_ARG(1, symbol, content);
285 return e[0].content(ex_to_symbol(e[1]));
288 static ex f_degree(const exprseq &e)
290 CHECK_ARG(1, symbol, degree);
291 return e[0].degree(ex_to_symbol(e[1]));
294 static ex f_determinant(const exprseq &e)
296 CHECK_ARG(0, matrix, determinant);
297 return ex_to_matrix(e[0]).determinant();
300 static ex f_diag(const exprseq &e)
303 matrix &m = *new matrix(dim, dim);
304 for (int i=0; i<dim; i++)
305 m.set(i, i, e.op(i));
309 static ex f_diff2(const exprseq &e)
311 CHECK_ARG(1, symbol, diff);
312 return e[0].diff(ex_to_symbol(e[1]));
315 static ex f_diff3(const exprseq &e)
317 CHECK_ARG(1, symbol, diff);
318 CHECK_ARG(2, numeric, diff);
319 return e[0].diff(ex_to_symbol(e[1]), ex_to_numeric(e[2]).to_int());
322 static ex f_divide(const exprseq &e)
325 if (divide(e[0], e[1], q))
331 static ex f_eval2(const exprseq &e)
333 CHECK_ARG(1, numeric, eval);
334 return e[0].eval(ex_to_numeric(e[1]).to_int());
337 static ex f_evalf2(const exprseq &e)
339 CHECK_ARG(1, numeric, evalf);
340 return e[0].evalf(ex_to_numeric(e[1]).to_int());
343 static ex f_has(const exprseq &e)
345 return e[0].has(e[1]) ? exONE() : exZERO();
348 static ex f_inverse(const exprseq &e)
350 CHECK_ARG(0, matrix, inverse);
351 return ex_to_matrix(e[0]).inverse();
354 static ex f_is(const exprseq &e)
356 CHECK_ARG(0, relational, is);
357 return (bool)ex_to_relational(e[0]) ? exONE() : exZERO();
360 static ex f_lcoeff(const exprseq &e)
362 CHECK_ARG(1, symbol, lcoeff);
363 return e[0].lcoeff(ex_to_symbol(e[1]));
366 static ex f_ldegree(const exprseq &e)
368 CHECK_ARG(1, symbol, ldegree);
369 return e[0].ldegree(ex_to_symbol(e[1]));
372 static ex f_normal2(const exprseq &e)
374 CHECK_ARG(1, numeric, normal);
375 return e[0].normal(ex_to_numeric(e[1]).to_int());
378 static ex f_op(const exprseq &e)
380 CHECK_ARG(1, numeric, op);
381 int n = ex_to_numeric(e[1]).to_int();
382 if (n < 0 || n >= e[0].nops())
383 throw(std::out_of_range("second argument to op() is out of range"));
387 static ex f_prem(const exprseq &e)
389 CHECK_ARG(2, symbol, prem);
390 return prem(e[0], e[1], ex_to_symbol(e[2]));
393 static ex f_primpart(const exprseq &e)
395 CHECK_ARG(1, symbol, primpart);
396 return e[0].primpart(ex_to_symbol(e[1]));
399 static ex f_quo(const exprseq &e)
401 CHECK_ARG(2, symbol, quo);
402 return quo(e[0], e[1], ex_to_symbol(e[2]));
405 static ex f_rem(const exprseq &e)
407 CHECK_ARG(2, symbol, rem);
408 return rem(e[0], e[1], ex_to_symbol(e[2]));
411 static ex f_series2(const exprseq &e)
413 CHECK_ARG(1, symbol, series);
414 return e[0].series(ex_to_symbol(e[1]), exZERO());
417 static ex f_series3(const exprseq &e)
419 CHECK_ARG(1, symbol, series);
420 return e[0].series(ex_to_symbol(e[1]), e[2]);
423 static ex f_series4(const exprseq &e)
425 CHECK_ARG(1, symbol, series);
426 CHECK_ARG(3, numeric, series);
427 return e[0].series(ex_to_symbol(e[1]), e[2], ex_to_numeric(e[3]).to_int());
430 static ex f_sqrfree(const exprseq &e)
432 CHECK_ARG(1, symbol, sqrfree);
433 return sqrfree(e[0], ex_to_symbol(e[1]));
436 static ex f_subs3(const exprseq &e)
438 CHECK_ARG(1, lst, subs);
439 CHECK_ARG(2, lst, subs);
440 return e[0].subs(ex_to_lst(e[1]), ex_to_lst(e[2]));
443 static ex f_tcoeff(const exprseq &e)
445 CHECK_ARG(1, symbol, tcoeff);
446 return e[0].tcoeff(ex_to_symbol(e[1]));
449 static ex f_trace(const exprseq &e)
451 CHECK_ARG(0, matrix, trace);
452 return ex_to_matrix(e[0]).trace();
455 static ex f_transpose(const exprseq &e)
457 CHECK_ARG(0, matrix, transpose);
458 return ex_to_matrix(e[0]).transpose();
461 static ex f_unassign(const exprseq &e)
463 CHECK_ARG(0, symbol, unassign);
464 (const_cast<symbol *>(&ex_to_symbol(e[0])))->unassign();
468 static ex f_unit(const exprseq &e)
470 CHECK_ARG(1, symbol, unit);
471 return e[0].unit(ex_to_symbol(e[1]));
474 static ex f_dummy(const exprseq &e)
476 throw(std::logic_error("dummy function called (shouldn't happen)"));
479 // Table for initializing the "fcns" map
485 static const fcn_init builtin_fcns[] = {
486 {"beta", fcn_desc(f_beta, 2)},
487 {"charpoly", fcn_desc(f_charpoly, 2)},
488 {"coeff", fcn_desc(f_coeff, 3)},
489 {"collect", fcn_desc(f_collect, 2)},
490 {"content", fcn_desc(f_content, 2)},
491 {"degree", fcn_desc(f_degree, 2)},
492 {"denom", fcn_desc(f_denom, 1)},
493 {"determinant", fcn_desc(f_determinant, 1)},
494 {"diag", fcn_desc(f_diag, 0)},
495 {"diff", fcn_desc(f_diff2, 2)},
496 {"diff", fcn_desc(f_diff3, 3)},
497 {"divide", fcn_desc(f_divide, 2)},
498 {"eval", fcn_desc(f_eval1, 1)},
499 {"eval", fcn_desc(f_eval2, 2)},
500 {"evalf", fcn_desc(f_evalf1, 1)},
501 {"evalf", fcn_desc(f_evalf2, 2)},
502 {"expand", fcn_desc(f_expand, 1)},
503 {"gcd", fcn_desc(f_gcd, 2)},
504 {"has", fcn_desc(f_has, 2)},
505 {"inverse", fcn_desc(f_inverse, 1)},
506 {"is", fcn_desc(f_is, 1)},
507 {"lcm", fcn_desc(f_lcm, 2)},
508 {"lcoeff", fcn_desc(f_lcoeff, 2)},
509 {"ldegree", fcn_desc(f_ldegree, 2)},
510 {"lsolve", fcn_desc(f_lsolve, 2)},
511 {"nops", fcn_desc(f_nops, 1)},
512 {"normal", fcn_desc(f_normal1, 1)},
513 {"normal", fcn_desc(f_normal2, 2)},
514 {"numer", fcn_desc(f_numer, 1)},
515 {"op", fcn_desc(f_op, 2)},
516 {"power", fcn_desc(f_power, 2)},
517 {"prem", fcn_desc(f_prem, 3)},
518 {"primpart", fcn_desc(f_primpart, 2)},
519 {"quo", fcn_desc(f_quo, 3)},
520 {"rem", fcn_desc(f_rem, 3)},
521 {"series", fcn_desc(f_series2, 2)},
522 {"series", fcn_desc(f_series3, 3)},
523 {"series", fcn_desc(f_series4, 4)},
524 {"sqrfree", fcn_desc(f_sqrfree, 2)},
525 {"sqrt", fcn_desc(f_sqrt, 1)},
526 {"subs", fcn_desc(f_subs2, 2)},
527 {"subs", fcn_desc(f_subs3, 3)},
528 {"tcoeff", fcn_desc(f_tcoeff, 2)},
529 {"time", fcn_desc(f_dummy, 0)},
530 {"trace", fcn_desc(f_trace, 1)},
531 {"transpose", fcn_desc(f_transpose, 1)},
532 {"unassign", fcn_desc(f_unassign, 1)},
533 {"unit", fcn_desc(f_unit, 2)},
534 {NULL, fcn_desc(f_dummy, 0)} // End marker
539 * Add functions to ginsh
542 // Functions from fcn_init array
543 static void insert_fcns(const fcn_init *p)
546 fcns.insert(make_pair(string(p->name), p->desc));
551 static ex f_ginac_function(const exprseq &es, int serial)
553 return function(serial, es).eval(1);
556 // All registered GiNaC functions
557 void GiNaC::ginsh_get_ginac_functions(void)
559 vector<registered_function_info>::const_iterator i = function::registered_functions().begin(), end = function::registered_functions().end();
562 fcns.insert(make_pair(i->name, fcn_desc(f_ginac_function, i->nparams, serial)));
570 * Find a function given a name and number of parameters. Throw exceptions on error.
573 static fcn_tab::const_iterator find_function(const ex &sym, int req_params)
575 const string &name = ex_to_symbol(sym).getname();
576 typedef fcn_tab::const_iterator I;
577 pair<I, I> b = fcns.equal_range(name);
578 if (b.first == b.second)
579 throw(std::logic_error("unknown function '" + name + "'"));
581 for (I i=b.first; i!=b.second; i++)
582 if ((i->second.num_params == 0) || (i->second.num_params == req_params))
585 throw(std::logic_error("invalid number of arguments to " + name + "()"));
590 * Insert help strings
593 // Normal help string
594 static void insert_help(const char *topic, const char *str)
596 help.insert(make_pair(string(topic), string(str)));
599 // Help string for functions, automatically generates synopsis
600 static void insert_fcn_help(const char *name, const char *str)
602 typedef fcn_tab::const_iterator I;
603 pair<I, I> b = fcns.equal_range(name);
604 if (b.first != b.second) {
605 string help_str = string(name) + "(";
606 for (int i=0; i<b.first->second.num_params; i++) {
609 help_str += "expression";
613 help.insert(make_pair(string(name), help_str));
622 // Help for a given topic
623 static void print_help(const string &topic)
625 typedef help_tab::const_iterator I;
626 pair<I, I> b = help.equal_range(topic);
627 if (b.first == b.second)
628 cout << "no help for '" << topic << "'\n";
630 for (I i=b.first; i!=b.second; i++)
631 cout << i->second << endl;
635 // List of help topics
636 static void print_help_topics(void)
638 cout << "Available help topics:\n";
639 help_tab::const_iterator i;
640 string last_name = string("*");
642 for (i=help.begin(); i!=help.end(); i++) {
643 // Don't print duplicates
644 if (i->first != last_name) {
649 last_name = i->first;
652 cout << "\nTo get help for a certain topic, type ?topic\n";
657 * Convert list of lists to matrix
660 static ex lst2matrix(const ex &l)
662 if (!is_ex_of_type(l, lst))
663 throw(std::logic_error("internal error: argument to lst2matrix() is not a list"));
665 // Find number of rows and columns
666 int rows = l.nops(), cols = 0, i, j;
667 for (i=0; i<rows; i++)
668 if (l.op(i).nops() > cols)
669 cols = l.op(i).nops();
671 // Allocate and fill matrix
672 matrix &m = *new matrix(rows, cols);
673 for (i=0; i<rows; i++)
674 for (j=0; j<cols; j++)
675 if (l.op(i).nops() > j)
676 m.set(i, j, l.op(i).op(j));
678 m.set(i, j, exZERO());
684 * Function name completion functions for readline
687 static char *fcn_generator(char *text, int state)
689 static int len; // Length of word to complete
690 static fcn_tab::const_iterator index; // Iterator to function being currently considered
692 // If this is a new word to complete, initialize now
694 index = fcns.begin();
698 // Return the next function which partially matches
699 while (index != fcns.end()) {
700 const char *fcn_name = index->first.c_str();
702 if (strncmp(fcn_name, text, len) == 0)
703 return strdup(fcn_name);
708 static char **fcn_completion(char *text, int start, int end)
710 if (rl_line_buffer[0] == '!') {
711 // For shell commands, revert back to filename completion
712 rl_completion_append_character = orig_completion_append_character;
713 rl_basic_word_break_characters = orig_basic_word_break_characters;
714 return completion_matches(text, filename_completion_function);
716 // Otherwise, complete function names
717 rl_completion_append_character = '(';
718 rl_basic_word_break_characters = " \t\n\"#$%&'()*+,-./:;<=>?@[\\]^`{|}~";
719 return completion_matches(text, fcn_generator);
728 int main(int argc, char **argv)
730 // Print banner in interactive mode
732 cout << "ginsh - GiNaC Interactive Shell (" << PACKAGE << " " << VERSION << ")\n";
733 cout << "Copyright (C) 1999 Johannes Gutenberg Universitaet Mainz, Germany\n";
734 cout << "This is free software, and you are welcome to redistribute it\n";
735 cout << "under certain conditions; see the file COPYING for details.\n";
736 cout << "Type ?? for a list of help topics.\n";
739 // Init function table
740 insert_fcns(builtin_fcns);
741 ginsh_get_ginac_functions();
743 // Init help for operators (automatically generated from man page)
744 insert_help("operators", "Operators in falling order of precedence:");
745 #include "ginsh_op_help.c"
747 // Init help for built-in functions (automatically generated from man page)
748 #include "ginsh_fcn_help.c"
750 // Help for GiNaC functions is added manually
751 insert_fcn_help("acos", "inverse cosine function");
752 insert_fcn_help("acosh", "inverse hyperbolic cosine function");
753 insert_fcn_help("asin", "inverse sine function");
754 insert_fcn_help("asinh", "inverse hyperbolic sine function");
755 insert_fcn_help("atan", "inverse tangent function");
756 insert_fcn_help("atan2", "inverse tangent function with two arguments");
757 insert_fcn_help("atanh", "inverse hyperbolic tangent function");
758 insert_fcn_help("cos", "cosine function");
759 insert_fcn_help("cosh", "hyperbolic cosine function");
760 insert_fcn_help("sin", "sine function");
761 insert_fcn_help("sinh", "hyperbolic sine function");
762 insert_fcn_help("tan", "tangent function");
763 insert_fcn_help("tanh", "hyperbolic tangent function");
764 insert_fcn_help("exp", "exponential function");
765 insert_fcn_help("log", "natural logarithm");
766 insert_fcn_help("Li2", "dilogarithm");
767 insert_fcn_help("Li3", "trilogarithm");
768 insert_fcn_help("binomial", "binomial function");
769 insert_fcn_help("factorial", "factorial function");
770 insert_fcn_help("gamma", "gamma function");
771 insert_fcn_help("Order", "order term function (for truncated power series)");
773 // Init readline completer
774 rl_readline_name = argv[0];
775 rl_attempted_completion_function = (CPPFunction *)fcn_completion;
776 orig_completion_append_character = rl_completion_append_character;
777 orig_basic_word_break_characters = rl_basic_word_break_characters;
779 // Init input file list, open first file
780 num_files = argc - 1;
781 file_list = argv + 1;
783 yyin = fopen(*file_list, "r");
785 cerr << "Can't open " << *file_list << endl;
792 // Parse input, catch all remaining exceptions
796 } catch (exception &e) {
797 cerr << e.what() << endl;