Changeset d99a716 for src/Parser
- Timestamp:
- Jan 4, 2023, 1:44:19 PM (3 years ago)
- Branches:
- ADT, ast-experimental, master, stuck-waitfor-destruct
- Children:
- 339e30a, a14926b
- Parents:
- 0348fd8 (diff), 66a89e7 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - Location:
- src/Parser
- Files:
-
- 2 edited
-
RunParser.cpp (modified) (3 diffs)
-
RunParser.hpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/RunParser.cpp
r0348fd8 rd99a716 10 10 // Created On : Mon Dec 19 11:00:00 2022 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Mon Dec 19 11:15:00 202213 // Update Count : 012 // Last Modified On : Thr Dec 22 10:18:00 2022 13 // Update Count : 1 14 14 // 15 15 16 16 #include "RunParser.hpp" 17 17 18 #include "AST/Convert.hpp" // for convert 19 #include "AST/TranslationUnit.hpp" // for TranslationUnit 20 #include "CodeTools/TrackLoc.h" // for fillLocations 21 #include "Common/CodeLocationTools.hpp" // for forceFillCodeLocations 18 22 #include "Parser/ParseNode.h" // for DeclarationNode, buildList 19 23 #include "Parser/TypedefTable.h" // for TypedefTable … … 41 45 } // parse 42 46 43 void dumpParseTree( std::ostream & out ) { 44 parseTree->printList( out ); 45 delete parseTree; 46 parseTree = nullptr; 47 } 48 49 std::list<Declaration *> buildUnit(void) { 47 ast::TranslationUnit buildUnit(void) { 50 48 std::list<Declaration *> translationUnit; 51 49 buildList( parseTree, translationUnit ); … … 54 52 parseTree = nullptr; 55 53 56 return translationUnit; 54 // When the parse/buildList code is translated to the new ast, these 55 // fill passes (and the one after 'Hoist Type Decls') should be redundent 56 // because the code locations should already be filled. 57 CodeTools::fillLocations( translationUnit ); 58 ast::TranslationUnit transUnit = convert( std::move( translationUnit ) ); 59 forceFillCodeLocations( transUnit ); 60 return transUnit; 57 61 } 58 62 -
src/Parser/RunParser.hpp
r0348fd8 rd99a716 10 10 // Created On : Mon Dec 19 10:42:00 2022 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Mon Dec 19 11:15:00 202213 // Update Count : 012 // Last Modified On : Thr Dec 22 10:23:00 2022 13 // Update Count : 1 14 14 // 15 15 … … 17 17 18 18 #include <iosfwd> // for ostream 19 #include <list> // for list20 19 21 20 #include "SynTree/LinkageSpec.h" // for Spec 22 class Declaration; 21 namespace ast { 22 class TranslationUnit; 23 } 23 24 24 25 // The Parser does not have an enclosing namespace. … … 30 31 void parse( FILE * input, LinkageSpec::Spec linkage, bool alwaysExit = false ); 31 32 32 /// Drain the internal accumulator of parsed code and print it to the stream.33 void dumpParseTree( std::ostream & );34 35 33 /// Drain the internal accumulator of parsed code and build a translation 36 34 /// unit from it. 37 std::list<Declaration *>buildUnit(void);35 ast::TranslationUnit buildUnit(void); 38 36 39 37 // Local Variables: //
Note:
See TracChangeset
for help on using the changeset viewer.