Changes in / [7ecbb7e:5b7a60c8]


Ignore:
Location:
src
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • src/Common/module.mk

    r7ecbb7e r5b7a60c8  
    1111## Created On       : Mon Jun  1 17:49:17 2015
    1212## Last Modified By : Peter A. Buhr
    13 ## Last Modified On : Mon Jun  1 17:51:23 2015
    14 ## Update Count     : 1
     13## Last Modified On : Thu Aug 18 13:29:04 2016
     14## Update Count     : 2
    1515###############################################################################
    1616
    1717SRC += Common/SemanticError.cc \
    18        Common/UniqueName.cc
     18       Common/UniqueName.cc \
     19       Common/Assert.cc
  • src/Makefile.am

    r7ecbb7e r5b7a60c8  
    1111## Created On       : Sun May 31 08:51:46 2015
    1212## Last Modified By : Peter A. Buhr
    13 ## Last Modified On : Fri Jul  8 12:22:25 2016
    14 ## Update Count     : 60
     13## Last Modified On : Thu Aug 18 16:37:20 2016
     14## Update Count     : 68
    1515###############################################################################
    1616
     
    4242cfa_cpplib_PROGRAMS = driver/cfa-cpp
    4343driver_cfa_cpp_SOURCES = ${SRC}
    44 driver_cfa_cpp_LDADD = ${LEXLIB}        # yywrap
    45 # need files Common/utility.h
    46 driver_cfa_cpp_CXXFLAGS = -Wno-deprecated -Wall -DDEBUG_ALL
    47 
    48 AM_CXXFLAGS = -g -std=c++11
     44driver_cfa_cpp_LDADD = ${LEXLIB}                        # yywrap
     45driver_cfa_cpp_CXXFLAGS = -Wno-deprecated -Wall -DDEBUG_ALL -I@CFA_PREFIX@/src/include
    4946
    5047MAINTAINERCLEANFILES += ${libdir}/${notdir ${cfa_cpplib_PROGRAMS}}
  • src/Makefile.in

    r7ecbb7e r5b7a60c8  
    105105        Common/driver_cfa_cpp-SemanticError.$(OBJEXT) \
    106106        Common/driver_cfa_cpp-UniqueName.$(OBJEXT) \
     107        Common/driver_cfa_cpp-Assert.$(OBJEXT) \
    107108        ControlStruct/driver_cfa_cpp-LabelGenerator.$(OBJEXT) \
    108109        ControlStruct/driver_cfa_cpp-LabelFixer.$(OBJEXT) \
     
    369370        CodeGen/CodeGenerator.cc CodeGen/GenType.cc \
    370371        CodeGen/FixNames.cc CodeGen/OperatorTable.cc \
    371         Common/SemanticError.cc Common/UniqueName.cc \
     372        Common/SemanticError.cc Common/UniqueName.cc Common/Assert.cc \
    372373        ControlStruct/LabelGenerator.cc ControlStruct/LabelFixer.cc \
    373374        ControlStruct/MLEMutator.cc ControlStruct/Mutate.cc \
     
    425426cfa_cpplibdir = ${libdir}
    426427driver_cfa_cpp_SOURCES = ${SRC}
    427 driver_cfa_cpp_LDADD = ${LEXLIB}        # yywrap
     428driver_cfa_cpp_LDADD = ${LEXLIB}                        # yywrap
    428429# need files Common/utility.h
    429 driver_cfa_cpp_CXXFLAGS = -Wno-deprecated -Wall -DDEBUG_ALL
    430 AM_CXXFLAGS = -g -std=c++11
     430driver_cfa_cpp_CXXFLAGS = -Wno-deprecated -Wall -DDEBUG_ALL -I@CFA_PREFIX@/src/include
    431431all: $(BUILT_SOURCES)
    432432        $(MAKE) $(AM_MAKEFLAGS) all-am
     
    527527        Common/$(DEPDIR)/$(am__dirstamp)
    528528Common/driver_cfa_cpp-UniqueName.$(OBJEXT): Common/$(am__dirstamp) \
     529        Common/$(DEPDIR)/$(am__dirstamp)
     530Common/driver_cfa_cpp-Assert.$(OBJEXT): Common/$(am__dirstamp) \
    529531        Common/$(DEPDIR)/$(am__dirstamp)
    530532ControlStruct/$(am__dirstamp):
     
    814816        -rm -f CodeGen/driver_cfa_cpp-Generate.$(OBJEXT)
    815817        -rm -f CodeGen/driver_cfa_cpp-OperatorTable.$(OBJEXT)
     818        -rm -f Common/driver_cfa_cpp-Assert.$(OBJEXT)
    816819        -rm -f Common/driver_cfa_cpp-SemanticError.$(OBJEXT)
    817820        -rm -f Common/driver_cfa_cpp-UniqueName.$(OBJEXT)
     
    923926@AMDEP_TRUE@@am__include@ @am__quote@CodeGen/$(DEPDIR)/driver_cfa_cpp-Generate.Po@am__quote@
    924927@AMDEP_TRUE@@am__include@ @am__quote@CodeGen/$(DEPDIR)/driver_cfa_cpp-OperatorTable.Po@am__quote@
     928@AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/driver_cfa_cpp-Assert.Po@am__quote@
    925929@AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/driver_cfa_cpp-SemanticError.Po@am__quote@
    926930@AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/driver_cfa_cpp-UniqueName.Po@am__quote@
     
    11641168@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Common/driver_cfa_cpp-UniqueName.obj `if test -f 'Common/UniqueName.cc'; then $(CYGPATH_W) 'Common/UniqueName.cc'; else $(CYGPATH_W) '$(srcdir)/Common/UniqueName.cc'; fi`
    11651169
     1170Common/driver_cfa_cpp-Assert.o: Common/Assert.cc
     1171@am__fastdepCXX_TRUE@   $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Common/driver_cfa_cpp-Assert.o -MD -MP -MF Common/$(DEPDIR)/driver_cfa_cpp-Assert.Tpo -c -o Common/driver_cfa_cpp-Assert.o `test -f 'Common/Assert.cc' || echo '$(srcdir)/'`Common/Assert.cc
     1172@am__fastdepCXX_TRUE@   $(AM_V_at)$(am__mv) Common/$(DEPDIR)/driver_cfa_cpp-Assert.Tpo Common/$(DEPDIR)/driver_cfa_cpp-Assert.Po
     1173@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(AM_V_CXX)source='Common/Assert.cc' object='Common/driver_cfa_cpp-Assert.o' libtool=no @AMDEPBACKSLASH@
     1174@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1175@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Common/driver_cfa_cpp-Assert.o `test -f 'Common/Assert.cc' || echo '$(srcdir)/'`Common/Assert.cc
     1176
     1177Common/driver_cfa_cpp-Assert.obj: Common/Assert.cc
     1178@am__fastdepCXX_TRUE@   $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Common/driver_cfa_cpp-Assert.obj -MD -MP -MF Common/$(DEPDIR)/driver_cfa_cpp-Assert.Tpo -c -o Common/driver_cfa_cpp-Assert.obj `if test -f 'Common/Assert.cc'; then $(CYGPATH_W) 'Common/Assert.cc'; else $(CYGPATH_W) '$(srcdir)/Common/Assert.cc'; fi`
     1179@am__fastdepCXX_TRUE@   $(AM_V_at)$(am__mv) Common/$(DEPDIR)/driver_cfa_cpp-Assert.Tpo Common/$(DEPDIR)/driver_cfa_cpp-Assert.Po
     1180@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(AM_V_CXX)source='Common/Assert.cc' object='Common/driver_cfa_cpp-Assert.obj' libtool=no @AMDEPBACKSLASH@
     1181@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1182@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Common/driver_cfa_cpp-Assert.obj `if test -f 'Common/Assert.cc'; then $(CYGPATH_W) 'Common/Assert.cc'; else $(CYGPATH_W) '$(srcdir)/Common/Assert.cc'; fi`
     1183
    11661184ControlStruct/driver_cfa_cpp-LabelGenerator.o: ControlStruct/LabelGenerator.cc
    11671185@am__fastdepCXX_TRUE@   $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ControlStruct/driver_cfa_cpp-LabelGenerator.o -MD -MP -MF ControlStruct/$(DEPDIR)/driver_cfa_cpp-LabelGenerator.Tpo -c -o ControlStruct/driver_cfa_cpp-LabelGenerator.o `test -f 'ControlStruct/LabelGenerator.cc' || echo '$(srcdir)/'`ControlStruct/LabelGenerator.cc
  • src/Parser/DeclarationNode.cc

    r7ecbb7e r5b7a60c8  
    1010// Created On       : Sat May 16 12:34:05 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Aug 17 11:08:56 2016
    13 // Update Count     : 180
     12// Last Modified On : Wed Aug 17 23:14:51 2016
     13// Update Count     : 181
    1414//
    1515
     
    779779}
    780780
    781 DeclarationNode *DeclarationNode::appendList( DeclarationNode *node ) {
    782         return (DeclarationNode *)set_last( node );
    783 }
    784 
    785781DeclarationNode *DeclarationNode::extractAggregate() const {
    786782        if ( type ) {
  • src/Parser/ParseNode.cc

    r7ecbb7e r5b7a60c8  
    1010// Created On       : Sat May 16 13:26:29 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Aug 16 21:31:47 2016
    13 // Update Count     : 125
     12// Last Modified On : Wed Aug 17 23:14:16 2016
     13// Update Count     : 126
    1414//
    1515
     
    1919int ParseNode::indent_by = 4;
    2020
    21 ParseNode::ParseNode() {};
    22 ParseNode::ParseNode( const string *name ) : name( *name ) { assert( false ); delete name; }
    23 ParseNode::ParseNode( const string &name ) : name( name ) { assert( false ); }
    24 
    25 ParseNode::~ParseNode() {
    26         delete next;
    27 };
    28 
    29 ParseNode *ParseNode::get_last() {
    30         ParseNode *current;
    31         for ( current = this; current->get_next() != 0; current = current->get_next() );
    32         return current;
    33 }
    34 
    35 ParseNode *ParseNode::set_last( ParseNode *newlast ) {
    36         if ( newlast != 0 ) get_last()->set_next( newlast );
    37         return this;
    38 }
    39 
    4021// Local Variables: //
    4122// tab-width: 4 //
  • src/Parser/ParseNode.h

    r7ecbb7e r5b7a60c8  
    1010// Created On       : Sat May 16 13:28:16 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Aug 16 21:32:18 2016
    13 // Update Count     : 538
     12// Last Modified On : Wed Aug 17 23:15:59 2016
     13// Update Count     : 541
    1414//
    1515
     
    4040class ParseNode {
    4141  public:
    42         ParseNode();
    43         ParseNode( const std::string * );
    44         ParseNode( const std::string & );                                       // for copy constructing subclasses
    45         virtual ~ParseNode();
     42        ParseNode() {};
     43        ParseNode( const std::string *name ) : name( *name ) { assert( false ); delete name; }
     44        ParseNode( const std::string &name ) : name( name ) { assert( false ); }
     45        virtual ~ParseNode() { delete next; };
    4646        virtual ParseNode *clone() const = 0;
    4747
    4848        ParseNode *get_next() const { return next; }
    4949        ParseNode *set_next( ParseNode *newlink ) { next = newlink; return this; }
    50         ParseNode *get_last();
    51         ParseNode *set_last( ParseNode *newlast );
     50        ParseNode *get_last() {
     51                ParseNode *current;
     52                for ( current = this; current->get_next() != 0; current = current->get_next() );
     53                return current;
     54        }
     55        ParseNode *set_last( ParseNode *newlast ) {
     56                if ( newlast != 0 ) get_last()->set_next( newlast );
     57                return this;
     58        }
    5259
    5360        const std::string &get_name() const { return name; }
     
    254261        DeclarationNode *cloneBaseType( DeclarationNode *newdecl );
    255262
    256         DeclarationNode *appendList( DeclarationNode * );
     263        DeclarationNode *appendList( DeclarationNode *node ) {
     264                return (DeclarationNode *)set_last( node );
     265        }
    257266
    258267        void print( std::ostream &os, int indent = 0 ) const;
  • src/main.cc

    r7ecbb7e r5b7a60c8  
    1010// Created On       : Fri May 15 23:12:02 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Aug 17 22:13:38 2016
    13 // Update Count     : 341
     12// Last Modified On : Thu Aug 18 16:33:49 2016
     13// Update Count     : 347
    1414//
    1515
     
    7070static void dump( std::list< Declaration * > & translationUnit, std::ostream & out = std::cout );
    7171
    72 //************************************************
    73 
    74 #define __STRINGIFY__(str) #str
    75 #define __VSTRINGIFY__(str) __STRINGIFY__(str)
    76 #define assertf(expr, fmt, ...) ((expr) ? static_cast<void>(0) : __assert_fail_f(__VSTRINGIFY__(expr), __FILE__, __LINE__, __PRETTY_FUNCTION__, fmt, ## __VA_ARGS__ ))
    77 #define CFA_ASSERT_FMT "*CFA assertion error* from program \"%s\" in \"%s\" at line %d in file \"%s\": "
    78 
    79 extern const char * __progname;                                                 // global name of running executable (argv[0])
    80 // called by macro assert in assert.h
    81 void __assert_fail( const char *assertion, const char *file, unsigned int line, const char *function ) {
    82         fprintf( stderr, CFA_ASSERT_FMT, __progname, function, line, file );
    83         exit( EXIT_FAILURE );
    84 }
    85 
    86 #include <cstdarg>
    87 // called by macro assertf
    88 void __assert_fail_f( const char *assertion, const char *file, unsigned int line, const char *function, const char *fmt, ... ) {
    89         fprintf( stderr, CFA_ASSERT_FMT, __progname, function, line, file );
    90         va_list args;
    91         va_start( args, fmt );
    92         vfprintf( stderr, fmt, args );
    93         exit( EXIT_FAILURE );
    94 }
    95 
    96 //************************************************
    97 
    9872int main( int argc, char * argv[] ) {
    9973        FILE * input;                                                                           // use FILE rather than istream because yyin is FILE
     
    408382} // dump
    409383
    410 
    411 
    412384// Local Variables: //
    413385// tab-width: 4 //
Note: See TracChangeset for help on using the changeset viewer.