Ignore:
Timestamp:
Jun 29, 2017, 8:04:42 AM (7 years ago)
Author:
Peter A. Buhr <pabuhr@…>
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
Message:

remainder of pretty printer

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>
     18using namespace std;
    219#include "filter.h"
    320
     
    623
    724int main( int argc, char *argv[] ) {
    8     switch ( argc ) {
    9       case 2: {
    10           string arg( argv[1] );
     25        switch ( argc ) {
     26          case 2: {
     27                  string arg( argv[1] );
    1128
    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     }
     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        }
    3350
    34     //yydebug = 1;
    35     yyparse();
     51        //yydebug = 1;
     52        yyparse();
    3653}
    3754
    3855// Local Variables: //
    39 // compile-command: "gmake" //
     56// mode: c++ //
     57// tab-width: 4 //
     58// compile-command: "make install" //
    4059// End: //
Note: See TracChangeset for help on using the changeset viewer.