Changeset 64b3cda
- Timestamp:
- Dec 22, 2022, 4:05:12 PM (3 years ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- ea2ed3a
- Parents:
- 019b2d3
- Location:
- src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/CompilationState.cc
r019b2d3 r64b3cda 33 33 useNewAST = true, 34 34 nomainp = false, 35 parsep = false,36 35 resolvep = false, 37 36 resolvprotop = false, -
src/CompilationState.h
r019b2d3 r64b3cda 32 32 useNewAST, 33 33 nomainp, 34 parsep,35 34 resolvep, 36 35 resolvprotop, -
src/Parser/RunParser.cpp
r019b2d3 r64b3cda 45 45 } // parse 46 46 47 void dumpParseTree( std::ostream & out ) {48 parseTree->printList( out );49 delete parseTree;50 parseTree = nullptr;51 }52 53 47 ast::TranslationUnit buildUnit(void) { 54 48 std::list<Declaration *> translationUnit; -
src/Parser/RunParser.hpp
r019b2d3 r64b3cda 31 31 void parse( FILE * input, LinkageSpec::Spec linkage, bool alwaysExit = false ); 32 32 33 /// Drain the internal accumulator of parsed code and print it to the stream.34 void dumpParseTree( std::ostream & );35 36 33 /// Drain the internal accumulator of parsed code and build a translation 37 34 /// unit from it. -
src/main.cc
r019b2d3 r64b3cda 228 228 ostream * output = & cout; 229 229 list< Declaration * > translationUnit; 230 ast::TranslationUnit transUnit; 230 231 231 232 Signal( SIGSEGV, sigSegvBusHandler, SA_SIGINFO ); … … 294 295 parse( input, libcfap ? LinkageSpec::Intrinsic : LinkageSpec::Cforall, yydebug ); 295 296 296 if ( parsep ) { 297 dumpParseTree( cout ); 298 return EXIT_SUCCESS; 299 } // if 300 301 auto transUnit = buildUnit(); 297 transUnit = buildUnit(); 302 298 303 299 if ( astp ) { … … 467 463 if ( errorp ) { 468 464 cerr << "---AST at error:---" << endl; 469 dump( translationUnit, cerr ); 465 // We check which section the errors came from without looking at 466 // transUnit because std::move means it could look like anything. 467 if ( !translationUnit.empty() ) { 468 dump( translationUnit, cerr ); 469 } else { 470 dump( std::move( transUnit ), cerr ); 471 } 470 472 cerr << endl << "---End of AST, begin error message:---\n" << endl; 471 473 } // if … … 571 573 { "rproto", resolvprotop, true, "resolver-proto instance" }, 572 574 { "rsteps", resolvep, true, "print resolver steps" }, 573 { "tree", parsep, true, "print parse tree" },574 575 // code dumps 575 576 { "ast", astp, true, "print AST after parsing" },
Note:
See TracChangeset
for help on using the changeset viewer.