Changeset 7d4f6ed for tools/prettyprinter/main.cc
- Timestamp:
- Jun 29, 2017, 8:04:42 AM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 2b7afbd
- Parents:
- 9335ecc
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/prettyprinter/main.cc
r9335ecc r7d4f6ed 1 #include <cstdlib> 1 // 2 // Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo 3 // 4 // The contents of this file are covered under the licence agreement in the 5 // file "LICENCE" distributed with Cforall. 6 // 7 // main.cc -- 8 // 9 // Author : Peter A. Buhr 10 // Created On : Wed Jun 28 22:57:26 2017 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Jun 28 22:58:40 2017 13 // Update Count : 3 14 // 15 16 #include <iostream> 17 #include <string> 18 using namespace std; 2 19 #include "filter.h" 3 20 … … 6 23 7 24 int main( int argc, char *argv[] ) { 8 9 10 string arg( argv[1] );25 switch ( argc ) { 26 case 2: { 27 string arg( argv[1] ); 11 28 12 if ( arg == "-identity" ) {13 14 } else if ( arg == "-parse_tree" ) {15 16 } else if ( arg == "-nocode" ) {17 18 } else if ( arg == "-latex" ) {19 20 } else if ( arg == "-html" ) {21 22 } else {23 24 25 } // if26 break;27 28 29 30 cerr << "Usage: " << argv[0] << " [-identity | -parse_tree | -nocode | -latex | -html] < bison.y" << endl;31 exit( -1 );32 29 if ( arg == "-identity" ) { 30 filter = Identity; 31 } else if ( arg == "-parse_tree" ) { 32 filter = Parse_Tree; 33 } else if ( arg == "-nocode" ) { 34 filter = Nocode; 35 } else if ( arg == "-latex" ) { 36 filter = LaTeX; 37 } else if ( arg == "-html" ) { 38 filter = HTML; 39 } else { 40 cerr << "Unknown printer option: " << argv[1] << endl; 41 goto usage; 42 } // if 43 break; 44 } 45 usage: 46 default: 47 cerr << "Usage: " << argv[0] << " [-identity | -parse_tree | -nocode | -latex | -html] < bison.y" << endl; 48 exit( -1 ); 49 } 33 50 34 35 51 //yydebug = 1; 52 yyparse(); 36 53 } 37 54 38 55 // Local Variables: // 39 // compile-command: "gmake" // 56 // mode: c++ // 57 // tab-width: 4 // 58 // compile-command: "make install" // 40 59 // End: //
Note: See TracChangeset
for help on using the changeset viewer.