Changeset f2f595d7 for src


Ignore:
Timestamp:
Feb 16, 2023, 10:49:05 AM (15 months ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
ADT, ast-experimental, master
Children:
cad9edb
Parents:
d3bffdb
Message:

RunParser? now uses AST for its interface everywhere. (Works because LinkageSpec::Spec and ast::Linkage::Spec have the same layout.)

Location:
src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/RunParser.cpp

    rd3bffdb rf2f595d7  
    1010// Created On       : Mon Dec 19 11:00:00 2022
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Thr Dec 22 10:18:00 2022
    13 // Update Count     : 1
     12// Last Modified On : Thr Feb 16 10:08:00 2023
     13// Update Count     : 2
    1414//
    1515
     
    2424
    2525// Variables global to the parsing code.
    26 LinkageSpec::Spec linkage = LinkageSpec::Cforall;
     26ast::Linkage::Spec linkage = ast::Linkage::Cforall;
    2727TypedefTable typedefTable;
    2828DeclarationNode * parseTree = nullptr;
    2929
    30 void parse( FILE * input, LinkageSpec::Spec linkage, bool alwaysExit ) {
     30void parse( FILE * input, ast::Linkage::Spec linkage, bool alwaysExit ) {
    3131        extern int yyparse( void );
    3232        extern FILE * yyin;
  • src/Parser/RunParser.hpp

    rd3bffdb rf2f595d7  
    1010// Created On       : Mon Dec 19 10:42:00 2022
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Thr Dec 22 10:23:00 2022
    13 // Update Count     : 1
     12// Last Modified On : Thr Feb 16 10:08:00 2023
     13// Update Count     : 2
    1414//
    1515
     
    1818#include <iosfwd>                           // for ostream
    1919
    20 #include "SynTree/LinkageSpec.h"            // for Spec
     20#include "AST/LinkageSpec.hpp"              // for Spec
    2121namespace ast {
    2222        class TranslationUnit;
     
    2929/// The input file is closed when complete. Exits instead of returning on
    3030/// error or if alwaysExit is true.
    31 void parse( FILE * input, LinkageSpec::Spec linkage, bool alwaysExit = false );
     31void parse( FILE * input, ast::Linkage::Spec linkage, bool alwaysExit = false );
    3232
    3333/// Drain the internal accumulator of parsed code and build a translation
  • src/main.cc

    rd3bffdb rf2f595d7  
    1010// Created On       : Fri May 15 23:12:02 2015
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Wed Oct  5 12:06:00 2022
    13 // Update Count     : 679
     12// Last Modified On : Thr Feb 16 10:08:00 2023
     13// Update Count     : 680
    1414//
    1515
     
    272272                        FILE * gcc_builtins = fopen( (PreludeDirector + "/gcc-builtins.cf").c_str(), "r" );
    273273                        assertf( gcc_builtins, "cannot open gcc-builtins.cf\n" );
    274                         parse( gcc_builtins, LinkageSpec::Compiler );
     274                        parse( gcc_builtins, ast::Linkage::Compiler );
    275275
    276276                        // read the extra prelude in, if not generating the cfa library
    277277                        FILE * extras = fopen( (PreludeDirector + "/extras.cf").c_str(), "r" );
    278278                        assertf( extras, "cannot open extras.cf\n" );
    279                         parse( extras, LinkageSpec::BuiltinC );
     279                        parse( extras, ast::Linkage::BuiltinC );
    280280
    281281                        if ( ! libcfap ) {
     
    283283                                FILE * prelude = fopen( (PreludeDirector + "/prelude.cfa").c_str(), "r" );
    284284                                assertf( prelude, "cannot open prelude.cfa\n" );
    285                                 parse( prelude, LinkageSpec::Intrinsic );
     285                                parse( prelude, ast::Linkage::Intrinsic );
    286286
    287287                                // Read to cfa builtins, if not generating the cfa library
    288288                                FILE * builtins = fopen( (PreludeDirector + "/builtins.cf").c_str(), "r" );
    289289                                assertf( builtins, "cannot open builtins.cf\n" );
    290                                 parse( builtins, LinkageSpec::BuiltinCFA );
    291                         } // if
    292                 } // if
    293 
    294                 parse( input, libcfap ? LinkageSpec::Intrinsic : LinkageSpec::Cforall, yydebug );
     290                                parse( builtins, ast::Linkage::BuiltinCFA );
     291                        } // if
     292                } // if
     293
     294                parse( input, libcfap ? ast::Linkage::Intrinsic : ast::Linkage::Cforall, yydebug );
    295295
    296296                transUnit = buildUnit();
     
    340340                PASS( "Generate Autogen Routines", Validate::autogenerateRoutines( transUnit ) );
    341341
    342         PASS( "Implement Actors", Concurrency::implementActors( transUnit ) );
    343 
     342                PASS( "Implement Actors", Concurrency::implementActors( transUnit ) );
    344343                PASS( "Implement Mutex", Concurrency::implementMutex( transUnit ) );
    345344                PASS( "Implement Thread Start", Concurrency::implementThreadStarter( transUnit ) );
Note: See TracChangeset for help on using the changeset viewer.