Changeset aee7e35


Ignore:
Timestamp:
Sep 29, 2016, 10:48:09 AM (7 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
7e10773
Parents:
7b69174 (diff), 4b1fd2c (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

Files:
8 added
39 edited

Legend:

Unmodified
Added
Removed
  • src/CodeGen/GenType.cc

    r7b69174 raee7e35  
    4242                virtual void visit( TypeInstType *typeInst );
    4343                virtual void visit( VarArgsType *varArgsType );
     44                virtual void visit( ZeroType *zeroType );
     45                virtual void visit( OneType *oneType );
    4446
    4547          private:
     
    200202        }
    201203
     204        void GenType::visit( ZeroType *zeroType ) {
     205                // ideally these wouldn't hit codegen at all, but should be safe to make them ints
     206                typeString = "int " + typeString;
     207                handleQualifiers( zeroType );
     208        }
     209
     210        void GenType::visit( OneType *oneType ) {
     211                // ideally these wouldn't hit codegen at all, but should be safe to make them ints
     212                typeString = "int " + typeString;
     213                handleQualifiers( oneType );
     214        }
     215
    202216        void GenType::handleQualifiers( Type *type ) {
    203217                if ( type->get_isConst() ) {
  • src/Common/SemanticError.h

    r7b69174 raee7e35  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Jun  8 14:38:53 2015
    13 // Update Count     : 4
     12// Last Modified On : Sat Sep 24 15:13:42 2016
     13// Update Count     : 5
    1414//
    1515
     
    4646}
    4747
    48 
    4948#endif // SEMANTICERROR_H
    5049
  • src/Common/module.mk

    r7b69174 raee7e35  
    1111## Created On       : Mon Jun  1 17:49:17 2015
    1212## Last Modified By : Peter A. Buhr
    13 ## Last Modified On : Thu Aug 18 13:29:04 2016
    14 ## Update Count     : 2
     13## Last Modified On : Tue Sep 27 11:06:38 2016
     14## Update Count     : 4
    1515###############################################################################
    1616
    1717SRC += Common/SemanticError.cc \
    1818       Common/UniqueName.cc \
     19       Common/DebugMalloc.cc \
    1920       Common/Assert.cc
  • src/Common/utility.h

    r7b69174 raee7e35  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Jun  8 17:33:59 2016
    13 // Update Count     : 22
     12// Last Modified On : Fri Sep 23 11:46:47 2016
     13// Update Count     : 28
    1414//
    1515
     
    2525#include <sstream>
    2626#include <string>
     27#include <cassert>
    2728
    2829template< typename T >
     
    101102                } // if
    102103        } // for
    103 }
    104 
    105 static inline std::string assign_strptr( const std::string *str ) {
    106         if ( str == 0 ) {
    107                 return "";
    108         } else {
    109                 std::string tmp;
    110                 tmp = *str;
    111                 delete str;
    112                 return tmp;
    113         } // if
    114104}
    115105
     
    141131
    142132template < typename T >
    143 void toString_single ( std::ostream & os, const T & value ) {
     133void toString_single( std::ostream & os, const T & value ) {
    144134        os << value;
    145135}
    146136
    147137template < typename T, typename... Params >
    148 void toString_single ( std::ostream & os, const T & value, const Params & ... params ) {
     138void toString_single( std::ostream & os, const T & value, const Params & ... params ) {
    149139        os << value;
    150140        toString_single( os, params ... );
     
    152142
    153143template < typename ... Params >
    154 std::string toString ( const Params & ... params ) {
     144std::string toString( const Params & ... params ) {
    155145        std::ostringstream os;
    156146        toString_single( os, params... );
  • src/Makefile.am

    r7b69174 raee7e35  
    1111## Created On       : Sun May 31 08:51:46 2015
    1212## Last Modified By : Peter A. Buhr
    13 ## Last Modified On : Sat Aug 20 11:13:12 2016
    14 ## Update Count     : 71
     13## Last Modified On : Sat Sep 24 15:03:52 2016
     14## Update Count     : 73
    1515###############################################################################
    1616
     
    4040cfa_cpplib_PROGRAMS = driver/cfa-cpp
    4141driver_cfa_cpp_SOURCES = ${SRC}
    42 driver_cfa_cpp_LDADD = ${LEXLIB}                        # yywrap
     42driver_cfa_cpp_LDADD = ${LEXLIB} -ldl                   # yywrap
    4343driver_cfa_cpp_CXXFLAGS = -Wno-deprecated -Wall -DDEBUG_ALL -rdynamic -I${abs_top_srcdir}/src/include
    4444
  • src/Makefile.in

    r7b69174 raee7e35  
    9898        Common/driver_cfa_cpp-SemanticError.$(OBJEXT) \
    9999        Common/driver_cfa_cpp-UniqueName.$(OBJEXT) \
     100        Common/driver_cfa_cpp-DebugMalloc.$(OBJEXT) \
    100101        Common/driver_cfa_cpp-Assert.$(OBJEXT) \
    101102        ControlStruct/driver_cfa_cpp-LabelGenerator.$(OBJEXT) \
     
    165166        SynTree/driver_cfa_cpp-AttrType.$(OBJEXT) \
    166167        SynTree/driver_cfa_cpp-VarArgsType.$(OBJEXT) \
     168        SynTree/driver_cfa_cpp-ZeroOneType.$(OBJEXT) \
    167169        SynTree/driver_cfa_cpp-Constant.$(OBJEXT) \
    168170        SynTree/driver_cfa_cpp-Expression.$(OBJEXT) \
     
    358360        CodeGen/CodeGenerator.cc CodeGen/GenType.cc \
    359361        CodeGen/FixNames.cc CodeGen/OperatorTable.cc \
    360         Common/SemanticError.cc Common/UniqueName.cc Common/Assert.cc \
     362        Common/SemanticError.cc Common/UniqueName.cc \
     363        Common/DebugMalloc.cc Common/Assert.cc \
    361364        ControlStruct/LabelGenerator.cc ControlStruct/LabelFixer.cc \
    362365        ControlStruct/MLEMutator.cc ControlStruct/Mutate.cc \
     
    390393        SynTree/ReferenceToType.cc SynTree/TupleType.cc \
    391394        SynTree/TypeofType.cc SynTree/AttrType.cc \
    392         SynTree/VarArgsType.cc SynTree/Constant.cc \
    393         SynTree/Expression.cc SynTree/TupleExpr.cc \
     395        SynTree/VarArgsType.cc SynTree/ZeroOneType.cc \
     396        SynTree/Constant.cc SynTree/Expression.cc SynTree/TupleExpr.cc \
    394397        SynTree/CommaExpr.cc SynTree/TypeExpr.cc \
    395398        SynTree/ApplicationExpr.cc SynTree/AddressExpr.cc \
     
    413416cfa_cpplibdir = ${libdir}
    414417driver_cfa_cpp_SOURCES = ${SRC}
    415 driver_cfa_cpp_LDADD = ${LEXLIB}                        # yywrap
     418driver_cfa_cpp_LDADD = ${LEXLIB} -ldl                   # yywrap
    416419driver_cfa_cpp_CXXFLAGS = -Wno-deprecated -Wall -DDEBUG_ALL -rdynamic -I${abs_top_srcdir}/src/include
    417420all: $(BUILT_SOURCES)
     
    513516        Common/$(DEPDIR)/$(am__dirstamp)
    514517Common/driver_cfa_cpp-UniqueName.$(OBJEXT): Common/$(am__dirstamp) \
     518        Common/$(DEPDIR)/$(am__dirstamp)
     519Common/driver_cfa_cpp-DebugMalloc.$(OBJEXT): Common/$(am__dirstamp) \
    515520        Common/$(DEPDIR)/$(am__dirstamp)
    516521Common/driver_cfa_cpp-Assert.$(OBJEXT): Common/$(am__dirstamp) \
     
    715720SynTree/driver_cfa_cpp-VarArgsType.$(OBJEXT): SynTree/$(am__dirstamp) \
    716721        SynTree/$(DEPDIR)/$(am__dirstamp)
     722SynTree/driver_cfa_cpp-ZeroOneType.$(OBJEXT): SynTree/$(am__dirstamp) \
     723        SynTree/$(DEPDIR)/$(am__dirstamp)
    717724SynTree/driver_cfa_cpp-Constant.$(OBJEXT): SynTree/$(am__dirstamp) \
    718725        SynTree/$(DEPDIR)/$(am__dirstamp)
     
    786793        -rm -f CodeGen/driver_cfa_cpp-OperatorTable.$(OBJEXT)
    787794        -rm -f Common/driver_cfa_cpp-Assert.$(OBJEXT)
     795        -rm -f Common/driver_cfa_cpp-DebugMalloc.$(OBJEXT)
    788796        -rm -f Common/driver_cfa_cpp-SemanticError.$(OBJEXT)
    789797        -rm -f Common/driver_cfa_cpp-UniqueName.$(OBJEXT)
     
    877885        -rm -f SynTree/driver_cfa_cpp-Visitor.$(OBJEXT)
    878886        -rm -f SynTree/driver_cfa_cpp-VoidType.$(OBJEXT)
     887        -rm -f SynTree/driver_cfa_cpp-ZeroOneType.$(OBJEXT)
    879888        -rm -f Tuples/driver_cfa_cpp-NameMatcher.$(OBJEXT)
    880889        -rm -f Tuples/driver_cfa_cpp-TupleAssignment.$(OBJEXT)
     
    891900@AMDEP_TRUE@@am__include@ @am__quote@CodeGen/$(DEPDIR)/driver_cfa_cpp-OperatorTable.Po@am__quote@
    892901@AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/driver_cfa_cpp-Assert.Po@am__quote@
     902@AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/driver_cfa_cpp-DebugMalloc.Po@am__quote@
    893903@AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/driver_cfa_cpp-SemanticError.Po@am__quote@
    894904@AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/driver_cfa_cpp-UniqueName.Po@am__quote@
     
    982992@AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-Visitor.Po@am__quote@
    983993@AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-VoidType.Po@am__quote@
     994@AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-ZeroOneType.Po@am__quote@
    984995@AMDEP_TRUE@@am__include@ @am__quote@Tuples/$(DEPDIR)/driver_cfa_cpp-NameMatcher.Po@am__quote@
    985996@AMDEP_TRUE@@am__include@ @am__quote@Tuples/$(DEPDIR)/driver_cfa_cpp-TupleAssignment.Po@am__quote@
     
    11271138@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`
    11281139
     1140Common/driver_cfa_cpp-DebugMalloc.o: Common/DebugMalloc.cc
     1141@am__fastdepCXX_TRUE@   $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Common/driver_cfa_cpp-DebugMalloc.o -MD -MP -MF Common/$(DEPDIR)/driver_cfa_cpp-DebugMalloc.Tpo -c -o Common/driver_cfa_cpp-DebugMalloc.o `test -f 'Common/DebugMalloc.cc' || echo '$(srcdir)/'`Common/DebugMalloc.cc
     1142@am__fastdepCXX_TRUE@   $(AM_V_at)$(am__mv) Common/$(DEPDIR)/driver_cfa_cpp-DebugMalloc.Tpo Common/$(DEPDIR)/driver_cfa_cpp-DebugMalloc.Po
     1143@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(AM_V_CXX)source='Common/DebugMalloc.cc' object='Common/driver_cfa_cpp-DebugMalloc.o' libtool=no @AMDEPBACKSLASH@
     1144@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1145@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-DebugMalloc.o `test -f 'Common/DebugMalloc.cc' || echo '$(srcdir)/'`Common/DebugMalloc.cc
     1146
     1147Common/driver_cfa_cpp-DebugMalloc.obj: Common/DebugMalloc.cc
     1148@am__fastdepCXX_TRUE@   $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Common/driver_cfa_cpp-DebugMalloc.obj -MD -MP -MF Common/$(DEPDIR)/driver_cfa_cpp-DebugMalloc.Tpo -c -o Common/driver_cfa_cpp-DebugMalloc.obj `if test -f 'Common/DebugMalloc.cc'; then $(CYGPATH_W) 'Common/DebugMalloc.cc'; else $(CYGPATH_W) '$(srcdir)/Common/DebugMalloc.cc'; fi`
     1149@am__fastdepCXX_TRUE@   $(AM_V_at)$(am__mv) Common/$(DEPDIR)/driver_cfa_cpp-DebugMalloc.Tpo Common/$(DEPDIR)/driver_cfa_cpp-DebugMalloc.Po
     1150@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(AM_V_CXX)source='Common/DebugMalloc.cc' object='Common/driver_cfa_cpp-DebugMalloc.obj' libtool=no @AMDEPBACKSLASH@
     1151@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1152@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-DebugMalloc.obj `if test -f 'Common/DebugMalloc.cc'; then $(CYGPATH_W) 'Common/DebugMalloc.cc'; else $(CYGPATH_W) '$(srcdir)/Common/DebugMalloc.cc'; fi`
     1153
    11291154Common/driver_cfa_cpp-Assert.o: Common/Assert.cc
    11301155@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
     
    20642089@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    20652090@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-VarArgsType.obj `if test -f 'SynTree/VarArgsType.cc'; then $(CYGPATH_W) 'SynTree/VarArgsType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/VarArgsType.cc'; fi`
     2091
     2092SynTree/driver_cfa_cpp-ZeroOneType.o: SynTree/ZeroOneType.cc
     2093@am__fastdepCXX_TRUE@   $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-ZeroOneType.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-ZeroOneType.Tpo -c -o SynTree/driver_cfa_cpp-ZeroOneType.o `test -f 'SynTree/ZeroOneType.cc' || echo '$(srcdir)/'`SynTree/ZeroOneType.cc
     2094@am__fastdepCXX_TRUE@   $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-ZeroOneType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-ZeroOneType.Po
     2095@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(AM_V_CXX)source='SynTree/ZeroOneType.cc' object='SynTree/driver_cfa_cpp-ZeroOneType.o' libtool=no @AMDEPBACKSLASH@
     2096@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     2097@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-ZeroOneType.o `test -f 'SynTree/ZeroOneType.cc' || echo '$(srcdir)/'`SynTree/ZeroOneType.cc
     2098
     2099SynTree/driver_cfa_cpp-ZeroOneType.obj: SynTree/ZeroOneType.cc
     2100@am__fastdepCXX_TRUE@   $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-ZeroOneType.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-ZeroOneType.Tpo -c -o SynTree/driver_cfa_cpp-ZeroOneType.obj `if test -f 'SynTree/ZeroOneType.cc'; then $(CYGPATH_W) 'SynTree/ZeroOneType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/ZeroOneType.cc'; fi`
     2101@am__fastdepCXX_TRUE@   $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-ZeroOneType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-ZeroOneType.Po
     2102@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(AM_V_CXX)source='SynTree/ZeroOneType.cc' object='SynTree/driver_cfa_cpp-ZeroOneType.obj' libtool=no @AMDEPBACKSLASH@
     2103@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     2104@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-ZeroOneType.obj `if test -f 'SynTree/ZeroOneType.cc'; then $(CYGPATH_W) 'SynTree/ZeroOneType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/ZeroOneType.cc'; fi`
    20662105
    20672106SynTree/driver_cfa_cpp-Constant.o: SynTree/Constant.cc
  • src/Parser/DeclarationNode.cc

    r7b69174 raee7e35  
    1010// Created On       : Sat May 16 12:34:05 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Sep 14 23:13:28 2016
    13 // Update Count     : 502
     12// Last Modified On : Mon Sep 26 22:18:40 2016
     13// Update Count     : 640
    1414//
    1515
     
    3131
    3232// These must remain in the same order as the corresponding DeclarationNode enumerations.
    33 const char *DeclarationNode::storageName[] = { "extern", "static", "auto", "register", "inline", "fortran", "_Noreturn", "_Thread_local", "NoStorageClass" };
    34 const char *DeclarationNode::qualifierName[] = { "const", "restrict", "volatile", "lvalue", "_Atomic", "NoQualifier" };
    35 const char *DeclarationNode::basicTypeName[] = { "void", "_Bool", "char", "int", "float", "double", "long double", "NoBasicType" };
    36 const char *DeclarationNode::complexTypeName[] = { "_Complex", "_Imaginary", "NoComplexType" };
    37 const char *DeclarationNode::signednessName[] = { "signed", "unsigned", "NoSignedness" };
    38 const char *DeclarationNode::lengthName[] = { "short", "long", "long long", "NoLength" };
    39 const char *DeclarationNode::aggregateName[] = { "struct", "union", "context" };
    40 const char *DeclarationNode::typeClassName[] = { "otype", "dtype", "ftype" };
    41 const char *DeclarationNode::builtinTypeName[] = { "__builtin_va_list" };
     33const char * DeclarationNode::storageName[] = { "extern", "static", "auto", "register", "inline", "fortran", "_Noreturn", "_Thread_local", "NoStorageClass" };
     34const char * DeclarationNode::qualifierName[] = { "const", "restrict", "volatile", "lvalue", "_Atomic", "NoQualifier" };
     35const char * DeclarationNode::basicTypeName[] = { "void", "_Bool", "char", "int", "float", "double", "long double", "NoBasicType" };
     36const char * DeclarationNode::complexTypeName[] = { "_Complex", "_Imaginary", "NoComplexType" };
     37const char * DeclarationNode::signednessName[] = { "signed", "unsigned", "NoSignedness" };
     38const char * DeclarationNode::lengthName[] = { "short", "long", "long long", "NoLength" };
     39const char * DeclarationNode::aggregateName[] = { "struct", "union", "context" };
     40const char * DeclarationNode::typeClassName[] = { "otype", "dtype", "ftype" };
     41const char * DeclarationNode::builtinTypeName[] = { "__builtin_va_list" };
    4242
    4343UniqueName DeclarationNode::anonymous( "__anonymous" );
     
    4646
    4747DeclarationNode::DeclarationNode() :
    48                 type( 0 ),
     48                type( nullptr ),
    4949                storageClass( NoStorageClass ),
    5050                isInline( false ),
    5151                isNoreturn( false ),
    52                 bitfieldWidth( 0 ),
    53                 initializer( 0 ),
     52                bitfieldWidth( nullptr ),
     53                initializer( nullptr ),
    5454                hasEllipsis( false ),
    5555                linkage( ::linkage ),
    5656                extension( false ) {
     57
     58        variable.name = nullptr;
    5759        variable.tyClass = DeclarationNode::Otype;
    5860        variable.assertions = nullptr;
    5961
     62        attr.name = nullptr;
    6063        attr.expr = nullptr;
    6164        attr.type = nullptr;
     
    6366
    6467DeclarationNode::~DeclarationNode() {
     68        delete attr.name;
    6569        delete attr.expr;
    6670        delete attr.type;
     71
     72        delete variable.name;
     73        delete variable.assertions;
     74
    6775        delete type;
    6876        delete bitfieldWidth;
     
    7078}
    7179
    72 DeclarationNode *DeclarationNode::clone() const {
    73         DeclarationNode *newnode = new DeclarationNode;
     80DeclarationNode * DeclarationNode::clone() const {
     81        DeclarationNode * newnode = new DeclarationNode;
    7482        newnode->type = maybeClone( type );
    75         newnode->name = name;
     83        newnode->name = name ? new string( *name ) : nullptr;
    7684        newnode->storageClass = storageClass;
    7785        newnode->isInline = isInline;
     
    8391        newnode->linkage = linkage;
    8492
     93        newnode->variable.name = variable.name ? new string( *variable.name ) : nullptr;
     94        newnode->variable.tyClass = variable.tyClass;
    8595        newnode->variable.assertions = maybeClone( variable.assertions );
    86         newnode->variable.name = variable.name;
    87         newnode->variable.tyClass = variable.tyClass;
    88 
     96
     97        newnode->attr.name = attr.name ? new string( *attr.name ) : nullptr;
    8998        newnode->attr.expr = maybeClone( attr.expr );
    9099        newnode->attr.type = maybeClone( attr.type );
     
    98107void DeclarationNode::print( std::ostream &os, int indent ) const {
    99108        os << string( indent, ' ' );
    100         if ( name == "" ) {
     109        if ( name ) {
     110                os << *name << ": ";
     111        } else {
    101112                os << "unnamed: ";
    102         } else {
    103                 os << name << ": ";
    104113        } // if
    105114
     
    122131        } // if
    123132
    124         if ( initializer != 0 ) {
     133        if ( initializer ) {
    125134                os << endl << string( indent + 2, ' ' ) << "with initializer ";
    126135                initializer->printOneLine( os );
     
    139148}
    140149
    141 DeclarationNode *DeclarationNode::newFunction( std::string *name, DeclarationNode *ret, DeclarationNode *param, StatementNode *body, bool newStyle ) {
    142         DeclarationNode *newnode = new DeclarationNode;
    143         newnode->name = assign_strptr( name );
    144 
     150DeclarationNode * DeclarationNode::newFunction( string * name, DeclarationNode * ret, DeclarationNode * param, StatementNode * body, bool newStyle ) {
     151        DeclarationNode * newnode = new DeclarationNode;
     152        newnode->name = name;
    145153        newnode->type = new TypeData( TypeData::Function );
    146154        newnode->type->function.params = param;
    147155        newnode->type->function.newStyle = newStyle;
    148156        newnode->type->function.body = body;
    149         typedefTable.addToEnclosingScope( newnode->name, TypedefTable::ID );
     157        // ignore unnamed routine declarations: void p( int (*)(int) );
     158        if ( newnode->name ) {
     159                typedefTable.addToEnclosingScope( *newnode->name, TypedefTable::ID );
     160        } // if
    150161
    151162        if ( body ) {
     
    155166        if ( ret ) {
    156167                newnode->type->base = ret->type;
    157                 ret->type = 0;
     168                ret->type = nullptr;
    158169                delete ret;
    159170        } // if
     
    163174
    164175DeclarationNode * DeclarationNode::newQualifier( Qualifier q ) {
    165         DeclarationNode *newnode = new DeclarationNode;
     176        DeclarationNode * newnode = new DeclarationNode;
    166177        newnode->type = new TypeData();
    167178        newnode->type->qualifiers[ q ] = 1;
     
    169180} // DeclarationNode::newQualifier
    170181
    171 DeclarationNode * DeclarationNode::newForall( DeclarationNode *forall ) {
    172         DeclarationNode *newnode = new DeclarationNode;
     182DeclarationNode * DeclarationNode::newForall( DeclarationNode * forall ) {
     183        DeclarationNode * newnode = new DeclarationNode;
    173184        newnode->type = new TypeData( TypeData::Unknown );
    174185        newnode->type->forall = forall;
     
    177188
    178189DeclarationNode * DeclarationNode::newStorageClass( DeclarationNode::StorageClass sc ) {
    179         DeclarationNode *newnode = new DeclarationNode;
    180         //switch (sc) {
    181         //      case Inline: newnode->isInline = true; break;
    182         //      case Noreturn: newnode->isNoreturn = true; break;
    183         //      default: newnode->storageClass = sc; break;
    184         //}
     190        DeclarationNode * newnode = new DeclarationNode;
    185191        newnode->storageClass = sc;
    186192        return newnode;
     
    188194
    189195DeclarationNode * DeclarationNode::newBasicType( BasicType bt ) {
    190         DeclarationNode *newnode = new DeclarationNode;
     196        DeclarationNode * newnode = new DeclarationNode;
    191197        newnode->type = new TypeData( TypeData::Basic );
    192198        newnode->type->basictype = bt;
     
    195201
    196202DeclarationNode * DeclarationNode::newComplexType( ComplexType ct ) {
    197         DeclarationNode *newnode = new DeclarationNode;
     203        DeclarationNode * newnode = new DeclarationNode;
    198204        newnode->type = new TypeData( TypeData::Basic );
    199205        newnode->type->complextype = ct;
     
    202208
    203209DeclarationNode * DeclarationNode::newSignedNess( Signedness sn ) {
    204         DeclarationNode *newnode = new DeclarationNode;
     210        DeclarationNode * newnode = new DeclarationNode;
    205211        newnode->type = new TypeData( TypeData::Basic );
    206212        newnode->type->signedness = sn;
     
    209215
    210216DeclarationNode * DeclarationNode::newLength( Length lnth ) {
    211         DeclarationNode *newnode = new DeclarationNode;
     217        DeclarationNode * newnode = new DeclarationNode;
    212218        newnode->type = new TypeData( TypeData::Basic );
    213219        newnode->type->length = lnth;
     
    215221} // DeclarationNode::newLength
    216222
    217 DeclarationNode * DeclarationNode::newFromTypedef( std::string *name ) {
    218         DeclarationNode *newnode = new DeclarationNode;
     223DeclarationNode * DeclarationNode::newFromTypedef( string * name ) {
     224        DeclarationNode * newnode = new DeclarationNode;
    219225        newnode->type = new TypeData( TypeData::SymbolicInst );
    220         newnode->type->symbolic.name = assign_strptr( name );
     226        newnode->type->symbolic.name = name;
    221227        newnode->type->symbolic.isTypedef = true;
    222         newnode->type->symbolic.params = 0;
     228        newnode->type->symbolic.params = nullptr;
    223229        return newnode;
    224230} // DeclarationNode::newFromTypedef
    225231
    226 DeclarationNode * DeclarationNode::newAggregate( Aggregate kind, const std::string *name, ExpressionNode *actuals, DeclarationNode *fields, bool body ) {
    227         DeclarationNode *newnode = new DeclarationNode;
     232DeclarationNode * DeclarationNode::newAggregate( Aggregate kind, const string * name, ExpressionNode * actuals, DeclarationNode * fields, bool body ) {
     233        DeclarationNode * newnode = new DeclarationNode;
    228234        newnode->type = new TypeData( TypeData::Aggregate );
    229235        newnode->type->aggregate.kind = kind;
    230         newnode->type->aggregate.name = assign_strptr( name );
    231         if ( newnode->type->aggregate.name == "" ) {            // anonymous aggregate ?
    232                 newnode->type->aggregate.name = anonymous.newName();
     236        if ( name ) {
     237                newnode->type->aggregate.name = name;
     238        } else {                                                                                        // anonymous aggregate ?
     239                newnode->type->aggregate.name = new string( anonymous.newName() );
    233240        } // if
    234241        newnode->type->aggregate.actuals = actuals;
     
    238245} // DeclarationNode::newAggregate
    239246
    240 DeclarationNode *DeclarationNode::newEnum( std::string *name, DeclarationNode *constants ) {
    241         DeclarationNode *newnode = new DeclarationNode;
    242         newnode->name = assign_strptr( name );
     247DeclarationNode * DeclarationNode::newEnum( string * name, DeclarationNode * constants ) {
     248        DeclarationNode * newnode = new DeclarationNode;
    243249        newnode->type = new TypeData( TypeData::Enum );
    244         newnode->type->enumeration.name = newnode->name;
    245         if ( newnode->type->enumeration.name == "" ) {          // anonymous enumeration ?
    246                 newnode->type->enumeration.name = DeclarationNode::anonymous.newName();
     250        if ( name ) {
     251                newnode->type->enumeration.name = name;
     252        } else {                                                                                        // anonymous aggregate ?
     253                newnode->type->enumeration.name = new string( anonymous.newName() );
    247254        } // if
    248255        newnode->type->enumeration.constants = constants;
     
    250257} // DeclarationNode::newEnum
    251258
    252 DeclarationNode *DeclarationNode::newEnumConstant( std::string *name, ExpressionNode *constant ) {
    253         DeclarationNode *newnode = new DeclarationNode;
    254         newnode->name = assign_strptr( name );
     259DeclarationNode * DeclarationNode::newEnumConstant( string * name, ExpressionNode * constant ) {
     260        DeclarationNode * newnode = new DeclarationNode;
     261        newnode->name = name;
    255262        newnode->enumeratorValue.reset( constant );
    256         typedefTable.addToEnclosingScope( newnode->name, TypedefTable::ID );
     263        typedefTable.addToEnclosingScope( *newnode->name, TypedefTable::ID );
    257264        return newnode;
    258265} // DeclarationNode::newEnumConstant
    259266
    260 DeclarationNode *DeclarationNode::newName( std::string *name ) {
    261         DeclarationNode *newnode = new DeclarationNode;
    262         newnode->name = assign_strptr( name );
     267DeclarationNode * DeclarationNode::newName( string * name ) {
     268        DeclarationNode * newnode = new DeclarationNode;
     269        newnode->name = name;
    263270        return newnode;
    264271} // DeclarationNode::newName
    265272
    266 DeclarationNode *DeclarationNode::newFromTypeGen( std::string *name, ExpressionNode *params ) {
    267         DeclarationNode *newnode = new DeclarationNode;
     273DeclarationNode * DeclarationNode::newFromTypeGen( string * name, ExpressionNode * params ) {
     274        DeclarationNode * newnode = new DeclarationNode;
    268275        newnode->type = new TypeData( TypeData::SymbolicInst );
    269         newnode->type->symbolic.name = assign_strptr( name );
     276        newnode->type->symbolic.name = name;
    270277        newnode->type->symbolic.isTypedef = false;
    271278        newnode->type->symbolic.actuals = params;
     
    273280} // DeclarationNode::newFromTypeGen
    274281
    275 DeclarationNode *DeclarationNode::newTypeParam( TypeClass tc, std::string *name ) {
    276         DeclarationNode *newnode = new DeclarationNode;
    277         newnode->name = assign_strptr( name );
    278         newnode->type = new TypeData( TypeData::Variable );
     282DeclarationNode * DeclarationNode::newTypeParam( TypeClass tc, string * name ) {
     283        DeclarationNode * newnode = new DeclarationNode;
     284        newnode->type = nullptr;
    279285        newnode->variable.tyClass = tc;
    280         newnode->variable.name = newnode->name;
     286        newnode->variable.name = name;
    281287        return newnode;
    282288} // DeclarationNode::newTypeParam
    283289
    284 DeclarationNode *DeclarationNode::newTrait( std::string *name, DeclarationNode *params, DeclarationNode *asserts ) {
    285         DeclarationNode *newnode = new DeclarationNode;
     290DeclarationNode * DeclarationNode::newTrait( const string * name, DeclarationNode * params, DeclarationNode * asserts ) {
     291        DeclarationNode * newnode = new DeclarationNode;
    286292        newnode->type = new TypeData( TypeData::Aggregate );
     293        newnode->type->aggregate.name = name;
    287294        newnode->type->aggregate.kind = Trait;
    288295        newnode->type->aggregate.params = params;
    289296        newnode->type->aggregate.fields = asserts;
    290         newnode->type->aggregate.name = assign_strptr( name );
    291297        return newnode;
    292298} // DeclarationNode::newTrait
    293299
    294 DeclarationNode *DeclarationNode::newTraitUse( std::string *name, ExpressionNode *params ) {
    295         DeclarationNode *newnode = new DeclarationNode;
     300DeclarationNode * DeclarationNode::newTraitUse( const string * name, ExpressionNode * params ) {
     301        DeclarationNode * newnode = new DeclarationNode;
    296302        newnode->type = new TypeData( TypeData::AggregateInst );
    297303        newnode->type->aggInst.aggregate = new TypeData( TypeData::Aggregate );
    298304        newnode->type->aggInst.aggregate->aggregate.kind = Trait;
    299         newnode->type->aggInst.aggregate->aggregate.name = assign_strptr( name );
     305        newnode->type->aggInst.aggregate->aggregate.name = name;
    300306        newnode->type->aggInst.params = params;
    301307        return newnode;
    302308} // DeclarationNode::newTraitUse
    303309
    304 DeclarationNode *DeclarationNode::newTypeDecl( std::string *name, DeclarationNode *typeParams ) {
    305         DeclarationNode *newnode = new DeclarationNode;
    306         newnode->name = assign_strptr( name );
     310DeclarationNode * DeclarationNode::newTypeDecl( string * name, DeclarationNode * typeParams ) {
     311        DeclarationNode * newnode = new DeclarationNode;
    307312        newnode->type = new TypeData( TypeData::Symbolic );
    308313        newnode->type->symbolic.isTypedef = false;
    309314        newnode->type->symbolic.params = typeParams;
    310         newnode->type->symbolic.name = newnode->name;
     315        newnode->type->symbolic.name = name;
    311316        return newnode;
    312317} // DeclarationNode::newTypeDecl
    313318
    314 DeclarationNode *DeclarationNode::newPointer( DeclarationNode *qualifiers ) {
    315         DeclarationNode *newnode = new DeclarationNode;
     319DeclarationNode * DeclarationNode::newPointer( DeclarationNode * qualifiers ) {
     320        DeclarationNode * newnode = new DeclarationNode;
    316321        newnode->type = new TypeData( TypeData::Pointer );
    317322        return newnode->addQualifiers( qualifiers );
    318323} // DeclarationNode::newPointer
    319324
    320 DeclarationNode *DeclarationNode::newArray( ExpressionNode *size, DeclarationNode *qualifiers, bool isStatic ) {
    321         DeclarationNode *newnode = new DeclarationNode;
     325DeclarationNode * DeclarationNode::newArray( ExpressionNode * size, DeclarationNode * qualifiers, bool isStatic ) {
     326        DeclarationNode * newnode = new DeclarationNode;
    322327        newnode->type = new TypeData( TypeData::Array );
    323328        newnode->type->array.dimension = size;
    324329        newnode->type->array.isStatic = isStatic;
    325         if ( newnode->type->array.dimension == 0 || newnode->type->array.dimension->isExpressionType<ConstantExpr *>() ) {
     330        if ( newnode->type->array.dimension == nullptr || newnode->type->array.dimension->isExpressionType<ConstantExpr * >() ) {
    326331                newnode->type->array.isVarLen = false;
    327332        } else {
     
    331336} // DeclarationNode::newArray
    332337
    333 DeclarationNode *DeclarationNode::newVarArray( DeclarationNode *qualifiers ) {
    334         DeclarationNode *newnode = new DeclarationNode;
     338DeclarationNode * DeclarationNode::newVarArray( DeclarationNode * qualifiers ) {
     339        DeclarationNode * newnode = new DeclarationNode;
    335340        newnode->type = new TypeData( TypeData::Array );
    336         newnode->type->array.dimension = 0;
     341        newnode->type->array.dimension = nullptr;
    337342        newnode->type->array.isStatic = false;
    338343        newnode->type->array.isVarLen = true;
     
    340345}
    341346
    342 DeclarationNode *DeclarationNode::newBitfield( ExpressionNode *size ) {
    343         DeclarationNode *newnode = new DeclarationNode;
     347DeclarationNode * DeclarationNode::newBitfield( ExpressionNode * size ) {
     348        DeclarationNode * newnode = new DeclarationNode;
    344349        newnode->bitfieldWidth = size;
    345350        return newnode;
    346351}
    347352
    348 DeclarationNode *DeclarationNode::newTuple( DeclarationNode *members ) {
    349         DeclarationNode *newnode = new DeclarationNode;
     353DeclarationNode * DeclarationNode::newTuple( DeclarationNode * members ) {
     354        DeclarationNode * newnode = new DeclarationNode;
    350355        newnode->type = new TypeData( TypeData::Tuple );
    351356        newnode->type->tuple = members;
     
    353358}
    354359
    355 DeclarationNode *DeclarationNode::newTypeof( ExpressionNode *expr ) {
    356         DeclarationNode *newnode = new DeclarationNode;
     360DeclarationNode * DeclarationNode::newTypeof( ExpressionNode * expr ) {
     361        DeclarationNode * newnode = new DeclarationNode;
    357362        newnode->type = new TypeData( TypeData::Typeof );
    358363        newnode->type->typeexpr = expr;
     
    361366
    362367DeclarationNode * DeclarationNode::newBuiltinType( BuiltinType bt ) {
    363         DeclarationNode *newnode = new DeclarationNode;
     368        DeclarationNode * newnode = new DeclarationNode;
    364369        newnode->type = new TypeData( TypeData::Builtin );
    365370        newnode->builtin = bt;
     
    367372} // DeclarationNode::newBuiltinType
    368373
    369 DeclarationNode *DeclarationNode::newAttr( std::string *name, ExpressionNode *expr ) {
    370         DeclarationNode *newnode = new DeclarationNode;
    371         newnode->type = new TypeData( TypeData::Attr );
    372         newnode->attr.name = assign_strptr( name );
     374DeclarationNode * DeclarationNode::newAttr( string * name, ExpressionNode * expr ) {
     375        DeclarationNode * newnode = new DeclarationNode;
     376        newnode->type = nullptr;
     377        newnode->attr.name = name;
    373378        newnode->attr.expr = expr;
    374379        return newnode;
    375380}
    376381
    377 DeclarationNode *DeclarationNode::newAttr( std::string *name, DeclarationNode *type ) {
    378         DeclarationNode *newnode = new DeclarationNode;
    379         newnode->type = new TypeData( TypeData::Attr );
    380         newnode->attr.name = assign_strptr( name );
     382DeclarationNode * DeclarationNode::newAttr( string * name, DeclarationNode * type ) {
     383        DeclarationNode * newnode = new DeclarationNode;
     384        newnode->type = nullptr;
     385        newnode->attr.name = name;
    381386        newnode->attr.type = type;
    382387        return newnode;
     
    389394} // appendError
    390395
    391 void DeclarationNode::checkQualifiers( const TypeData *src, const TypeData *dst ) {
     396void DeclarationNode::checkQualifiers( const TypeData * src, const TypeData * dst ) {
    392397        TypeData::Qualifiers qsrc = src->qualifiers, qdst = dst->qualifiers; // optimization
    393398
     
    401406} // DeclarationNode::checkQualifiers
    402407
    403 void DeclarationNode::checkStorageClasses( DeclarationNode *q ) {
     408void DeclarationNode::checkStorageClasses( DeclarationNode * q ) {
    404409        if ( storageClass != NoStorageClass && q->storageClass != NoStorageClass ) {
    405410                if ( storageClass == q->storageClass ) {                // duplicate qualifier
     
    413418} // DeclarationNode::copyStorageClasses
    414419
    415 DeclarationNode *DeclarationNode::copyStorageClasses( DeclarationNode *q ) {
     420DeclarationNode * DeclarationNode::copyStorageClasses( DeclarationNode * q ) {
    416421        isInline = isInline || q->isInline;
    417422        isNoreturn = isNoreturn || q->isNoreturn;
     
    424429} // DeclarationNode::copyStorageClasses
    425430
    426 static void addQualifiersToType( TypeData *&src, TypeData *dst ) {
     431static void addQualifiersToType( TypeData *&src, TypeData * dst ) {
    427432        if ( src->forall && dst->kind == TypeData::Function ) {
    428433                if ( dst->forall ) {
     
    431436                        dst->forall = src->forall;
    432437                } // if
    433                 src->forall = 0;
     438                src->forall = nullptr;
    434439        } // if
    435440        if ( dst->base ) {
     
    437442        } else if ( dst->kind == TypeData::Function ) {
    438443                dst->base = src;
    439                 src = 0;
     444                src = nullptr;
    440445        } else {
    441446                dst->qualifiers |= src->qualifiers;
     
    443448} // addQualifiersToType
    444449
    445 DeclarationNode *DeclarationNode::addQualifiers( DeclarationNode *q ) {
    446         if ( ! q ) return this;
     450DeclarationNode * DeclarationNode::addQualifiers( DeclarationNode * q ) {
     451        if ( ! q ) { delete q; return this; }
    447452
    448453        checkStorageClasses( q );
    449454        copyStorageClasses( q );
    450455
    451         if ( ! q->type ) { delete q; return this; }
     456        if ( ! q->type ) {
     457                delete q;
     458                return this;
     459        } // if
    452460
    453461        if ( ! type ) {
    454 //              type = new TypeData;
    455                 type = q->type;
     462                type = q->type;                                                                 // reuse this structure
     463                q->type = nullptr;
     464                delete q;
    456465                return this;
    457466        } // if
     
    467476                                type->aggregate.params = q->type->forall;
    468477                                // change implicit typedef from TYPEDEFname to TYPEGENname
    469                                 typedefTable.changeKind( type->aggregate.name, TypedefTable::TG );
     478                                typedefTable.changeKind( *type->aggregate.name, TypedefTable::TG );
    470479                        } else {
    471480                                type->forall = q->type->forall;
    472481                        } // if
    473482                } // if
    474                 q->type->forall = 0;
     483                q->type->forall = nullptr;
    475484        } // if
    476485        delete q;
     
    485494                        dst->forall = src->forall;
    486495                } // if
    487                 src->forall = 0;
     496                src->forall = nullptr;
    488497        } // if
    489498        if ( dst->base ) {
     
    494503                        src->qualifiers |= dst->qualifiers;
    495504                        dst = src;
    496                         src = 0;
     505                        src = nullptr;
    497506                        break;
    498507                  case TypeData::Basic:
     
    504513                                        dst->basictype = src->basictype;
    505514                                } else if ( src->basictype != DeclarationNode::NoBasicType )
    506                                         throw SemanticError( std::string( "conflicting type specifier " ) + DeclarationNode::basicTypeName[ src->basictype ] + " in type: ", src );
     515                                        throw SemanticError( string( "conflicting type specifier " ) + DeclarationNode::basicTypeName[ src->basictype ] + " in type: ", src );
    507516
    508517                                if ( dst->complextype == DeclarationNode::NoComplexType ) {
    509518                                        dst->complextype = src->complextype;
    510519                                } else if ( src->complextype != DeclarationNode::NoComplexType )
    511                                         throw SemanticError( std::string( "conflicting type specifier " ) + DeclarationNode::complexTypeName[ src->complextype ] + " in type: ", src );
     520                                        throw SemanticError( string( "conflicting type specifier " ) + DeclarationNode::complexTypeName[ src->complextype ] + " in type: ", src );
    512521
    513522                                if ( dst->signedness == DeclarationNode::NoSignedness ) {
    514523                                        dst->signedness = src->signedness;
    515524                                } else if ( src->signedness != DeclarationNode::NoSignedness )
    516                                         throw SemanticError( std::string( "conflicting type specifier " ) + DeclarationNode::signednessName[ src->signedness ] + " in type: ", src );
     525                                        throw SemanticError( string( "conflicting type specifier " ) + DeclarationNode::signednessName[ src->signedness ] + " in type: ", src );
    517526
    518527                                if ( dst->length == DeclarationNode::NoLength ) {
     
    521530                                        dst->length = DeclarationNode::LongLong;
    522531                                } else if ( src->length != DeclarationNode::NoLength )
    523                                         throw SemanticError( std::string( "conflicting type specifier " ) + DeclarationNode::lengthName[ src->length ] + " in type: ", src );
     532                                        throw SemanticError( string( "conflicting type specifier " ) + DeclarationNode::lengthName[ src->length ] + " in type: ", src );
    524533                        } // if
    525534                        break;
     
    534543                                } // if
    535544                                dst->base->qualifiers |= src->qualifiers;
    536                                 src = 0;
     545                                src = nullptr;
    537546                                break;
    538547                          default:
     
    542551                                        dst->forall = src->forall;
    543552                                } // if
    544                                 src->forall = 0;
     553                                src->forall = nullptr;
    545554                                dst->base = src;
    546                                 src = 0;
     555                                src = nullptr;
    547556                        } // switch
    548557                } // switch
     
    550559}
    551560
    552 DeclarationNode *DeclarationNode::addType( DeclarationNode *o ) {
     561DeclarationNode * DeclarationNode::addType( DeclarationNode * o ) {
    553562        if ( o ) {
    554563                checkStorageClasses( o );
     
    566575                                        type = o->type;
    567576                                } // if
    568                                 o->type = 0;
     577                                o->type = nullptr;
    569578                        } else {
    570579                                addTypeToType( o->type, type );
     
    584593}
    585594
    586 DeclarationNode *DeclarationNode::addTypedef() {
    587         TypeData *newtype = new TypeData( TypeData::Symbolic );
    588         newtype->symbolic.params = 0;
     595DeclarationNode * DeclarationNode::addTypedef() {
     596        TypeData * newtype = new TypeData( TypeData::Symbolic );
     597        newtype->symbolic.params = nullptr;
    589598        newtype->symbolic.isTypedef = true;
    590         newtype->symbolic.name = name;
     599        newtype->symbolic.name = name ? new string( *name ) : nullptr;
    591600        newtype->base = type;
    592601        type = newtype;
     
    594603}
    595604
    596 DeclarationNode *DeclarationNode::addAssertions( DeclarationNode *assertions ) {
     605DeclarationNode * DeclarationNode::addAssertions( DeclarationNode * assertions ) {
     606        if ( variable.name ) {
     607                if ( variable.assertions ) {
     608                        variable.assertions->appendList( assertions );
     609                } else {
     610                        variable.assertions = assertions;
     611                } // if
     612                return this;
     613        } // if
     614
    597615        assert( type );
    598616        switch ( type->kind ) {
     
    604622                } // if
    605623                break;
    606           case TypeData::Variable:
    607                 if ( variable.assertions ) {
    608                         variable.assertions->appendList( assertions );
    609                 } else {
    610                         variable.assertions = assertions;
    611                 } // if
    612                 break;
     624          // case TypeData::Variable:
     625          //    if ( variable.assertions ) {
     626          //            variable.assertions->appendList( assertions );
     627          //    } else {
     628          //            variable.assertions = assertions;
     629          //    } // if
     630          //    break;
    613631          default:
    614632                assert( false );
     
    618636}
    619637
    620 DeclarationNode *DeclarationNode::addName( std::string *newname ) {
    621         name = assign_strptr( newname );
    622         return this;
    623 }
    624 
    625 DeclarationNode *DeclarationNode::addBitfield( ExpressionNode *size ) {
     638DeclarationNode * DeclarationNode::addName( string * newname ) {
     639        assert( ! name );
     640        name = newname;
     641        return this;
     642}
     643
     644DeclarationNode * DeclarationNode::addBitfield( ExpressionNode * size ) {
    626645        bitfieldWidth = size;
    627646        return this;
    628647}
    629648
    630 DeclarationNode *DeclarationNode::addVarArgs() {
     649DeclarationNode * DeclarationNode::addVarArgs() {
    631650        assert( type );
    632651        hasEllipsis = true;
     
    634653}
    635654
    636 DeclarationNode *DeclarationNode::addFunctionBody( StatementNode *body ) {
     655DeclarationNode * DeclarationNode::addFunctionBody( StatementNode * body ) {
    637656        assert( type );
    638657        assert( type->kind == TypeData::Function );
    639         assert( type->function.body == 0 );
     658        assert( ! type->function.body );
    640659        type->function.body = body;
    641660        type->function.hasBody = true;
     
    643662}
    644663
    645 DeclarationNode *DeclarationNode::addOldDeclList( DeclarationNode *list ) {
     664DeclarationNode * DeclarationNode::addOldDeclList( DeclarationNode * list ) {
    646665        assert( type );
    647666        assert( type->kind == TypeData::Function );
    648         assert( type->function.oldDeclList == 0 );
     667        assert( ! type->function.oldDeclList );
    649668        type->function.oldDeclList = list;
    650669        return this;
    651670}
    652671
    653 static void setBase( TypeData *&type, TypeData *newType ) {
     672static void setBase( TypeData *&type, TypeData * newType ) {
    654673        if ( type ) {
    655                 TypeData *prevBase = type;
    656                 TypeData *curBase = type->base;
    657                 while ( curBase != 0 ) {
     674                TypeData * prevBase = type;
     675                TypeData * curBase = type->base;
     676                while ( curBase != nullptr ) {
    658677                        prevBase = curBase;
    659678                        curBase = curBase->base;
     
    665684}
    666685
    667 DeclarationNode *DeclarationNode::addPointer( DeclarationNode *p ) {
     686DeclarationNode * DeclarationNode::addPointer( DeclarationNode * p ) {
    668687        if ( p ) {
    669688                assert( p->type->kind == TypeData::Pointer );
    670689                setBase( type, p->type );
    671                 p->type = 0;
     690                p->type = nullptr;
    672691                delete p;
    673692        } // if
     
    675694}
    676695
    677 DeclarationNode *DeclarationNode::addArray( DeclarationNode *a ) {
     696DeclarationNode * DeclarationNode::addArray( DeclarationNode * a ) {
    678697        if ( a ) {
    679698                assert( a->type->kind == TypeData::Array );
    680699                setBase( type, a->type );
    681                 a->type = 0;
     700                a->type = nullptr;
    682701                delete a;
    683702        } // if
     
    685704}
    686705
    687 DeclarationNode *DeclarationNode::addNewPointer( DeclarationNode *p ) {
     706DeclarationNode * DeclarationNode::addNewPointer( DeclarationNode * p ) {
    688707        if ( p ) {
    689708                assert( p->type->kind == TypeData::Pointer );
     
    703722                                p->type->base = type;
    704723                        } // switch
    705                         type = 0;
     724                        type = nullptr;
    706725                } // if
    707726                delete this;
     
    712731}
    713732
    714 static TypeData *findLast( TypeData *a ) {
     733static TypeData * findLast( TypeData * a ) {
    715734        assert( a );
    716         TypeData *cur = a;
     735        TypeData * cur = a;
    717736        while ( cur->base ) {
    718737                cur = cur->base;
     
    721740}
    722741
    723 DeclarationNode *DeclarationNode::addNewArray( DeclarationNode *a ) {
     742DeclarationNode * DeclarationNode::addNewArray( DeclarationNode * a ) {
    724743        if ( a ) {
    725744                assert( a->type->kind == TypeData::Array );
    726                 TypeData *lastArray = findLast( a->type );
     745                TypeData * lastArray = findLast( a->type );
    727746                if ( type ) {
    728747                        switch ( type->kind ) {
     
    739758                                lastArray->base = type;
    740759                        } // switch
    741                         type = 0;
     760                        type = nullptr;
    742761                } // if
    743762                delete this;
     
    748767}
    749768
    750 DeclarationNode *DeclarationNode::addParamList( DeclarationNode *params ) {
    751         TypeData *ftype = new TypeData( TypeData::Function );
     769DeclarationNode * DeclarationNode::addParamList( DeclarationNode * params ) {
     770        TypeData * ftype = new TypeData( TypeData::Function );
    752771        ftype->function.params = params;
    753772        setBase( type, ftype );
     
    755774}
    756775
    757 static TypeData *addIdListToType( TypeData *type, DeclarationNode *ids ) {
     776static TypeData * addIdListToType( TypeData * type, DeclarationNode * ids ) {
    758777        if ( type ) {
    759778                if ( type->kind != TypeData::Function ) {
     
    764783                return type;
    765784        } else {
    766                 TypeData *newtype = new TypeData( TypeData::Function );
     785                TypeData * newtype = new TypeData( TypeData::Function );
    767786                newtype->function.idList = ids;
    768787                return newtype;
    769788        } // if
    770 }
    771 
    772 DeclarationNode *DeclarationNode::addIdList( DeclarationNode *ids ) {
     789} // addIdListToType
     790
     791DeclarationNode * DeclarationNode::addIdList( DeclarationNode * ids ) {
    773792        type = addIdListToType( type, ids );
    774793        return this;
    775794}
    776795
    777 DeclarationNode *DeclarationNode::addInitializer( InitializerNode *init ) {
    778         //assert
     796DeclarationNode * DeclarationNode::addInitializer( InitializerNode * init ) {
    779797        initializer = init;
    780798        return this;
    781799}
    782800
    783 DeclarationNode *DeclarationNode::cloneBaseType( string *newName ) {
    784         DeclarationNode *newnode = new DeclarationNode;
    785         TypeData *srcType = type;
    786         while ( srcType->base ) {
    787                 srcType = srcType->base;
    788         } // while
    789         newnode->type = maybeClone( srcType );
    790         if ( newnode->type->kind == TypeData::AggregateInst ) {
    791                 // don't duplicate members
    792                 if ( newnode->type->aggInst.aggregate->kind == TypeData::Enum ) {
    793                         delete newnode->type->aggInst.aggregate->enumeration.constants;
    794                         newnode->type->aggInst.aggregate->enumeration.constants = 0;
    795                 } else {
    796                         assert( newnode->type->aggInst.aggregate->kind == TypeData::Aggregate );
    797                         delete newnode->type->aggInst.aggregate->aggregate.fields;
    798                         newnode->type->aggInst.aggregate->aggregate.fields = 0;
    799                 } // if
    800         } // if
    801         newnode->type->forall = maybeClone( type->forall );
    802         assert( storageClass == NoStorageClass );
    803         newnode->copyStorageClasses( this );
    804         newnode->name = assign_strptr( newName );
    805         return newnode;
    806 }
    807 
    808 DeclarationNode *DeclarationNode::cloneBaseType( DeclarationNode *o ) {
    809         if ( o ) {
    810                 o->copyStorageClasses( this );
    811                 if ( type ) {
    812                         TypeData *srcType = type;
    813                         while ( srcType->base ) {
    814                                 srcType = srcType->base;
    815                         } // while
    816                         TypeData *newType = srcType->clone();
    817                         if ( newType->kind == TypeData::AggregateInst ) {
    818                                 // don't duplicate members
    819                                 if ( newType->aggInst.aggregate->kind == TypeData::Enum ) {
    820                                         delete newType->aggInst.aggregate->enumeration.constants;
    821                                         newType->aggInst.aggregate->enumeration.constants = 0;
    822                                 } else {
    823                                         assert( newType->aggInst.aggregate->kind == TypeData::Aggregate );
    824                                         delete newType->aggInst.aggregate->aggregate.fields;
    825                                         newType->aggInst.aggregate->aggregate.fields = 0;
    826                                 } // if
    827                         } // if
    828                         newType->forall = maybeClone( type->forall );
    829                         if ( ! o->type ) {
    830                                 o->type = newType;
    831                         } else {
    832                                 addTypeToType( newType, o->type );
    833                                 delete newType;
    834                         } // if
    835                 } // if
    836         } // if
    837         return o;
    838 }
    839 
    840 DeclarationNode *DeclarationNode::cloneType( string *newName ) {
    841         DeclarationNode *newnode = new DeclarationNode;
     801DeclarationNode * DeclarationNode::cloneType( string * newName ) {
     802        DeclarationNode * newnode = new DeclarationNode;
    842803        newnode->type = maybeClone( type );
    843804        assert( storageClass == NoStorageClass );
    844805        newnode->copyStorageClasses( this );
    845         newnode->name = assign_strptr( newName );
    846         return newnode;
    847 }
    848 
    849 DeclarationNode *DeclarationNode::cloneType( DeclarationNode *o ) {
    850         if ( o ) {
    851                 assert( storageClass == NoStorageClass );
    852                 o->copyStorageClasses( this );
    853                 if ( type ) {
    854                         TypeData *newType = type->clone();
    855                         if ( ! o->type ) {
    856                                 o->type = newType;
     806        assert( newName );
     807        newnode->name = newName;
     808        return newnode;
     809}
     810
     811DeclarationNode * DeclarationNode::cloneBaseType( DeclarationNode * o ) {
     812        if ( ! o ) return nullptr;
     813
     814        o->copyStorageClasses( this );
     815        if ( type ) {
     816                TypeData * srcType = type;
     817
     818                while ( srcType->base ) {
     819                        srcType = srcType->base;
     820                } // while
     821
     822                TypeData * newType = srcType->clone();
     823                if ( newType->kind == TypeData::AggregateInst ) {
     824                        // don't duplicate members
     825                        if ( newType->aggInst.aggregate->kind == TypeData::Enum ) {
     826                                delete newType->aggInst.aggregate->enumeration.constants;
     827                                newType->aggInst.aggregate->enumeration.constants = nullptr;
    857828                        } else {
    858                                 addTypeToType( newType, o->type );
    859                                 delete newType;
     829                                assert( newType->aggInst.aggregate->kind == TypeData::Aggregate );
     830                                delete newType->aggInst.aggregate->aggregate.fields;
     831                                newType->aggInst.aggregate->aggregate.fields = nullptr;
    860832                        } // if
    861833                } // if
    862         } // if
    863         delete o;
     834
     835                newType->forall = maybeClone( type->forall );
     836                if ( ! o->type ) {
     837                        o->type = newType;
     838                } else {
     839                        addTypeToType( newType, o->type );
     840                        delete newType;
     841                } // if
     842        } // if
    864843        return o;
    865844}
    866845
    867 DeclarationNode *DeclarationNode::extractAggregate() const {
     846DeclarationNode * DeclarationNode::extractAggregate() const {
    868847        if ( type ) {
    869                 TypeData *ret = typeextractAggregate( type );
     848                TypeData * ret = typeextractAggregate( type );
    870849                if ( ret ) {
    871                         DeclarationNode *newnode = new DeclarationNode;
     850                        DeclarationNode * newnode = new DeclarationNode;
    872851                        newnode->type = ret;
    873852                        return newnode;
    874853                } // if
    875854        } // if
    876         return 0;
    877 }
    878 
    879 void buildList( const DeclarationNode *firstNode, std::list< Declaration * > &outputList ) {
     855        return nullptr;
     856}
     857
     858void buildList( const DeclarationNode * firstNode, std::list< Declaration * > &outputList ) {
    880859        SemanticError errors;
    881860        std::back_insert_iterator< std::list< Declaration * > > out( outputList );
    882         const DeclarationNode *cur = firstNode;
     861        const DeclarationNode * cur = firstNode;
     862
    883863        while ( cur ) {
    884864                try {
    885                         if ( DeclarationNode *extr = cur->extractAggregate() ) {
     865                        if ( DeclarationNode * extr = cur->extractAggregate() ) {
    886866                                // handle the case where a structure declaration is contained within an object or type declaration
    887                                 Declaration *decl = extr->build();
     867                                Declaration * decl = extr->build();
    888868                                if ( decl ) {
    889                                         *out++ = decl;
     869                                        * out++ = decl;
    890870                                } // if
    891871                                delete extr;
    892872                        } // if
    893                         Declaration *decl = cur->build();
     873
     874                        Declaration * decl = cur->build();
    894875                        if ( decl ) {
    895                                 *out++ = decl;
     876                                * out++ = decl;
    896877                        } // if
    897878                } catch( SemanticError &e ) {
     
    900881                cur = dynamic_cast< DeclarationNode * >( cur->get_next() );
    901882        } // while
     883
    902884        if ( ! errors.isEmpty() ) {
    903885                throw errors;
    904886        } // if
    905 }
    906 
    907 void buildList( const DeclarationNode *firstNode, std::list< DeclarationWithType * > &outputList ) {
     887} // buildList
     888
     889void buildList( const DeclarationNode * firstNode, std::list< DeclarationWithType * > &outputList ) {
    908890        SemanticError errors;
    909891        std::back_insert_iterator< std::list< DeclarationWithType * > > out( outputList );
    910         const DeclarationNode *cur = firstNode;
     892        const DeclarationNode * cur = firstNode;
    911893        while ( cur ) {
    912894                try {
    913                         Declaration *decl = cur->build();
     895                        Declaration * decl = cur->build();
    914896                        if ( decl ) {
    915                                 if ( DeclarationWithType *dwt = dynamic_cast< DeclarationWithType * >( decl ) ) {
    916                                         *out++ = dwt;
    917                                 } else if ( StructDecl *agg = dynamic_cast< StructDecl * >( decl ) ) {
    918                                         StructInstType *inst = new StructInstType( Type::Qualifiers(), agg->get_name() );
    919                                         *out++ = new ObjectDecl( "", DeclarationNode::NoStorageClass, linkage, 0, inst, 0 );
     897                                if ( DeclarationWithType * dwt = dynamic_cast< DeclarationWithType * >( decl ) ) {
     898                                        * out++ = dwt;
     899                                } else if ( StructDecl * agg = dynamic_cast< StructDecl * >( decl ) ) {
     900                                        StructInstType * inst = new StructInstType( Type::Qualifiers(), agg->get_name() );
     901                                        * out++ = new ObjectDecl( "", DeclarationNode::NoStorageClass, linkage, nullptr, inst, nullptr );
    920902                                        delete agg;
    921                                 } else if ( UnionDecl *agg = dynamic_cast< UnionDecl * >( decl ) ) {
    922                                         UnionInstType *inst = new UnionInstType( Type::Qualifiers(), agg->get_name() );
    923                                         *out++ = new ObjectDecl( "", DeclarationNode::NoStorageClass, linkage, 0, inst, 0 );
     903                                } else if ( UnionDecl * agg = dynamic_cast< UnionDecl * >( decl ) ) {
     904                                        UnionInstType * inst = new UnionInstType( Type::Qualifiers(), agg->get_name() );
     905                                        * out++ = new ObjectDecl( "", DeclarationNode::NoStorageClass, linkage, nullptr, inst, nullptr );
    924906                                } // if
    925907                        } // if
     
    932914                throw errors;
    933915        } // if
    934 }
    935 
    936 void buildTypeList( const DeclarationNode *firstNode, std::list< Type * > &outputList ) {
     916} // buildList
     917
     918void buildTypeList( const DeclarationNode * firstNode, std::list< Type * > &outputList ) {
    937919        SemanticError errors;
    938920        std::back_insert_iterator< std::list< Type * > > out( outputList );
    939         const DeclarationNode *cur = firstNode;
     921        const DeclarationNode * cur = firstNode;
     922
    940923        while ( cur ) {
    941924                try {
    942                         *out++ = cur->buildType();
     925                        * out++ = cur->buildType();
    943926                } catch( SemanticError &e ) {
    944927                        errors.append( e );
     
    946929                cur = dynamic_cast< DeclarationNode * >( cur->get_next() );
    947930        } // while
     931
    948932        if ( ! errors.isEmpty() ) {
    949933                throw errors;
    950934        } // if
    951 }
    952 
    953 Declaration *DeclarationNode::build() const {
     935} // buildTypeList
     936
     937Declaration * DeclarationNode::build() const {
    954938        if ( ! error.empty() ) throw SemanticError( error + " in declaration of ", this );
     939
     940        if ( variable.name ) {
     941                static const TypeDecl::Kind kindMap[] = { TypeDecl::Any, TypeDecl::Ftype, TypeDecl::Dtype };
     942                TypeDecl * ret = new TypeDecl( *variable.name, DeclarationNode::NoStorageClass, nullptr, kindMap[ variable.tyClass ] );
     943                buildList( variable.assertions, ret->get_assertions() );
     944                return ret;
     945        } // if
     946
    955947        if ( type ) {
    956                 if ( type->kind == TypeData::Variable ) {
    957                         static const TypeDecl::Kind kindMap[] = { TypeDecl::Any, TypeDecl::Ftype, TypeDecl::Dtype };
    958                         TypeDecl * ret = new TypeDecl( variable.name, DeclarationNode::NoStorageClass, 0, kindMap[ variable.tyClass ] );
    959                         buildList( variable.assertions, ret->get_assertions() );
    960                         return ret;
     948                return buildDecl( type, name ? *name : string( "" ), storageClass, maybeBuild< Expression >( bitfieldWidth ), isInline, isNoreturn, linkage, maybeBuild< Initializer >(initializer) )->set_extension( extension );
     949        } // if
     950
     951        if ( ! isInline && ! isNoreturn ) {
     952                assertf( name, "ObjectDecl are assumed to have names\n" );
     953                return (new ObjectDecl( *name, storageClass, linkage, maybeBuild< Expression >( bitfieldWidth ), nullptr, maybeBuild< Initializer >( initializer ) ))->set_extension( extension );
     954        } // if
     955
     956        throw SemanticError( "invalid function specifier ", this );
     957}
     958
     959Type * DeclarationNode::buildType() const {
     960        assert( type );
     961
     962        if ( attr.name ) {
     963                AttrType * ret;
     964                if ( attr.expr ) {
     965                        ret = new AttrType( buildQualifiers( type ), *attr.name, attr.expr->build() );
    961966                } else {
    962                         return buildDecl( type, name, storageClass, maybeBuild< Expression >( bitfieldWidth ), isInline, isNoreturn, linkage, maybeBuild< Initializer >(initializer) )->set_extension( extension );
    963                 } // if
    964         } // if
    965         if ( ! isInline && ! isNoreturn ) {
    966                 return (new ObjectDecl( name, storageClass, linkage, maybeBuild< Expression >( bitfieldWidth ), 0, maybeBuild< Initializer >( initializer ) ))->set_extension( extension );
    967         } // if
    968         throw SemanticError( "invalid function specifier ", this );
    969 }
    970 
    971 Type *DeclarationNode::buildType() const {
    972         assert( type );
     967                        assert( attr.type );
     968                        ret = new AttrType( buildQualifiers( type ), *attr.name, attr.type->buildType() );
     969                } // if
     970                return ret;
     971        } // if
    973972
    974973        switch ( type->kind ) {
    975974          case TypeData::Enum:
    976                 return new EnumInstType( buildQualifiers( type ), type->enumeration.name );
     975                return new EnumInstType( buildQualifiers( type ), *type->enumeration.name );
    977976          case TypeData::Aggregate: {
    978                   ReferenceToType *ret;
     977                  ReferenceToType * ret;
    979978                  switch ( type->aggregate.kind ) {
    980979                        case DeclarationNode::Struct:
    981                           ret = new StructInstType( buildQualifiers( type ), type->aggregate.name );
     980                          ret = new StructInstType( buildQualifiers( type ), *type->aggregate.name );
    982981                          break;
    983982                        case DeclarationNode::Union:
    984                           ret = new UnionInstType( buildQualifiers( type ), type->aggregate.name );
     983                          ret = new UnionInstType( buildQualifiers( type ), *type->aggregate.name );
    985984                          break;
    986985                        case DeclarationNode::Trait:
    987                           ret = new TraitInstType( buildQualifiers( type ), type->aggregate.name );
     986                          ret = new TraitInstType( buildQualifiers( type ), *type->aggregate.name );
    988987                          break;
    989988                        default:
     
    994993          }
    995994          case TypeData::Symbolic: {
    996                   TypeInstType *ret = new TypeInstType( buildQualifiers( type ), type->symbolic.name, false );
     995                  TypeInstType * ret = new TypeInstType( buildQualifiers( type ), *type->symbolic.name, false );
    997996                  buildList( type->symbolic.actuals, ret->get_parameters() );
    998                   return ret;
    999           }
    1000           case TypeData::Attr: {
    1001                   assert( type->kind == TypeData::Attr );
    1002                   // assert( type->attr );
    1003                   AttrType * ret;
    1004                   if ( attr.expr ) {
    1005                           ret = new AttrType( buildQualifiers( type ), attr.name, attr.expr->build() );
    1006                   } else {
    1007                           assert( attr.type );
    1008                           ret = new AttrType( buildQualifiers( type ), attr.name, attr.type->buildType() );
    1009                   } // if
    1010997                  return ret;
    1011998          }
  • src/Parser/ExpressionNode.cc

    r7b69174 raee7e35  
    1010// Created On       : Sat May 16 13:17:07 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Aug 25 21:39:40 2016
    13 // Update Count     : 503
     12// Last Modified On : Fri Sep 16 16:27:44 2016
     13// Update Count     : 508
    1414//
    1515
     
    3131
    3232using namespace std;
    33 
    34 ExpressionNode::ExpressionNode( const ExpressionNode &other ) : ParseNode( other.get_name() ), extension( other.extension ) {}
    3533
    3634//##############################################################################
  • src/Parser/ParseNode.h

    r7b69174 raee7e35  
    1010// Created On       : Sat May 16 13:28:16 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Sep 12 08:00:05 2016
    13 // Update Count     : 603
     12// Last Modified On : Sat Sep 24 11:12:04 2016
     13// Update Count     : 633
    1414//
    1515
     
    4141  public:
    4242        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; };
     43        virtual ~ParseNode() { delete next; delete name; };
    4644        virtual ParseNode * clone() const = 0;
    4745
    4846        ParseNode * get_next() const { return next; }
    4947        ParseNode * set_next( ParseNode * newlink ) { next = newlink; return this; }
     48
    5049        ParseNode * get_last() {
    5150                ParseNode * current;
    52                 for ( current = this; current->get_next() != 0; current = current->get_next() );
     51                for ( current = this; current->get_next() != nullptr; current = current->get_next() );
    5352                return current;
    5453        }
    5554        ParseNode * set_last( ParseNode * newlast ) {
    56                 if ( newlast != 0 ) get_last()->set_next( newlast );
     55                if ( newlast != nullptr ) get_last()->set_next( newlast );
    5756                return this;
    5857        }
    59 
    60         const std::string &get_name() const { return name; }
    61         void set_name( const std::string &newValue ) { name = newValue; }
    6258
    6359        virtual void print( std::ostream &os, int indent = 0 ) const {}
    6460        virtual void printList( std::ostream &os, int indent = 0 ) const {}
    65   private:
     61
    6662        static int indent_by;
    6763
    6864        ParseNode * next = nullptr;
    69         std::string name;
     65        std::string * name = nullptr;
    7066}; // ParseNode
    7167
     
    7470class InitializerNode : public ParseNode {
    7571  public:
    76         InitializerNode( ExpressionNode *, bool aggrp = false,  ExpressionNode * des = 0 );
    77         InitializerNode( InitializerNode *, bool aggrp = false, ExpressionNode * des = 0 );
     72        InitializerNode( ExpressionNode *, bool aggrp = false,  ExpressionNode * des = nullptr );
     73        InitializerNode( InitializerNode *, bool aggrp = false, ExpressionNode * des = nullptr );
    7874        ~InitializerNode();
    7975        virtual InitializerNode * clone() const { assert( false ); return nullptr; }
     
    106102  public:
    107103        ExpressionNode( Expression * expr = nullptr ) : expr( expr ) {}
    108         ExpressionNode( Expression * expr, const std::string * name ) : ParseNode( name ), expr( expr ) {}
    109104        ExpressionNode( const ExpressionNode &other );
    110105        virtual ~ExpressionNode() {}
     
    183178Expression * build_attrexpr( NameExpr * var, ExpressionNode * expr_node );
    184179Expression * build_attrtype( NameExpr * var, DeclarationNode * decl_node );
    185 Expression * build_tuple( ExpressionNode * expr_node = 0 );
     180Expression * build_tuple( ExpressionNode * expr_node = nullptr );
    186181Expression * build_func( ExpressionNode * function, ExpressionNode * expr_node );
    187182Expression * build_range( ExpressionNode * low, ExpressionNode * high );
     
    219214        static DeclarationNode * newFunction( std::string * name, DeclarationNode * ret, DeclarationNode * param, StatementNode * body, bool newStyle = false );
    220215        static DeclarationNode * newQualifier( Qualifier );
    221         static DeclarationNode * newForall( DeclarationNode *);
     216        static DeclarationNode * newForall( DeclarationNode * );
    222217        static DeclarationNode * newStorageClass( StorageClass );
    223218        static DeclarationNode * newBasicType( BasicType );
     
    226221        static DeclarationNode * newLength( Length lnth );
    227222        static DeclarationNode * newBuiltinType( BuiltinType );
    228         static DeclarationNode * newFromTypedef( std::string *);
     223        static DeclarationNode * newFromTypedef( std::string * );
    229224        static DeclarationNode * newAggregate( Aggregate kind, const std::string * name, ExpressionNode * actuals, DeclarationNode * fields, bool body );
    230225        static DeclarationNode * newEnum( std::string * name, DeclarationNode * constants );
    231226        static DeclarationNode * newEnumConstant( std::string * name, ExpressionNode * constant );
    232         static DeclarationNode * newName( std::string *);
     227        static DeclarationNode * newName( std::string * );
    233228        static DeclarationNode * newFromTypeGen( std::string *, ExpressionNode * params );
    234         static DeclarationNode * newTypeParam( TypeClass, std::string *);
    235         static DeclarationNode * newTrait( std::string * name, DeclarationNode * params, DeclarationNode * asserts );
    236         static DeclarationNode * newTraitUse( std::string * name, ExpressionNode * params );
     229        static DeclarationNode * newTypeParam( TypeClass, std::string * );
     230        static DeclarationNode * newTrait( const std::string * name, DeclarationNode * params, DeclarationNode * asserts );
     231        static DeclarationNode * newTraitUse( const std::string * name, ExpressionNode * params );
    237232        static DeclarationNode * newTypeDecl( std::string * name, DeclarationNode * typeParams );
    238233        static DeclarationNode * newPointer( DeclarationNode * qualifiers );
     
    249244        DeclarationNode * clone() const;
    250245
    251         DeclarationNode * addQualifiers( DeclarationNode *);
     246        DeclarationNode * addQualifiers( DeclarationNode * );
    252247        void checkQualifiers( const TypeData *, const TypeData * );
    253         void checkStorageClasses( DeclarationNode *q );
    254         DeclarationNode * copyStorageClasses( DeclarationNode *);
    255         DeclarationNode * addType( DeclarationNode *);
     248        void checkStorageClasses( DeclarationNode * );
     249        DeclarationNode * copyStorageClasses( DeclarationNode * );
     250        DeclarationNode * addType( DeclarationNode * );
    256251        DeclarationNode * addTypedef();
    257         DeclarationNode * addAssertions( DeclarationNode *);
    258         DeclarationNode * addName( std::string *);
     252        DeclarationNode * addAssertions( DeclarationNode * );
     253        DeclarationNode * addName( std::string * );
    259254        DeclarationNode * addBitfield( ExpressionNode * size );
    260255        DeclarationNode * addVarArgs();
     
    270265
    271266        DeclarationNode * cloneType( std::string * newName );
    272         DeclarationNode * cloneType( DeclarationNode * existing );
    273         DeclarationNode * cloneType( int ) { return cloneType( ( std::string *)0 ); }
    274         DeclarationNode * cloneBaseType( std::string * newName );
    275267        DeclarationNode * cloneBaseType( DeclarationNode * newdecl );
    276268
     
    286278
    287279        bool get_hasEllipsis() const;
    288         const std::string &get_name() const { return name; }
    289280        LinkageSpec::Spec get_linkage() const { return linkage; }
    290281        DeclarationNode * extractAggregate() const;
     
    295286        DeclarationNode * set_extension( bool exten ) { extension = exten; return this; }
    296287  public:
    297         // StorageClass buildStorageClass() const;
    298         // bool buildFuncSpecifier( StorageClass key ) const;
    299 
    300288        struct Variable_t {
     289                const std::string * name;
    301290                DeclarationNode::TypeClass tyClass;
    302                 std::string name;
    303291                DeclarationNode * assertions;
    304292        };
     
    306294
    307295        struct Attr_t {
    308                 std::string name;
     296                const std::string * name;
    309297                ExpressionNode * expr;
    310298                DeclarationNode * type;
     
    315303
    316304        TypeData * type;
    317         std::string name;
    318305        StorageClass storageClass;
    319306        bool isInline, isNoreturn;
     
    331318
    332319Type * buildType( TypeData * type );
    333 //Type::Qualifiers buildQualifiers( const TypeData::Qualifiers & qualifiers );
    334320
    335321static inline Type * maybeMoveBuildType( const DeclarationNode * orig ) {
     
    393379Statement * build_finally( StatementNode * stmt );
    394380Statement * build_compound( StatementNode * first );
    395 Statement * build_asmstmt( bool voltile, ConstantExpr * instruction, ExpressionNode * output = 0, ExpressionNode * input = 0, ExpressionNode * clobber = 0, LabelNode * gotolabels = 0 );
     381Statement * build_asmstmt( bool voltile, ConstantExpr * instruction, ExpressionNode * output = nullptr, ExpressionNode * input = nullptr, ExpressionNode * clobber = nullptr, LabelNode * gotolabels = nullptr );
    396382
    397383//##############################################################################
  • src/Parser/TypeData.cc

    r7b69174 raee7e35  
    1010// Created On       : Sat May 16 15:12:51 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Sep 12 21:11:22 2016
    13 // Update Count     : 377
     12// Last Modified On : Sat Sep 24 11:14:26 2016
     13// Update Count     : 415
    1414//
    1515
     
    2424#include "SynTree/Statement.h"
    2525#include "SynTree/Initializer.h"
    26 
    27 TypeData::TypeData( Kind k ) : kind( k ), base( 0 ), forall( 0 ) {
     26using namespace std;
     27
     28TypeData::TypeData( Kind k ) : kind( k ), base( nullptr ), forall( nullptr ) {
    2829        switch ( kind ) {
    2930          case Unknown:
     
    3738          case Array:
    3839                // array = new Array_t;
    39                 array.dimension = 0;
     40                array.dimension = nullptr;
    4041                array.isVarLen = false;
    4142                array.isStatic = false;
     
    4344          case Function:
    4445                // function = new Function_t;
    45                 function.params = 0;
    46                 function.idList = 0;
    47                 function.oldDeclList = 0;
    48                 function.body = 0;
     46                function.params = nullptr;
     47                function.idList = nullptr;
     48                function.oldDeclList = nullptr;
     49                function.body = nullptr;
    4950                function.hasBody = false;
    5051                function.newStyle = false;
     
    5253          case Aggregate:
    5354                // aggregate = new Aggregate_t;
    54                 aggregate.params = 0;
    55                 aggregate.actuals = 0;
    56                 aggregate.fields = 0;
     55                aggregate.name = nullptr;
     56                aggregate.params = nullptr;
     57                aggregate.actuals = nullptr;
     58                aggregate.fields = nullptr;
    5759                break;
    5860          case AggregateInst:
    5961                // aggInst = new AggInst_t;
    60                 aggInst.aggregate = 0;
    61                 aggInst.params = 0;
     62                aggInst.aggregate = nullptr;
     63                aggInst.params = nullptr;
    6264                break;
    6365          case Enum:
    6466                // enumeration = new Enumeration_t;
    65                 enumeration.constants = 0;
     67                enumeration.name = nullptr;
     68                enumeration.constants = nullptr;
    6669                break;
    6770          case Symbolic:
    6871          case SymbolicInst:
    6972                // symbolic = new Symbolic_t;
    70                 symbolic.params = 0;
    71                 symbolic.actuals = 0;
    72                 symbolic.assertions = 0;
    73                 break;
    74           case Variable:
    75                 // variable = new Variable_t;
    76                 // variable.tyClass = DeclarationNode::Type;
    77                 // variable.assertions = 0;
     73                symbolic.name = nullptr;
     74                symbolic.params = nullptr;
     75                symbolic.actuals = nullptr;
     76                symbolic.assertions = nullptr;
    7877                break;
    7978          case Tuple:
     
    8483                // typeexpr = new Typeof_t;
    8584                typeexpr = nullptr;
    86                 break;
    87           case Attr:
    88                 // attr = new Attr_t;
    89                 // attr.expr = nullptr;
    90                 // attr.type = nullptr;
    9185                break;
    9286          case Builtin:
     
    121115                break;
    122116          case Aggregate:
     117                delete aggregate.name;
    123118                delete aggregate.params;
    124119                delete aggregate.actuals;
     
    132127                break;
    133128          case Enum:
     129                delete enumeration.name;
    134130                delete enumeration.constants;
    135131                // delete enumeration;
     
    137133          case Symbolic:
    138134          case SymbolicInst:
     135                delete symbolic.name;
    139136                delete symbolic.params;
    140137                delete symbolic.actuals;
     
    142139                // delete symbolic;
    143140                break;
    144           case Variable:
    145                 // delete variable.assertions;
    146                 // delete variable;
    147                 break;
    148141          case Tuple:
    149142                // delete tuple->members;
     
    153146                // delete typeexpr->expr;
    154147                delete typeexpr;
    155                 break;
    156           case Attr:
    157                 // delete attr.expr;
    158                 // delete attr.type;
    159                 // delete attr;
    160148                break;
    161149          case Builtin:
     
    197185                break;
    198186          case Aggregate:
     187                newtype->aggregate.name = aggregate.name ? new string( *aggregate.name ) : nullptr;
    199188                newtype->aggregate.params = maybeClone( aggregate.params );
    200189                newtype->aggregate.actuals = maybeClone( aggregate.actuals );
    201190                newtype->aggregate.fields = maybeClone( aggregate.fields );
    202                 newtype->aggregate.name = aggregate.name;
    203191                newtype->aggregate.kind = aggregate.kind;
    204192                newtype->aggregate.body = aggregate.body;
     
    209197                break;
    210198          case Enum:
    211                 newtype->enumeration.name = enumeration.name;
     199                newtype->enumeration.name = enumeration.name ? new string( *enumeration.name ) : nullptr;
    212200                newtype->enumeration.constants = maybeClone( enumeration.constants );
    213201                break;
    214202          case Symbolic:
    215203          case SymbolicInst:
     204                newtype->symbolic.name = symbolic.name ? new string( *symbolic.name ) : nullptr;
    216205                newtype->symbolic.params = maybeClone( symbolic.params );
    217206                newtype->symbolic.actuals = maybeClone( symbolic.actuals );
    218207                newtype->symbolic.assertions = maybeClone( symbolic.assertions );
    219208                newtype->symbolic.isTypedef = symbolic.isTypedef;
    220                 newtype->symbolic.name = symbolic.name;
    221                 break;
    222           case Variable:
    223                 assert( false );
    224                 // newtype->variable.assertions = maybeClone( variable.assertions );
    225                 // newtype->variable.name = variable.name;
    226                 // newtype->variable.tyClass = variable.tyClass;
    227209                break;
    228210          case Tuple:
     
    231213          case Typeof:
    232214                newtype->typeexpr = maybeClone( typeexpr );
    233                 break;
    234           case Attr:
    235                 assert( false );
    236                 // newtype->attr.expr = maybeClone( attr.expr );
    237                 // newtype->attr.type = maybeClone( attr.type );
    238215                break;
    239216          case Builtin:
     
    245222} // TypeData::clone
    246223
    247 void TypeData::print( std::ostream &os, int indent ) const {
    248         using std::endl;
    249         using std::string;
    250 
     224void TypeData::print( ostream &os, int indent ) const {
    251225        for ( int i = 0; i < DeclarationNode::NoQualifier; i += 1 ) {
    252226                if ( qualifiers[i] ) os << DeclarationNode::qualifierName[ i ] << ' ';
     
    326300                break;
    327301          case Aggregate:
    328                 os << DeclarationNode::aggregateName[ aggregate.kind ] << ' ' << aggregate.name << endl;
     302                os << DeclarationNode::aggregateName[ aggregate.kind ] << ' ' << *aggregate.name << endl;
    329303                if ( aggregate.params ) {
    330304                        os << string( indent + 2, ' ' ) << "with type parameters " << endl;
     
    363337                break;
    364338          case SymbolicInst:
    365                 os << "instance of type " << symbolic.name;
     339                os << "instance of type " << *symbolic.name;
    366340                if ( symbolic.actuals ) {
    367341                        os << " with parameters" << endl;
     
    389363                } // if
    390364                break;
    391           case Variable:
    392                 // os << DeclarationNode::typeClassName[ variable.tyClass ] << " variable ";
    393                 // if ( variable.assertions ) {
    394                 //      os << endl << string( indent + 2, ' ' ) << "with assertions" << endl;
    395                 //      variable.assertions->printList( os, indent + 4 );
    396                 //      os << string( indent + 2, ' ' );
    397                 // } // if
    398                 break;
    399365          case Tuple:
    400366                os << "tuple ";
     
    410376                } // if
    411377                break;
    412           case Attr:
    413                 // os << "attribute type decl " << attr.name << " applied to ";
    414                 // if ( attr.expr ) {
    415                 //      attr.expr->print( os, indent + 2 );
    416                 // } // if
    417                 // if ( attr.type ) {
    418                 //      attr.type->print( os, indent + 2 );
    419                 // } // if
    420                 break;
    421378          case Builtin:
    422379                os << "gcc builtin type";
     
    428385} // TypeData::print
    429386
    430 void buildForall( const DeclarationNode * firstNode, std::list< TypeDecl* > &outputList ) {
     387void buildForall( const DeclarationNode * firstNode, list< TypeDecl* > &outputList ) {
    431388        buildList( firstNode, outputList );
    432         for ( std::list< TypeDecl* >::iterator i = outputList.begin(); i != outputList.end(); ++i ) {
     389        for ( list< TypeDecl* >::iterator i = outputList.begin(); i != outputList.end(); ++i ) {
    433390                if ( (*i)->get_kind() == TypeDecl::Any ) {
    434391                        // add assertion parameters to `type' tyvars in reverse order
    435392                        // add dtor:  void ^?{}(T *)
    436393                        FunctionType * dtorType = new FunctionType( Type::Qualifiers(), false );
    437                         dtorType->get_parameters().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, new PointerType( Type::Qualifiers(), new TypeInstType( Type::Qualifiers(), (*i)->get_name(), *i ) ), 0 ) );
    438                         (*i)->get_assertions().push_front( new FunctionDecl( "^?{}", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, dtorType, 0, false, false ) );
     394                        dtorType->get_parameters().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, nullptr, new PointerType( Type::Qualifiers(), new TypeInstType( Type::Qualifiers(), (*i)->get_name(), *i ) ), nullptr ) );
     395                        (*i)->get_assertions().push_front( new FunctionDecl( "^?{}", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, dtorType, nullptr, false, false ) );
    439396
    440397                        // add copy ctor:  void ?{}(T *, T)
    441398                        FunctionType * copyCtorType = new FunctionType( Type::Qualifiers(), false );
    442                         copyCtorType->get_parameters().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, new PointerType( Type::Qualifiers(), new TypeInstType( Type::Qualifiers(), (*i)->get_name(), *i ) ), 0 ) );
    443                         copyCtorType->get_parameters().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, new TypeInstType( Type::Qualifiers(), (*i)->get_name(), *i ), 0 ) );
    444                         (*i)->get_assertions().push_front( new FunctionDecl( "?{}", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, copyCtorType, 0, false, false ) );
     399                        copyCtorType->get_parameters().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, nullptr, new PointerType( Type::Qualifiers(), new TypeInstType( Type::Qualifiers(), (*i)->get_name(), *i ) ), nullptr ) );
     400                        copyCtorType->get_parameters().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, nullptr, new TypeInstType( Type::Qualifiers(), (*i)->get_name(), *i ), nullptr ) );
     401                        (*i)->get_assertions().push_front( new FunctionDecl( "?{}", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, copyCtorType, nullptr, false, false ) );
    445402
    446403                        // add default ctor:  void ?{}(T *)
    447404                        FunctionType * ctorType = new FunctionType( Type::Qualifiers(), false );
    448                         ctorType->get_parameters().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, new PointerType( Type::Qualifiers(), new TypeInstType( Type::Qualifiers(), (*i)->get_name(), *i ) ), 0 ) );
    449                         (*i)->get_assertions().push_front( new FunctionDecl( "?{}", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, ctorType, 0, false, false ) );
     405                        ctorType->get_parameters().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, nullptr, new PointerType( Type::Qualifiers(), new TypeInstType( Type::Qualifiers(), (*i)->get_name(), *i ) ), nullptr ) );
     406                        (*i)->get_assertions().push_front( new FunctionDecl( "?{}", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, ctorType, nullptr, false, false ) );
    450407
    451408                        // add assignment operator:  T * ?=?(T *, T)
    452409                        FunctionType * assignType = new FunctionType( Type::Qualifiers(), false );
    453                         assignType->get_parameters().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, new PointerType( Type::Qualifiers(), new TypeInstType( Type::Qualifiers(), (*i)->get_name(), *i ) ), 0 ) );
    454                         assignType->get_parameters().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, new TypeInstType( Type::Qualifiers(), (*i)->get_name(), *i ), 0 ) );
    455                         assignType->get_returnVals().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, new TypeInstType( Type::Qualifiers(), (*i)->get_name(), *i ), 0 ) );
    456                         (*i)->get_assertions().push_front( new FunctionDecl( "?=?", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, assignType, 0, false, false ) );
     410                        assignType->get_parameters().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, nullptr, new PointerType( Type::Qualifiers(), new TypeInstType( Type::Qualifiers(), (*i)->get_name(), *i ) ), nullptr ) );
     411                        assignType->get_parameters().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, nullptr, new TypeInstType( Type::Qualifiers(), (*i)->get_name(), *i ), nullptr ) );
     412                        assignType->get_returnVals().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, nullptr, new TypeInstType( Type::Qualifiers(), (*i)->get_name(), *i ), nullptr ) );
     413                        (*i)->get_assertions().push_front( new FunctionDecl( "?=?", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, assignType, nullptr, false, false ) );
    457414                } // if
    458415        } // for
     
    486443          case TypeData::Builtin:
    487444                return new VarArgsType( buildQualifiers( td ) );
    488           case TypeData::Attr:
    489                 assert( false );
    490                 return buildAttr( td );
    491445          case TypeData::Symbolic:
    492446          case TypeData::Enum:
    493447          case TypeData::Aggregate:
    494           case TypeData::Variable:
    495448                assert( false );
    496449        } // switch
    497         return 0;
     450        return nullptr;
    498451} // typebuild
    499452
    500453TypeData * typeextractAggregate( const TypeData * td, bool toplevel ) {
    501         TypeData * ret = 0;
     454        TypeData * ret = nullptr;
    502455
    503456        switch ( td->kind ) {
     
    549502          case DeclarationNode::Bool:
    550503                if ( td->signedness != DeclarationNode::NoSignedness ) {
    551                         throw SemanticError( std::string( "invalid type specifier " ) + DeclarationNode::signednessName[ td->signedness ] + " in type: ", td );
     504                        throw SemanticError( string( "invalid type specifier " ) + DeclarationNode::signednessName[ td->signedness ] + " in type: ", td );
    552505                } // if
    553506                if ( td->length != DeclarationNode::NoLength ) {
    554                         throw SemanticError( std::string( "invalid type specifier " ) + DeclarationNode::lengthName[ td->length ] + " in type: ", td );
     507                        throw SemanticError( string( "invalid type specifier " ) + DeclarationNode::lengthName[ td->length ] + " in type: ", td );
    555508                } // if
    556509
     
    565518
    566519                if ( td->length != DeclarationNode::NoLength ) {
    567                         throw SemanticError( std::string( "invalid type specifier " ) + DeclarationNode::lengthName[ td->length ] + " in type: ", td );
     520                        throw SemanticError( string( "invalid type specifier " ) + DeclarationNode::lengthName[ td->length ] + " in type: ", td );
    568521                } // if
    569522
     
    595548          FloatingPoint: ;
    596549                if ( td->signedness != DeclarationNode::NoSignedness ) {
    597                         throw SemanticError( std::string( "invalid type specifier " ) + DeclarationNode::signednessName[ td->signedness ] + " in type: ", td );
     550                        throw SemanticError( string( "invalid type specifier " ) + DeclarationNode::signednessName[ td->signedness ] + " in type: ", td );
    598551                } // if
    599552                if ( td->length == DeclarationNode::Short || td->length == DeclarationNode::LongLong ) {
    600                         throw SemanticError( std::string( "invalid type specifier " ) + DeclarationNode::lengthName[ td->length ] + " in type: ", td );
     553                        throw SemanticError( string( "invalid type specifier " ) + DeclarationNode::lengthName[ td->length ] + " in type: ", td );
    601554                } // if
    602555                if ( td->basictype == DeclarationNode::Float && td->length == DeclarationNode::Long ) {
     
    655608        switch ( td->aggregate.kind ) {
    656609          case DeclarationNode::Struct:
    657                 at = new StructDecl( td->aggregate.name );
     610                at = new StructDecl( *td->aggregate.name );
    658611                buildForall( td->aggregate.params, at->get_parameters() );
    659612                break;
    660613          case DeclarationNode::Union:
    661                 at = new UnionDecl( td->aggregate.name );
     614                at = new UnionDecl( *td->aggregate.name );
    662615                buildForall( td->aggregate.params, at->get_parameters() );
    663616                break;
    664617          case DeclarationNode::Trait:
    665                 at = new TraitDecl( td->aggregate.name );
     618                at = new TraitDecl( *td->aggregate.name );
    666619                buildList( td->aggregate.params, at->get_parameters() );
    667620                break;
     
    681634        ReferenceToType * ret;
    682635        if ( td->aggInst.aggregate->kind == TypeData::Enum ) {
    683                 ret = new EnumInstType( buildQualifiers( td ), td->aggInst.aggregate->enumeration.name );
     636                ret = new EnumInstType( buildQualifiers( td ), *td->aggInst.aggregate->enumeration.name );
    684637        } else {
    685638                assert( td->aggInst.aggregate->kind == TypeData::Aggregate );
    686639                switch ( td->aggInst.aggregate->aggregate.kind ) {
    687640                  case DeclarationNode::Struct:
    688                         ret = new StructInstType( buildQualifiers( td ), td->aggInst.aggregate->aggregate.name );
     641                        assert( td->aggInst.aggregate->aggregate.name );
     642                        ret = new StructInstType( buildQualifiers( td ), *td->aggInst.aggregate->aggregate.name );
    689643                        break;
    690644                  case DeclarationNode::Union:
    691                         ret = new UnionInstType( buildQualifiers( td ), td->aggInst.aggregate->aggregate.name );
     645                        ret = new UnionInstType( buildQualifiers( td ), *td->aggInst.aggregate->aggregate.name );
    692646                        break;
    693647                  case DeclarationNode::Trait:
    694                         ret = new TraitInstType( buildQualifiers( td ), td->aggInst.aggregate->aggregate.name );
     648                        ret = new TraitInstType( buildQualifiers( td ), *td->aggInst.aggregate->aggregate.name );
    695649                        break;
    696650                  default:
     
    703657} // buildAggInst
    704658
    705 NamedTypeDecl * buildSymbolic( const TypeData * td, const std::string & name, DeclarationNode::StorageClass sc ) {
     659NamedTypeDecl * buildSymbolic( const TypeData * td, const string & name, DeclarationNode::StorageClass sc ) {
    706660        assert( td->kind == TypeData::Symbolic );
    707661        NamedTypeDecl * ret;
     
    717671} // buildSymbolic
    718672
    719 TypeDecl * buildVariable( const TypeData * td ) {
    720         assert( false );
    721         return nullptr;
    722         // assert( td->kind == TypeData::Variable );
    723         // static const TypeDecl::Kind kindMap[] = { TypeDecl::Any, TypeDecl::Ftype, TypeDecl::Dtype };
    724 
    725         // TypeDecl * ret = new TypeDecl( td->variable.name, DeclarationNode::NoStorageClass, 0, kindMap[ td->variable.tyClass ] );
    726         // buildList( td->variable.assertions, ret->get_assertions() );
    727         // return ret;
    728 } // buildSymbolic
    729 
    730673EnumDecl * buildEnum( const TypeData * td ) {
    731674        assert( td->kind == TypeData::Enum );
    732         EnumDecl * ret = new EnumDecl( td->enumeration.name );
     675        EnumDecl * ret = new EnumDecl( *td->enumeration.name );
    733676        buildList( td->enumeration.constants, ret->get_members() );
    734         std::list< Declaration * >::iterator members = ret->get_members().begin();
     677        list< Declaration * >::iterator members = ret->get_members().begin();
    735678        for ( const DeclarationNode * cur = td->enumeration. constants; cur != nullptr; cur = dynamic_cast< DeclarationNode * >( cur->get_next() ), ++members ) {
    736679                if ( cur->has_enumeratorValue() ) {
    737680                        ObjectDecl * member = dynamic_cast< ObjectDecl * >(* members);
    738                         member->set_init( new SingleInit( maybeMoveBuild< Expression >( cur->consume_enumeratorValue() ), std::list< Expression * >() ) );
     681                        member->set_init( new SingleInit( maybeMoveBuild< Expression >( cur->consume_enumeratorValue() ), list< Expression * >() ) );
    739682                } // if
    740683        } // for
     
    744687TypeInstType * buildSymbolicInst( const TypeData * td ) {
    745688        assert( td->kind == TypeData::SymbolicInst );
    746         TypeInstType * ret = new TypeInstType( buildQualifiers( td ), td->symbolic.name, false );
     689        TypeInstType * ret = new TypeInstType( buildQualifiers( td ), *td->symbolic.name, false );
    747690        buildList( td->symbolic.actuals, ret->get_parameters() );
    748691        buildForall( td->forall, ret->get_forall() );
     
    765708} // buildTypeof
    766709
    767 AttrType * buildAttr( const TypeData * td ) {
    768         assert( false );
    769         return nullptr;
    770         // assert( td->kind == TypeData::Attr );
    771         // // assert( td->attr );
    772         // AttrType * ret;
    773         // if ( td->attr.expr ) {
    774         //      ret = new AttrType( buildQualifiers( td ), td->attr.name, td->attr.expr->build() );
    775         // } else {
    776         //      assert( td->attr.type );
    777         //      ret = new AttrType( buildQualifiers( td ), td->attr.name, td->attr.type->buildType() );
    778         // } // if
    779         // return ret;
    780 } // buildAttr
    781 
    782 Declaration * buildDecl( const TypeData * td, std::string name, DeclarationNode::StorageClass sc, Expression * bitfieldWidth, bool isInline, bool isNoreturn, LinkageSpec::Spec linkage, Initializer * init ) {
     710Declaration * buildDecl( const TypeData * td, const string &name, DeclarationNode::StorageClass sc, Expression * bitfieldWidth, bool isInline, bool isNoreturn, LinkageSpec::Spec linkage, Initializer * init ) {
    783711        if ( td->kind == TypeData::Function ) {
    784712                FunctionDecl * decl;
     
    790718                                decl = new FunctionDecl( name, sc, linkage, buildFunction( td ), body, isInline, isNoreturn );
    791719                        } else {
    792                                 // std::list< Label > ls;
    793                                 decl = new FunctionDecl( name, sc, linkage, buildFunction( td ), new CompoundStmt( std::list< Label >() ), isInline, isNoreturn );
     720                                // list< Label > ls;
     721                                decl = new FunctionDecl( name, sc, linkage, buildFunction( td ), new CompoundStmt( list< Label >() ), isInline, isNoreturn );
    794722                        } // if
    795723                } else {
    796                         decl = new FunctionDecl( name, sc, linkage, buildFunction( td ), 0, isInline, isNoreturn );
    797                 } // if
    798                 for ( DeclarationNode * cur = td->function.idList; cur != 0; cur = dynamic_cast< DeclarationNode* >( cur->get_next() ) ) {
    799                         if ( cur->get_name() != "" ) {
    800                                 decl->get_oldIdents().insert( decl->get_oldIdents().end(), cur->get_name() );
     724                        decl = new FunctionDecl( name, sc, linkage, buildFunction( td ), nullptr, isInline, isNoreturn );
     725                } // if
     726                for ( DeclarationNode * cur = td->function.idList; cur != nullptr; cur = dynamic_cast< DeclarationNode* >( cur->get_next() ) ) {
     727                        if ( cur->name ) {
     728                                decl->get_oldIdents().insert( decl->get_oldIdents().end(), *cur->name );
    801729                        } // if
    802730                } // for
     
    809737        } else if ( td->kind == TypeData::Symbolic ) {
    810738                return buildSymbolic( td, name, sc );
    811         } else if ( td->kind == TypeData::Variable ) {
    812                 assert( false );
    813                 return buildVariable( td );
    814739        } else {
    815                 return new ObjectDecl( name, sc, linkage, bitfieldWidth, typebuild( td ), init, std::list< Attribute * >(), isInline, isNoreturn );
     740                return new ObjectDecl( name, sc, linkage, bitfieldWidth, typebuild( td ), init, list< Attribute * >(), isInline, isNoreturn );
    816741        } // if
    817         return 0;
     742        return nullptr;
    818743} // buildDecl
    819744
     
    831756                        break;
    832757                  default:
    833                         ft->get_returnVals().push_back( dynamic_cast< DeclarationWithType* >( buildDecl( td->base,  "", DeclarationNode::NoStorageClass, 0, false, false, LinkageSpec::Cforall ) ) );
     758                        ft->get_returnVals().push_back( dynamic_cast< DeclarationWithType* >( buildDecl( td->base,  "", DeclarationNode::NoStorageClass, nullptr, false, false, LinkageSpec::Cforall ) ) );
    834759                } // switch
    835760        } else {
    836                 ft->get_returnVals().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, new BasicType( Type::Qualifiers(), BasicType::SignedInt ), 0 ) );
     761                ft->get_returnVals().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, nullptr, new BasicType( Type::Qualifiers(), BasicType::SignedInt ), nullptr ) );
    837762        } // if
    838763        return ft;
  • src/Parser/TypeData.h

    r7b69174 raee7e35  
    1010// Created On       : Sat May 16 15:18:36 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Sep 12 17:15:49 2016
    13 // Update Count     : 129
     12// Last Modified On : Sat Sep 24 11:10:38 2016
     13// Update Count     : 141
    1414//
    1515
     
    2424struct TypeData {
    2525        enum Kind { Unknown, Basic, Pointer, Array, Function, Aggregate, AggregateInst,
    26                                 Enum, EnumConstant, Symbolic, SymbolicInst, Variable, Tuple, Typeof, Builtin, Attr };
     26                                Enum, EnumConstant, Symbolic, SymbolicInst, Tuple, Typeof, Builtin };
    2727
    2828        struct Aggregate_t {
    2929                DeclarationNode::Aggregate kind;
    30                 std::string name;
     30                const std::string * name;
    3131                DeclarationNode * params;
    32                 ExpressionNode  * actuals;                                              // holds actual parameters later applied to AggInst
     32                ExpressionNode * actuals;                                               // holds actual parameters later applied to AggInst
    3333                DeclarationNode * fields;
    3434                bool body;
     
    4747
    4848        struct Enumeration_t {
    49                 std::string name;
     49                const std::string * name;
    5050                DeclarationNode * constants;
    5151        };
     
    6161
    6262        struct Symbolic_t {
    63                 std::string name;
     63                const std::string * name;
    6464                bool isTypedef;                                                                 // false => TYPEGENname, true => TYPEDEFname
    6565                DeclarationNode * params;
     
    8888                DeclarationNode * tuple;
    8989                ExpressionNode * typeexpr;
    90                 // Attr_t attr;
    9190                // DeclarationNode::BuiltinType builtin;
    9291
     
    111110TupleType * buildTuple( const TypeData * );
    112111TypeofType * buildTypeof( const TypeData * );
    113 AttrType * buildAttr( const TypeData * );
    114 Declaration * buildDecl( const TypeData *, std::string, DeclarationNode::StorageClass, Expression *, bool isInline, bool isNoreturn, LinkageSpec::Spec, Initializer * init = 0 );
     112Declaration * buildDecl( const TypeData *, const std::string &, DeclarationNode::StorageClass, Expression *, bool isInline, bool isNoreturn, LinkageSpec::Spec, Initializer * init = nullptr );
    115113FunctionType * buildFunction( const TypeData * );
    116114
  • src/Parser/parser.cc

    r7b69174 raee7e35  
    8282#include "TypeData.h"
    8383#include "LinkageSpec.h"
     84using namespace std;
    8485
    8586extern DeclarationNode * parseTree;
     
    8788extern TypedefTable typedefTable;
    8889
    89 std::stack< LinkageSpec::Spec > linkageStack;
    90 
    91 void appendStr( std::string *to, std::string *from ) {
     90stack< LinkageSpec::Spec > linkageStack;
     91
     92void appendStr( string *to, string *from ) {
    9293        // "abc" "def" "ghi" => "abcdefghi", remove new text from quotes and insert before last quote in old string.
    9394        to->insert( to->length() - 1, from->substr( 1, from->length() - 2 ) );
     
    9697
    9798/* Line 268 of yacc.c  */
    98 #line 99 "Parser/parser.cc"
     99#line 100 "Parser/parser.cc"
    99100
    100101/* Enabling traces.  */
     
    347348
    348349/* Line 293 of yacc.c  */
    349 #line 115 "parser.yy"
     350#line 116 "parser.yy"
    350351
    351352        Token tok;
     
    367368
    368369/* Line 293 of yacc.c  */
    369 #line 370 "Parser/parser.cc"
     370#line 371 "Parser/parser.cc"
    370371} YYSTYPE;
    371372# define YYSTYPE_IS_TRIVIAL 1
     
    379380
    380381/* Line 343 of yacc.c  */
    381 #line 382 "Parser/parser.cc"
     382#line 383 "Parser/parser.cc"
    382383
    383384#ifdef short
     
    10211022static const yytype_uint16 yyrline[] =
    10221023{
    1023        0,   300,   300,   304,   311,   312,   313,   317,   318,   319,
    1024      323,   324,   328,   329,   333,   334,   338,   342,   343,   354,
    1025      356,   358,   360,   365,   366,   372,   376,   378,   379,   381,
    1026      382,   384,   386,   388,   397,   398,   404,   405,   409,   410,
    1027      414,   418,   420,   422,   424,   429,   432,   434,   436,   441,
    1028      454,   456,   458,   460,   462,   464,   466,   468,   470,   472,
    1029      474,   481,   482,   488,   489,   490,   491,   495,   496,   498,
    1030      503,   504,   506,   508,   513,   514,   516,   521,   522,   524,
    1031      529,   530,   532,   534,   536,   541,   542,   544,   549,   550,
    1032      555,   556,   561,   562,   567,   568,   573,   574,   579,   580,
    1033      583,   585,   590,   595,   596,   598,   604,   605,   609,   610,
    1034      611,   612,   613,   614,   615,   616,   617,   618,   619,   620,
    1035      626,   628,   630,   632,   637,   638,   643,   644,   650,   651,
    1036      657,   658,   659,   660,   661,   662,   663,   664,   665,   675,
    1037      682,   684,   694,   695,   700,   702,   708,   710,   714,   715,
    1038      720,   725,   728,   730,   732,   742,   744,   755,   756,   758,
    1039      762,   764,   768,   769,   774,   775,   779,   784,   785,   789,
    1040      791,   797,   798,   802,   804,   806,   808,   814,   815,   819,
    1041      821,   826,   828,   830,   835,   837,   842,   844,   848,   851,
    1042      855,   858,   862,   864,   866,   868,   873,   875,   877,   882,
    1043      884,   886,   888,   890,   895,   897,   899,   901,   906,   918,
    1044      919,   924,   926,   931,   935,   937,   939,   941,   943,   949,
    1045      950,   956,   957,   961,   962,   967,   969,   975,   976,   978,
    1046      983,   988,   998,  1000,  1004,  1005,  1010,  1012,  1016,  1017,
    1047     1021,  1023,  1027,  1028,  1032,  1033,  1037,  1038,  1053,  1054,
    1048     1055,  1056,  1057,  1061,  1066,  1073,  1083,  1088,  1093,  1101,
    1049     1106,  1111,  1116,  1121,  1129,  1151,  1156,  1163,  1165,  1172,
    1050     1177,  1182,  1193,  1198,  1203,  1208,  1213,  1222,  1227,  1235,
    1051     1236,  1237,  1238,  1244,  1249,  1257,  1258,  1259,  1260,  1264,
    1052     1265,  1266,  1267,  1272,  1273,  1282,  1283,  1288,  1289,  1294,
    1053     1296,  1298,  1300,  1302,  1305,  1304,  1316,  1317,  1319,  1329,
    1054     1330,  1335,  1337,  1339,  1341,  1343,  1346,  1348,  1351,  1356,
    1055     1358,  1360,  1362,  1364,  1366,  1368,  1370,  1372,  1374,  1376,
    1056     1378,  1380,  1386,  1387,  1389,  1391,  1393,  1398,  1399,  1405,
    1057     1406,  1408,  1410,  1415,  1417,  1419,  1421,  1426,  1427,  1429,
    1058     1431,  1436,  1437,  1439,  1444,  1445,  1447,  1449,  1454,  1456,
    1059     1458,  1463,  1464,  1468,  1470,  1476,  1475,  1479,  1481,  1486,
    1060     1488,  1494,  1495,  1500,  1501,  1503,  1504,  1513,  1514,  1516,
    1061     1518,  1523,  1525,  1531,  1532,  1534,  1537,  1540,  1545,  1546,
    1062     1551,  1556,  1560,  1562,  1568,  1567,  1574,  1576,  1582,  1583,
    1063     1591,  1592,  1596,  1597,  1598,  1600,  1602,  1609,  1610,  1612,
    1064     1614,  1619,  1620,  1626,  1627,  1631,  1632,  1637,  1638,  1639,
    1065     1641,  1649,  1650,  1652,  1655,  1657,  1661,  1662,  1663,  1665,
    1066     1667,  1671,  1676,  1684,  1685,  1694,  1696,  1701,  1702,  1703,
    1067     1707,  1708,  1709,  1713,  1714,  1715,  1719,  1720,  1721,  1726,
    1068     1727,  1728,  1729,  1735,  1736,  1738,  1743,  1744,  1749,  1750,
    1069     1751,  1752,  1753,  1768,  1769,  1774,  1775,  1781,  1783,  1786,
    1070     1788,  1790,  1813,  1814,  1816,  1818,  1823,  1824,  1826,  1831,
    1071     1836,  1837,  1843,  1842,  1846,  1850,  1852,  1854,  1860,  1861,
    1072     1866,  1871,  1873,  1878,  1880,  1881,  1883,  1888,  1890,  1892,
    1073     1897,  1899,  1904,  1909,  1917,  1923,  1922,  1936,  1937,  1942,
    1074     1943,  1947,  1952,  1957,  1965,  1970,  1981,  1982,  1987,  1988,
    1075     1994,  1995,  1999,  2000,  2001,  2004,  2003,  2014,  2023,  2029,
    1076     2035,  2044,  2050,  2056,  2062,  2068,  2076,  2082,  2090,  2096,
    1077     2105,  2106,  2107,  2111,  2115,  2117,  2122,  2123,  2127,  2128,
    1078     2133,  2139,  2140,  2143,  2145,  2146,  2150,  2151,  2152,  2153,
    1079     2187,  2189,  2190,  2192,  2197,  2202,  2207,  2209,  2211,  2216,
    1080     2218,  2220,  2222,  2227,  2229,  2238,  2240,  2241,  2246,  2248,
    1081     2250,  2255,  2257,  2259,  2264,  2266,  2268,  2277,  2278,  2279,
    1082     2283,  2285,  2287,  2292,  2294,  2296,  2301,  2303,  2305,  2320,
    1083     2322,  2323,  2325,  2330,  2331,  2336,  2338,  2340,  2345,  2347,
    1084     2349,  2351,  2356,  2358,  2360,  2370,  2372,  2373,  2375,  2380,
    1085     2382,  2384,  2389,  2391,  2393,  2395,  2400,  2402,  2404,  2435,
    1086     2437,  2438,  2440,  2445,  2450,  2458,  2460,  2462,  2467,  2469,
    1087     2474,  2476,  2490,  2491,  2493,  2498,  2500,  2502,  2504,  2506,
    1088     2511,  2512,  2514,  2516,  2521,  2523,  2525,  2531,  2533,  2535,
    1089     2539,  2541,  2543,  2545,  2559,  2560,  2562,  2567,  2569,  2571,
    1090     2573,  2575,  2580,  2581,  2583,  2585,  2590,  2592,  2594,  2600,
    1091     2601,  2603,  2612,  2615,  2617,  2620,  2622,  2624,  2637,  2638,
    1092     2640,  2645,  2647,  2649,  2651,  2653,  2658,  2659,  2661,  2663,
    1093     2668,  2670,  2678,  2679,  2680,  2685,  2686,  2690,  2692,  2694,
    1094     2696,  2698,  2700,  2707,  2709,  2711,  2713,  2715,  2717,  2719,
    1095     2721,  2723,  2725,  2730,  2732,  2734,  2739,  2765,  2766,  2768,
    1096     2772,  2773,  2777,  2779,  2781,  2783,  2785,  2787,  2794,  2796,
    1097     2798,  2800,  2802,  2804,  2809,  2814,  2816,  2818,  2836,  2838,
    1098     2843,  2844
     1024       0,   301,   301,   305,   312,   313,   314,   318,   319,   320,
     1025     324,   325,   329,   330,   334,   335,   339,   343,   344,   355,
     1026     357,   359,   361,   366,   367,   373,   377,   379,   380,   382,
     1027     383,   385,   387,   389,   398,   399,   405,   406,   410,   411,
     1028     415,   419,   421,   423,   425,   430,   433,   435,   437,   442,
     1029     455,   457,   459,   461,   463,   465,   467,   469,   471,   473,
     1030     475,   482,   483,   489,   490,   491,   492,   496,   497,   499,
     1031     504,   505,   507,   509,   514,   515,   517,   522,   523,   525,
     1032     530,   531,   533,   535,   537,   542,   543,   545,   550,   551,
     1033     556,   557,   562,   563,   568,   569,   574,   575,   580,   581,
     1034     584,   586,   591,   596,   597,   599,   605,   606,   610,   611,
     1035     612,   613,   614,   615,   616,   617,   618,   619,   620,   621,
     1036     627,   629,   631,   633,   638,   639,   644,   645,   651,   652,
     1037     658,   659,   660,   661,   662,   663,   664,   665,   666,   676,
     1038     683,   685,   695,   696,   701,   703,   709,   711,   715,   716,
     1039     721,   726,   729,   731,   733,   743,   745,   756,   757,   759,
     1040     763,   765,   769,   770,   775,   776,   780,   785,   786,   790,
     1041     792,   798,   799,   803,   805,   807,   809,   815,   816,   820,
     1042     822,   827,   829,   831,   836,   838,   843,   845,   849,   852,
     1043     856,   859,   863,   865,   867,   869,   874,   876,   878,   883,
     1044     885,   887,   889,   891,   896,   898,   900,   902,   907,   919,
     1045     920,   925,   927,   932,   936,   938,   940,   942,   944,   950,
     1046     951,   957,   958,   962,   963,   968,   970,   976,   977,   979,
     1047     984,   989,   999,  1001,  1005,  1006,  1011,  1013,  1017,  1018,
     1048    1022,  1024,  1028,  1029,  1033,  1034,  1038,  1039,  1054,  1055,
     1049    1056,  1057,  1058,  1062,  1067,  1074,  1084,  1089,  1094,  1102,
     1050    1107,  1112,  1117,  1122,  1130,  1152,  1157,  1164,  1166,  1173,
     1051    1178,  1183,  1194,  1199,  1204,  1209,  1214,  1223,  1228,  1236,
     1052    1237,  1238,  1239,  1245,  1250,  1258,  1259,  1260,  1261,  1265,
     1053    1266,  1267,  1268,  1273,  1274,  1283,  1284,  1289,  1290,  1295,
     1054    1297,  1299,  1301,  1303,  1306,  1305,  1317,  1318,  1320,  1330,
     1055    1331,  1336,  1338,  1340,  1342,  1344,  1347,  1349,  1352,  1357,
     1056    1359,  1361,  1363,  1365,  1367,  1369,  1371,  1373,  1375,  1377,
     1057    1379,  1381,  1387,  1388,  1390,  1392,  1394,  1399,  1400,  1406,
     1058    1407,  1409,  1411,  1416,  1418,  1420,  1422,  1427,  1428,  1430,
     1059    1432,  1437,  1438,  1440,  1445,  1446,  1448,  1450,  1455,  1457,
     1060    1459,  1464,  1465,  1469,  1471,  1477,  1476,  1480,  1482,  1487,
     1061    1489,  1495,  1496,  1501,  1502,  1504,  1505,  1514,  1515,  1517,
     1062    1519,  1524,  1526,  1532,  1533,  1535,  1538,  1541,  1546,  1547,
     1063    1552,  1557,  1561,  1563,  1569,  1568,  1575,  1577,  1583,  1584,
     1064    1592,  1593,  1597,  1598,  1599,  1601,  1603,  1610,  1611,  1613,
     1065    1615,  1620,  1621,  1627,  1628,  1632,  1633,  1638,  1639,  1640,
     1066    1642,  1650,  1651,  1653,  1656,  1658,  1662,  1663,  1664,  1666,
     1067    1668,  1672,  1677,  1685,  1686,  1695,  1697,  1702,  1703,  1704,
     1068    1708,  1709,  1710,  1714,  1715,  1716,  1720,  1721,  1722,  1727,
     1069    1728,  1729,  1730,  1736,  1737,  1739,  1744,  1745,  1750,  1751,
     1070    1752,  1753,  1754,  1769,  1770,  1775,  1776,  1782,  1784,  1787,
     1071    1789,  1791,  1814,  1815,  1817,  1819,  1824,  1825,  1827,  1832,
     1072    1837,  1838,  1844,  1843,  1847,  1851,  1853,  1855,  1861,  1862,
     1073    1867,  1872,  1874,  1879,  1881,  1882,  1884,  1889,  1891,  1893,
     1074    1898,  1900,  1905,  1910,  1918,  1924,  1923,  1937,  1938,  1943,
     1075    1944,  1948,  1953,  1958,  1966,  1971,  1982,  1983,  1988,  1989,
     1076    1995,  1996,  2000,  2001,  2002,  2005,  2004,  2015,  2024,  2030,
     1077    2036,  2045,  2051,  2057,  2063,  2069,  2077,  2083,  2091,  2097,
     1078    2106,  2107,  2108,  2112,  2116,  2118,  2123,  2124,  2128,  2129,
     1079    2134,  2140,  2141,  2144,  2146,  2147,  2151,  2152,  2153,  2154,
     1080    2188,  2190,  2191,  2193,  2198,  2203,  2208,  2210,  2212,  2217,
     1081    2219,  2221,  2223,  2228,  2230,  2239,  2241,  2242,  2247,  2249,
     1082    2251,  2256,  2258,  2260,  2265,  2267,  2269,  2278,  2279,  2280,
     1083    2284,  2286,  2288,  2293,  2295,  2297,  2302,  2304,  2306,  2321,
     1084    2323,  2324,  2326,  2331,  2332,  2337,  2339,  2341,  2346,  2348,
     1085    2350,  2352,  2357,  2359,  2361,  2371,  2373,  2374,  2376,  2381,
     1086    2383,  2385,  2390,  2392,  2394,  2396,  2401,  2403,  2405,  2436,
     1087    2438,  2439,  2441,  2446,  2451,  2459,  2461,  2463,  2468,  2470,
     1088    2475,  2477,  2491,  2492,  2494,  2499,  2501,  2503,  2505,  2507,
     1089    2512,  2513,  2515,  2517,  2522,  2524,  2526,  2532,  2534,  2536,
     1090    2540,  2542,  2544,  2546,  2560,  2561,  2563,  2568,  2570,  2572,
     1091    2574,  2576,  2581,  2582,  2584,  2586,  2591,  2593,  2595,  2601,
     1092    2602,  2604,  2613,  2616,  2618,  2621,  2623,  2625,  2638,  2639,
     1093    2641,  2646,  2648,  2650,  2652,  2654,  2659,  2660,  2662,  2664,
     1094    2669,  2671,  2679,  2680,  2681,  2686,  2687,  2691,  2693,  2695,
     1095    2697,  2699,  2701,  2708,  2710,  2712,  2714,  2716,  2718,  2720,
     1096    2722,  2724,  2726,  2731,  2733,  2735,  2740,  2766,  2767,  2769,
     1097    2773,  2774,  2778,  2780,  2782,  2784,  2786,  2788,  2795,  2797,
     1098    2799,  2801,  2803,  2805,  2810,  2815,  2817,  2819,  2837,  2839,
     1099    2844,  2845
    10991100};
    11001101#endif
     
    49714972
    49724973/* Line 1806 of yacc.c  */
    4973 #line 300 "parser.yy"
     4974#line 301 "parser.yy"
    49744975    { typedefTable.enterScope(); }
    49754976    break;
     
    49784979
    49794980/* Line 1806 of yacc.c  */
    4980 #line 304 "parser.yy"
     4981#line 305 "parser.yy"
    49814982    { typedefTable.leaveScope(); }
    49824983    break;
     
    49854986
    49864987/* Line 1806 of yacc.c  */
    4987 #line 311 "parser.yy"
     4988#line 312 "parser.yy"
    49884989    { (yyval.en) = new ExpressionNode( build_constantInteger( *(yyvsp[(1) - (1)].tok) ) ); }
    49894990    break;
     
    49924993
    49934994/* Line 1806 of yacc.c  */
    4994 #line 312 "parser.yy"
     4995#line 313 "parser.yy"
    49954996    { (yyval.en) = new ExpressionNode( build_constantFloat( *(yyvsp[(1) - (1)].tok) ) ); }
    49964997    break;
     
    49995000
    50005001/* Line 1806 of yacc.c  */
    5001 #line 313 "parser.yy"
     5002#line 314 "parser.yy"
    50025003    { (yyval.en) = new ExpressionNode( build_constantChar( *(yyvsp[(1) - (1)].tok) ) ); }
    50035004    break;
     
    50065007
    50075008/* Line 1806 of yacc.c  */
    5008 #line 338 "parser.yy"
     5009#line 339 "parser.yy"
    50095010    { (yyval.constant) = build_constantStr( *(yyvsp[(1) - (1)].str) ); }
    50105011    break;
     
    50135014
    50145015/* Line 1806 of yacc.c  */
    5015 #line 342 "parser.yy"
     5016#line 343 "parser.yy"
    50165017    { (yyval.str) = (yyvsp[(1) - (1)].tok); }
    50175018    break;
     
    50205021
    50215022/* Line 1806 of yacc.c  */
    5022 #line 344 "parser.yy"
     5023#line 345 "parser.yy"
    50235024    {
    50245025                        appendStr( (yyvsp[(1) - (2)].str), (yyvsp[(2) - (2)].tok) );                                            // append 2nd juxtaposed string to 1st
     
    50315032
    50325033/* Line 1806 of yacc.c  */
    5033 #line 355 "parser.yy"
     5034#line 356 "parser.yy"
    50345035    { (yyval.en) = new ExpressionNode( build_varref( (yyvsp[(1) - (1)].tok) ) ); }
    50355036    break;
     
    50385039
    50395040/* Line 1806 of yacc.c  */
    5040 #line 357 "parser.yy"
     5041#line 358 "parser.yy"
    50415042    { (yyval.en) = new ExpressionNode( build_varref( (yyvsp[(1) - (1)].tok) ) ); }
    50425043    break;
     
    50455046
    50465047/* Line 1806 of yacc.c  */
    5047 #line 359 "parser.yy"
     5048#line 360 "parser.yy"
    50485049    { (yyval.en) = (yyvsp[(2) - (3)].en); }
    50495050    break;
     
    50525053
    50535054/* Line 1806 of yacc.c  */
    5054 #line 361 "parser.yy"
     5055#line 362 "parser.yy"
    50555056    { (yyval.en) = new ExpressionNode( build_valexpr( (yyvsp[(2) - (3)].sn) ) ); }
    50565057    break;
     
    50595060
    50605061/* Line 1806 of yacc.c  */
    5061 #line 371 "parser.yy"
     5062#line 372 "parser.yy"
    50625063    { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::Index, (yyvsp[(1) - (6)].en), (yyvsp[(4) - (6)].en) ) ); }
    50635064    break;
     
    50665067
    50675068/* Line 1806 of yacc.c  */
    5068 #line 373 "parser.yy"
     5069#line 374 "parser.yy"
    50695070    { (yyval.en) = new ExpressionNode( build_func( (yyvsp[(1) - (4)].en), (yyvsp[(3) - (4)].en) ) ); }
    50705071    break;
     
    50735074
    50745075/* Line 1806 of yacc.c  */
    5075 #line 377 "parser.yy"
     5076#line 378 "parser.yy"
    50765077    { (yyval.en) = new ExpressionNode( build_fieldSel( (yyvsp[(1) - (3)].en), build_varref( (yyvsp[(3) - (3)].tok) ) ) ); }
    50775078    break;
     
    50805081
    50815082/* Line 1806 of yacc.c  */
    5082 #line 380 "parser.yy"
     5083#line 381 "parser.yy"
    50835084    { (yyval.en) = new ExpressionNode( build_pfieldSel( (yyvsp[(1) - (3)].en), build_varref( (yyvsp[(3) - (3)].tok) ) ) ); }
    50845085    break;
     
    50875088
    50885089/* Line 1806 of yacc.c  */
    5089 #line 383 "parser.yy"
     5090#line 384 "parser.yy"
    50905091    { (yyval.en) = new ExpressionNode( build_unary_ptr( OperKinds::IncrPost, (yyvsp[(1) - (2)].en) ) ); }
    50915092    break;
     
    50945095
    50955096/* Line 1806 of yacc.c  */
    5096 #line 385 "parser.yy"
     5097#line 386 "parser.yy"
    50975098    { (yyval.en) = new ExpressionNode( build_unary_ptr( OperKinds::DecrPost, (yyvsp[(1) - (2)].en) ) ); }
    50985099    break;
     
    51015102
    51025103/* Line 1806 of yacc.c  */
    5103 #line 387 "parser.yy"
     5104#line 388 "parser.yy"
    51045105    { (yyval.en) = new ExpressionNode( build_compoundLiteral( (yyvsp[(2) - (7)].decl), new InitializerNode( (yyvsp[(5) - (7)].in), true ) ) ); }
    51055106    break;
     
    51085109
    51095110/* Line 1806 of yacc.c  */
    5110 #line 389 "parser.yy"
     5111#line 390 "parser.yy"
    51115112    {
    51125113                        Token fn;
    5113                         fn.str = new std::string( "?{}" ); // location undefined - use location of '{'?
     5114                        fn.str = new std::string( "?{}" );                      // location undefined - use location of '{'?
    51145115                        (yyval.en) = new ExpressionNode( new ConstructorExpr( build_func( new ExpressionNode( build_varref( fn ) ), (ExpressionNode *)( (yyvsp[(1) - (4)].en) )->set_last( (yyvsp[(3) - (4)].en) ) ) ) );
    51155116                }
     
    51195120
    51205121/* Line 1806 of yacc.c  */
    5121 #line 399 "parser.yy"
     5122#line 400 "parser.yy"
    51225123    { (yyval.en) = (ExpressionNode *)( (yyvsp[(1) - (3)].en)->set_last( (yyvsp[(3) - (3)].en) )); }
    51235124    break;
     
    51265127
    51275128/* Line 1806 of yacc.c  */
    5128 #line 404 "parser.yy"
     5129#line 405 "parser.yy"
    51295130    { (yyval.en) = 0; }
    51305131    break;
     
    51335134
    51345135/* Line 1806 of yacc.c  */
    5135 #line 410 "parser.yy"
     5136#line 411 "parser.yy"
    51365137    { (yyval.en) = (ExpressionNode *)(yyvsp[(1) - (3)].en)->set_last( (yyvsp[(3) - (3)].en) ); }
    51375138    break;
     
    51405141
    51415142/* Line 1806 of yacc.c  */
    5142 #line 415 "parser.yy"
     5143#line 416 "parser.yy"
    51435144    { (yyval.en) = new ExpressionNode( build_varref( (yyvsp[(1) - (1)].tok) ) ); }
    51445145    break;
     
    51475148
    51485149/* Line 1806 of yacc.c  */
    5149 #line 419 "parser.yy"
     5150#line 420 "parser.yy"
    51505151    { (yyval.en) = new ExpressionNode( build_fieldSel( (yyvsp[(3) - (3)].en), build_varref( (yyvsp[(1) - (3)].tok) ) ) ); }
    51515152    break;
     
    51545155
    51555156/* Line 1806 of yacc.c  */
    5156 #line 421 "parser.yy"
     5157#line 422 "parser.yy"
    51575158    { (yyval.en) = new ExpressionNode( build_fieldSel( (yyvsp[(5) - (7)].en), build_varref( (yyvsp[(1) - (7)].tok) ) ) ); }
    51585159    break;
     
    51615162
    51625163/* Line 1806 of yacc.c  */
    5163 #line 423 "parser.yy"
     5164#line 424 "parser.yy"
    51645165    { (yyval.en) = new ExpressionNode( build_pfieldSel( (yyvsp[(3) - (3)].en), build_varref( (yyvsp[(1) - (3)].tok) ) ) ); }
    51655166    break;
     
    51685169
    51695170/* Line 1806 of yacc.c  */
    5170 #line 425 "parser.yy"
     5171#line 426 "parser.yy"
    51715172    { (yyval.en) = new ExpressionNode( build_pfieldSel( (yyvsp[(5) - (7)].en), build_varref( (yyvsp[(1) - (7)].tok) ) ) ); }
    51725173    break;
     
    51755176
    51765177/* Line 1806 of yacc.c  */
    5177 #line 433 "parser.yy"
     5178#line 434 "parser.yy"
    51785179    { (yyval.en) = (yyvsp[(1) - (1)].en); }
    51795180    break;
     
    51825183
    51835184/* Line 1806 of yacc.c  */
    5184 #line 435 "parser.yy"
     5185#line 436 "parser.yy"
    51855186    { (yyval.en) = new ExpressionNode( (yyvsp[(1) - (1)].constant) ); }
    51865187    break;
     
    51895190
    51905191/* Line 1806 of yacc.c  */
    5191 #line 437 "parser.yy"
     5192#line 438 "parser.yy"
    51925193    { (yyval.en) = (yyvsp[(2) - (2)].en)->set_extension( true ); }
    51935194    break;
     
    51965197
    51975198/* Line 1806 of yacc.c  */
    5198 #line 442 "parser.yy"
     5199#line 443 "parser.yy"
    51995200    {
    52005201                        switch ( (yyvsp[(1) - (2)].op) ) {
     
    52145215
    52155216/* Line 1806 of yacc.c  */
    5216 #line 455 "parser.yy"
     5217#line 456 "parser.yy"
    52175218    { (yyval.en) = new ExpressionNode( build_unary_val( (yyvsp[(1) - (2)].op), (yyvsp[(2) - (2)].en) ) ); }
    52185219    break;
     
    52215222
    52225223/* Line 1806 of yacc.c  */
    5223 #line 457 "parser.yy"
     5224#line 458 "parser.yy"
    52245225    { (yyval.en) = new ExpressionNode( build_unary_ptr( OperKinds::Incr, (yyvsp[(2) - (2)].en) ) ); }
    52255226    break;
     
    52285229
    52295230/* Line 1806 of yacc.c  */
    5230 #line 459 "parser.yy"
     5231#line 460 "parser.yy"
    52315232    { (yyval.en) = new ExpressionNode( build_unary_ptr( OperKinds::Decr, (yyvsp[(2) - (2)].en) ) ); }
    52325233    break;
     
    52355236
    52365237/* Line 1806 of yacc.c  */
    5237 #line 461 "parser.yy"
     5238#line 462 "parser.yy"
    52385239    { (yyval.en) = new ExpressionNode( build_sizeOfexpr( (yyvsp[(2) - (2)].en) ) ); }
    52395240    break;
     
    52425243
    52435244/* Line 1806 of yacc.c  */
    5244 #line 463 "parser.yy"
     5245#line 464 "parser.yy"
    52455246    { (yyval.en) = new ExpressionNode( build_sizeOftype( (yyvsp[(3) - (4)].decl) ) ); }
    52465247    break;
     
    52495250
    52505251/* Line 1806 of yacc.c  */
    5251 #line 465 "parser.yy"
     5252#line 466 "parser.yy"
    52525253    { (yyval.en) = new ExpressionNode( build_alignOfexpr( (yyvsp[(2) - (2)].en) ) ); }
    52535254    break;
     
    52565257
    52575258/* Line 1806 of yacc.c  */
    5258 #line 467 "parser.yy"
     5259#line 468 "parser.yy"
    52595260    { (yyval.en) = new ExpressionNode( build_alignOftype( (yyvsp[(3) - (4)].decl) ) ); }
    52605261    break;
     
    52635264
    52645265/* Line 1806 of yacc.c  */
    5265 #line 469 "parser.yy"
     5266#line 470 "parser.yy"
    52665267    { (yyval.en) = new ExpressionNode( build_offsetOf( (yyvsp[(3) - (6)].decl), build_varref( (yyvsp[(5) - (6)].tok) ) ) ); }
    52675268    break;
     
    52705271
    52715272/* Line 1806 of yacc.c  */
    5272 #line 471 "parser.yy"
     5273#line 472 "parser.yy"
    52735274    { (yyval.en) = new ExpressionNode( build_attrexpr( build_varref( (yyvsp[(1) - (1)].tok) ), nullptr ) ); }
    52745275    break;
     
    52775278
    52785279/* Line 1806 of yacc.c  */
    5279 #line 473 "parser.yy"
     5280#line 474 "parser.yy"
    52805281    { (yyval.en) = new ExpressionNode( build_attrexpr( build_varref( (yyvsp[(1) - (4)].tok) ), (yyvsp[(3) - (4)].en) ) ); }
    52815282    break;
     
    52845285
    52855286/* Line 1806 of yacc.c  */
    5286 #line 475 "parser.yy"
     5287#line 476 "parser.yy"
    52875288    { (yyval.en) = new ExpressionNode( build_attrtype( build_varref( (yyvsp[(1) - (4)].tok) ), (yyvsp[(3) - (4)].decl) ) ); }
    52885289    break;
     
    52915292
    52925293/* Line 1806 of yacc.c  */
    5293 #line 481 "parser.yy"
     5294#line 482 "parser.yy"
    52945295    { (yyval.op) = OperKinds::PointTo; }
    52955296    break;
     
    52985299
    52995300/* Line 1806 of yacc.c  */
    5300 #line 482 "parser.yy"
     5301#line 483 "parser.yy"
    53015302    { (yyval.op) = OperKinds::AddressOf; }
    53025303    break;
     
    53055306
    53065307/* Line 1806 of yacc.c  */
    5307 #line 488 "parser.yy"
     5308#line 489 "parser.yy"
    53085309    { (yyval.op) = OperKinds::UnPlus; }
    53095310    break;
     
    53125313
    53135314/* Line 1806 of yacc.c  */
    5314 #line 489 "parser.yy"
     5315#line 490 "parser.yy"
    53155316    { (yyval.op) = OperKinds::UnMinus; }
    53165317    break;
     
    53195320
    53205321/* Line 1806 of yacc.c  */
    5321 #line 490 "parser.yy"
     5322#line 491 "parser.yy"
    53225323    { (yyval.op) = OperKinds::Neg; }
    53235324    break;
     
    53265327
    53275328/* Line 1806 of yacc.c  */
    5328 #line 491 "parser.yy"
     5329#line 492 "parser.yy"
    53295330    { (yyval.op) = OperKinds::BitNeg; }
    53305331    break;
     
    53335334
    53345335/* Line 1806 of yacc.c  */
    5335 #line 497 "parser.yy"
     5336#line 498 "parser.yy"
    53365337    { (yyval.en) = new ExpressionNode( build_cast( (yyvsp[(2) - (4)].decl), (yyvsp[(4) - (4)].en) ) ); }
    53375338    break;
     
    53405341
    53415342/* Line 1806 of yacc.c  */
    5342 #line 499 "parser.yy"
     5343#line 500 "parser.yy"
    53435344    { (yyval.en) = new ExpressionNode( build_cast( (yyvsp[(2) - (4)].decl), (yyvsp[(4) - (4)].en) ) ); }
    53445345    break;
     
    53475348
    53485349/* Line 1806 of yacc.c  */
    5349 #line 505 "parser.yy"
     5350#line 506 "parser.yy"
    53505351    { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::Mul, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
    53515352    break;
     
    53545355
    53555356/* Line 1806 of yacc.c  */
    5356 #line 507 "parser.yy"
     5357#line 508 "parser.yy"
    53575358    { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::Div, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
    53585359    break;
     
    53615362
    53625363/* Line 1806 of yacc.c  */
    5363 #line 509 "parser.yy"
     5364#line 510 "parser.yy"
    53645365    { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::Mod, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
    53655366    break;
     
    53685369
    53695370/* Line 1806 of yacc.c  */
    5370 #line 515 "parser.yy"
     5371#line 516 "parser.yy"
    53715372    { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::Plus, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
    53725373    break;
     
    53755376
    53765377/* Line 1806 of yacc.c  */
    5377 #line 517 "parser.yy"
     5378#line 518 "parser.yy"
    53785379    { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::Minus, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
    53795380    break;
     
    53825383
    53835384/* Line 1806 of yacc.c  */
    5384 #line 523 "parser.yy"
     5385#line 524 "parser.yy"
    53855386    { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::LShift, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
    53865387    break;
     
    53895390
    53905391/* Line 1806 of yacc.c  */
    5391 #line 525 "parser.yy"
     5392#line 526 "parser.yy"
    53925393    { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::RShift, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
    53935394    break;
     
    53965397
    53975398/* Line 1806 of yacc.c  */
    5398 #line 531 "parser.yy"
     5399#line 532 "parser.yy"
    53995400    { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::LThan, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
    54005401    break;
     
    54035404
    54045405/* Line 1806 of yacc.c  */
    5405 #line 533 "parser.yy"
     5406#line 534 "parser.yy"
    54065407    { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::GThan, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
    54075408    break;
     
    54105411
    54115412/* Line 1806 of yacc.c  */
    5412 #line 535 "parser.yy"
     5413#line 536 "parser.yy"
    54135414    { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::LEThan, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
    54145415    break;
     
    54175418
    54185419/* Line 1806 of yacc.c  */
    5419 #line 537 "parser.yy"
     5420#line 538 "parser.yy"
    54205421    { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::GEThan, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
    54215422    break;
     
    54245425
    54255426/* Line 1806 of yacc.c  */
    5426 #line 543 "parser.yy"
     5427#line 544 "parser.yy"
    54275428    { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::Eq, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
    54285429    break;
     
    54315432
    54325433/* Line 1806 of yacc.c  */
    5433 #line 545 "parser.yy"
     5434#line 546 "parser.yy"
    54345435    { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::Neq, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
    54355436    break;
     
    54385439
    54395440/* Line 1806 of yacc.c  */
    5440 #line 551 "parser.yy"
     5441#line 552 "parser.yy"
    54415442    { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::BitAnd, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
    54425443    break;
     
    54455446
    54465447/* Line 1806 of yacc.c  */
    5447 #line 557 "parser.yy"
     5448#line 558 "parser.yy"
    54485449    { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::Xor, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
    54495450    break;
     
    54525453
    54535454/* Line 1806 of yacc.c  */
    5454 #line 563 "parser.yy"
     5455#line 564 "parser.yy"
    54555456    { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::BitOr, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
    54565457    break;
     
    54595460
    54605461/* Line 1806 of yacc.c  */
    5461 #line 569 "parser.yy"
     5462#line 570 "parser.yy"
    54625463    { (yyval.en) = new ExpressionNode( build_and_or( (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en), true ) ); }
    54635464    break;
     
    54665467
    54675468/* Line 1806 of yacc.c  */
    5468 #line 575 "parser.yy"
     5469#line 576 "parser.yy"
    54695470    { (yyval.en) = new ExpressionNode( build_and_or( (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en), false ) ); }
    54705471    break;
     
    54735474
    54745475/* Line 1806 of yacc.c  */
    5475 #line 581 "parser.yy"
     5476#line 582 "parser.yy"
    54765477    { (yyval.en) = new ExpressionNode( build_cond( (yyvsp[(1) - (5)].en), (yyvsp[(3) - (5)].en), (yyvsp[(5) - (5)].en) ) ); }
    54775478    break;
     
    54805481
    54815482/* Line 1806 of yacc.c  */
    5482 #line 584 "parser.yy"
     5483#line 585 "parser.yy"
    54835484    { (yyval.en) = new ExpressionNode( build_cond( (yyvsp[(1) - (4)].en), (yyvsp[(1) - (4)].en), (yyvsp[(4) - (4)].en) ) ); }
    54845485    break;
     
    54875488
    54885489/* Line 1806 of yacc.c  */
    5489 #line 586 "parser.yy"
     5490#line 587 "parser.yy"
    54905491    { (yyval.en) = new ExpressionNode( build_cond( (yyvsp[(1) - (5)].en), (yyvsp[(3) - (5)].en), (yyvsp[(5) - (5)].en) ) ); }
    54915492    break;
     
    54945495
    54955496/* Line 1806 of yacc.c  */
    5496 #line 597 "parser.yy"
     5497#line 598 "parser.yy"
    54975498    { (yyval.en) = new ExpressionNode( build_binary_ptr( (yyvsp[(2) - (3)].op), (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
    54985499    break;
     
    55015502
    55025503/* Line 1806 of yacc.c  */
    5503 #line 599 "parser.yy"
     5504#line 600 "parser.yy"
    55045505    { (yyval.en) = ( (yyvsp[(2) - (2)].en) == 0 ) ? (yyvsp[(1) - (2)].en) : new ExpressionNode( build_binary_ptr( OperKinds::Assign, (yyvsp[(1) - (2)].en), (yyvsp[(2) - (2)].en) ) ); }
    55055506    break;
     
    55085509
    55095510/* Line 1806 of yacc.c  */
    5510 #line 604 "parser.yy"
     5511#line 605 "parser.yy"
    55115512    { (yyval.en) = nullptr; }
    55125513    break;
     
    55155516
    55165517/* Line 1806 of yacc.c  */
    5517 #line 609 "parser.yy"
     5518#line 610 "parser.yy"
    55185519    { (yyval.op) = OperKinds::Assign; }
    55195520    break;
     
    55225523
    55235524/* Line 1806 of yacc.c  */
    5524 #line 610 "parser.yy"
     5525#line 611 "parser.yy"
    55255526    { (yyval.op) = OperKinds::AtAssn; }
    55265527    break;
     
    55295530
    55305531/* Line 1806 of yacc.c  */
    5531 #line 611 "parser.yy"
     5532#line 612 "parser.yy"
    55325533    { (yyval.op) = OperKinds::MulAssn; }
    55335534    break;
     
    55365537
    55375538/* Line 1806 of yacc.c  */
    5538 #line 612 "parser.yy"
     5539#line 613 "parser.yy"
    55395540    { (yyval.op) = OperKinds::DivAssn; }
    55405541    break;
     
    55435544
    55445545/* Line 1806 of yacc.c  */
    5545 #line 613 "parser.yy"
     5546#line 614 "parser.yy"
    55465547    { (yyval.op) = OperKinds::ModAssn; }
    55475548    break;
     
    55505551
    55515552/* Line 1806 of yacc.c  */
    5552 #line 614 "parser.yy"
     5553#line 615 "parser.yy"
    55535554    { (yyval.op) = OperKinds::PlusAssn; }
    55545555    break;
     
    55575558
    55585559/* Line 1806 of yacc.c  */
    5559 #line 615 "parser.yy"
     5560#line 616 "parser.yy"
    55605561    { (yyval.op) = OperKinds::MinusAssn; }
    55615562    break;
     
    55645565
    55655566/* Line 1806 of yacc.c  */
    5566 #line 616 "parser.yy"
     5567#line 617 "parser.yy"
    55675568    { (yyval.op) = OperKinds::LSAssn; }
    55685569    break;
     
    55715572
    55725573/* Line 1806 of yacc.c  */
    5573 #line 617 "parser.yy"
     5574#line 618 "parser.yy"
    55745575    { (yyval.op) = OperKinds::RSAssn; }
    55755576    break;
     
    55785579
    55795580/* Line 1806 of yacc.c  */
    5580 #line 618 "parser.yy"
     5581#line 619 "parser.yy"
    55815582    { (yyval.op) = OperKinds::AndAssn; }
    55825583    break;
     
    55855586
    55865587/* Line 1806 of yacc.c  */
    5587 #line 619 "parser.yy"
     5588#line 620 "parser.yy"
    55885589    { (yyval.op) = OperKinds::ERAssn; }
    55895590    break;
     
    55925593
    55935594/* Line 1806 of yacc.c  */
    5594 #line 620 "parser.yy"
     5595#line 621 "parser.yy"
    55955596    { (yyval.op) = OperKinds::OrAssn; }
    55965597    break;
     
    55995600
    56005601/* Line 1806 of yacc.c  */
    5601 #line 627 "parser.yy"
     5602#line 628 "parser.yy"
    56025603    { (yyval.en) = new ExpressionNode( build_tuple() ); }
    56035604    break;
     
    56065607
    56075608/* Line 1806 of yacc.c  */
    5608 #line 629 "parser.yy"
     5609#line 630 "parser.yy"
    56095610    { (yyval.en) = new ExpressionNode( build_tuple( (yyvsp[(3) - (5)].en) ) ); }
    56105611    break;
     
    56135614
    56145615/* Line 1806 of yacc.c  */
    5615 #line 631 "parser.yy"
     5616#line 632 "parser.yy"
    56165617    { (yyval.en) = new ExpressionNode( build_tuple( (ExpressionNode *)(new ExpressionNode( nullptr ) )->set_last( (yyvsp[(4) - (6)].en) ) ) ); }
    56175618    break;
     
    56205621
    56215622/* Line 1806 of yacc.c  */
    5622 #line 633 "parser.yy"
     5623#line 634 "parser.yy"
    56235624    { (yyval.en) = new ExpressionNode( build_tuple( (ExpressionNode *)(yyvsp[(3) - (7)].en)->set_last( (yyvsp[(5) - (7)].en) ) ) ); }
    56245625    break;
     
    56275628
    56285629/* Line 1806 of yacc.c  */
    5629 #line 639 "parser.yy"
     5630#line 640 "parser.yy"
    56305631    { (yyval.en) = (ExpressionNode *)(yyvsp[(1) - (3)].en)->set_last( (yyvsp[(3) - (3)].en) ); }
    56315632    break;
     
    56345635
    56355636/* Line 1806 of yacc.c  */
    5636 #line 645 "parser.yy"
     5637#line 646 "parser.yy"
    56375638    { (yyval.en) = new ExpressionNode( build_comma( (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
    56385639    break;
     
    56415642
    56425643/* Line 1806 of yacc.c  */
    5643 #line 650 "parser.yy"
     5644#line 651 "parser.yy"
    56445645    { (yyval.en) = 0; }
    56455646    break;
     
    56485649
    56495650/* Line 1806 of yacc.c  */
    5650 #line 659 "parser.yy"
     5651#line 660 "parser.yy"
    56515652    { (yyval.sn) = (yyvsp[(1) - (1)].sn); }
    56525653    break;
     
    56555656
    56565657/* Line 1806 of yacc.c  */
    5657 #line 666 "parser.yy"
     5658#line 667 "parser.yy"
    56585659    {
    56595660                        Token fn;
    5660                         fn.str = new std::string( "^?{}" ); // location undefined
     5661                        fn.str = new string( "^?{}" );                          // location undefined
    56615662                        (yyval.sn) = new StatementNode( build_expr( new ExpressionNode( build_func( new ExpressionNode( build_varref( fn ) ), (ExpressionNode *)( (yyvsp[(2) - (6)].en) )->set_last( (yyvsp[(4) - (6)].en) ) ) ) ) );
    56625663                }
     
    56665667
    56675668/* Line 1806 of yacc.c  */
    5668 #line 676 "parser.yy"
     5669#line 677 "parser.yy"
    56695670    {
    56705671                        (yyval.sn) = (yyvsp[(4) - (4)].sn)->add_label( (yyvsp[(1) - (4)].tok) );
     
    56755676
    56765677/* Line 1806 of yacc.c  */
    5677 #line 683 "parser.yy"
     5678#line 684 "parser.yy"
    56785679    { (yyval.sn) = new StatementNode( build_compound( (StatementNode *)0 ) ); }
    56795680    break;
     
    56825683
    56835684/* Line 1806 of yacc.c  */
    5684 #line 690 "parser.yy"
     5685#line 691 "parser.yy"
    56855686    { (yyval.sn) = new StatementNode( build_compound( (yyvsp[(5) - (7)].sn) ) ); }
    56865687    break;
     
    56895690
    56905691/* Line 1806 of yacc.c  */
    5691 #line 696 "parser.yy"
     5692#line 697 "parser.yy"
    56925693    { if ( (yyvsp[(1) - (3)].sn) != 0 ) { (yyvsp[(1) - (3)].sn)->set_last( (yyvsp[(3) - (3)].sn) ); (yyval.sn) = (yyvsp[(1) - (3)].sn); } }
    56935694    break;
     
    56965697
    56975698/* Line 1806 of yacc.c  */
    5698 #line 701 "parser.yy"
     5699#line 702 "parser.yy"
    56995700    { (yyval.sn) = new StatementNode( (yyvsp[(1) - (1)].decl) ); }
    57005701    break;
     
    57035704
    57045705/* Line 1806 of yacc.c  */
    5705 #line 703 "parser.yy"
     5706#line 704 "parser.yy"
    57065707    {   // mark all fields in list
    57075708                        for ( DeclarationNode *iter = (yyvsp[(2) - (2)].decl); iter != nullptr; iter = (DeclarationNode *)iter->get_next() )
     
    57145715
    57155716/* Line 1806 of yacc.c  */
    5716 #line 709 "parser.yy"
     5717#line 710 "parser.yy"
    57175718    { (yyval.sn) = new StatementNode( (yyvsp[(1) - (1)].decl) ); }
    57185719    break;
     
    57215722
    57225723/* Line 1806 of yacc.c  */
    5723 #line 716 "parser.yy"
     5724#line 717 "parser.yy"
    57245725    { if ( (yyvsp[(1) - (2)].sn) != 0 ) { (yyvsp[(1) - (2)].sn)->set_last( (yyvsp[(2) - (2)].sn) ); (yyval.sn) = (yyvsp[(1) - (2)].sn); } }
    57255726    break;
     
    57285729
    57295730/* Line 1806 of yacc.c  */
    5730 #line 721 "parser.yy"
     5731#line 722 "parser.yy"
    57315732    { (yyval.sn) = new StatementNode( build_expr( (yyvsp[(1) - (2)].en) ) ); }
    57325733    break;
     
    57355736
    57365737/* Line 1806 of yacc.c  */
    5737 #line 727 "parser.yy"
     5738#line 728 "parser.yy"
    57385739    { (yyval.sn) = new StatementNode( build_if( (yyvsp[(3) - (5)].en), (yyvsp[(5) - (5)].sn), nullptr ) ); }
    57395740    break;
     
    57425743
    57435744/* Line 1806 of yacc.c  */
    5744 #line 729 "parser.yy"
     5745#line 730 "parser.yy"
    57455746    { (yyval.sn) = new StatementNode( build_if( (yyvsp[(3) - (7)].en), (yyvsp[(5) - (7)].sn), (yyvsp[(7) - (7)].sn) ) ); }
    57465747    break;
     
    57495750
    57505751/* Line 1806 of yacc.c  */
    5751 #line 731 "parser.yy"
     5752#line 732 "parser.yy"
    57525753    { (yyval.sn) = new StatementNode( build_switch( (yyvsp[(3) - (5)].en), (yyvsp[(5) - (5)].sn) ) ); }
    57535754    break;
     
    57565757
    57575758/* Line 1806 of yacc.c  */
    5758 #line 733 "parser.yy"
     5759#line 734 "parser.yy"
    57595760    {
    57605761                        StatementNode *sw = new StatementNode( build_switch( (yyvsp[(3) - (9)].en), (yyvsp[(8) - (9)].sn) ) );
     
    57715772
    57725773/* Line 1806 of yacc.c  */
    5773 #line 743 "parser.yy"
     5774#line 744 "parser.yy"
    57745775    { (yyval.sn) = new StatementNode( build_switch( (yyvsp[(3) - (5)].en), (yyvsp[(5) - (5)].sn) ) ); }
    57755776    break;
     
    57785779
    57795780/* Line 1806 of yacc.c  */
    5780 #line 745 "parser.yy"
     5781#line 746 "parser.yy"
    57815782    {
    57825783                        StatementNode *sw = new StatementNode( build_switch( (yyvsp[(3) - (9)].en), (yyvsp[(8) - (9)].sn) ) );
     
    57885789
    57895790/* Line 1806 of yacc.c  */
    5790 #line 755 "parser.yy"
     5791#line 756 "parser.yy"
    57915792    { (yyval.en) = (yyvsp[(1) - (1)].en); }
    57925793    break;
     
    57955796
    57965797/* Line 1806 of yacc.c  */
    5797 #line 757 "parser.yy"
     5798#line 758 "parser.yy"
    57985799    { (yyval.en) = new ExpressionNode( build_range( (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
    57995800    break;
     
    58025803
    58035804/* Line 1806 of yacc.c  */
    5804 #line 762 "parser.yy"
     5805#line 763 "parser.yy"
    58055806    { (yyval.sn) = new StatementNode( build_case( (yyvsp[(1) - (1)].en) ) ); }
    58065807    break;
     
    58095810
    58105811/* Line 1806 of yacc.c  */
    5811 #line 764 "parser.yy"
     5812#line 765 "parser.yy"
    58125813    { (yyval.sn) = (StatementNode *)((yyvsp[(1) - (3)].sn)->set_last( new StatementNode( build_case( (yyvsp[(3) - (3)].en) ) ) ) ); }
    58135814    break;
     
    58165817
    58175818/* Line 1806 of yacc.c  */
    5818 #line 768 "parser.yy"
     5819#line 769 "parser.yy"
    58195820    { (yyval.sn) = (yyvsp[(2) - (3)].sn); }
    58205821    break;
     
    58235824
    58245825/* Line 1806 of yacc.c  */
    5825 #line 769 "parser.yy"
     5826#line 770 "parser.yy"
    58265827    { (yyval.sn) = new StatementNode( build_default() ); }
    58275828    break;
     
    58305831
    58315832/* Line 1806 of yacc.c  */
    5832 #line 775 "parser.yy"
     5833#line 776 "parser.yy"
    58335834    { (yyval.sn) = (StatementNode *)( (yyvsp[(1) - (2)].sn)->set_last( (yyvsp[(2) - (2)].sn) )); }
    58345835    break;
     
    58375838
    58385839/* Line 1806 of yacc.c  */
    5839 #line 779 "parser.yy"
     5840#line 780 "parser.yy"
    58405841    { (yyval.sn) = (yyvsp[(1) - (2)].sn)->append_last_case( new StatementNode( build_compound( (yyvsp[(2) - (2)].sn) ) ) ); }
    58415842    break;
     
    58445845
    58455846/* Line 1806 of yacc.c  */
    5846 #line 784 "parser.yy"
     5847#line 785 "parser.yy"
    58475848    { (yyval.sn) = 0; }
    58485849    break;
     
    58515852
    58525853/* Line 1806 of yacc.c  */
    5853 #line 790 "parser.yy"
     5854#line 791 "parser.yy"
    58545855    { (yyval.sn) = (yyvsp[(1) - (2)].sn)->append_last_case( new StatementNode( build_compound( (yyvsp[(2) - (2)].sn) ) ) ); }
    58555856    break;
     
    58585859
    58595860/* Line 1806 of yacc.c  */
    5860 #line 792 "parser.yy"
     5861#line 793 "parser.yy"
    58615862    { (yyval.sn) = (StatementNode *)( (yyvsp[(1) - (3)].sn)->set_last( (yyvsp[(2) - (3)].sn)->append_last_case( new StatementNode( build_compound( (yyvsp[(3) - (3)].sn) ) ) ) ) ); }
    58625863    break;
     
    58655866
    58665867/* Line 1806 of yacc.c  */
    5867 #line 797 "parser.yy"
     5868#line 798 "parser.yy"
    58685869    { (yyval.sn) = 0; }
    58695870    break;
     
    58725873
    58735874/* Line 1806 of yacc.c  */
    5874 #line 803 "parser.yy"
     5875#line 804 "parser.yy"
    58755876    { (yyval.sn) = (yyvsp[(1) - (2)].sn)->append_last_case( (yyvsp[(2) - (2)].sn) ); }
    58765877    break;
     
    58795880
    58805881/* Line 1806 of yacc.c  */
    5881 #line 805 "parser.yy"
     5882#line 806 "parser.yy"
    58825883    { (yyval.sn) = (yyvsp[(1) - (3)].sn)->append_last_case( new StatementNode( build_compound( (StatementNode *)(yyvsp[(2) - (3)].sn)->set_last( (yyvsp[(3) - (3)].sn) ) ) ) ); }
    58835884    break;
     
    58865887
    58875888/* Line 1806 of yacc.c  */
    5888 #line 807 "parser.yy"
     5889#line 808 "parser.yy"
    58895890    { (yyval.sn) = (StatementNode *)( (yyvsp[(1) - (3)].sn)->set_last( (yyvsp[(2) - (3)].sn)->append_last_case( (yyvsp[(3) - (3)].sn) ))); }
    58905891    break;
     
    58935894
    58945895/* Line 1806 of yacc.c  */
    5895 #line 809 "parser.yy"
     5896#line 810 "parser.yy"
    58965897    { (yyval.sn) = (StatementNode *)( (yyvsp[(1) - (4)].sn)->set_last( (yyvsp[(2) - (4)].sn)->append_last_case( new StatementNode( build_compound( (StatementNode *)(yyvsp[(3) - (4)].sn)->set_last( (yyvsp[(4) - (4)].sn) ) ) ) ) ) ); }
    58975898    break;
     
    59005901
    59015902/* Line 1806 of yacc.c  */
    5902 #line 814 "parser.yy"
     5903#line 815 "parser.yy"
    59035904    { (yyval.sn) = new StatementNode( build_branch( BranchStmt::Break ) ); }
    59045905    break;
     
    59075908
    59085909/* Line 1806 of yacc.c  */
    5909 #line 820 "parser.yy"
     5910#line 821 "parser.yy"
    59105911    { (yyval.sn) = 0; }
    59115912    break;
     
    59145915
    59155916/* Line 1806 of yacc.c  */
    5916 #line 822 "parser.yy"
     5917#line 823 "parser.yy"
    59175918    { (yyval.sn) = 0; }
    59185919    break;
     
    59215922
    59225923/* Line 1806 of yacc.c  */
    5923 #line 827 "parser.yy"
     5924#line 828 "parser.yy"
    59245925    { (yyval.sn) = new StatementNode( build_while( (yyvsp[(3) - (5)].en), (yyvsp[(5) - (5)].sn) ) ); }
    59255926    break;
     
    59285929
    59295930/* Line 1806 of yacc.c  */
    5930 #line 829 "parser.yy"
     5931#line 830 "parser.yy"
    59315932    { (yyval.sn) = new StatementNode( build_while( (yyvsp[(5) - (7)].en), (yyvsp[(2) - (7)].sn), true ) ); }
    59325933    break;
     
    59355936
    59365937/* Line 1806 of yacc.c  */
    5937 #line 831 "parser.yy"
     5938#line 832 "parser.yy"
    59385939    { (yyval.sn) = new StatementNode( build_for( (yyvsp[(4) - (6)].fctl), (yyvsp[(6) - (6)].sn) ) ); }
    59395940    break;
     
    59425943
    59435944/* Line 1806 of yacc.c  */
    5944 #line 836 "parser.yy"
     5945#line 837 "parser.yy"
    59455946    { (yyval.fctl) = new ForCtl( (yyvsp[(1) - (6)].en), (yyvsp[(4) - (6)].en), (yyvsp[(6) - (6)].en) ); }
    59465947    break;
     
    59495950
    59505951/* Line 1806 of yacc.c  */
    5951 #line 838 "parser.yy"
     5952#line 839 "parser.yy"
    59525953    { (yyval.fctl) = new ForCtl( (yyvsp[(1) - (4)].decl), (yyvsp[(2) - (4)].en), (yyvsp[(4) - (4)].en) ); }
    59535954    break;
     
    59565957
    59575958/* Line 1806 of yacc.c  */
    5958 #line 843 "parser.yy"
     5959#line 844 "parser.yy"
    59595960    { (yyval.sn) = new StatementNode( build_branch( (yyvsp[(2) - (3)].tok), BranchStmt::Goto ) ); }
    59605961    break;
     
    59635964
    59645965/* Line 1806 of yacc.c  */
    5965 #line 847 "parser.yy"
     5966#line 848 "parser.yy"
    59665967    { (yyval.sn) = new StatementNode( build_computedgoto( (yyvsp[(3) - (4)].en) ) ); }
    59675968    break;
     
    59705971
    59715972/* Line 1806 of yacc.c  */
    5972 #line 850 "parser.yy"
     5973#line 851 "parser.yy"
    59735974    { (yyval.sn) = new StatementNode( build_branch( BranchStmt::Continue ) ); }
    59745975    break;
     
    59775978
    59785979/* Line 1806 of yacc.c  */
    5979 #line 854 "parser.yy"
     5980#line 855 "parser.yy"
    59805981    { (yyval.sn) = new StatementNode( build_branch( (yyvsp[(2) - (3)].tok), BranchStmt::Continue ) ); }
    59815982    break;
     
    59845985
    59855986/* Line 1806 of yacc.c  */
    5986 #line 857 "parser.yy"
     5987#line 858 "parser.yy"
    59875988    { (yyval.sn) = new StatementNode( build_branch( BranchStmt::Break ) ); }
    59885989    break;
     
    59915992
    59925993/* Line 1806 of yacc.c  */
    5993 #line 861 "parser.yy"
     5994#line 862 "parser.yy"
    59945995    { (yyval.sn) = new StatementNode( build_branch( (yyvsp[(2) - (3)].tok), BranchStmt::Break ) ); }
    59955996    break;
     
    59985999
    59996000/* Line 1806 of yacc.c  */
    6000 #line 863 "parser.yy"
     6001#line 864 "parser.yy"
    60016002    { (yyval.sn) = new StatementNode( build_return( (yyvsp[(2) - (3)].en) ) ); }
    60026003    break;
     
    60056006
    60066007/* Line 1806 of yacc.c  */
    6007 #line 865 "parser.yy"
     6008#line 866 "parser.yy"
    60086009    { (yyval.sn) = new StatementNode( build_throw( (yyvsp[(2) - (3)].en) ) ); }
    60096010    break;
     
    60126013
    60136014/* Line 1806 of yacc.c  */
    6014 #line 867 "parser.yy"
     6015#line 868 "parser.yy"
    60156016    { (yyval.sn) = new StatementNode( build_throw( (yyvsp[(2) - (3)].en) ) ); }
    60166017    break;
     
    60196020
    60206021/* Line 1806 of yacc.c  */
    6021 #line 869 "parser.yy"
     6022#line 870 "parser.yy"
    60226023    { (yyval.sn) = new StatementNode( build_throw( (yyvsp[(2) - (5)].en) ) ); }
    60236024    break;
     
    60266027
    60276028/* Line 1806 of yacc.c  */
    6028 #line 874 "parser.yy"
     6029#line 875 "parser.yy"
    60296030    { (yyval.sn) = new StatementNode( build_try( (yyvsp[(2) - (3)].sn), (yyvsp[(3) - (3)].sn), 0 ) ); }
    60306031    break;
     
    60336034
    60346035/* Line 1806 of yacc.c  */
    6035 #line 876 "parser.yy"
     6036#line 877 "parser.yy"
    60366037    { (yyval.sn) = new StatementNode( build_try( (yyvsp[(2) - (3)].sn), 0, (yyvsp[(3) - (3)].sn) ) ); }
    60376038    break;
     
    60406041
    60416042/* Line 1806 of yacc.c  */
    6042 #line 878 "parser.yy"
     6043#line 879 "parser.yy"
    60436044    { (yyval.sn) = new StatementNode( build_try( (yyvsp[(2) - (4)].sn), (yyvsp[(3) - (4)].sn), (yyvsp[(4) - (4)].sn) ) ); }
    60446045    break;
     
    60476048
    60486049/* Line 1806 of yacc.c  */
    6049 #line 885 "parser.yy"
     6050#line 886 "parser.yy"
    60506051    { (yyval.sn) = new StatementNode( build_catch( 0, (yyvsp[(5) - (5)].sn), true ) ); }
    60516052    break;
     
    60546055
    60556056/* Line 1806 of yacc.c  */
    6056 #line 887 "parser.yy"
     6057#line 888 "parser.yy"
    60576058    { (yyval.sn) = (StatementNode *)(yyvsp[(1) - (6)].sn)->set_last( new StatementNode( build_catch( 0, (yyvsp[(6) - (6)].sn), true ) ) ); }
    60586059    break;
     
    60616062
    60626063/* Line 1806 of yacc.c  */
    6063 #line 889 "parser.yy"
     6064#line 890 "parser.yy"
    60646065    { (yyval.sn) = new StatementNode( build_catch( 0, (yyvsp[(5) - (5)].sn), true ) ); }
    60656066    break;
     
    60686069
    60696070/* Line 1806 of yacc.c  */
    6070 #line 891 "parser.yy"
     6071#line 892 "parser.yy"
    60716072    { (yyval.sn) = (StatementNode *)(yyvsp[(1) - (6)].sn)->set_last( new StatementNode( build_catch( 0, (yyvsp[(6) - (6)].sn), true ) ) ); }
    60726073    break;
     
    60756076
    60766077/* Line 1806 of yacc.c  */
    6077 #line 896 "parser.yy"
     6078#line 897 "parser.yy"
    60786079    { (yyval.sn) = new StatementNode( build_catch( (yyvsp[(5) - (9)].decl), (yyvsp[(8) - (9)].sn) ) ); }
    60796080    break;
     
    60826083
    60836084/* Line 1806 of yacc.c  */
    6084 #line 898 "parser.yy"
     6085#line 899 "parser.yy"
    60856086    { (yyval.sn) = (StatementNode *)(yyvsp[(1) - (10)].sn)->set_last( new StatementNode( build_catch( (yyvsp[(6) - (10)].decl), (yyvsp[(9) - (10)].sn) ) ) ); }
    60866087    break;
     
    60896090
    60906091/* Line 1806 of yacc.c  */
    6091 #line 900 "parser.yy"
     6092#line 901 "parser.yy"
    60926093    { (yyval.sn) = new StatementNode( build_catch( (yyvsp[(5) - (9)].decl), (yyvsp[(8) - (9)].sn) ) ); }
    60936094    break;
     
    60966097
    60976098/* Line 1806 of yacc.c  */
    6098 #line 902 "parser.yy"
     6099#line 903 "parser.yy"
    60996100    { (yyval.sn) = (StatementNode *)(yyvsp[(1) - (10)].sn)->set_last( new StatementNode( build_catch( (yyvsp[(6) - (10)].decl), (yyvsp[(9) - (10)].sn) ) ) ); }
    61006101    break;
     
    61036104
    61046105/* Line 1806 of yacc.c  */
    6105 #line 907 "parser.yy"
     6106#line 908 "parser.yy"
    61066107    {
    61076108                        (yyval.sn) = new StatementNode( build_finally( (yyvsp[(2) - (2)].sn) ) );
     
    61126113
    61136114/* Line 1806 of yacc.c  */
    6114 #line 920 "parser.yy"
     6115#line 921 "parser.yy"
    61156116    {
    61166117                        typedefTable.addToEnclosingScope( TypedefTable::ID );
     
    61226123
    61236124/* Line 1806 of yacc.c  */
    6124 #line 925 "parser.yy"
     6125#line 926 "parser.yy"
    61256126    { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addType( (yyvsp[(1) - (2)].decl) ); }
    61266127    break;
     
    61296130
    61306131/* Line 1806 of yacc.c  */
    6131 #line 927 "parser.yy"
     6132#line 928 "parser.yy"
    61326133    {
    61336134                        typedefTable.addToEnclosingScope( TypedefTable::ID );
     
    61396140
    61406141/* Line 1806 of yacc.c  */
    6141 #line 936 "parser.yy"
     6142#line 937 "parser.yy"
    61426143    { (yyval.sn) = new StatementNode( build_asmstmt( (yyvsp[(2) - (6)].flag), (yyvsp[(4) - (6)].constant), 0 ) ); }
    61436144    break;
     
    61466147
    61476148/* Line 1806 of yacc.c  */
    6148 #line 938 "parser.yy"
     6149#line 939 "parser.yy"
    61496150    { (yyval.sn) = new StatementNode( build_asmstmt( (yyvsp[(2) - (8)].flag), (yyvsp[(4) - (8)].constant), (yyvsp[(6) - (8)].en) ) ); }
    61506151    break;
     
    61536154
    61546155/* Line 1806 of yacc.c  */
    6155 #line 940 "parser.yy"
     6156#line 941 "parser.yy"
    61566157    { (yyval.sn) = new StatementNode( build_asmstmt( (yyvsp[(2) - (10)].flag), (yyvsp[(4) - (10)].constant), (yyvsp[(6) - (10)].en), (yyvsp[(8) - (10)].en) ) ); }
    61576158    break;
     
    61606161
    61616162/* Line 1806 of yacc.c  */
    6162 #line 942 "parser.yy"
     6163#line 943 "parser.yy"
    61636164    { (yyval.sn) = new StatementNode( build_asmstmt( (yyvsp[(2) - (12)].flag), (yyvsp[(4) - (12)].constant), (yyvsp[(6) - (12)].en), (yyvsp[(8) - (12)].en), (yyvsp[(10) - (12)].en) ) ); }
    61646165    break;
     
    61676168
    61686169/* Line 1806 of yacc.c  */
    6169 #line 944 "parser.yy"
     6170#line 945 "parser.yy"
    61706171    { (yyval.sn) = new StatementNode( build_asmstmt( (yyvsp[(2) - (14)].flag), (yyvsp[(5) - (14)].constant), 0, (yyvsp[(8) - (14)].en), (yyvsp[(10) - (14)].en), (yyvsp[(12) - (14)].label) ) ); }
    61716172    break;
     
    61746175
    61756176/* Line 1806 of yacc.c  */
    6176 #line 949 "parser.yy"
     6177#line 950 "parser.yy"
    61776178    { (yyval.flag) = false; }
    61786179    break;
     
    61816182
    61826183/* Line 1806 of yacc.c  */
    6183 #line 951 "parser.yy"
     6184#line 952 "parser.yy"
    61846185    { (yyval.flag) = true; }
    61856186    break;
     
    61886189
    61896190/* Line 1806 of yacc.c  */
    6190 #line 956 "parser.yy"
     6191#line 957 "parser.yy"
    61916192    { (yyval.en) = 0; }
    61926193    break;
     
    61956196
    61966197/* Line 1806 of yacc.c  */
    6197 #line 963 "parser.yy"
     6198#line 964 "parser.yy"
    61986199    { (yyval.en) = (ExpressionNode *)(yyvsp[(1) - (3)].en)->set_last( (yyvsp[(3) - (3)].en) ); }
    61996200    break;
     
    62026203
    62036204/* Line 1806 of yacc.c  */
    6204 #line 968 "parser.yy"
     6205#line 969 "parser.yy"
    62056206    { (yyval.en) = new ExpressionNode( build_asmexpr( 0, (yyvsp[(1) - (4)].constant), (yyvsp[(3) - (4)].en) ) ); }
    62066207    break;
     
    62096210
    62106211/* Line 1806 of yacc.c  */
    6211 #line 970 "parser.yy"
     6212#line 971 "parser.yy"
    62126213    { (yyval.en) = new ExpressionNode( build_asmexpr( (yyvsp[(2) - (7)].en), (yyvsp[(4) - (7)].constant), (yyvsp[(6) - (7)].en) ) ); }
    62136214    break;
     
    62166217
    62176218/* Line 1806 of yacc.c  */
    6218 #line 975 "parser.yy"
     6219#line 976 "parser.yy"
    62196220    { (yyval.en) = 0; }
    62206221    break;
     
    62236224
    62246225/* Line 1806 of yacc.c  */
    6225 #line 977 "parser.yy"
     6226#line 978 "parser.yy"
    62266227    { (yyval.en) = new ExpressionNode( (yyvsp[(1) - (1)].constant) ); }
    62276228    break;
     
    62306231
    62316232/* Line 1806 of yacc.c  */
    6232 #line 979 "parser.yy"
     6233#line 980 "parser.yy"
    62336234    { (yyval.en) = (ExpressionNode *)(yyvsp[(1) - (3)].en)->set_last( new ExpressionNode( (yyvsp[(3) - (3)].constant) ) ); }
    62346235    break;
     
    62376238
    62386239/* Line 1806 of yacc.c  */
    6239 #line 984 "parser.yy"
     6240#line 985 "parser.yy"
    62406241    {
    62416242                        (yyval.label) = new LabelNode(); (yyval.label)->labels.push_back( *(yyvsp[(1) - (1)].tok) );
     
    62476248
    62486249/* Line 1806 of yacc.c  */
    6249 #line 989 "parser.yy"
     6250#line 990 "parser.yy"
    62506251    {
    62516252                        (yyval.label) = (yyvsp[(1) - (3)].label); (yyvsp[(1) - (3)].label)->labels.push_back( *(yyvsp[(3) - (3)].tok) );
     
    62576258
    62586259/* Line 1806 of yacc.c  */
    6259 #line 999 "parser.yy"
     6260#line 1000 "parser.yy"
    62606261    { (yyval.decl) = 0; }
    62616262    break;
     
    62646265
    62656266/* Line 1806 of yacc.c  */
    6266 #line 1006 "parser.yy"
     6267#line 1007 "parser.yy"
    62676268    { (yyval.decl) = (yyvsp[(1) - (3)].decl)->appendList( (yyvsp[(3) - (3)].decl) ); }
    62686269    break;
     
    62716272
    62726273/* Line 1806 of yacc.c  */
    6273 #line 1011 "parser.yy"
     6274#line 1012 "parser.yy"
    62746275    { (yyval.decl) = 0; }
    62756276    break;
     
    62786279
    62796280/* Line 1806 of yacc.c  */
    6280 #line 1018 "parser.yy"
     6281#line 1019 "parser.yy"
    62816282    { (yyval.decl) = (yyvsp[(1) - (3)].decl)->appendList( (yyvsp[(3) - (3)].decl) ); }
    62826283    break;
    62836284
    62846285  case 244:
    6285 
    6286 /* Line 1806 of yacc.c  */
    6287 #line 1032 "parser.yy"
    6288     {}
    6289     break;
    6290 
    6291   case 245:
    62926286
    62936287/* Line 1806 of yacc.c  */
     
    62966290    break;
    62976291
     6292  case 245:
     6293
     6294/* Line 1806 of yacc.c  */
     6295#line 1034 "parser.yy"
     6296    {}
     6297    break;
     6298
    62986299  case 253:
    62996300
    63006301/* Line 1806 of yacc.c  */
    6301 #line 1062 "parser.yy"
     6302#line 1063 "parser.yy"
    63026303    {
    63036304                        typedefTable.addToEnclosingScope( TypedefTable::ID );
     
    63096310
    63106311/* Line 1806 of yacc.c  */
    6311 #line 1069 "parser.yy"
     6312#line 1070 "parser.yy"
    63126313    {
    63136314                        typedefTable.addToEnclosingScope( TypedefTable::ID );
     
    63196320
    63206321/* Line 1806 of yacc.c  */
    6321 #line 1074 "parser.yy"
     6322#line 1075 "parser.yy"
    63226323    {
    63236324                        typedefTable.addToEnclosingScope( *(yyvsp[(5) - (6)].tok), TypedefTable::ID );
     
    63296330
    63306331/* Line 1806 of yacc.c  */
    6331 #line 1084 "parser.yy"
     6332#line 1085 "parser.yy"
    63326333    {
    63336334                        typedefTable.setNextIdentifier( *(yyvsp[(2) - (3)].tok) );
     
    63396340
    63406341/* Line 1806 of yacc.c  */
    6341 #line 1089 "parser.yy"
     6342#line 1090 "parser.yy"
    63426343    {
    63436344                        typedefTable.setNextIdentifier( *(yyvsp[(2) - (3)].tok) );
     
    63496350
    63506351/* Line 1806 of yacc.c  */
    6351 #line 1094 "parser.yy"
     6352#line 1095 "parser.yy"
    63526353    {
    63536354                        typedefTable.setNextIdentifier( *(yyvsp[(3) - (4)].tok) );
     
    63596360
    63606361/* Line 1806 of yacc.c  */
    6361 #line 1102 "parser.yy"
     6362#line 1103 "parser.yy"
    63626363    {
    63636364                        typedefTable.addToEnclosingScope( TypedefTable::ID );
     
    63696370
    63706371/* Line 1806 of yacc.c  */
    6371 #line 1107 "parser.yy"
     6372#line 1108 "parser.yy"
    63726373    {
    63736374                        typedefTable.addToEnclosingScope( TypedefTable::ID );
     
    63796380
    63806381/* Line 1806 of yacc.c  */
    6381 #line 1112 "parser.yy"
     6382#line 1113 "parser.yy"
    63826383    {
    63836384                        typedefTable.addToEnclosingScope( TypedefTable::ID );
     
    63896390
    63906391/* Line 1806 of yacc.c  */
    6391 #line 1117 "parser.yy"
     6392#line 1118 "parser.yy"
    63926393    {
    63936394                        typedefTable.addToEnclosingScope( TypedefTable::ID );
     
    63996400
    64006401/* Line 1806 of yacc.c  */
    6401 #line 1122 "parser.yy"
     6402#line 1123 "parser.yy"
    64026403    {
    64036404                        typedefTable.addToEnclosingScope( *(yyvsp[(5) - (5)].tok), TypedefTable::ID );
     
    64096410
    64106411/* Line 1806 of yacc.c  */
    6411 #line 1130 "parser.yy"
     6412#line 1131 "parser.yy"
    64126413    {
    64136414                        (yyval.decl) = DeclarationNode::newFunction( (yyvsp[(3) - (8)].tok), DeclarationNode::newTuple( 0 ), (yyvsp[(6) - (8)].decl), 0, true );
     
    64186419
    64196420/* Line 1806 of yacc.c  */
    6420 #line 1153 "parser.yy"
     6421#line 1154 "parser.yy"
    64216422    {
    64226423                        (yyval.decl) = DeclarationNode::newFunction( (yyvsp[(2) - (7)].tok), (yyvsp[(1) - (7)].decl), (yyvsp[(5) - (7)].decl), 0, true );
     
    64276428
    64286429/* Line 1806 of yacc.c  */
    6429 #line 1157 "parser.yy"
     6430#line 1158 "parser.yy"
    64306431    {
    64316432                        (yyval.decl) = DeclarationNode::newFunction( (yyvsp[(2) - (7)].tok), (yyvsp[(1) - (7)].decl), (yyvsp[(5) - (7)].decl), 0, true );
     
    64366437
    64376438/* Line 1806 of yacc.c  */
    6438 #line 1164 "parser.yy"
     6439#line 1165 "parser.yy"
    64396440    { (yyval.decl) = DeclarationNode::newTuple( (yyvsp[(3) - (5)].decl) ); }
    64406441    break;
     
    64436444
    64446445/* Line 1806 of yacc.c  */
    6445 #line 1168 "parser.yy"
     6446#line 1169 "parser.yy"
    64466447    { (yyval.decl) = DeclarationNode::newTuple( (yyvsp[(3) - (9)].decl)->appendList( (yyvsp[(7) - (9)].decl) ) ); }
    64476448    break;
     
    64506451
    64516452/* Line 1806 of yacc.c  */
    6452 #line 1173 "parser.yy"
     6453#line 1174 "parser.yy"
    64536454    {
    64546455                        typedefTable.addToEnclosingScope( TypedefTable::TD );
     
    64606461
    64616462/* Line 1806 of yacc.c  */
    6462 #line 1178 "parser.yy"
     6463#line 1179 "parser.yy"
    64636464    {
    64646465                        typedefTable.addToEnclosingScope( TypedefTable::TD );
     
    64706471
    64716472/* Line 1806 of yacc.c  */
    6472 #line 1183 "parser.yy"
     6473#line 1184 "parser.yy"
    64736474    {
    64746475                        typedefTable.addToEnclosingScope( *(yyvsp[(5) - (5)].tok), TypedefTable::TD );
     
    64806481
    64816482/* Line 1806 of yacc.c  */
    6482 #line 1194 "parser.yy"
     6483#line 1195 "parser.yy"
    64836484    {
    64846485                        typedefTable.addToEnclosingScope( TypedefTable::TD );
     
    64906491
    64916492/* Line 1806 of yacc.c  */
    6492 #line 1199 "parser.yy"
     6493#line 1200 "parser.yy"
    64936494    {
    64946495                        typedefTable.addToEnclosingScope( TypedefTable::TD );
     
    65006501
    65016502/* Line 1806 of yacc.c  */
    6502 #line 1204 "parser.yy"
     6503#line 1205 "parser.yy"
    65036504    {
    65046505                        typedefTable.addToEnclosingScope( TypedefTable::TD );
     
    65106511
    65116512/* Line 1806 of yacc.c  */
    6512 #line 1209 "parser.yy"
     6513#line 1210 "parser.yy"
    65136514    {
    65146515                        typedefTable.addToEnclosingScope( TypedefTable::TD );
     
    65206521
    65216522/* Line 1806 of yacc.c  */
    6522 #line 1214 "parser.yy"
     6523#line 1215 "parser.yy"
    65236524    {
    65246525                        typedefTable.addToEnclosingScope( TypedefTable::TD );
     
    65306531
    65316532/* Line 1806 of yacc.c  */
    6532 #line 1223 "parser.yy"
     6533#line 1224 "parser.yy"
    65336534    {
    65346535                        typedefTable.addToEnclosingScope( *(yyvsp[(2) - (4)].tok), TypedefTable::TD );
     
    65406541
    65416542/* Line 1806 of yacc.c  */
    6542 #line 1228 "parser.yy"
     6543#line 1229 "parser.yy"
    65436544    {
    65446545                        typedefTable.addToEnclosingScope( *(yyvsp[(5) - (7)].tok), TypedefTable::TD );
     
    65506551
    65516552/* Line 1806 of yacc.c  */
    6552 #line 1245 "parser.yy"
     6553#line 1246 "parser.yy"
    65536554    {
    65546555                        typedefTable.addToEnclosingScope( TypedefTable::ID );
     
    65606561
    65616562/* Line 1806 of yacc.c  */
    6562 #line 1250 "parser.yy"
     6563#line 1251 "parser.yy"
    65636564    {
    65646565                        typedefTable.addToEnclosingScope( TypedefTable::ID );
     
    65706571
    65716572/* Line 1806 of yacc.c  */
    6572 #line 1272 "parser.yy"
     6573#line 1273 "parser.yy"
    65736574    { (yyval.decl) = 0; }
    65746575    break;
     
    65776578
    65786579/* Line 1806 of yacc.c  */
    6579 #line 1284 "parser.yy"
     6580#line 1285 "parser.yy"
    65806581    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
    65816582    break;
     
    65846585
    65856586/* Line 1806 of yacc.c  */
    6586 #line 1295 "parser.yy"
     6587#line 1296 "parser.yy"
    65876588    { (yyval.decl) = DeclarationNode::newQualifier( DeclarationNode::Const ); }
    65886589    break;
     
    65916592
    65926593/* Line 1806 of yacc.c  */
    6593 #line 1297 "parser.yy"
     6594#line 1298 "parser.yy"
    65946595    { (yyval.decl) = DeclarationNode::newQualifier( DeclarationNode::Restrict ); }
    65956596    break;
     
    65986599
    65996600/* Line 1806 of yacc.c  */
    6600 #line 1299 "parser.yy"
     6601#line 1300 "parser.yy"
    66016602    { (yyval.decl) = DeclarationNode::newQualifier( DeclarationNode::Volatile ); }
    66026603    break;
     
    66056606
    66066607/* Line 1806 of yacc.c  */
    6607 #line 1301 "parser.yy"
     6608#line 1302 "parser.yy"
    66086609    { (yyval.decl) = DeclarationNode::newQualifier( DeclarationNode::Lvalue ); }
    66096610    break;
     
    66126613
    66136614/* Line 1806 of yacc.c  */
    6614 #line 1303 "parser.yy"
     6615#line 1304 "parser.yy"
    66156616    { (yyval.decl) = DeclarationNode::newQualifier( DeclarationNode::Atomic ); }
    66166617    break;
     
    66196620
    66206621/* Line 1806 of yacc.c  */
    6621 #line 1305 "parser.yy"
     6622#line 1306 "parser.yy"
    66226623    {
    66236624                        typedefTable.enterScope();
     
    66286629
    66296630/* Line 1806 of yacc.c  */
    6630 #line 1309 "parser.yy"
     6631#line 1310 "parser.yy"
    66316632    {
    66326633                        typedefTable.leaveScope();
     
    66386639
    66396640/* Line 1806 of yacc.c  */
    6640 #line 1318 "parser.yy"
     6641#line 1319 "parser.yy"
    66416642    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
    66426643    break;
     
    66456646
    66466647/* Line 1806 of yacc.c  */
    6647 #line 1320 "parser.yy"
     6648#line 1321 "parser.yy"
    66486649    { (yyval.decl) = (yyvsp[(1) - (3)].decl)->addQualifiers( (yyvsp[(2) - (3)].decl) )->addQualifiers( (yyvsp[(3) - (3)].decl) ); }
    66496650    break;
     
    66526653
    66536654/* Line 1806 of yacc.c  */
    6654 #line 1331 "parser.yy"
     6655#line 1332 "parser.yy"
    66556656    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
    66566657    break;
     
    66596660
    66606661/* Line 1806 of yacc.c  */
    6661 #line 1336 "parser.yy"
     6662#line 1337 "parser.yy"
    66626663    { (yyval.decl) = DeclarationNode::newStorageClass( DeclarationNode::Extern ); }
    66636664    break;
     
    66666667
    66676668/* Line 1806 of yacc.c  */
    6668 #line 1338 "parser.yy"
     6669#line 1339 "parser.yy"
    66696670    { (yyval.decl) = DeclarationNode::newStorageClass( DeclarationNode::Static ); }
    66706671    break;
     
    66736674
    66746675/* Line 1806 of yacc.c  */
    6675 #line 1340 "parser.yy"
     6676#line 1341 "parser.yy"
    66766677    { (yyval.decl) = DeclarationNode::newStorageClass( DeclarationNode::Auto ); }
    66776678    break;
     
    66806681
    66816682/* Line 1806 of yacc.c  */
    6682 #line 1342 "parser.yy"
     6683#line 1343 "parser.yy"
    66836684    { (yyval.decl) = DeclarationNode::newStorageClass( DeclarationNode::Register ); }
    66846685    break;
     
    66876688
    66886689/* Line 1806 of yacc.c  */
    6689 #line 1345 "parser.yy"
     6690#line 1346 "parser.yy"
    66906691    { (yyval.decl) = new DeclarationNode; (yyval.decl)->isInline = true; }
    66916692    break;
     
    66946695
    66956696/* Line 1806 of yacc.c  */
    6696 #line 1347 "parser.yy"
     6697#line 1348 "parser.yy"
    66976698    { (yyval.decl) = DeclarationNode::newStorageClass( DeclarationNode::Fortran ); }
    66986699    break;
     
    67016702
    67026703/* Line 1806 of yacc.c  */
    6703 #line 1350 "parser.yy"
     6704#line 1351 "parser.yy"
    67046705    { (yyval.decl) = new DeclarationNode; (yyval.decl)->isNoreturn = true; }
    67056706    break;
     
    67086709
    67096710/* Line 1806 of yacc.c  */
    6710 #line 1352 "parser.yy"
     6711#line 1353 "parser.yy"
    67116712    { (yyval.decl) = DeclarationNode::newStorageClass( DeclarationNode::Threadlocal ); }
    67126713    break;
     
    67156716
    67166717/* Line 1806 of yacc.c  */
    6717 #line 1357 "parser.yy"
     6718#line 1358 "parser.yy"
    67186719    { (yyval.decl) = DeclarationNode::newBasicType( DeclarationNode::Char ); }
    67196720    break;
     
    67226723
    67236724/* Line 1806 of yacc.c  */
    6724 #line 1359 "parser.yy"
     6725#line 1360 "parser.yy"
    67256726    { (yyval.decl) = DeclarationNode::newBasicType( DeclarationNode::Double ); }
    67266727    break;
     
    67296730
    67306731/* Line 1806 of yacc.c  */
    6731 #line 1361 "parser.yy"
     6732#line 1362 "parser.yy"
    67326733    { (yyval.decl) = DeclarationNode::newBasicType( DeclarationNode::Float ); }
    67336734    break;
     
    67366737
    67376738/* Line 1806 of yacc.c  */
    6738 #line 1363 "parser.yy"
     6739#line 1364 "parser.yy"
    67396740    { (yyval.decl) = DeclarationNode::newBasicType( DeclarationNode::Int ); }
    67406741    break;
     
    67436744
    67446745/* Line 1806 of yacc.c  */
    6745 #line 1365 "parser.yy"
     6746#line 1366 "parser.yy"
    67466747    { (yyval.decl) = DeclarationNode::newLength( DeclarationNode::Long ); }
    67476748    break;
     
    67506751
    67516752/* Line 1806 of yacc.c  */
    6752 #line 1367 "parser.yy"
     6753#line 1368 "parser.yy"
    67536754    { (yyval.decl) = DeclarationNode::newLength( DeclarationNode::Short ); }
    67546755    break;
     
    67576758
    67586759/* Line 1806 of yacc.c  */
    6759 #line 1369 "parser.yy"
     6760#line 1370 "parser.yy"
    67606761    { (yyval.decl) = DeclarationNode::newSignedNess( DeclarationNode::Signed ); }
    67616762    break;
     
    67646765
    67656766/* Line 1806 of yacc.c  */
    6766 #line 1371 "parser.yy"
     6767#line 1372 "parser.yy"
    67676768    { (yyval.decl) = DeclarationNode::newSignedNess( DeclarationNode::Unsigned ); }
    67686769    break;
     
    67716772
    67726773/* Line 1806 of yacc.c  */
    6773 #line 1373 "parser.yy"
     6774#line 1374 "parser.yy"
    67746775    { (yyval.decl) = DeclarationNode::newBasicType( DeclarationNode::Void ); }
    67756776    break;
     
    67786779
    67796780/* Line 1806 of yacc.c  */
    6780 #line 1375 "parser.yy"
     6781#line 1376 "parser.yy"
    67816782    { (yyval.decl) = DeclarationNode::newBasicType( DeclarationNode::Bool ); }
    67826783    break;
     
    67856786
    67866787/* Line 1806 of yacc.c  */
    6787 #line 1377 "parser.yy"
     6788#line 1378 "parser.yy"
    67886789    { (yyval.decl) = DeclarationNode::newComplexType( DeclarationNode::Complex ); }
    67896790    break;
     
    67926793
    67936794/* Line 1806 of yacc.c  */
    6794 #line 1379 "parser.yy"
     6795#line 1380 "parser.yy"
    67956796    { (yyval.decl) = DeclarationNode::newComplexType( DeclarationNode::Imaginary ); }
    67966797    break;
     
    67996800
    68006801/* Line 1806 of yacc.c  */
    6801 #line 1381 "parser.yy"
     6802#line 1382 "parser.yy"
    68026803    { (yyval.decl) = DeclarationNode::newBuiltinType( DeclarationNode::Valist ); }
    68036804    break;
     
    68066807
    68076808/* Line 1806 of yacc.c  */
    6808 #line 1388 "parser.yy"
     6809#line 1389 "parser.yy"
    68096810    { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); }
    68106811    break;
     
    68136814
    68146815/* Line 1806 of yacc.c  */
    6815 #line 1390 "parser.yy"
     6816#line 1391 "parser.yy"
    68166817    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
    68176818    break;
     
    68206821
    68216822/* Line 1806 of yacc.c  */
    6822 #line 1392 "parser.yy"
     6823#line 1393 "parser.yy"
    68236824    { (yyval.decl) = (yyvsp[(1) - (3)].decl)->addQualifiers( (yyvsp[(2) - (3)].decl) )->addQualifiers( (yyvsp[(3) - (3)].decl) ); }
    68246825    break;
     
    68276828
    68286829/* Line 1806 of yacc.c  */
    6829 #line 1394 "parser.yy"
     6830#line 1395 "parser.yy"
    68306831    { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addQualifiers( (yyvsp[(2) - (3)].decl) )->addType( (yyvsp[(1) - (3)].decl) ); }
    68316832    break;
     
    68346835
    68356836/* Line 1806 of yacc.c  */
    6836 #line 1400 "parser.yy"
     6837#line 1401 "parser.yy"
    68376838    { (yyval.decl) = (yyvsp[(2) - (3)].decl)->addQualifiers( (yyvsp[(1) - (3)].decl) )->addQualifiers( (yyvsp[(3) - (3)].decl) ); }
    68386839    break;
     
    68416842
    68426843/* Line 1806 of yacc.c  */
    6843 #line 1407 "parser.yy"
     6844#line 1408 "parser.yy"
    68446845    { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); }
    68456846    break;
     
    68486849
    68496850/* Line 1806 of yacc.c  */
    6850 #line 1409 "parser.yy"
     6851#line 1410 "parser.yy"
    68516852    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
    68526853    break;
     
    68556856
    68566857/* Line 1806 of yacc.c  */
    6857 #line 1411 "parser.yy"
     6858#line 1412 "parser.yy"
    68586859    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addType( (yyvsp[(2) - (2)].decl) ); }
    68596860    break;
     
    68626863
    68636864/* Line 1806 of yacc.c  */
    6864 #line 1416 "parser.yy"
     6865#line 1417 "parser.yy"
    68656866    { (yyval.decl) = (yyvsp[(3) - (4)].decl); }
    68666867    break;
     
    68696870
    68706871/* Line 1806 of yacc.c  */
    6871 #line 1418 "parser.yy"
     6872#line 1419 "parser.yy"
    68726873    { (yyval.decl) = DeclarationNode::newTypeof( (yyvsp[(3) - (4)].en) ); }
    68736874    break;
     
    68766877
    68776878/* Line 1806 of yacc.c  */
    6878 #line 1420 "parser.yy"
     6879#line 1421 "parser.yy"
    68796880    { (yyval.decl) = DeclarationNode::newAttr( (yyvsp[(1) - (4)].tok), (yyvsp[(3) - (4)].decl) ); }
    68806881    break;
     
    68836884
    68846885/* Line 1806 of yacc.c  */
    6885 #line 1422 "parser.yy"
     6886#line 1423 "parser.yy"
    68866887    { (yyval.decl) = DeclarationNode::newAttr( (yyvsp[(1) - (4)].tok), (yyvsp[(3) - (4)].en) ); }
    68876888    break;
     
    68906891
    68916892/* Line 1806 of yacc.c  */
    6892 #line 1428 "parser.yy"
     6893#line 1429 "parser.yy"
    68936894    { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); }
    68946895    break;
     
    68976898
    68986899/* Line 1806 of yacc.c  */
    6899 #line 1430 "parser.yy"
     6900#line 1431 "parser.yy"
    69006901    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
    69016902    break;
     
    69046905
    69056906/* Line 1806 of yacc.c  */
    6906 #line 1432 "parser.yy"
     6907#line 1433 "parser.yy"
    69076908    { (yyval.decl) = (yyvsp[(1) - (3)].decl)->addQualifiers( (yyvsp[(2) - (3)].decl) )->addQualifiers( (yyvsp[(3) - (3)].decl) ); }
    69086909    break;
     
    69116912
    69126913/* Line 1806 of yacc.c  */
    6913 #line 1438 "parser.yy"
     6914#line 1439 "parser.yy"
    69146915    { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); }
    69156916    break;
     
    69186919
    69196920/* Line 1806 of yacc.c  */
    6920 #line 1440 "parser.yy"
     6921#line 1441 "parser.yy"
    69216922    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
    69226923    break;
     
    69256926
    69266927/* Line 1806 of yacc.c  */
    6927 #line 1446 "parser.yy"
     6928#line 1447 "parser.yy"
    69286929    { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); }
    69296930    break;
     
    69326933
    69336934/* Line 1806 of yacc.c  */
    6934 #line 1448 "parser.yy"
     6935#line 1449 "parser.yy"
    69356936    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
    69366937    break;
     
    69396940
    69406941/* Line 1806 of yacc.c  */
    6941 #line 1450 "parser.yy"
     6942#line 1451 "parser.yy"
    69426943    { (yyval.decl) = (yyvsp[(1) - (3)].decl)->addQualifiers( (yyvsp[(2) - (3)].decl) )->addQualifiers( (yyvsp[(3) - (3)].decl) ); }
    69436944    break;
     
    69466947
    69476948/* Line 1806 of yacc.c  */
    6948 #line 1455 "parser.yy"
     6949#line 1456 "parser.yy"
    69496950    { (yyval.decl) = DeclarationNode::newFromTypedef( (yyvsp[(1) - (1)].tok) ); }
    69506951    break;
     
    69536954
    69546955/* Line 1806 of yacc.c  */
    6955 #line 1457 "parser.yy"
     6956#line 1458 "parser.yy"
    69566957    { (yyval.decl) = DeclarationNode::newFromTypedef( (yyvsp[(2) - (2)].tok) )->addQualifiers( (yyvsp[(1) - (2)].decl) ); }
    69576958    break;
     
    69606961
    69616962/* Line 1806 of yacc.c  */
    6962 #line 1459 "parser.yy"
     6963#line 1460 "parser.yy"
    69636964    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
    69646965    break;
     
    69676968
    69686969/* Line 1806 of yacc.c  */
    6969 #line 1469 "parser.yy"
    6970     { (yyval.decl) = DeclarationNode::newAggregate( (yyvsp[(1) - (4)].aggKey), 0, 0, (yyvsp[(3) - (4)].decl), true ); }
     6970#line 1470 "parser.yy"
     6971    { (yyval.decl) = DeclarationNode::newAggregate( (yyvsp[(1) - (4)].aggKey), nullptr, nullptr, (yyvsp[(3) - (4)].decl), true ); }
    69716972    break;
    69726973
     
    69746975
    69756976/* Line 1806 of yacc.c  */
    6976 #line 1471 "parser.yy"
     6977#line 1472 "parser.yy"
    69776978    {
    69786979                        typedefTable.makeTypedef( *(yyvsp[(2) - (2)].tok) );
    6979                         (yyval.decl) = DeclarationNode::newAggregate( (yyvsp[(1) - (2)].aggKey), (yyvsp[(2) - (2)].tok), 0, 0, false );
     6980                        (yyval.decl) = DeclarationNode::newAggregate( (yyvsp[(1) - (2)].aggKey), (yyvsp[(2) - (2)].tok), nullptr, nullptr, false );
    69806981                }
    69816982    break;
     
    69846985
    69856986/* Line 1806 of yacc.c  */
    6986 #line 1476 "parser.yy"
     6987#line 1477 "parser.yy"
    69876988    { typedefTable.makeTypedef( *(yyvsp[(2) - (2)].tok) ); }
    69886989    break;
     
    69916992
    69926993/* Line 1806 of yacc.c  */
    6993 #line 1478 "parser.yy"
    6994     { (yyval.decl) = DeclarationNode::newAggregate( (yyvsp[(1) - (6)].aggKey), (yyvsp[(2) - (6)].tok), 0, (yyvsp[(5) - (6)].decl), true ); }
     6994#line 1479 "parser.yy"
     6995    { (yyval.decl) = DeclarationNode::newAggregate( (yyvsp[(1) - (6)].aggKey), (yyvsp[(2) - (6)].tok), nullptr, (yyvsp[(5) - (6)].decl), true ); }
    69956996    break;
    69966997
     
    69986999
    69997000/* Line 1806 of yacc.c  */
    7000 #line 1480 "parser.yy"
    7001     { (yyval.decl) = DeclarationNode::newAggregate( (yyvsp[(1) - (7)].aggKey), 0, (yyvsp[(3) - (7)].en), (yyvsp[(6) - (7)].decl), false ); }
     7001#line 1481 "parser.yy"
     7002    { (yyval.decl) = DeclarationNode::newAggregate( (yyvsp[(1) - (7)].aggKey), nullptr, (yyvsp[(3) - (7)].en), (yyvsp[(6) - (7)].decl), false ); }
    70027003    break;
    70037004
     
    70057006
    70067007/* Line 1806 of yacc.c  */
    7007 #line 1482 "parser.yy"
     7008#line 1483 "parser.yy"
    70087009    { (yyval.decl) = (yyvsp[(2) - (2)].decl); }
    70097010    break;
     
    70127013
    70137014/* Line 1806 of yacc.c  */
    7014 #line 1487 "parser.yy"
     7015#line 1488 "parser.yy"
    70157016    { (yyval.aggKey) = DeclarationNode::Struct; }
    70167017    break;
     
    70197020
    70207021/* Line 1806 of yacc.c  */
    7021 #line 1489 "parser.yy"
     7022#line 1490 "parser.yy"
    70227023    { (yyval.aggKey) = DeclarationNode::Union; }
    70237024    break;
     
    70267027
    70277028/* Line 1806 of yacc.c  */
    7028 #line 1494 "parser.yy"
     7029#line 1495 "parser.yy"
    70297030    { (yyval.decl) = 0; }
    70307031    break;
     
    70337034
    70347035/* Line 1806 of yacc.c  */
    7035 #line 1496 "parser.yy"
     7036#line 1497 "parser.yy"
    70367037    { (yyval.decl) = (yyvsp[(1) - (2)].decl) != 0 ? (yyvsp[(1) - (2)].decl)->appendList( (yyvsp[(2) - (2)].decl) ) : (yyvsp[(2) - (2)].decl); }
    70377038    break;
     
    70407041
    70417042/* Line 1806 of yacc.c  */
    7042 #line 1502 "parser.yy"
     7043#line 1503 "parser.yy"
    70437044    { (yyval.decl) = (yyvsp[(2) - (3)].decl)->set_extension( true ); }
    70447045    break;
     
    70477048
    70487049/* Line 1806 of yacc.c  */
    7049 #line 1505 "parser.yy"
     7050#line 1506 "parser.yy"
    70507051    {   // mark all fields in list
    70517052                        for ( DeclarationNode *iter = (yyvsp[(2) - (3)].decl); iter != nullptr; iter = (DeclarationNode *)iter->get_next() )
     
    70587059
    70597060/* Line 1806 of yacc.c  */
    7060 #line 1515 "parser.yy"
     7061#line 1516 "parser.yy"
    70617062    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addName( (yyvsp[(2) - (2)].tok) ); }
    70627063    break;
     
    70657066
    70667067/* Line 1806 of yacc.c  */
    7067 #line 1517 "parser.yy"
     7068#line 1518 "parser.yy"
    70687069    { (yyval.decl) = (yyvsp[(1) - (3)].decl)->appendList( (yyvsp[(1) - (3)].decl)->cloneType( (yyvsp[(3) - (3)].tok) ) ); }
    70697070    break;
     
    70727073
    70737074/* Line 1806 of yacc.c  */
    7074 #line 1519 "parser.yy"
     7075#line 1520 "parser.yy"
    70757076    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->appendList( (yyvsp[(1) - (2)].decl)->cloneType( 0 ) ); }
    70767077    break;
     
    70797080
    70807081/* Line 1806 of yacc.c  */
    7081 #line 1524 "parser.yy"
     7082#line 1525 "parser.yy"
    70827083    { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addType( (yyvsp[(1) - (2)].decl) ); }
    70837084    break;
     
    70867087
    70877088/* Line 1806 of yacc.c  */
    7088 #line 1526 "parser.yy"
     7089#line 1527 "parser.yy"
    70897090    { (yyval.decl) = (yyvsp[(1) - (4)].decl)->appendList( (yyvsp[(1) - (4)].decl)->cloneBaseType( (yyvsp[(4) - (4)].decl) ) ); }
    70907091    break;
     
    70937094
    70947095/* Line 1806 of yacc.c  */
    7095 #line 1531 "parser.yy"
     7096#line 1532 "parser.yy"
    70967097    { (yyval.decl) = DeclarationNode::newName( 0 ); /* XXX */ }
    70977098    break;
     
    71007101
    71017102/* Line 1806 of yacc.c  */
    7102 #line 1533 "parser.yy"
     7103#line 1534 "parser.yy"
    71037104    { (yyval.decl) = DeclarationNode::newBitfield( (yyvsp[(1) - (1)].en) ); }
    71047105    break;
     
    71077108
    71087109/* Line 1806 of yacc.c  */
    7109 #line 1536 "parser.yy"
     7110#line 1537 "parser.yy"
    71107111    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addBitfield( (yyvsp[(2) - (2)].en) ); }
    71117112    break;
     
    71147115
    71157116/* Line 1806 of yacc.c  */
    7116 #line 1539 "parser.yy"
     7117#line 1540 "parser.yy"
    71177118    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addBitfield( (yyvsp[(2) - (2)].en) ); }
    71187119    break;
     
    71217122
    71227123/* Line 1806 of yacc.c  */
    7123 #line 1545 "parser.yy"
     7124#line 1546 "parser.yy"
    71247125    { (yyval.en) = 0; }
    71257126    break;
     
    71287129
    71297130/* Line 1806 of yacc.c  */
    7130 #line 1547 "parser.yy"
     7131#line 1548 "parser.yy"
    71317132    { (yyval.en) = (yyvsp[(1) - (1)].en); }
    71327133    break;
     
    71357136
    71367137/* Line 1806 of yacc.c  */
    7137 #line 1552 "parser.yy"
     7138#line 1553 "parser.yy"
    71387139    { (yyval.en) = (yyvsp[(2) - (2)].en); }
    71397140    break;
     
    71427143
    71437144/* Line 1806 of yacc.c  */
    7144 #line 1561 "parser.yy"
    7145     { (yyval.decl) = DeclarationNode::newEnum( 0, (yyvsp[(3) - (5)].decl) ); }
     7145#line 1562 "parser.yy"
     7146    { (yyval.decl) = DeclarationNode::newEnum( nullptr, (yyvsp[(3) - (5)].decl) ); }
    71467147    break;
    71477148
     
    71497150
    71507151/* Line 1806 of yacc.c  */
    7151 #line 1563 "parser.yy"
     7152#line 1564 "parser.yy"
    71527153    {
    71537154                        typedefTable.makeTypedef( *(yyvsp[(2) - (2)].tok) );
     
    71597160
    71607161/* Line 1806 of yacc.c  */
    7161 #line 1568 "parser.yy"
     7162#line 1569 "parser.yy"
    71627163    { typedefTable.makeTypedef( *(yyvsp[(2) - (2)].tok) ); }
    71637164    break;
     
    71667167
    71677168/* Line 1806 of yacc.c  */
    7168 #line 1570 "parser.yy"
     7169#line 1571 "parser.yy"
    71697170    { (yyval.decl) = DeclarationNode::newEnum( (yyvsp[(2) - (7)].tok), (yyvsp[(5) - (7)].decl) ); }
    71707171    break;
     
    71737174
    71747175/* Line 1806 of yacc.c  */
    7175 #line 1575 "parser.yy"
     7176#line 1576 "parser.yy"
    71767177    { (yyval.decl) = DeclarationNode::newEnumConstant( (yyvsp[(1) - (2)].tok), (yyvsp[(2) - (2)].en) ); }
    71777178    break;
     
    71807181
    71817182/* Line 1806 of yacc.c  */
    7182 #line 1577 "parser.yy"
     7183#line 1578 "parser.yy"
    71837184    { (yyval.decl) = (yyvsp[(1) - (4)].decl)->appendList( DeclarationNode::newEnumConstant( (yyvsp[(3) - (4)].tok), (yyvsp[(4) - (4)].en) ) ); }
    71847185    break;
     
    71877188
    71887189/* Line 1806 of yacc.c  */
    7189 #line 1582 "parser.yy"
     7190#line 1583 "parser.yy"
    71907191    { (yyval.en) = 0; }
    71917192    break;
     
    71947195
    71957196/* Line 1806 of yacc.c  */
    7196 #line 1584 "parser.yy"
     7197#line 1585 "parser.yy"
    71977198    { (yyval.en) = (yyvsp[(2) - (2)].en); }
    71987199    break;
     
    72017202
    72027203/* Line 1806 of yacc.c  */
    7203 #line 1591 "parser.yy"
     7204#line 1592 "parser.yy"
    72047205    { (yyval.decl) = 0; }
    72057206    break;
     
    72087209
    72097210/* Line 1806 of yacc.c  */
    7210 #line 1599 "parser.yy"
     7211#line 1600 "parser.yy"
    72117212    { (yyval.decl) = (yyvsp[(1) - (5)].decl)->appendList( (yyvsp[(5) - (5)].decl) ); }
    72127213    break;
     
    72157216
    72167217/* Line 1806 of yacc.c  */
    7217 #line 1601 "parser.yy"
     7218#line 1602 "parser.yy"
    72187219    { (yyval.decl) = (yyvsp[(1) - (5)].decl)->addVarArgs(); }
    72197220    break;
     
    72227223
    72237224/* Line 1806 of yacc.c  */
    7224 #line 1603 "parser.yy"
     7225#line 1604 "parser.yy"
    72257226    { (yyval.decl) = (yyvsp[(1) - (5)].decl)->addVarArgs(); }
    72267227    break;
     
    72297230
    72307231/* Line 1806 of yacc.c  */
    7231 #line 1611 "parser.yy"
     7232#line 1612 "parser.yy"
    72327233    { (yyval.decl) = (yyvsp[(1) - (5)].decl)->appendList( (yyvsp[(5) - (5)].decl) ); }
    72337234    break;
     
    72367237
    72377238/* Line 1806 of yacc.c  */
    7238 #line 1613 "parser.yy"
     7239#line 1614 "parser.yy"
    72397240    { (yyval.decl) = (yyvsp[(1) - (5)].decl)->appendList( (yyvsp[(5) - (5)].decl) ); }
    72407241    break;
     
    72437244
    72447245/* Line 1806 of yacc.c  */
    7245 #line 1615 "parser.yy"