Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main.cc

    r68cd1ce rde62360d  
    1010// Created On       : Fri May 15 23:12:02 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Jun 12 06:56:40 2015
    13 // Update Count     : 70
     12// Last Modified On : Mon Jun 22 17:02:11 2015
     13// Update Count     : 73
    1414//
    1515
     
    5858bool
    5959        astp = false,
     60        bresolvep = false,
    6061        exprp = false,
    6162        expraltp = false,
    6263        grammarp = false,
    6364        libcfap = false,
     65        nopreludep = false,
     66        protop = false,
     67        parsep = false,
    6468        resolvep = false,                                                                       // used in AlternativeFinder
    6569        symtabp = false,
    66         parsep = false,
    6770        validp = false,
    68         preludep = true,
    69         protop = false,
    70         codegenp = false,
    71         errorp = false;
    72 
    73 enum { Ast, Expr, ExprAlt, Grammar, LibCFA, Nopreamble, Parse, Prototypes, Resolver, Symbol, Validate, };
     71        errorp = false,
     72        codegenp = false;
     73
     74enum { Ast, Bresolver, Expr, ExprAlt, Grammar, LibCFA, Nopreamble, Parse, Prototypes, Resolver, Symbol, Validate, };
    7475
    7576static struct option long_opts[] = {
    7677        { "ast", no_argument, 0, Ast },
     78        { "before-resolver", no_argument, 0, Bresolver },
    7779        { "expr", no_argument, 0, Expr },
    7880        { "expralt", no_argument, 0, ExprAlt },
     
    9799       
    98100        int c;
    99         while ( (c = getopt_long( argc, argv, "aefglnpqrsvyzD:", long_opts, &long_index )) != -1 ) {
     101        while ( (c = getopt_long( argc, argv, "abefglnpqrsvyzD:", long_opts, &long_index )) != -1 ) {
    100102                switch ( c ) {
    101103                  case Ast:
     
    103105                        astp = true;
    104106                        break;
     107                  case Bresolver:
     108                  case 'b':                                                                             // print before resolver steps
     109                        bresolvep = true;
     110                        break;
    105111                  case Expr:
    106112                  case 'e':                                                                             // dump AST after expression analysis
     
    121127                  case Nopreamble:
    122128                  case 'n':                                                                             // do not read preamble
    123                         preludep = false;
     129                        nopreludep = true;
    124130                        break;
    125131                  case Prototypes:
     
    178184
    179185                // read in the builtins and the prelude
    180                 if ( preludep ) {                                                               // include gcc builtins
     186                if ( ! nopreludep ) {                                                   // include gcc builtins
    181187                        FILE * builtins = fopen( CFA_LIBDIR "/builtins.cf", "r" );
    182188                        if ( builtins == NULL ) {
     
    251257                } // if
    252258
     259                if ( bresolvep ) {
     260                        printAll( translationUnit, std::cout );
     261                        return 0;
     262                } // if
     263
    253264                OPTPRINT( "resolve" )
    254265                ResolvExpr::resolve( translationUnit );
Note: See TracChangeset for help on using the changeset viewer.