Changeset cbd1ba8
- Timestamp:
- Dec 19, 2022, 11:51:04 AM (21 months ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- d0bdb18
- Parents:
- c63f470
- Location:
- src
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/module.mk
rc63f470 rcbd1ba8 30 30 Parser/parserutility.cc \ 31 31 Parser/parserutility.h \ 32 Parser/RunParser.cpp \ 33 Parser/RunParser.hpp \ 32 34 Parser/StatementNode.cc \ 33 35 Parser/TypeData.cc \ -
src/main.cc
rc63f470 rcbd1ba8 59 59 #include "InitTweak/GenInit.h" // for genInit 60 60 #include "MakeLibCfa.h" // for makeLibCfa 61 #include "Parser/ParseNode.h" // for DeclarationNode, buildList 62 #include "Parser/TypedefTable.h" // for TypedefTable 61 #include "Parser/RunParser.hpp" // for buildList, dumpParseTree,... 63 62 #include "ResolvExpr/CandidatePrinter.hpp" // for printCandidates 64 63 #include "ResolvExpr/Resolver.h" // for resolve … … 109 108 Stats::Time::StopBlock(); 110 109 111 LinkageSpec::Spec linkage = LinkageSpec::Cforall;112 TypedefTable typedefTable;113 DeclarationNode * parseTree = nullptr; // program parse tree114 115 110 static bool waiting_for_gdb = false; // flag to set cfa-cpp to wait for gdb on start 116 111 … … 118 113 119 114 static void parse_cmdline( int argc, char * argv[] ); 120 static void parse( FILE * input, LinkageSpec::Spec linkage, bool shouldExit = false );121 115 static void dump( list< Declaration * > & translationUnit, ostream & out = cout ); 122 116 static void dump( ast::TranslationUnit && transUnit, ostream & out = cout ); … … 301 295 302 296 if ( parsep ) { 303 parseTree->printList( cout ); 304 delete parseTree; 305 return EXIT_SUCCESS; 306 } // if 307 308 buildList( parseTree, translationUnit ); 309 delete parseTree; 310 parseTree = nullptr; 297 dumpParseTree( cout ); 298 return EXIT_SUCCESS; 299 } // if 300 301 translationUnit = buildUnit(); 311 302 312 303 if ( astp ) { … … 748 739 } // parse_cmdline 749 740 750 static void parse( FILE * input, LinkageSpec::Spec linkage, bool shouldExit ) {751 extern int yyparse( void );752 extern FILE * yyin;753 extern int yylineno;754 755 ::linkage = linkage; // set globals756 yyin = input;757 yylineno = 1;758 int parseStatus = yyparse();759 760 fclose( input );761 if ( shouldExit || parseStatus != 0 ) {762 exit( parseStatus );763 } // if764 } // parse765 766 741 static bool notPrelude( Declaration * decl ) { 767 742 return ! LinkageSpec::isBuiltin( decl->get_linkage() );
Note: See TracChangeset
for help on using the changeset viewer.