Changes in src/main.cc [d3b7937:faf8857]
- File:
-
- 1 edited
-
src/main.cc (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/main.cc
rd3b7937 rfaf8857 10 10 // Created On : Fri May 15 23:12:02 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Jan 27 22:20:20 201613 // Update Count : 1 9912 // Last Modified On : Thu Dec 17 12:59:06 2015 13 // Update Count : 179 14 14 // 15 15 … … 45 45 //#include "Try/Visit.h" 46 46 47 #include " Common/SemanticError.h"48 #include " Common/UnimplementedError.h"47 #include "SemanticError.h" 48 #include "UnimplementedError.h" 49 49 50 50 #include "../config.h" … … 70 70 resolvep = false, // used in AlternativeFinder 71 71 symtabp = false, 72 treep = false,73 72 validp = false, 74 73 errorp = false, 75 74 codegenp = false; 76 75 77 enum { Ast, Bresolver, Expr, ExprAlt, Grammar, LibCFA, Nopreamble, Parse, Prototypes, Resolver, Symbol, Tree,Validate, };76 enum { Ast, Bresolver, Expr, ExprAlt, Grammar, LibCFA, Nopreamble, Parse, Prototypes, Resolver, Symbol, Validate, }; 78 77 79 78 static struct option long_opts[] = { … … 89 88 { "resolver", no_argument, 0, Resolver }, 90 89 { "symbol", no_argument, 0, Symbol }, 91 { "tree", no_argument, 0, Tree },92 90 { "validate", no_argument, 0, Validate }, 93 91 { 0, 0, 0, 0 } … … 103 101 104 102 int c; 105 while ( (c = getopt_long( argc, argv, "abefglnpqrs tvyzD:", long_opts, &long_index )) != -1 ) {103 while ( (c = getopt_long( argc, argv, "abefglnpqrsvyzD:", long_opts, &long_index )) != -1 ) { 106 104 switch ( c ) { 107 105 case Ast: … … 148 146 case 's': // print symbol table events 149 147 symtabp = true; 150 break;151 case Tree:152 case 't': // build in tree153 treep = true;154 148 break; 155 149 case 'v': // dump AST after decl validation pass … … 194 188 if ( ! nopreludep ) { // include gcc builtins 195 189 // -l is for initial build ONLY and builtins.cf is not in the lib directory so access it here. 196 FILE * builtins = fopen( libcfap | treep ? "builtins.cf" : CFA_LIBDIR "/builtins.cf", "r" );190 FILE * builtins = fopen( libcfap ? "./builtins.cf" : CFA_LIBDIR "/builtins.cf", "r" ); 197 191 if ( builtins == NULL ) { 198 std::cerr << "Error: can't open builtins .cf" << std::endl;192 std::cerr << "Error: can't open builtins" << std::endl; 199 193 exit( 1 ); 200 194 } // if … … 204 198 if ( ! libcfap ) { 205 199 // read the prelude in, if not generating the cfa library 206 FILE * prelude = fopen( treep ? "prelude.cf" :CFA_LIBDIR "/prelude.cf", "r" );200 FILE * prelude = fopen( CFA_LIBDIR "/prelude.cf", "r" ); 207 201 if ( prelude == NULL ) { 208 std::cerr << "Error: can't open prelude .cf" << std::endl;202 std::cerr << "Error: can't open prelude" << std::endl; 209 203 exit( 1 ); 210 204 } // if
Note:
See TracChangeset
for help on using the changeset viewer.