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