Changeset 64b3cda


Ignore:
Timestamp:
Dec 22, 2022, 4:05:12 PM (19 months ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
ADT, ast-experimental, master
Children:
ea2ed3a
Parents:
019b2d3
Message:

Adjusted -Pasterr so it works while using the new ast. Removed the -Ptree option as it doesn't seem to work and no one uses it.

Location:
src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • src/CompilationState.cc

    r019b2d3 r64b3cda  
    3333        useNewAST = true,
    3434        nomainp = false,
    35         parsep = false,
    3635        resolvep = false,
    3736        resolvprotop = false,
  • src/CompilationState.h

    r019b2d3 r64b3cda  
    3232        useNewAST,
    3333        nomainp,
    34         parsep,
    3534        resolvep,
    3635        resolvprotop,
  • src/Parser/RunParser.cpp

    r019b2d3 r64b3cda  
    4545} // parse
    4646
    47 void dumpParseTree( std::ostream & out ) {
    48         parseTree->printList( out );
    49         delete parseTree;
    50         parseTree = nullptr;
    51 }
    52 
    5347ast::TranslationUnit buildUnit(void) {
    5448        std::list<Declaration *> translationUnit;
  • src/Parser/RunParser.hpp

    r019b2d3 r64b3cda  
    3131void parse( FILE * input, LinkageSpec::Spec linkage, bool alwaysExit = false );
    3232
    33 /// Drain the internal accumulator of parsed code and print it to the stream.
    34 void dumpParseTree( std::ostream & );
    35 
    3633/// Drain the internal accumulator of parsed code and build a translation
    3734/// unit from it.
  • src/main.cc

    r019b2d3 r64b3cda  
    228228        ostream * output = & cout;
    229229        list< Declaration * > translationUnit;
     230        ast::TranslationUnit transUnit;
    230231
    231232        Signal( SIGSEGV, sigSegvBusHandler, SA_SIGINFO );
     
    294295                parse( input, libcfap ? LinkageSpec::Intrinsic : LinkageSpec::Cforall, yydebug );
    295296
    296                 if ( parsep ) {
    297                         dumpParseTree( cout );
    298                         return EXIT_SUCCESS;
    299                 } // if
    300 
    301                 auto transUnit = buildUnit();
     297                transUnit = buildUnit();
    302298
    303299                if ( astp ) {
     
    467463                if ( errorp ) {
    468464                        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                        }
    470472                        cerr << endl << "---End of AST, begin error message:---\n" << endl;
    471473                } // if
     
    571573        { "rproto", resolvprotop, true, "resolver-proto instance" },
    572574        { "rsteps", resolvep, true, "print resolver steps" },
    573         { "tree", parsep, true, "print parse tree" },
    574575        // code dumps
    575576        { "ast", astp, true, "print AST after parsing" },
Note: See TracChangeset for help on using the changeset viewer.