source: tools/prettyprinter/main.cc @ fda8168

aaron-thesisarm-ehcleanup-dtorsdeferred_resndemanglerenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprnew-envno_listpersistent-indexerresolv-newwith_gc
Last change on this file since fda8168 was fda8168, checked in by Peter A. Buhr <pabuhr@…>, 5 years ago

format tool for pretty printing grammar

  • Property mode set to 100644
File size: 870 bytes
Line 
1#include <cstdlib>
2#include "filter.h"
3
4extern int yydebug;
5extern int yyparse( void );
6
7int main( int argc, char *argv[] ) {
8    switch ( argc ) {
9      case 2: {
10          string arg( argv[1] );
11
12          if ( arg == "-identity" ) {
13              filter = Identity;
14          } else if ( arg == "-parse_tree" ) {
15              filter = Parse_Tree;
16          } else if ( arg == "-nocode" ) {
17              filter = Nocode;
18          } else if ( arg == "-latex" ) {
19              filter = LaTeX;
20          } else if ( arg == "-html" ) {
21              filter = HTML;
22          } else {
23              cerr << "Unknown printer option: " << argv[1] << endl;
24              goto usage;
25          } // if
26          break;
27      }
28      usage:
29      default:
30        cerr << "Usage: " << argv[0] << " [-identity | -parse_tree | -nocode | -latex | -html] < bison.y" << endl;
31        exit( -1 );
32    }
33
34    //yydebug = 1;
35    yyparse();
36}
37
38// Local Variables: //
39// compile-command: "gmake" //
40// End: //
Note: See TracBrowser for help on using the repository browser.