Changeset 1afda5a2 for src/main.cc


Ignore:
Timestamp:
Dec 19, 2022, 9:37:55 PM (3 years ago)
Author:
caparsons <caparson@…>
Branches:
ADT, ast-experimental, master
Children:
199456c, ebbe941
Parents:
8e64cb4 (diff), d18540f (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.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main.cc

    r8e64cb4 r1afda5a2  
    5959#include "InitTweak/GenInit.h"              // for genInit
    6060#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,...
    6362#include "ResolvExpr/CandidatePrinter.hpp"  // for printCandidates
    6463#include "ResolvExpr/Resolver.h"            // for resolve
     
    109108        Stats::Time::StopBlock();
    110109
    111 LinkageSpec::Spec linkage = LinkageSpec::Cforall;
    112 TypedefTable typedefTable;
    113 DeclarationNode * parseTree = nullptr;                                  // program parse tree
    114 
    115110static bool waiting_for_gdb = false;                                    // flag to set cfa-cpp to wait for gdb on start
    116111
     
    118113
    119114static void parse_cmdline( int argc, char * argv[] );
    120 static void parse( FILE * input, LinkageSpec::Spec linkage, bool shouldExit = false );
    121115static void dump( list< Declaration * > & translationUnit, ostream & out = cout );
    122116static void dump( ast::TranslationUnit && transUnit, ostream & out = cout );
     
    301295
    302296                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();
    311302
    312303                if ( astp ) {
     
    748739} // parse_cmdline
    749740
    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 globals
    756         yyin = input;
    757         yylineno = 1;
    758         int parseStatus = yyparse();
    759 
    760         fclose( input );
    761         if ( shouldExit || parseStatus != 0 ) {
    762                 exit( parseStatus );
    763         } // if
    764 } // parse
    765 
    766741static bool notPrelude( Declaration * decl ) {
    767742        return ! LinkageSpec::isBuiltin( decl->get_linkage() );
Note: See TracChangeset for help on using the changeset viewer.