Ignore:
Timestamp:
Dec 22, 2022, 3:17:52 PM (19 months ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
ADT, ast-experimental, master
Children:
64b3cda
Parents:
be3b952
Message:

Moved new to old ast conversion up into the RunParser? module. As far as main is concerned the new ast is used from the beginning (except for LinkageSpec::Spec).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/RunParser.cpp

    rbe3b952 r019b2d3  
    1010// Created On       : Mon Dec 19 11:00:00 2022
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Mon Dec 19 11:15:00 2022
    13 // Update Count     : 0
     12// Last Modified On : Thr Dec 22 10:18:00 2022
     13// Update Count     : 1
    1414//
    1515
    1616#include "RunParser.hpp"
    1717
     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
    1822#include "Parser/ParseNode.h"               // for DeclarationNode, buildList
    1923#include "Parser/TypedefTable.h"            // for TypedefTable
     
    4751}
    4852
    49 std::list<Declaration *> buildUnit(void) {
     53ast::TranslationUnit buildUnit(void) {
    5054        std::list<Declaration *> translationUnit;
    5155        buildList( parseTree, translationUnit );
     
    5458        parseTree = nullptr;
    5559
    56         return translationUnit;
     60        // When the parse/buildList code is translated to the new ast, these
     61        // fill passes (and the one after 'Hoist Type Decls') should be redundent
     62        // because the code locations should already be filled.
     63        CodeTools::fillLocations( translationUnit );
     64        ast::TranslationUnit transUnit = convert( std::move( translationUnit ) );
     65        forceFillCodeLocations( transUnit );
     66        return transUnit;
    5767}
    5868
Note: See TracChangeset for help on using the changeset viewer.