Changes in / [c331406:5070fe4]


Ignore:
Files:
2 added
2 deleted
60 edited

Legend:

Unmodified
Added
Removed
  • doc/aaron_comp_II/comp_II.tex

    rc331406 r5070fe4  
    156156
    157157forall(otype M | has_magnitude(M))
    158 M abs( M m ) {
     158int sgn( M m ) {
    159159    M zero = 0;  // uses zero_t constructor from trait
    160     return m < zero ? -m : m;
    161 }
    162 
    163 forall(otype M | has_magnitude(M))
    164 M max_magnitude( M a, M b ) {
    165     M aa = abs(a), ab = abs(b);
    166     return aa < ab ? b : a;
    167 }
    168 \end{lstlisting}
    169 
    170 Semantically, a trait is merely a named list of type assertions, but they can be used in many of the same situations where an interface in Java or an abstract base class in \CC would be used.
    171 Unlike Java interfaces or \CC base classes, \CFA types do not explicitly state any inheritance relationship to traits they satisfy; this can be considered a form of structural inheritance, similar to interface implementation in Go, as opposed to the nominal inheritance model of Java and \CC.
    172 % TODO talk about modelling of nominal inheritance with structural inheritance, possibility of investigating some resolver algorithms that require nominal
     160    if ( m < zero ) return -1;
     161    if ( zero < m ) return 1;
     162    return 0;
     163}
     164
     165// TODO write another function
     166\end{lstlisting}
    173167
    174168\subsection{Name Overloading}
  • src/CodeGen/CodeGenerator.cc

    rc331406 r5070fe4  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Aug  4 13:35:30 2016
    13 // Update Count     : 352
     11// Last Modified By :
     12// Last Modified On : Sun Jul 31 08:42:18 2016
     13// Update Count     : 345
    1414//
    1515
     
    4848        }
    4949
    50         void CodeGenerator::extension( Expression * expr ) {
     50        void CodeGenerator::extension( Expression *expr ) {
    5151                if ( expr->get_extension() ) {
    5252                        output << "__extension__ ";
     
    5454        } // extension
    5555
    56         void CodeGenerator::extension( Declaration * decl ) {
     56        void CodeGenerator::extension( Declaration *decl ) {
    5757                if ( decl->get_extension() ) {
    5858                        output << "__extension__ ";
     
    7373        }
    7474
    75         ostream & operator<<( ostream & output, CodeGenerator::LabelPrinter & printLabels ) {
     75        ostream & operator<<( ostream & output, CodeGenerator::LabelPrinter &printLabels ) {
    7676                std::list< Label > & labs = *printLabels.labels;
    7777                // l.unique(); // assumes a sorted list. Why not use set? Does order matter?
     
    7979                        output << l.get_name() + ": ";
    8080                        printLabels.cg.genAttributes( l.get_attributes() );
    81                 } // for
     81                }
    8282                return output;
    8383        }
    8484
    85         CodeGenerator::CodeGenerator( std::ostream & os ) : indent( *this), cur_indent( 0 ), insideFunction( false ), output( os ), printLabels( *this ) {}
    86 
    87         CodeGenerator::CodeGenerator( std::ostream & os, std::string init, int indentation, bool infunp )
     85        CodeGenerator::CodeGenerator( std::ostream &os ) : indent( *this), cur_indent( 0 ), insideFunction( false ), output( os ), printLabels( *this ) {}
     86
     87        CodeGenerator::CodeGenerator( std::ostream &os, std::string init, int indentation, bool infunp )
    8888                        : indent( *this), cur_indent( indentation ), insideFunction( infunp ), output( os ), printLabels( *this ) {
    8989                //output << std::string( init );
    9090        }
    9191
    92         CodeGenerator::CodeGenerator( std::ostream & os, char * init, int indentation, bool infunp )
     92        CodeGenerator::CodeGenerator( std::ostream &os, char *init, int indentation, bool infunp )
    9393                        : indent( *this ), cur_indent( indentation ), insideFunction( infunp ), output( os ), printLabels( *this ) {
    9494                //output << std::string( init );
    9595        }
    9696
    97         string mangleName( DeclarationWithType * decl ) {
     97        string mangleName( DeclarationWithType *decl ) {
    9898                if ( decl->get_mangleName() != "" ) {
    9999                        // need to incorporate scope level in order to differentiate names for destructors
     
    112112                                        genCommaList( attr->get_parameters().begin(), attr->get_parameters().end() );
    113113                                        output << ")";
    114                                 } // if
     114                                }
    115115                                output << ",";
    116                         } // for
     116                        }
    117117                        output << ")) ";
    118                 } // if
     118                }
    119119        }
    120120
    121121
    122122        //*** Declarations
    123         void CodeGenerator::visit( FunctionDecl * functionDecl ) {
     123        void CodeGenerator::visit( FunctionDecl *functionDecl ) {
    124124                extension( functionDecl );
    125125                genAttributes( functionDecl->get_attributes() );
     
    146146        }
    147147
    148         void CodeGenerator::visit( ObjectDecl * objectDecl ) {
     148        void CodeGenerator::visit( ObjectDecl *objectDecl ) {
    149149                extension( objectDecl );
    150                 genAttributes( objectDecl->get_attributes() );
    151 
    152150                handleStorageClass( objectDecl );
    153151                output << genType( objectDecl->get_type(), mangleName( objectDecl ) );
     
    164162        }
    165163
    166         void CodeGenerator::handleAggregate( AggregateDecl * aggDecl ) {
     164        void CodeGenerator::handleAggregate( AggregateDecl *aggDecl ) {
    167165                if ( aggDecl->get_name() != "" )
    168166                        output << aggDecl->get_name();
    169167
    170                 std::list< Declaration * > & memb = aggDecl->get_members();
     168                std::list< Declaration * > &memb = aggDecl->get_members();
    171169                if ( ! memb.empty() ) {
    172170//              if ( aggDecl->has_body() ) {
    173 //                      std::list< Declaration * > & memb = aggDecl->get_members();
     171//                      std::list< Declaration * > &memb = aggDecl->get_members();
    174172                        output << " {" << endl;
    175173
     
    187185        }
    188186
    189         void CodeGenerator::visit( StructDecl * structDecl ) {
     187        void CodeGenerator::visit( StructDecl *structDecl ) {
    190188                extension( structDecl );
    191189                output << "struct ";
     
    193191        }
    194192
    195         void CodeGenerator::visit( UnionDecl * unionDecl ) {
     193        void CodeGenerator::visit( UnionDecl *unionDecl ) {
    196194                extension( unionDecl );
    197195                output << "union ";
     
    199197        }
    200198
    201         void CodeGenerator::visit( EnumDecl * enumDecl ) {
     199        void CodeGenerator::visit( EnumDecl *enumDecl ) {
    202200                extension( enumDecl );
    203201                output << "enum ";
     
    213211                        cur_indent += CodeGenerator::tabsize;
    214212                        for ( std::list< Declaration* >::iterator i = memb.begin(); i != memb.end();  i++) {
    215                                 ObjectDecl * obj = dynamic_cast< ObjectDecl* >( *i );
     213                                ObjectDecl *obj = dynamic_cast< ObjectDecl* >( *i );
    216214                                assert( obj );
    217215                                output << indent << mangleName( obj );
     
    229227        }
    230228
    231         void CodeGenerator::visit( TraitDecl * traitDecl ) {}
    232 
    233         void CodeGenerator::visit( TypedefDecl * typeDecl ) {
     229        void CodeGenerator::visit( TraitDecl *traitDecl ) {}
     230
     231        void CodeGenerator::visit( TypedefDecl *typeDecl ) {
    234232                assert( false && "Typedefs are removed and substituted in earlier passes." );
    235233                //output << "typedef ";
     
    237235        }
    238236
    239         void CodeGenerator::visit( TypeDecl * typeDecl ) {
     237        void CodeGenerator::visit( TypeDecl *typeDecl ) {
    240238                // really, we should mutate this into something that isn't a TypeDecl but that requires large-scale changes,
    241239                // still to be done
     
    265263        }
    266264
    267         void CodeGenerator::visit( SingleInit * init ) {
     265        void CodeGenerator::visit( SingleInit *init ) {
    268266                printDesignators( init->get_designators() );
    269267                init->get_value()->accept( *this );
    270268        }
    271269
    272         void CodeGenerator::visit( ListInit * init ) {
     270        void CodeGenerator::visit( ListInit *init ) {
    273271                printDesignators( init->get_designators() );
    274272                output << "{ ";
    275                 if ( init->begin() == init->end() ) {
     273                if ( init->begin_initializers() == init->end_initializers() ) {
    276274                        // illegal to leave initializer list empty for scalar initializers, but always legal to have 0
    277275                        output << "0";
    278276                } else {
    279                         genCommaList( init->begin(), init->end() );
    280                 } // if
     277                        genCommaList( init->begin_initializers(), init->end_initializers() );
     278                }
    281279                output << " }";
    282280        }
    283281
    284         void CodeGenerator::visit( Constant * constant ) {
     282        void CodeGenerator::visit( Constant *constant ) {
    285283                output << constant->get_value() ;
    286284        }
    287285
    288286        //*** Expressions
    289         void CodeGenerator::visit( ApplicationExpr * applicationExpr ) {
     287        void CodeGenerator::visit( ApplicationExpr *applicationExpr ) {
    290288                extension( applicationExpr );
    291                 if ( VariableExpr * varExpr = dynamic_cast< VariableExpr* >( applicationExpr->get_function() ) ) {
     289                if ( VariableExpr *varExpr = dynamic_cast< VariableExpr* >( applicationExpr->get_function() ) ) {
    292290                        OperatorInfo opInfo;
    293291                        if ( varExpr->get_var()->get_linkage() == LinkageSpec::Intrinsic && operatorLookup( varExpr->get_var()->get_name(), opInfo ) ) {
     
    301299                                        {
    302300                                                assert( arg != applicationExpr->get_args().end() );
    303                                                 if ( AddressExpr * addrExpr = dynamic_cast< AddressExpr * >( *arg ) ) {
     301                                                if ( AddressExpr *addrExpr = dynamic_cast< AddressExpr * >( *arg ) ) {
    304302                                                        // remove & from first assignment/ctor argument
    305303                                                        *arg = addrExpr->get_arg();
    306304                                                } else {
    307305                                                        // no address-of operator, so must be a pointer - add dereference
    308                                                         UntypedExpr * newExpr = new UntypedExpr( new NameExpr( "*?" ) );
     306                                                        UntypedExpr *newExpr = new UntypedExpr( new NameExpr( "*?" ) );
    309307                                                        newExpr->get_args().push_back( *arg );
    310308                                                        assert( (*arg)->get_results().size() == 1 );
     
    354352                                                // no constructors with 0 or more than 2 parameters
    355353                                                assert( false );
    356                                         } // if
     354                                        }
    357355                                        break;
    358356
     
    403401        }
    404402
    405         void CodeGenerator::visit( UntypedExpr * untypedExpr ) {
     403        void CodeGenerator::visit( UntypedExpr *untypedExpr ) {
    406404                extension( untypedExpr );
    407                 if ( NameExpr * nameExpr = dynamic_cast< NameExpr* >( untypedExpr->get_function() ) ) {
     405                if ( NameExpr *nameExpr = dynamic_cast< NameExpr* >( untypedExpr->get_function() ) ) {
    408406                        OperatorInfo opInfo;
    409407                        if ( operatorLookup( nameExpr->get_name(), opInfo ) ) {
     
    474472                                } // switch
    475473                        } else {
    476                                 if ( nameExpr->get_name() == "..." ) { // case V1 ... V2 or case V1~V2
     474                                if ( nameExpr->get_name() == "Range" ) { // case V1 ... V2 or case V1~V2
    477475                                        assert( untypedExpr->get_args().size() == 2 );
    478476                                        (*untypedExpr->get_args().begin())->accept( *this );
     
    494492        }
    495493
    496         void CodeGenerator::visit( RangeExpr * rangeExpr ) {
    497                 rangeExpr->get_low()->accept( *this );
    498                 output << " ... ";
    499                 rangeExpr->get_high()->accept( *this );
    500         }
    501 
    502         void CodeGenerator::visit( NameExpr * nameExpr ) {
     494        void CodeGenerator::visit( NameExpr *nameExpr ) {
    503495                extension( nameExpr );
    504496                OperatorInfo opInfo;
     
    511503        }
    512504
    513         void CodeGenerator::visit( AddressExpr * addressExpr ) {
     505        void CodeGenerator::visit( AddressExpr *addressExpr ) {
    514506                extension( addressExpr );
    515507                output << "(&";
    516508                // this hack makes sure that we don't convert "constant_zero" to "0" if we're taking its address
    517                 if ( VariableExpr * variableExpr = dynamic_cast< VariableExpr* >( addressExpr->get_arg() ) ) {
     509                if ( VariableExpr *variableExpr = dynamic_cast< VariableExpr* >( addressExpr->get_arg() ) ) {
    518510                        output << mangleName( variableExpr->get_var() );
    519511                } else {
     
    523515        }
    524516
    525         void CodeGenerator::visit( CastExpr * castExpr ) {
     517        void CodeGenerator::visit( CastExpr *castExpr ) {
    526518                extension( castExpr );
    527519                output << "(";
     
    541533        }
    542534
    543         void CodeGenerator::visit( UntypedMemberExpr * memberExpr ) {
     535        void CodeGenerator::visit( UntypedMemberExpr *memberExpr ) {
    544536                assert( false );
    545537        }
    546538
    547         void CodeGenerator::visit( MemberExpr * memberExpr ) {
     539        void CodeGenerator::visit( MemberExpr *memberExpr ) {
    548540                extension( memberExpr );
    549541                memberExpr->get_aggregate()->accept( *this );
     
    551543        }
    552544
    553         void CodeGenerator::visit( VariableExpr * variableExpr ) {
     545        void CodeGenerator::visit( VariableExpr *variableExpr ) {
    554546                extension( variableExpr );
    555547                OperatorInfo opInfo;
     
    561553        }
    562554
    563         void CodeGenerator::visit( ConstantExpr * constantExpr ) {
     555        void CodeGenerator::visit( ConstantExpr *constantExpr ) {
    564556                assert( constantExpr->get_constant() );
    565557                extension( constantExpr );
     
    567559        }
    568560
    569         void CodeGenerator::visit( SizeofExpr * sizeofExpr ) {
     561        void CodeGenerator::visit( SizeofExpr *sizeofExpr ) {
    570562                extension( sizeofExpr );
    571563                output << "sizeof(";
     
    578570        }
    579571
    580         void CodeGenerator::visit( AlignofExpr * alignofExpr ) {
     572        void CodeGenerator::visit( AlignofExpr *alignofExpr ) {
    581573                // use GCC extension to avoid bumping std to C11
    582574                extension( alignofExpr );
     
    590582        }
    591583
    592         void CodeGenerator::visit( UntypedOffsetofExpr * offsetofExpr ) {
     584        void CodeGenerator::visit( UntypedOffsetofExpr *offsetofExpr ) {
    593585                assert( false && "UntypedOffsetofExpr should not reach code generation." );
    594586        }
    595587
    596         void CodeGenerator::visit( OffsetofExpr * offsetofExpr ) {
     588        void CodeGenerator::visit( OffsetofExpr *offsetofExpr ) {
    597589                // use GCC builtin
    598590                output << "__builtin_offsetof(";
     
    602594        }
    603595
    604         void CodeGenerator::visit( OffsetPackExpr * offsetPackExpr ) {
     596        void CodeGenerator::visit( OffsetPackExpr *offsetPackExpr ) {
    605597                assert( false && "OffsetPackExpr should not reach code generation." );
    606598        }
    607599
    608         void CodeGenerator::visit( LogicalExpr * logicalExpr ) {
     600        void CodeGenerator::visit( LogicalExpr *logicalExpr ) {
    609601                extension( logicalExpr );
    610602                output << "(";
     
    619611        }
    620612
    621         void CodeGenerator::visit( ConditionalExpr * conditionalExpr ) {
     613        void CodeGenerator::visit( ConditionalExpr *conditionalExpr ) {
    622614                extension( conditionalExpr );
    623615                output << "(";
     
    630622        }
    631623
    632         void CodeGenerator::visit( CommaExpr * commaExpr ) {
     624        void CodeGenerator::visit( CommaExpr *commaExpr ) {
    633625                extension( commaExpr );
    634626                output << "(";
     
    639631        }
    640632
    641         void CodeGenerator::visit( TupleExpr * tupleExpr ) {}
    642 
    643         void CodeGenerator::visit( TypeExpr * typeExpr ) {}
    644 
    645         void CodeGenerator::visit( AsmExpr * asmExpr ) {
     633        void CodeGenerator::visit( TupleExpr *tupleExpr ) {}
     634
     635        void CodeGenerator::visit( TypeExpr *typeExpr ) {}
     636
     637        void CodeGenerator::visit( AsmExpr *asmExpr ) {
    646638                if ( asmExpr->get_inout() ) {
    647639                        output << "[ ";
     
    656648
    657649        //*** Statements
    658         void CodeGenerator::visit( CompoundStmt * compoundStmt ) {
     650        void CodeGenerator::visit( CompoundStmt *compoundStmt ) {
    659651                std::list<Statement*> ks = compoundStmt->get_kids();
    660652                output << "{" << endl;
     
    670662                                output << endl;
    671663                        } // if
    672                 } // for
     664                }
    673665                cur_indent -= CodeGenerator::tabsize;
    674666
     
    676668        }
    677669
    678         void CodeGenerator::visit( ExprStmt * exprStmt ) {
     670        void CodeGenerator::visit( ExprStmt *exprStmt ) {
    679671                assert( exprStmt );
    680672                // cast the top-level expression to void to reduce gcc warnings.
     
    684676        }
    685677
    686         void CodeGenerator::visit( AsmStmt * asmStmt ) {
     678        void CodeGenerator::visit( AsmStmt *asmStmt ) {
    687679                output << "asm ";
    688680                if ( asmStmt->get_voltile() ) output << "volatile ";
     
    707699        }
    708700
    709         void CodeGenerator::visit( IfStmt * ifStmt ) {
     701        void CodeGenerator::visit( IfStmt *ifStmt ) {
    710702                output << "if ( ";
    711703                ifStmt->get_condition()->accept( *this );
     
    720712        }
    721713
    722         void CodeGenerator::visit( SwitchStmt * switchStmt ) {
     714        void CodeGenerator::visit( SwitchStmt *switchStmt ) {
    723715                output << "switch ( " ;
    724716                switchStmt->get_condition()->accept( *this );
     
    727719                output << "{" << std::endl;
    728720                cur_indent += CodeGenerator::tabsize;
    729                 acceptAll( switchStmt->get_statements(), *this );
     721
     722                acceptAll( switchStmt->get_branches(), *this );
     723
    730724                cur_indent -= CodeGenerator::tabsize;
     725
    731726                output << indent << "}";
    732727        }
    733728
    734         void CodeGenerator::visit( CaseStmt * caseStmt ) {
     729        void CodeGenerator::visit( CaseStmt *caseStmt ) {
    735730                output << indent;
    736731                if ( caseStmt->isDefault()) {
     
    753748        }
    754749
    755         void CodeGenerator::visit( BranchStmt * branchStmt ) {
     750        void CodeGenerator::visit( BranchStmt *branchStmt ) {
    756751                switch ( branchStmt->get_type()) {
    757752                  case BranchStmt::Goto:
     
    776771
    777772
    778         void CodeGenerator::visit( ReturnStmt * returnStmt ) {
     773        void CodeGenerator::visit( ReturnStmt *returnStmt ) {
    779774                output << "return ";
    780775                maybeAccept( returnStmt->get_expr(), *this );
     
    782777        }
    783778
    784         void CodeGenerator::visit( WhileStmt * whileStmt ) {
     779        void CodeGenerator::visit( WhileStmt *whileStmt ) {
    785780                if ( whileStmt->get_isDoWhile() ) {
    786781                        output << "do" ;
     
    804799        }
    805800
    806         void CodeGenerator::visit( ForStmt * forStmt ) {
     801        void CodeGenerator::visit( ForStmt *forStmt ) {
    807802                // initialization is always hoisted, so don't bother doing anything with that
    808803                output << "for (;";
     
    826821        }
    827822
    828         void CodeGenerator::visit( NullStmt * nullStmt ) {
     823        void CodeGenerator::visit( NullStmt *nullStmt ) {
    829824                //output << indent << CodeGenerator::printLabels( nullStmt->get_labels() );
    830825                output << "/* null statement */ ;";
    831826        }
    832827
    833         void CodeGenerator::visit( DeclStmt * declStmt ) {
     828        void CodeGenerator::visit( DeclStmt *declStmt ) {
    834829                declStmt->get_decl()->accept( *this );
    835830
     
    839834        }
    840835
    841         void CodeGenerator::handleStorageClass( Declaration * decl ) {
     836        void CodeGenerator::handleStorageClass( Declaration *decl ) {
    842837                switch ( decl->get_storageClass() ) {
    843838                  case DeclarationNode::Extern:
  • src/CodeGen/CodeGenerator.h

    rc331406 r5070fe4  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Aug  4 13:37:07 2016
    13 // Update Count     : 38
     12// Last Modified On : Sat Jul 30 11:10:42 2016
     13// Update Count     : 37
    1414//
    1515
     
    5454                virtual void visit( ApplicationExpr *applicationExpr );
    5555                virtual void visit( UntypedExpr *untypedExpr );
    56                 virtual void visit( RangeExpr * rangeExpr );
    5756                virtual void visit( NameExpr *nameExpr );
    5857                virtual void visit( AddressExpr *addressExpr );
  • src/ControlStruct/MLEMutator.cc

    rc331406 r5070fe4  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Aug  4 11:21:32 2016
    13 // Update Count     : 202
     12// Last Modified On : Tue Jul 12 17:36:51 2016
     13// Update Count     : 197
    1414//
    1515
     
    128128                Label brkLabel = generator->newLabel("switchBreak");
    129129                enclosingControlStructures.push_back( Entry(switchStmt, brkLabel) );
    130                 mutateAll( switchStmt->get_statements(), *this );
     130                mutateAll( switchStmt->get_branches(), *this );
    131131
    132132                Entry &e = enclosingControlStructures.back();
     
    138138                        // switch should be CastStmts), append the exit label + break to the last case statement; create a default
    139139                        // case if there are no cases
    140                         std::list< Statement * > &statements = switchStmt->get_statements();
    141                         if ( statements.empty() ) {
    142                                 statements.push_back( CaseStmt::makeDefault() );
    143                         } // if
    144 
    145                         if ( CaseStmt * c = dynamic_cast< CaseStmt * >( statements.back() ) ) {
     140                        std::list< Statement * > &branches = switchStmt->get_branches();
     141                        if ( branches.empty() ) {
     142                                branches.push_back( CaseStmt::makeDefault() );
     143                        } // if
     144
     145                        if ( CaseStmt * c = dynamic_cast< CaseStmt * >( branches.back() ) ) {
    146146                                std::list<Label> temp; temp.push_back( brkLabel );
    147147                                c->get_statements().push_back( new BranchStmt( temp, Label("brkLabel"), BranchStmt::Break ) );
    148                         } else assert(0); // as of this point, all statements of a switch are still CaseStmts
     148                        } else assert(0); // as of this point, all branches of a switch are still CaseStmts
    149149                } // if
    150150
  • src/ControlStruct/Mutate.cc

    rc331406 r5070fe4  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Aug  4 11:39:08 2016
    13 // Update Count     : 9
     12// Last Modified On : Tue Jul 12 17:37:45 2016
     13// Update Count     : 8
    1414//
    1515
     
    2222#include "LabelFixer.h"
    2323#include "MLEMutator.h"
     24#include "CaseRangeMutator.h"
    2425#include "ForExprMutator.h"
    2526#include "LabelTypeChecker.h"
     
    4041                LabelFixer lfix;
    4142
     43                // expand case ranges and turn fallthru into a null statement
     44                CaseRangeMutator ranges;
     45
    4246                //ExceptMutator exc;
    4347                // LabelTypeChecker lbl;
     
    4549                mutateAll( translationUnit, formut );
    4650                acceptAll( translationUnit, lfix );
     51                mutateAll( translationUnit, ranges );
    4752                //mutateAll( translationUnit, exc );
    4853                //acceptAll( translationUnit, lbl );
  • src/ControlStruct/module.mk

    rc331406 r5070fe4  
    1111## Created On       : Mon Jun  1 17:49:17 2015
    1212## Last Modified By : Peter A. Buhr
    13 ## Last Modified On : Thu Aug  4 11:38:06 2016
    14 ## Update Count     : 3
     13## Last Modified On : Tue Jul 12 17:40:31 2016
     14## Update Count     : 2
    1515###############################################################################
    1616
     
    1818        ControlStruct/LabelFixer.cc \
    1919        ControlStruct/MLEMutator.cc \
     20        ControlStruct/CaseRangeMutator.cc \
    2021        ControlStruct/Mutate.cc \
    2122        ControlStruct/ForExprMutator.cc \
  • src/GenPoly/DeclMutator.cc

    rc331406 r5070fe4  
    1010// Created On       : Fri Nov 27 14:44:00 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Aug  4 11:16:43 2016
    13 // Update Count     : 3
     12// Last Modified On : Tue Jul 12 17:38:46 2016
     13// Update Count     : 2
    1414//
    1515
     
    163163        Statement* DeclMutator::mutate(SwitchStmt *switchStmt) {
    164164                switchStmt->set_condition( maybeMutate( switchStmt->get_condition(), *this ) );
    165                 mutateAll( switchStmt->get_statements(), *this );
     165                mutateAll( switchStmt->get_branches(), *this );
    166166                return switchStmt;
    167167        }
  • src/GenPoly/DeclMutator.h

    rc331406 r5070fe4  
    2828        class DeclMutator : public Mutator {
    2929        public:
    30                 typedef Mutator Parent;
    31 
    3230                DeclMutator();
    3331                virtual ~DeclMutator();
    34 
    35                 using Parent::mutate;
     32               
    3633                virtual CompoundStmt* mutate(CompoundStmt *compoundStmt);
    3734                virtual Statement* mutate(IfStmt *ifStmt);
     
    4542                /// Mutates a list of declarations with this visitor
    4643                void mutateDeclarationList(std::list< Declaration* >& decls);
    47 
     44               
    4845                /// Called on entry to a new scope; overriders should call this as a super-class call
    4946                virtual void doBeginScope();
  • src/GenPoly/PolyMutator.cc

    rc331406 r5070fe4  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Aug  4 11:26:22 2016
    13 // Update Count     : 16
     12// Last Modified On : Tue Jul 12 17:39:32 2016
     13// Update Count     : 12
    1414//
    1515
     
    9999
    100100        Statement * PolyMutator::mutate(SwitchStmt *switchStmt) {
    101                 mutateStatementList( switchStmt->get_statements() );
     101                mutateStatementList( switchStmt->get_branches() );
    102102                switchStmt->set_condition( mutateExpression( switchStmt->get_condition() ) );
    103103                return switchStmt;
  • src/GenPoly/Specialize.cc

    rc331406 r5070fe4  
    3131#include "Common/UniqueName.h"
    3232#include "Common/utility.h"
    33 #include "InitTweak/InitTweak.h"
    3433
    3534namespace GenPoly {
     
    185184                mutateAll( appExpr->get_args(), *this );
    186185
    187                 if ( ! InitTweak::isIntrinsicCallExpr( appExpr ) ) {
    188                         // create thunks for the inferred parameters
    189                         // don't need to do this for intrinsic calls, because they aren't actually passed
    190                         for ( InferredParams::iterator inferParam = appExpr->get_inferParams().begin(); inferParam != appExpr->get_inferParams().end(); ++inferParam ) {
    191                                 inferParam->second.expr = doSpecialization( inferParam->second.formalType, inferParam->second.expr, &appExpr->get_inferParams() );
    192                         }
    193 
    194                         handleExplicitParams( appExpr );
    195                 }
     186                // create thunks for the inferred parameters
     187                for ( InferredParams::iterator inferParam = appExpr->get_inferParams().begin(); inferParam != appExpr->get_inferParams().end(); ++inferParam ) {
     188                        inferParam->second.expr = doSpecialization( inferParam->second.formalType, inferParam->second.expr, &appExpr->get_inferParams() );
     189                }
     190
     191                handleExplicitParams( appExpr );
    196192
    197193                return appExpr;
  • src/InitTweak/FixGlobalInit.cc

    rc331406 r5070fe4  
    4646                FunctionDecl * destroyFunction;
    4747        };
     48
     49        class ConstExprChecker : public Visitor {
     50        public:
     51                ConstExprChecker() : isConstExpr( true ) {}
     52
     53                virtual void visit( ApplicationExpr *applicationExpr ) { isConstExpr = false; }
     54                virtual void visit( UntypedExpr *untypedExpr ) { isConstExpr = false; }
     55                virtual void visit( NameExpr *nameExpr ) { isConstExpr = false; }
     56                virtual void visit( CastExpr *castExpr ) { isConstExpr = false; }
     57                virtual void visit( LabelAddressExpr *labAddressExpr ) { isConstExpr = false; }
     58                virtual void visit( UntypedMemberExpr *memberExpr ) { isConstExpr = false; }
     59                virtual void visit( MemberExpr *memberExpr ) { isConstExpr = false; }
     60                virtual void visit( VariableExpr *variableExpr ) { isConstExpr = false; }
     61                virtual void visit( ConstantExpr *constantExpr ) { /* bottom out */ }
     62                // these might be okay?
     63                // virtual void visit( SizeofExpr *sizeofExpr );
     64                // virtual void visit( AlignofExpr *alignofExpr );
     65                // virtual void visit( UntypedOffsetofExpr *offsetofExpr );
     66                // virtual void visit( OffsetofExpr *offsetofExpr );
     67                // virtual void visit( OffsetPackExpr *offsetPackExpr );
     68                // virtual void visit( AttrExpr *attrExpr );
     69                // virtual void visit( CommaExpr *commaExpr );
     70                // virtual void visit( LogicalExpr *logicalExpr );
     71                // virtual void visit( ConditionalExpr *conditionalExpr );
     72                virtual void visit( TupleExpr *tupleExpr ) { isConstExpr = false; }
     73                virtual void visit( SolvedTupleExpr *tupleExpr ) { isConstExpr = false; }
     74                virtual void visit( TypeExpr *typeExpr ) { isConstExpr = false; }
     75                virtual void visit( AsmExpr *asmExpr ) { isConstExpr = false; }
     76                virtual void visit( UntypedValofExpr *valofExpr ) { isConstExpr = false; }
     77                virtual void visit( CompoundLiteralExpr *compLitExpr ) { isConstExpr = false; }
     78
     79                bool isConstExpr;
     80        };
     81
     82        bool isConstExpr( Initializer * init ) {
     83                if ( init ) {
     84                        ConstExprChecker checker;
     85                        init->accept( checker );
     86                        return checker.isConstExpr;
     87                } // if
     88                // for all intents and purposes, no initializer means const expr
     89                return true;
     90        }
    4891
    4992        void fixGlobalInit( std::list< Declaration * > & translationUnit, const std::string & name, bool inLibrary ) {
     
    97140                std::list< Statement * > & destroyStatements = destroyFunction->get_statements()->get_kids();
    98141
     142                if ( ! tryConstruct( objDecl ) ) return; // don't construct @= or designated objects
     143                if ( objDecl->get_storageClass() == DeclarationNode::Extern ) return;
    99144                // C allows you to initialize objects with constant expressions
    100145                // xxx - this is an optimization. Need to first resolve constructors before we decide
     
    102147                // if ( isConstExpr( objDecl->get_init() ) ) return;
    103148
    104                 if ( ConstructorInit * ctorInit = dynamic_cast< ConstructorInit * >( objDecl->get_init() ) ) {
    105                         // a decision should have been made by the resolver, so ctor and init are not both non-NULL
    106                         assert( ! ctorInit->get_ctor() || ! ctorInit->get_init() );
     149                if ( dynamic_cast< ArrayType * > ( objDecl->get_type() ) ) {
     150                        // xxx - initialize each element of the array
     151                } else {
     152                        // steal initializer from object and attach it to a new temporary
     153                        ObjectDecl *newObj = new ObjectDecl( tempNamer.newName(), DeclarationNode::NoStorageClass, LinkageSpec::C, 0, objDecl->get_type()->clone(), objDecl->get_init() );
     154                        objDecl->set_init( NULL );
     155                        initStatements.push_back( new DeclStmt( noLabels, newObj ) );
    107156
    108                         Statement * dtor = ctorInit->get_dtor();
    109                         if ( dtor && ! isIntrinsicSingleArgCallStmt( dtor ) ) {
    110                                 // don't need to call intrinsic dtor, because it does nothing, but
    111                                 // non-intrinsic dtors must be called
    112                                 destroyStatements.push_front( dtor );
    113                                 ctorInit->set_dtor( NULL );
    114                         } // if
    115                         if ( Statement * ctor = ctorInit->get_ctor() ) {
    116                                 initStatements.push_back( ctor );
    117                                 objDecl->set_init( NULL );
    118                                 ctorInit->set_ctor( NULL );
    119                         } else if ( Initializer * init = ctorInit->get_init() ) {
    120                                 objDecl->set_init( init );
    121                                 ctorInit->set_init( NULL );
    122                         } else {
    123                                 // no constructor and no initializer, which is okay
    124                                 objDecl->set_init( NULL );
    125                         } // if
    126                         delete ctorInit;
     157                        // copy construct objDecl using temporary
     158                        UntypedExpr * init = new UntypedExpr( new NameExpr( "?{}" ) );
     159                        init->get_args().push_back( new AddressExpr( new VariableExpr( objDecl ) ) );
     160                        init->get_args().push_back( new VariableExpr( newObj ) );
     161                        initStatements.push_back( new ImplicitCtorDtorStmt( new ExprStmt( noLabels, init ) ) );
     162
     163                        // add destructor calls to global destroy function
     164                        UntypedExpr * destroy = new UntypedExpr( new NameExpr( "^?{}" ) );
     165                        destroy->get_args().push_back( new AddressExpr( new VariableExpr( objDecl ) ) );
     166                        destroyStatements.push_front( new ImplicitCtorDtorStmt( new ExprStmt( noLabels, destroy ) ) );
    127167                } // if
    128168        }
  • src/InitTweak/FixInit.cc

    rc331406 r5070fe4  
    1818#include <iterator>
    1919#include <algorithm>
     20#include "FixInit.h"
    2021#include "InitTweak.h"
    21 #include "FixInit.h"
    22 #include "FixGlobalInit.h"
    2322#include "ResolvExpr/Resolver.h"
    2423#include "ResolvExpr/typeops.h"
     
    2625#include "SynTree/Type.h"
    2726#include "SynTree/Expression.h"
    28 #include "SynTree/Attribute.h"
    2927#include "SynTree/Statement.h"
    3028#include "SynTree/Initializer.h"
     
    8583                };
    8684
    87                 // debug
    8885                struct printSet {
    8986                        typedef ObjDeclCollector::ObjectSet ObjectSet;
     
    162159
    163160                        virtual DeclarationWithType * mutate( ObjectDecl *objDecl );
    164 
    165                         std::list< Declaration * > staticDtorDecls;
    166161                };
    167162
     
    176171        } // namespace
    177172
    178         void fix( std::list< Declaration * > & translationUnit, const std::string & filename, bool inLibrary ) {
    179                 // fixes ConstructorInit for global variables. should happen before fixInitializers.
    180                 InitTweak::fixGlobalInit( translationUnit, filename, inLibrary );
    181 
     173        void fix( std::list< Declaration * > & translationUnit ) {
    182174                InsertImplicitCalls::insert( translationUnit );
    183175                ResolveCopyCtors::resolveImplicitCalls( translationUnit );
     
    202194                void FixInit::fixInitializers( std::list< Declaration * > & translationUnit ) {
    203195                        FixInit fixer;
    204 
    205                         // can't use mutateAll, because need to insert declarations at top-level
    206                         // can't use DeclMutator, because sometimes need to insert IfStmt, etc.
    207                         SemanticError errors;
    208                         for ( std::list< Declaration * >::iterator i = translationUnit.begin(); i != translationUnit.end(); ++i ) {
    209                                 try {
    210                                         *i = maybeMutate( *i, fixer );
    211                                         translationUnit.splice( i, fixer.staticDtorDecls );
    212                                 } catch( SemanticError &e ) {
    213                                         errors.append( e );
    214                                 } // try
    215                         } // for
    216                         if ( ! errors.isEmpty() ) {
    217                                 throw errors;
    218                         } // if
     196                        mutateAll( translationUnit, fixer );
    219197                }
    220198
     
    444422                                if ( Statement * ctor = ctorInit->get_ctor() ) {
    445423                                        if ( objDecl->get_storageClass() == DeclarationNode::Static ) {
    446                                                 // originally wanted to take advantage of gcc nested functions, but
    447                                                 // we get memory errors with this approach. To remedy this, the static
    448                                                 // variable is hoisted when the destructor needs to be called.
    449                                                 //
    450424                                                // generate:
    451                                                 // static T __objName_static_varN;
    452                                                 // void __objName_dtor_atexitN() {
    453                                                 //   __dtor__...;
     425                                                // static bool __objName_uninitialized = true;
     426                                                // if (__objName_uninitialized) {
     427                                                //   __ctor(__objName);
     428                                                //   void dtor_atexit() {
     429                                                //     __dtor(__objName);
     430                                                //   }
     431                                                //   on_exit(dtorOnExit, &__objName);
     432                                                //   __objName_uninitialized = false;
    454433                                                // }
    455                                                 // int f(...) {
    456                                                 //   ...
    457                                                 //   static bool __objName_uninitialized = true;
    458                                                 //   if (__objName_uninitialized) {
    459                                                 //     __ctor(__objName);
    460                                                 //     __objName_uninitialized = false;
    461                                                 //     atexit(__objName_dtor_atexitN);
    462                                                 //   }
    463                                                 //   ...
    464                                                 // }
    465 
    466                                                 static UniqueName dtorCallerNamer( "_dtor_atexit" );
    467 
    468                                                 // static bool __objName_uninitialized = true
     434
     435                                                // generate first line
    469436                                                BasicType * boolType = new BasicType( Type::Qualifiers(), BasicType::Bool );
    470437                                                SingleInit * boolInitExpr = new SingleInit( new ConstantExpr( Constant( boolType->clone(), "1" ) ), noDesignators );
     
    472439                                                isUninitializedVar->fixUniqueId();
    473440
     441                                                // void dtor_atexit(...) {...}
     442                                                FunctionDecl * dtorCaller = new FunctionDecl( objDecl->get_mangleName() + "_dtor_atexit", DeclarationNode::NoStorageClass, LinkageSpec::C, new FunctionType( Type::Qualifiers(), false ), new CompoundStmt( noLabels ), false, false );
     443                                                dtorCaller->fixUniqueId();
     444                                                dtorCaller->get_statements()->get_kids().push_back( ctorInit->get_dtor()->clone() );
     445
     446                                                // on_exit(dtor_atexit);
     447                                                UntypedExpr * callAtexit = new UntypedExpr( new NameExpr( "atexit" ) );
     448                                                callAtexit->get_args().push_back( new VariableExpr( dtorCaller ) );
     449
    474450                                                // __objName_uninitialized = false;
    475451                                                UntypedExpr * setTrue = new UntypedExpr( new NameExpr( "?=?" ) );
     
    481457                                                std::list< Statement * > & body = initStmts->get_kids();
    482458                                                body.push_back( ctor );
     459                                                body.push_back( new DeclStmt( noLabels, dtorCaller ) );
     460                                                body.push_back( new ExprStmt( noLabels, callAtexit ) );
    483461                                                body.push_back( new ExprStmt( noLabels, setTrue ) );
    484462
     
    487465                                                stmtsToAddAfter.push_back( new DeclStmt( noLabels, isUninitializedVar ) );
    488466                                                stmtsToAddAfter.push_back( ifStmt );
    489 
    490                                                 if ( ctorInit->get_dtor() ) {
    491                                                         // if the object has a non-trivial destructor, have to
    492                                                         // hoist it and the object into the global space and
    493                                                         // call the destructor function with atexit.
    494 
    495                                                         Statement * dtorStmt = ctorInit->get_dtor()->clone();
    496 
    497                                                         // void __objName_dtor_atexitN(...) {...}
    498                                                         FunctionDecl * dtorCaller = new FunctionDecl( objDecl->get_mangleName() + dtorCallerNamer.newName(), DeclarationNode::Static, LinkageSpec::C, new FunctionType( Type::Qualifiers(), false ), new CompoundStmt( noLabels ), false, false );
    499                                                         dtorCaller->fixUniqueId();
    500                                                         dtorCaller->get_statements()->get_kids().push_back( dtorStmt );
    501 
    502                                                         // atexit(dtor_atexit);
    503                                                         UntypedExpr * callAtexit = new UntypedExpr( new NameExpr( "atexit" ) );
    504                                                         callAtexit->get_args().push_back( new VariableExpr( dtorCaller ) );
    505 
    506                                                         body.push_back( new ExprStmt( noLabels, callAtexit ) );
    507 
    508                                                         // hoist variable and dtor caller decls to list of decls that will be added into global scope
    509                                                         staticDtorDecls.push_back( objDecl );
    510                                                         staticDtorDecls.push_back( dtorCaller );
    511 
    512                                                         // need to rename object uniquely since it now appears
    513                                                         // at global scope and there could be multiple function-scoped
    514                                                         // static variables with the same name in different functions.
    515                                                         static UniqueName staticNamer( "_static_var" );
    516                                                         objDecl->set_mangleName( objDecl->get_mangleName() + staticNamer.newName() );
    517 
    518                                                         objDecl->set_init( NULL );
    519                                                         ctorInit->set_ctor( NULL );
    520                                                         delete ctorInit;
    521 
    522                                                         // xxx - temporary hack: need to return a declaration, but want to hoist the current object out of this scope
    523                                                         // create a new object which is never used
    524                                                         static UniqueName dummyNamer( "_dummy" );
    525                                                         ObjectDecl * dummy = new ObjectDecl( dummyNamer.newName(), DeclarationNode::Static, LinkageSpec::Cforall, 0, new PointerType( Type::Qualifiers(), new VoidType( Type::Qualifiers() ) ), 0, std::list< Attribute * >{ new Attribute("unused") } );
    526                                                         return dummy;
    527                                                 }
    528467                                        } else {
    529468                                                stmtsToAddAfter.push_back( ctor );
     
    585524                                        assert( ! ctorInit->get_ctor() || ! ctorInit->get_init() );
    586525                                        Statement * dtor = ctorInit->get_dtor();
    587                                         if ( dtor && ! isIntrinsicSingleArgCallStmt( dtor ) ) {
     526                                        if ( dtor && ! isInstrinsicSingleArgCallStmt( dtor ) ) {
    588527                                                // don't need to call intrinsic dtor, because it does nothing, but
    589528                                                // non-intrinsic dtors must be called
  • src/InitTweak/FixInit.h

    rc331406 r5070fe4  
    2727  /// replace constructor initializers with expression statements
    2828  /// and unwrap basic C-style initializers
    29         void fix( std::list< Declaration * > & translationUnit, const std::string & name, bool inLibrary );
     29        void fix( std::list< Declaration * > & translationUnit );
    3030} // namespace
    3131
  • src/InitTweak/GenInit.cc

    rc331406 r5070fe4  
    2626#include "SymTab/Autogen.h"
    2727#include "GenPoly/PolyMutator.h"
    28 #include "GenPoly/DeclMutator.h"
    2928
    3029namespace InitTweak {
     
    5655          public:
    5756                /// create constructor and destructor statements for object declarations.
    58                 /// the actual call statements will be added in after the resolver has run
    59                 /// so that the initializer expression is only removed if a constructor is found
    60                 /// and the same destructor call is inserted in all of the appropriate locations.
     57                /// Destructors are inserted directly into the code, whereas constructors
     58                /// will be added in after the resolver has run so that the initializer expression
     59                /// is only removed if a constructor is found
    6160                static void generateCtorDtor( std::list< Declaration * > &translationUnit );
     61
     62                CtorDtor() : inFunction( false ) {}
    6263
    6364                virtual DeclarationWithType * mutate( ObjectDecl * );
    6465                virtual DeclarationWithType * mutate( FunctionDecl *functionDecl );
    65                 // should not traverse into any of these declarations to find objects
    66                 // that need to be constructed or destructed
    67                 virtual Declaration* mutate( StructDecl *aggregateDecl ) { return aggregateDecl; }
    68                 virtual Declaration* mutate( UnionDecl *aggregateDecl ) { return aggregateDecl; }
    69                 virtual Declaration* mutate( EnumDecl *aggregateDecl ) { return aggregateDecl; }
    70                 virtual Declaration* mutate( TraitDecl *aggregateDecl ) { return aggregateDecl; }
    71                 virtual TypeDecl* mutate( TypeDecl *typeDecl ) { return typeDecl; }
    72                 virtual Declaration* mutate( TypedefDecl *typeDecl ) { return typeDecl; }
    73 
    74                 virtual Type * mutate( FunctionType *funcType ) { return funcType; }
     66                virtual Declaration* mutate( StructDecl *aggregateDecl );
     67                virtual Declaration* mutate( UnionDecl *aggregateDecl );
     68                virtual Declaration* mutate( EnumDecl *aggregateDecl );
     69                virtual Declaration* mutate( TraitDecl *aggregateDecl );
     70                virtual TypeDecl* mutate( TypeDecl *typeDecl );
     71                virtual Declaration* mutate( TypedefDecl *typeDecl );
     72
     73                virtual Type * mutate( FunctionType *funcType );
    7574
    7675          protected:
    77         };
    78 
    79         class HoistArrayDimension : public GenPoly::DeclMutator {
    80           public:
    81                 typedef GenPoly::DeclMutator Parent;
    82 
    83                 /// hoist dimension from array types in object declaration so that it uses a single
    84                 /// const variable of type size_t, so that side effecting array dimensions are only
    85                 /// computed once.
    86                 static void hoistArrayDimension( std::list< Declaration * > & translationUnit );
    87 
    88           private:
    89                 virtual DeclarationWithType * mutate( ObjectDecl * objectDecl );
    90                 virtual DeclarationWithType * mutate( FunctionDecl *functionDecl );
    91                 // should not traverse into any of these declarations to find objects
    92                 // that need to be constructed or destructed
    93                 virtual Declaration* mutate( StructDecl *aggregateDecl ) { return aggregateDecl; }
    94                 virtual Declaration* mutate( UnionDecl *aggregateDecl ) { return aggregateDecl; }
    95                 virtual Declaration* mutate( EnumDecl *aggregateDecl ) { return aggregateDecl; }
    96                 virtual Declaration* mutate( TraitDecl *aggregateDecl ) { return aggregateDecl; }
    97                 virtual TypeDecl* mutate( TypeDecl *typeDecl ) { return typeDecl; }
    98                 virtual Declaration* mutate( TypedefDecl *typeDecl ) { return typeDecl; }
    99 
    100                 virtual Type* mutate( FunctionType *funcType ) { return funcType; }
    101 
    102                 void hoist( Type * type );
    103 
    104                 DeclarationNode::StorageClass storageclass = DeclarationNode::NoStorageClass;
    105                 bool inFunction = false;
     76                bool inFunction;
    10677        };
    10778
    10879        void genInit( std::list< Declaration * > & translationUnit ) {
    10980                ReturnFixer::makeReturnTemp( translationUnit );
    110                 HoistArrayDimension::hoistArrayDimension( translationUnit );
    11181                CtorDtor::generateCtorDtor( translationUnit );
    11282        }
     
    154124        }
    155125
    156         // precompute array dimension expression, because constructor generation may duplicate it,
    157         // which would be incorrect if it is a side-effecting computation.
    158         void HoistArrayDimension::hoistArrayDimension( std::list< Declaration * > & translationUnit ) {
    159                 HoistArrayDimension hoister;
    160                 hoister.mutateDeclarationList( translationUnit );
    161         }
    162 
    163         DeclarationWithType * HoistArrayDimension::mutate( ObjectDecl * objectDecl ) {
    164                 storageclass = objectDecl->get_storageClass();
    165                 DeclarationWithType * temp = Parent::mutate( objectDecl );
    166                 hoist( objectDecl->get_type() );
    167                 storageclass = DeclarationNode::NoStorageClass;
    168                 return temp;
    169         }
    170 
    171         void HoistArrayDimension::hoist( Type * type ) {
    172                 // if in function, generate const size_t var
    173                 static UniqueName dimensionName( "_array_dim" );
    174 
    175                 // C doesn't allow variable sized arrays at global scope or for static variables,
    176                 // so don't hoist dimension.
    177                 if ( ! inFunction ) return;
    178                 if ( storageclass == DeclarationNode::Static ) return;
    179 
    180                 if ( ArrayType * arrayType = dynamic_cast< ArrayType * >( type ) ) {
    181                         if ( ! arrayType->get_dimension() ) return; // xxx - recursive call to hoist?
    182 
    183                         // don't need to hoist dimension if it's a constexpr - only need to if there's potential
    184                         // for side effects.
    185                         if ( isConstExpr( arrayType->get_dimension() ) ) return;
    186 
    187                         ObjectDecl * arrayDimension = new ObjectDecl( dimensionName.newName(), storageclass, LinkageSpec::C, 0, SymTab::SizeType->clone(), new SingleInit( arrayType->get_dimension() ) );
    188                         arrayDimension->get_type()->set_isConst( true );
    189 
    190                         arrayType->set_dimension( new VariableExpr( arrayDimension ) );
    191                         addDeclaration( arrayDimension );
    192 
    193                         hoist( arrayType->get_base() );
    194                         return;
    195                 }
    196         }
    197 
    198         DeclarationWithType * HoistArrayDimension::mutate( FunctionDecl *functionDecl ) {
    199                 bool oldInFunc = inFunction;
    200                 inFunction = true;
    201                 DeclarationWithType * decl = Parent::mutate( functionDecl );
    202                 inFunction = oldInFunc;
    203                 return decl;
    204         }
    205126
    206127        void CtorDtor::generateCtorDtor( std::list< Declaration * > & translationUnit ) {
     
    209130        }
    210131
     132        namespace {
     133                Expression * makeCtorDtorExpr( std::string name, ObjectDecl * objDecl, std::list< Expression * > args ) {
     134                        UntypedExpr * expr = new UntypedExpr( new NameExpr( name ) );
     135                        expr->get_args().push_back( new AddressExpr( new VariableExpr( objDecl ) ) );
     136                        expr->get_args().splice( expr->get_args().end(), args );
     137                        return expr;
     138                }
     139        }
     140
    211141        DeclarationWithType * CtorDtor::mutate( ObjectDecl * objDecl ) {
    212                 // hands off if designated, if @=, or if extern
     142                // hands off if designated or if @=
    213143                if ( tryConstruct( objDecl ) ) {
    214                         // call into genImplicitCall from Autogen.h to generate calls to ctor/dtor
    215                         // for each constructable object
    216                         std::list< Statement * > ctor;
    217                         std::list< Statement * > dtor;
    218 
    219                         InitExpander srcParam( objDecl->get_init() );
    220                         InitExpander nullParam( (Initializer *)NULL );
    221                         SymTab::genImplicitCall( srcParam, new VariableExpr( objDecl ), "?{}", back_inserter( ctor ), objDecl );
    222                         SymTab::genImplicitCall( nullParam, new VariableExpr( objDecl ), "^?{}", front_inserter( dtor ), objDecl, false );
    223 
    224                         // Currently genImplicitCall produces a single Statement - a CompoundStmt
    225                         // which  wraps everything that needs to happen. As such, it's technically
    226                         // possible to use a Statement ** in the above calls, but this is inherently
    227                         // unsafe, so instead we take the slightly less efficient route, but will be
    228                         // immediately informed if somehow the above assumption is broken. In this case,
    229                         // we could always wrap the list of statements at this point with a CompoundStmt,
    230                         // but it seems reasonable at the moment for this to be done by genImplicitCall
    231                         // itself. It is possible that genImplicitCall produces no statements (e.g. if
    232                         // an array type does not have a dimension). In this case, it's fine to ignore
    233                         // the object for the purposes of construction.
    234                         assert( ctor.size() == dtor.size() && ctor.size() <= 1 );
    235                         if ( ctor.size() == 1 ) {
    236                                 // need to remember init expression, in case no ctors exist
    237                                 // if ctor does exist, want to use ctor expression instead of init
    238                                 // push this decision to the resolver
    239                                 assert( dynamic_cast< ImplicitCtorDtorStmt * > ( ctor.front() ) && dynamic_cast< ImplicitCtorDtorStmt * > ( dtor.front() ) );
    240                                 objDecl->set_init( new ConstructorInit( ctor.front(), dtor.front(), objDecl->get_init() ) );
     144                        if ( inFunction ) {
     145                                if ( ArrayType * at = dynamic_cast< ArrayType * >( objDecl->get_type() ) ) {
     146                                        // call into makeArrayFunction from validate.cc to generate calls to ctor/dtor for each element of array
     147                                        // TODO: walk initializer and generate appropriate copy ctor if element has initializer
     148                                        std::list< Expression * > args = makeInitList( objDecl->get_init() );
     149                                        if ( args.empty() ) {
     150                                                std::list< Statement * > ctor;
     151                                                std::list< Statement * > dtor;
     152
     153                                                SymTab::makeArrayFunction( NULL, new VariableExpr( objDecl ), at, "?{}", back_inserter( ctor ) );
     154                                                SymTab::makeArrayFunction( NULL, new VariableExpr( objDecl ), at, "^?{}", front_inserter( dtor ), false );
     155
     156                                                // Currently makeArrayFunction produces a single Statement - a CompoundStmt
     157                                                // which  wraps everything that needs to happen. As such, it's technically
     158                                                // possible to use a Statement ** in the above calls, but this is inherently
     159                                                // unsafe, so instead we take the slightly less efficient route, but will be
     160                                                // immediately informed if somehow the above assumption is broken. In this case,
     161                                                // we could always wrap the list of statements at this point with a CompoundStmt,
     162                                                // but it seems reasonable at the moment for this to be done by makeArrayFunction
     163                                                // itself
     164                                                assert( ctor.size() == 1 && dynamic_cast< ImplicitCtorDtorStmt * >( ctor.front() ) );
     165                                                assert( dtor.size() == 1 && dynamic_cast< ImplicitCtorDtorStmt * >( dtor.front() ) );
     166                                                objDecl->set_init( new ConstructorInit( ctor.front(), dtor.front(), objDecl->get_init() ) );
     167                                        } else {
     168                                                // array came with an initializer list: initialize each element
     169                                                // may have more initializers than elements in the array - need to check at each index that
     170                                                // we haven't exceeded size. This requires precomputing the size because it might be a side-effecting
     171                                                // computation.
     172                                                // may have fewer initializers than eleemnts in the array - need to default construct
     173                                                // remaining elements.
     174                                                // might be able to merge this with the case above.
     175                                        }
     176                                } else {
     177                                        // it's sufficient to attempt to call the ctor/dtor for the given object and its initializer
     178                                        Expression * ctor = makeCtorDtorExpr( "?{}", objDecl, makeInitList( objDecl->get_init() ) );
     179                                        Expression * dtor = makeCtorDtorExpr( "^?{}", objDecl, std::list< Expression * >() );
     180
     181                                        // need to remember init expression, in case no ctors exist
     182                                        // if ctor does exist, want to use ctor expression instead of init
     183                                        // push this decision to the resolver
     184                                        ExprStmt * ctorStmt = new ExprStmt( noLabels, ctor );
     185                                        ExprStmt * dtorStmt = new ExprStmt( noLabels, dtor );
     186                                        objDecl->set_init( new ConstructorInit( new ImplicitCtorDtorStmt( ctorStmt ), new ImplicitCtorDtorStmt( dtorStmt ), objDecl->get_init() ) );
     187                                }
    241188                        }
    242189                }
     
    246193        DeclarationWithType * CtorDtor::mutate( FunctionDecl *functionDecl ) {
    247194                // parameters should not be constructed and destructed, so don't mutate FunctionType
     195                bool oldInFunc = inFunction;
    248196                mutateAll( functionDecl->get_oldDecls(), *this );
     197                inFunction = true;
    249198                functionDecl->set_statements( maybeMutate( functionDecl->get_statements(), *this ) );
     199                inFunction = oldInFunc;
    250200                return functionDecl;
    251201        }
     202
     203        // should not traverse into any of these declarations to find objects
     204        // that need to be constructed or destructed
     205        Declaration* CtorDtor::mutate( StructDecl *aggregateDecl ) { return aggregateDecl; }
     206        Declaration* CtorDtor::mutate( UnionDecl *aggregateDecl ) { return aggregateDecl; }
     207        Declaration* CtorDtor::mutate( EnumDecl *aggregateDecl ) { return aggregateDecl; }
     208        Declaration* CtorDtor::mutate( TraitDecl *aggregateDecl ) { return aggregateDecl; }
     209        TypeDecl* CtorDtor::mutate( TypeDecl *typeDecl ) { return typeDecl; }
     210        Declaration* CtorDtor::mutate( TypedefDecl *typeDecl ) { return typeDecl; }
     211        Type* CtorDtor::mutate( FunctionType *funcType ) { return funcType; }
     212
    252213} // namespace InitTweak
    253214
  • src/InitTweak/InitTweak.cc

    rc331406 r5070fe4  
    1 #include <algorithm>
    21#include "InitTweak.h"
    32#include "SynTree/Visitor.h"
     
    54#include "SynTree/Initializer.h"
    65#include "SynTree/Expression.h"
    7 #include "SynTree/Attribute.h"
    86#include "GenPoly/GenPoly.h"
    97
     
    2220                };
    2321
    24                 class InitFlattener : public Visitor {
     22                class InitExpander : public Visitor {
    2523                        public:
     24                        InitExpander() {}
    2625                        virtual void visit( SingleInit * singleInit );
    2726                        virtual void visit( ListInit * listInit );
     
    2928                };
    3029
    31                 void InitFlattener::visit( SingleInit * singleInit ) {
     30                void InitExpander::visit( SingleInit * singleInit ) {
    3231                        argList.push_back( singleInit->get_value()->clone() );
    3332                }
    3433
    35                 void InitFlattener::visit( ListInit * listInit ) {
    36                         // flatten nested list inits
    37                         std::list<Initializer*>::iterator it = listInit->begin();
    38                         for ( ; it != listInit->end(); ++it ) {
     34                void InitExpander::visit( ListInit * listInit ) {
     35                        // xxx - for now, assume no nested list inits
     36                        std::list<Initializer*>::iterator it = listInit->begin_initializers();
     37                        for ( ; it != listInit->end_initializers(); ++it ) {
    3938                                (*it)->accept( *this );
    4039                        }
     
    4342
    4443        std::list< Expression * > makeInitList( Initializer * init ) {
    45                 InitFlattener flattener;
    46                 maybeAccept( init, flattener );
    47                 return flattener.argList;
     44                InitExpander expander;
     45                maybeAccept( init, expander );
     46                return expander.argList;
    4847        }
    4948
     
    5453        }
    5554
    56         class InitExpander::ExpanderImpl {
    57         public:
    58                 virtual std::list< Expression * > next( std::list< Expression * > & indices ) = 0;
    59                 virtual Statement * buildListInit( UntypedExpr * callExpr, std::list< Expression * > & indices ) = 0;
    60         };
    61 
    62         class InitImpl : public InitExpander::ExpanderImpl {
    63         public:
    64                 InitImpl( Initializer * init ) : init( init ) {}
    65 
    66                 virtual std::list< Expression * > next( std::list< Expression * > & indices ) {
    67                         // this is wrong, but just a placeholder for now
    68                         // if ( ! flattened ) flatten( indices );
    69                         // return ! inits.empty() ? makeInitList( inits.front() ) : std::list< Expression * >();
    70                         return makeInitList( init );
    71                 }
    72 
    73                 virtual Statement * buildListInit( UntypedExpr * callExpr, std::list< Expression * > & indices );
    74         private:
    75                 Initializer * init;
    76         };
    77 
    78         class ExprImpl : public InitExpander::ExpanderImpl {
    79         public:
    80                 ExprImpl( Expression * expr ) : arg( expr ) {}
    81 
    82                 virtual std::list< Expression * > next( std::list< Expression * > & indices ) {
    83                         std::list< Expression * > ret;
    84                         Expression * expr = maybeClone( arg );
    85                         if ( expr ) {
    86                                 for ( std::list< Expression * >::reverse_iterator it = indices.rbegin(); it != indices.rend(); ++it ) {
    87                                         // go through indices and layer on subscript exprs ?[?]
    88                                         ++it;
    89                                         UntypedExpr * subscriptExpr = new UntypedExpr( new NameExpr( "?[?]") );
    90                                         subscriptExpr->get_args().push_back( expr );
    91                                         subscriptExpr->get_args().push_back( (*it)->clone() );
    92                                         expr = subscriptExpr;
    93                                 }
    94                                 ret.push_back( expr );
    95                         }
    96                         return ret;
    97                 }
    98 
    99                 virtual Statement * buildListInit( UntypedExpr * callExpr, std::list< Expression * > & indices );
    100         private:
    101                 Expression * arg;
    102         };
    103 
    104         InitExpander::InitExpander( Initializer * init ) : expander( new InitImpl( init ) ) {}
    105 
    106         InitExpander::InitExpander( Expression * expr ) : expander( new ExprImpl( expr ) ) {}
    107 
    108         std::list< Expression * > InitExpander::operator*() {
    109                 return cur;
    110         }
    111 
    112         InitExpander & InitExpander::operator++() {
    113                 cur = expander->next( indices );
    114                 return *this;
    115         }
    116 
    117         // use array indices list to build switch statement
    118         void InitExpander::addArrayIndex( Expression * index, Expression * dimension ) {
    119                 indices.push_back( index );
    120                 indices.push_back( dimension );
    121         }
    122 
    123         void InitExpander::clearArrayIndices() {
    124                 indices.clear();
    125         }
    126 
    127         namespace {
    128                 /// given index i, dimension d, initializer init, and callExpr f, generates
    129                 ///   if (i < d) f(..., init)
    130                 ///   ++i;
    131                 /// so that only elements within the range of the array are constructed
    132                 template< typename OutIterator >
    133                 void buildCallExpr( UntypedExpr * callExpr, Expression * index, Expression * dimension, Initializer * init, OutIterator out ) {
    134                         UntypedExpr * cond = new UntypedExpr( new NameExpr( "?<?") );
    135                         cond->get_args().push_back( index->clone() );
    136                         cond->get_args().push_back( dimension->clone() );
    137 
    138                         std::list< Expression * > args = makeInitList( init );
    139                         callExpr->get_args().splice( callExpr->get_args().end(), args );
    140 
    141                         *out++ = new IfStmt( noLabels, cond, new ExprStmt( noLabels, callExpr ), NULL );
    142 
    143                         UntypedExpr * increment = new UntypedExpr( new NameExpr( "++?" ) );
    144                         increment->get_args().push_back( new AddressExpr( index->clone() ) );
    145                         *out++ = new ExprStmt( noLabels, increment );
    146                 }
    147 
    148                 template< typename OutIterator >
    149                 void build( UntypedExpr * callExpr, InitExpander::IndexList::iterator idx, InitExpander::IndexList::iterator idxEnd, Initializer * init, OutIterator out ) {
    150                         if ( idx == idxEnd ) return;
    151                         Expression * index = *idx++;
    152                         assert( idx != idxEnd );
    153                         Expression * dimension = *idx++;
    154 
    155                         // xxx - may want to eventually issue a warning here if we can detect
    156                         // that the number of elements exceeds to dimension of the array
    157                         if ( idx == idxEnd ) {
    158                                 if ( ListInit * listInit = dynamic_cast< ListInit * >( init ) ) {
    159                                         for ( Initializer * init : *listInit ) {
    160                                                 buildCallExpr( callExpr->clone(), index, dimension, init, out );
    161                                         }
    162                                 } else {
    163                                         buildCallExpr( callExpr->clone(), index, dimension, init, out );
    164                                 }
    165                         } else {
    166                                 std::list< Statement * > branches;
    167 
    168                                 unsigned long cond = 0;
    169                                 ListInit * listInit = dynamic_cast< ListInit * >( init );
    170                                 if ( ! listInit ) {
    171                                         // xxx - this shouldn't be an error, but need a way to
    172                                         // terminate without creating output, so should catch this error
    173                                         throw SemanticError( "unbalanced list initializers" );
    174                                 }
    175 
    176                                 static UniqueName targetLabel( "L__autogen__" );
    177                                 Label switchLabel( targetLabel.newName(), 0, std::list< Attribute * >{ new Attribute("unused") } );
    178                                 for ( Initializer * init : *listInit ) {
    179                                         Expression * condition;
    180                                         // check for designations
    181                                         // if ( init-> ) {
    182                                                 condition = new ConstantExpr( Constant::from_ulong( cond ) );
    183                                                 ++cond;
    184                                         // } else {
    185                                         //      condition = // ... take designation
    186                                         //      cond = // ... take designation+1
    187                                         // }
    188                                         std::list< Statement * > stmts;
    189                                         build( callExpr, idx, idxEnd, init, back_inserter( stmts ) );
    190                                         stmts.push_back( new BranchStmt( noLabels, switchLabel, BranchStmt::Break ) );
    191                                         CaseStmt * caseStmt = new CaseStmt( noLabels, condition, stmts );
    192                                         branches.push_back( caseStmt );
    193                                 }
    194                                 *out++ = new SwitchStmt( noLabels, index->clone(), branches );
    195                                 *out++ = new NullStmt( std::list<Label>{ switchLabel } );
    196                         }
    197                 }
    198         }
    199 
    200         // if array came with an initializer list: initialize each element
    201         // may have more initializers than elements in the array - need to check at each index that
    202         // we haven't exceeded size.
    203         // may have fewer initializers than elements in the array - need to default construct
    204         // remaining elements.
    205         // To accomplish this, generate switch statement, consuming all of expander's elements
    206         Statement * InitImpl::buildListInit( UntypedExpr * dst, std::list< Expression * > & indices ) {
    207                 if ( ! init ) return NULL;
    208                 CompoundStmt * block = new CompoundStmt( noLabels );
    209                 build( dst, indices.begin(), indices.end(), init, back_inserter( block->get_kids() ) );
    210                 if ( block->get_kids().empty() ) {
    211                         delete block;
    212                         return NULL;
    213                 } else {
    214                         init = NULL; // init was consumed in creating the list init
    215                         return block;
    216                 }
    217         }
    218 
    219         Statement * ExprImpl::buildListInit( UntypedExpr * dst, std::list< Expression * > & indices ) {
    220                 return NULL;
    221         }
    222 
    223         Statement * InitExpander::buildListInit( UntypedExpr * dst ) {
    224                 return expander->buildListInit( dst, indices );
    225         }
    226 
    22755        bool tryConstruct( ObjectDecl * objDecl ) {
    22856                return ! LinkageSpec::isBuiltin( objDecl->get_linkage() ) &&
    22957                        (objDecl->get_init() == NULL ||
    23058                                ( objDecl->get_init() != NULL && objDecl->get_init()->get_maybeConstructed() )) &&
    231                         ! isDesignated( objDecl->get_init() )
    232                         && objDecl->get_storageClass() != DeclarationNode::Extern;
    233         }
    234 
    235         class CallFinder : public Visitor {
    236         public:
    237                 typedef Visitor Parent;
    238                 CallFinder( const std::list< std::string > & names ) : names( names ) {}
    239 
    240                 virtual void visit( ApplicationExpr * appExpr ) {
    241                         handleCallExpr( appExpr );
    242                 }
    243 
    244                 virtual void visit( UntypedExpr * untypedExpr ) {
    245                         handleCallExpr( untypedExpr );
    246                 }
    247 
    248                 std::list< Expression * > * matches;
    249         private:
    250                 const std::list< std::string > names;
    251 
    252                 template< typename CallExpr >
    253                 void handleCallExpr( CallExpr * expr ) {
    254                         Parent::visit( expr );
    255                         std::string fname = getFunctionName( expr );
    256                         if ( std::find( names.begin(), names.end(), fname ) != names.end() ) {
    257                                 matches->push_back( expr );
    258                         }
    259                 }
    260         };
    261 
    262         void collectCtorDtorCalls( Statement * stmt, std::list< Expression * > & matches ) {
    263                 static CallFinder finder( std::list< std::string >{ "?{}", "^?{}" } );
    264                 finder.matches = &matches;
    265                 maybeAccept( stmt, finder );
     59                        ! isDesignated( objDecl->get_init() );
    26660        }
    26761
    26862        Expression * getCtorDtorCall( Statement * stmt ) {
    269                 std::list< Expression * > matches;
    270                 collectCtorDtorCalls( stmt, matches );
    271                 assert( matches.size() <= 1 );
    272                 return matches.size() == 1 ? matches.front() : NULL;
    273         }
    274 
    275         namespace {
    276                 VariableExpr * getCalledFunction( ApplicationExpr * appExpr ) {
    277                         assert( appExpr );
    278                         // xxx - it's possible this can be other things, e.g. MemberExpr, so this is insufficient
    279                         return dynamic_cast< VariableExpr * >( appExpr->get_function() );
     63                if ( stmt == NULL ) return NULL;
     64                if ( ExprStmt * exprStmt = dynamic_cast< ExprStmt * >( stmt ) ) {
     65                        return exprStmt->get_expr();
     66                } else if ( CompoundStmt * compoundStmt = dynamic_cast< CompoundStmt * >( stmt ) ) {
     67                        // could also be a compound statement with a loop, in the case of an array
     68                        if( compoundStmt->get_kids().size() == 2 ) {
     69                                // loop variable and loop
     70                                ForStmt * forStmt = dynamic_cast< ForStmt * >( compoundStmt->get_kids().back() );
     71                                assert( forStmt && forStmt->get_body() );
     72                                return getCtorDtorCall( forStmt->get_body() );
     73                        } else if ( compoundStmt->get_kids().size() == 1 ) {
     74                                // should be the call statement, but in any case there's only one option
     75                                return getCtorDtorCall( compoundStmt->get_kids().front() );
     76                        } else {
     77                                assert( false && "too many statements in compoundStmt for getCtorDtorCall" );
     78                        }
     79                } if ( ImplicitCtorDtorStmt * impCtorDtorStmt = dynamic_cast< ImplicitCtorDtorStmt * > ( stmt ) ) {
     80                        return getCtorDtorCall( impCtorDtorStmt->get_callStmt() );
     81                } else {
     82                        // should never get here
     83                        assert( false && "encountered unknown call statement" );
    28084                }
    28185        }
    28286
    283         ApplicationExpr * isIntrinsicCallExpr( Expression * expr ) {
    284                 ApplicationExpr * appExpr = dynamic_cast< ApplicationExpr * >( expr );
    285                 if ( ! appExpr ) return NULL;
    286                 VariableExpr * function = getCalledFunction( appExpr );
     87        bool isInstrinsicSingleArgCallStmt( Statement * stmt ) {
     88                Expression * callExpr = getCtorDtorCall( stmt );
     89                if ( ! callExpr ) return false;
     90                ApplicationExpr * appExpr = dynamic_cast< ApplicationExpr * >( callExpr );
     91                assert( appExpr );
     92                VariableExpr * function = dynamic_cast< VariableExpr * >( appExpr->get_function() );
    28793                assert( function );
    28894                // check for Intrinsic only - don't want to remove all overridable ctor/dtors because autogenerated ctor/dtor
    28995                // will call all member dtors, and some members may have a user defined dtor.
    290                 return function->get_var()->get_linkage() == LinkageSpec::Intrinsic ? appExpr : NULL;
    291         }
    292 
    293         bool isIntrinsicSingleArgCallStmt( Statement * stmt ) {
    294                 std::list< Expression * > callExprs;
    295                 collectCtorDtorCalls( stmt, callExprs );
    296                 // if ( callExprs.empty() ) return false; // xxx - do I still need this check?
    297                 return std::all_of( callExprs.begin(), callExprs.end(), []( Expression * callExpr ){
    298                         if ( ApplicationExpr * appExpr = isIntrinsicCallExpr( callExpr ) ) {
    299                                 assert( ! appExpr->get_function()->get_results().empty() );
    300                                 FunctionType *funcType = GenPoly::getFunctionType( appExpr->get_function()->get_results().front() );
    301                                 assert( funcType );
    302                                 return funcType->get_parameters().size() == 1;
    303                         }
    304                         return false;
    305                 });
     96                FunctionType * funcType = GenPoly::getFunctionType( function->get_var()->get_type() );
     97                assert( funcType );
     98                return function->get_var()->get_linkage() == LinkageSpec::Intrinsic && funcType->get_parameters().size() == 1;
    30699        }
    307100
     
    367160                else return NULL;
    368161        }
    369 
    370         class ConstExprChecker : public Visitor {
    371         public:
    372                 ConstExprChecker() : isConstExpr( true ) {}
    373 
    374                 virtual void visit( ApplicationExpr *applicationExpr ) { isConstExpr = false; }
    375                 virtual void visit( UntypedExpr *untypedExpr ) { isConstExpr = false; }
    376                 virtual void visit( NameExpr *nameExpr ) { isConstExpr = false; }
    377                 virtual void visit( CastExpr *castExpr ) { isConstExpr = false; }
    378                 virtual void visit( LabelAddressExpr *labAddressExpr ) { isConstExpr = false; }
    379                 virtual void visit( UntypedMemberExpr *memberExpr ) { isConstExpr = false; }
    380                 virtual void visit( MemberExpr *memberExpr ) { isConstExpr = false; }
    381                 virtual void visit( VariableExpr *variableExpr ) { isConstExpr = false; }
    382                 virtual void visit( ConstantExpr *constantExpr ) { /* bottom out */ }
    383                 // these might be okay?
    384                 // virtual void visit( SizeofExpr *sizeofExpr );
    385                 // virtual void visit( AlignofExpr *alignofExpr );
    386                 // virtual void visit( UntypedOffsetofExpr *offsetofExpr );
    387                 // virtual void visit( OffsetofExpr *offsetofExpr );
    388                 // virtual void visit( OffsetPackExpr *offsetPackExpr );
    389                 // virtual void visit( AttrExpr *attrExpr );
    390                 // virtual void visit( CommaExpr *commaExpr );
    391                 // virtual void visit( LogicalExpr *logicalExpr );
    392                 // virtual void visit( ConditionalExpr *conditionalExpr );
    393                 virtual void visit( TupleExpr *tupleExpr ) { isConstExpr = false; }
    394                 virtual void visit( SolvedTupleExpr *tupleExpr ) { isConstExpr = false; }
    395                 virtual void visit( TypeExpr *typeExpr ) { isConstExpr = false; }
    396                 virtual void visit( AsmExpr *asmExpr ) { isConstExpr = false; }
    397                 virtual void visit( UntypedValofExpr *valofExpr ) { isConstExpr = false; }
    398                 virtual void visit( CompoundLiteralExpr *compLitExpr ) { isConstExpr = false; }
    399 
    400                 bool isConstExpr;
    401         };
    402 
    403         bool isConstExpr( Expression * expr ) {
    404                 if ( expr ) {
    405                         ConstExprChecker checker;
    406                         expr->accept( checker );
    407                         return checker.isConstExpr;
    408                 }
    409                 return true;
    410         }
    411 
    412         bool isConstExpr( Initializer * init ) {
    413                 if ( init ) {
    414                         ConstExprChecker checker;
    415                         init->accept( checker );
    416                         return checker.isConstExpr;
    417                 } // if
    418                 // for all intents and purposes, no initializer means const expr
    419                 return true;
    420         }
    421 
    422162}
  • src/InitTweak/InitTweak.h

    rc331406 r5070fe4  
    2626// helper functions for initialization
    2727namespace InitTweak {
    28         /// transform Initializer into an argument list that can be passed to a call expression
    29         std::list< Expression * > makeInitList( Initializer * init );
     28  /// transform Initializer into an argument list that can be passed to a call expression
     29  std::list< Expression * > makeInitList( Initializer * init );
    3030
    31         /// True if the resolver should try to construct objDecl
    32         bool tryConstruct( ObjectDecl * objDecl );
     31  /// True if the resolver should try to construct objDecl
     32  bool tryConstruct( ObjectDecl * objDecl );
    3333
    34         /// True if the Initializer contains designations
    35         bool isDesignated( Initializer * init );
     34  /// True if the Initializer contains designations
     35  bool isDesignated( Initializer * init );
    3636
    37   /// Non-Null if expr is a call expression whose target function is intrinsic
    38   ApplicationExpr * isIntrinsicCallExpr( Expression * expr );
     37  /// True if stmt is a call statement where the function called is intrinsic and takes one parameter.
     38  /// Intended to be used for default ctor/dtor calls, but might have use elsewhere.
     39  /// Currently has assertions that make it less than fully general.
     40  bool isInstrinsicSingleArgCallStmt( Statement * expr );
    3941
    40         /// True if stmt is a call statement where the function called is intrinsic and takes one parameter.
    41         /// Intended to be used for default ctor/dtor calls, but might have use elsewhere.
    42         /// Currently has assertions that make it less than fully general.
    43         bool isIntrinsicSingleArgCallStmt( Statement * expr );
     42  /// get the Ctor/Dtor call expression from a Statement that looks like a generated ctor/dtor call
     43  Expression * getCtorDtorCall( Statement * stmt );
    4444
    45         /// get all Ctor/Dtor call expressions from a Statement
    46         void collectCtorDtorCalls( Statement * stmt, std::list< Expression * > & matches );
     45  /// returns the name of the function being called
     46  std::string getFunctionName( Expression * expr );
    4747
    48         /// get the Ctor/Dtor call expression from a Statement that looks like a generated ctor/dtor call
    49         Expression * getCtorDtorCall( Statement * stmt );
     48  /// returns the argument to a call expression in position N indexed from 0
     49  Expression *& getCallArg( Expression * callExpr, unsigned int pos );
    5050
    51         /// returns the name of the function being called
    52         std::string getFunctionName( Expression * expr );
     51  /// returns the base type of a PointerType or ArrayType, else returns NULL
     52  Type * getPointerBase( Type * );
    5353
    54         /// returns the argument to a call expression in position N indexed from 0
    55         Expression *& getCallArg( Expression * callExpr, unsigned int pos );
    56 
    57         /// returns the base type of a PointerType or ArrayType, else returns NULL
    58         Type * getPointerBase( Type * );
    59 
    60         /// returns the argument if it is a PointerType or ArrayType, else returns NULL
    61         Type * isPointerType( Type * );
    62 
    63         /// returns true if expr is trivially a compile-time constant
    64         bool isConstExpr( Expression * expr );
    65         bool isConstExpr( Initializer * init );
    66 
    67         class InitExpander {
    68         public:
    69                 // expand by stepping through init to get each list of arguments
    70                 InitExpander( Initializer * init );
    71 
    72                 // always expand to expr
    73                 InitExpander( Expression * expr );
    74 
    75                 // iterator-like interface
    76                 std::list< Expression * > operator*();
    77                 InitExpander & operator++();
    78 
    79                 // builds statement which has the same semantics as a C-style list initializer
    80                 // (for array initializers) using callExpr as the base expression to perform initialization
    81                 Statement * buildListInit( UntypedExpr * callExpr );
    82                 void addArrayIndex( Expression * index, Expression * dimension );
    83                 void clearArrayIndices();
    84 
    85                 class ExpanderImpl;
    86         private:
    87                 std::shared_ptr< ExpanderImpl > expander;
    88                 std::list< Expression * > cur;
    89 
    90                 // invariant: list of size 2N (elements come in pairs [index, dimension])
    91                 typedef std::list< Expression * > IndexList;
    92                 IndexList indices;
    93         };
     54  /// returns the argument if it is a PointerType or ArrayType, else returns NULL
     55  Type * isPointerType( Type * );
    9456} // namespace
    9557
  • src/Makefile.in

    rc331406 r5070fe4  
    108108        ControlStruct/driver_cfa_cpp-LabelFixer.$(OBJEXT) \
    109109        ControlStruct/driver_cfa_cpp-MLEMutator.$(OBJEXT) \
     110        ControlStruct/driver_cfa_cpp-CaseRangeMutator.$(OBJEXT) \
    110111        ControlStruct/driver_cfa_cpp-Mutate.$(OBJEXT) \
    111112        ControlStruct/driver_cfa_cpp-ForExprMutator.$(OBJEXT) \
     
    372373        Common/SemanticError.cc Common/UniqueName.cc \
    373374        ControlStruct/LabelGenerator.cc ControlStruct/LabelFixer.cc \
    374         ControlStruct/MLEMutator.cc ControlStruct/Mutate.cc \
    375         ControlStruct/ForExprMutator.cc \
     375        ControlStruct/MLEMutator.cc ControlStruct/CaseRangeMutator.cc \
     376        ControlStruct/Mutate.cc ControlStruct/ForExprMutator.cc \
    376377        ControlStruct/LabelTypeChecker.cc Designators/Processor.cc \
    377378        GenPoly/Box.cc GenPoly/GenPoly.cc GenPoly/PolyMutator.cc \
     
    542543        ControlStruct/$(DEPDIR)/$(am__dirstamp)
    543544ControlStruct/driver_cfa_cpp-MLEMutator.$(OBJEXT):  \
     545        ControlStruct/$(am__dirstamp) \
     546        ControlStruct/$(DEPDIR)/$(am__dirstamp)
     547ControlStruct/driver_cfa_cpp-CaseRangeMutator.$(OBJEXT):  \
    544548        ControlStruct/$(am__dirstamp) \
    545549        ControlStruct/$(DEPDIR)/$(am__dirstamp)
     
    819823        -rm -f Common/driver_cfa_cpp-SemanticError.$(OBJEXT)
    820824        -rm -f Common/driver_cfa_cpp-UniqueName.$(OBJEXT)
     825        -rm -f ControlStruct/driver_cfa_cpp-CaseRangeMutator.$(OBJEXT)
    821826        -rm -f ControlStruct/driver_cfa_cpp-ForExprMutator.$(OBJEXT)
    822827        -rm -f ControlStruct/driver_cfa_cpp-LabelFixer.$(OBJEXT)
     
    929934@AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/driver_cfa_cpp-SemanticError.Po@am__quote@
    930935@AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/driver_cfa_cpp-UniqueName.Po@am__quote@
     936@AMDEP_TRUE@@am__include@ @am__quote@ControlStruct/$(DEPDIR)/driver_cfa_cpp-CaseRangeMutator.Po@am__quote@
    931937@AMDEP_TRUE@@am__include@ @am__quote@ControlStruct/$(DEPDIR)/driver_cfa_cpp-ForExprMutator.Po@am__quote@
    932938@AMDEP_TRUE@@am__include@ @am__quote@ControlStruct/$(DEPDIR)/driver_cfa_cpp-LabelFixer.Po@am__quote@
     
    12111217@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ControlStruct/driver_cfa_cpp-MLEMutator.obj `if test -f 'ControlStruct/MLEMutator.cc'; then $(CYGPATH_W) 'ControlStruct/MLEMutator.cc'; else $(CYGPATH_W) '$(srcdir)/ControlStruct/MLEMutator.cc'; fi`
    12121218
     1219ControlStruct/driver_cfa_cpp-CaseRangeMutator.o: ControlStruct/CaseRangeMutator.cc
     1220@am__fastdepCXX_TRUE@   $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ControlStruct/driver_cfa_cpp-CaseRangeMutator.o -MD -MP -MF ControlStruct/$(DEPDIR)/driver_cfa_cpp-CaseRangeMutator.Tpo -c -o ControlStruct/driver_cfa_cpp-CaseRangeMutator.o `test -f 'ControlStruct/CaseRangeMutator.cc' || echo '$(srcdir)/'`ControlStruct/CaseRangeMutator.cc
     1221@am__fastdepCXX_TRUE@   $(AM_V_at)$(am__mv) ControlStruct/$(DEPDIR)/driver_cfa_cpp-CaseRangeMutator.Tpo ControlStruct/$(DEPDIR)/driver_cfa_cpp-CaseRangeMutator.Po
     1222@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(AM_V_CXX)source='ControlStruct/CaseRangeMutator.cc' object='ControlStruct/driver_cfa_cpp-CaseRangeMutator.o' libtool=no @AMDEPBACKSLASH@
     1223@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1224@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ControlStruct/driver_cfa_cpp-CaseRangeMutator.o `test -f 'ControlStruct/CaseRangeMutator.cc' || echo '$(srcdir)/'`ControlStruct/CaseRangeMutator.cc
     1225
     1226ControlStruct/driver_cfa_cpp-CaseRangeMutator.obj: ControlStruct/CaseRangeMutator.cc
     1227@am__fastdepCXX_TRUE@   $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ControlStruct/driver_cfa_cpp-CaseRangeMutator.obj -MD -MP -MF ControlStruct/$(DEPDIR)/driver_cfa_cpp-CaseRangeMutator.Tpo -c -o ControlStruct/driver_cfa_cpp-CaseRangeMutator.obj `if test -f 'ControlStruct/CaseRangeMutator.cc'; then $(CYGPATH_W) 'ControlStruct/CaseRangeMutator.cc'; else $(CYGPATH_W) '$(srcdir)/ControlStruct/CaseRangeMutator.cc'; fi`
     1228@am__fastdepCXX_TRUE@   $(AM_V_at)$(am__mv) ControlStruct/$(DEPDIR)/driver_cfa_cpp-CaseRangeMutator.Tpo ControlStruct/$(DEPDIR)/driver_cfa_cpp-CaseRangeMutator.Po
     1229@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(AM_V_CXX)source='ControlStruct/CaseRangeMutator.cc' object='ControlStruct/driver_cfa_cpp-CaseRangeMutator.obj' libtool=no @AMDEPBACKSLASH@
     1230@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1231@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ControlStruct/driver_cfa_cpp-CaseRangeMutator.obj `if test -f 'ControlStruct/CaseRangeMutator.cc'; then $(CYGPATH_W) 'ControlStruct/CaseRangeMutator.cc'; else $(CYGPATH_W) '$(srcdir)/ControlStruct/CaseRangeMutator.cc'; fi`
     1232
    12131233ControlStruct/driver_cfa_cpp-Mutate.o: ControlStruct/Mutate.cc
    12141234@am__fastdepCXX_TRUE@   $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ControlStruct/driver_cfa_cpp-Mutate.o -MD -MP -MF ControlStruct/$(DEPDIR)/driver_cfa_cpp-Mutate.Tpo -c -o ControlStruct/driver_cfa_cpp-Mutate.o `test -f 'ControlStruct/Mutate.cc' || echo '$(srcdir)/'`ControlStruct/Mutate.cc
  • src/Parser/ExpressionNode.cc

    rc331406 r5070fe4  
    1010// Created On       : Sat May 16 13:17:07 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Aug  5 07:56:23 2016
    13 // Update Count     : 375
     12// Last Modified On : Tue Jul  5 13:41:55 2016
     13// Update Count     : 320
    1414//
    1515
     
    8383}
    8484
    85 // CommaExprNode *ExpressionNode::add_to_list( ExpressionNode *exp ) {
    86 //      return new CommaExprNode( this, exp );
    87 // }
     85CommaExprNode *ExpressionNode::add_to_list( ExpressionNode *exp ) {
     86        return new CommaExprNode( this, exp );
     87}
    8888
    8989//##############################################################################
     
    246246        "?|?", "?&?", "?^?", "Cast", "?<<?", "?>>?", "?<?", "?>?", "?<=?", "?>=?", "?==?", "?!=?",
    247247        "?=?", "?*=?", "?/=?", "?%=?", "?+=?", "?-=?", "?<<=?", "?>>=?", "?&=?", "?^=?", "?|=?",
    248         "?[?]", "FieldSel", "PFieldSel", "...",
     248        "?[?]", "FieldSel", "PFieldSel", "Range",
    249249        // monadic
    250250        "+?", "-?", "AddressOf", "*?", "!?", "~?", "++?", "?++", "--?", "?--", "&&"
     
    258258OperatorNode::~OperatorNode() {}
    259259
    260 OperatorNode::Type OperatorNode::get_type( void ) const {
     260OperatorNode::Type OperatorNode::get_type( void ) const{
    261261        return type;
    262262}
     
    311311}
    312312
    313 
    314 Expression *build_cast( TypeValueNode * arg, ExpressionNode *expr_node ) {
    315         DeclarationNode *decl_node = arg->get_decl();
    316 
    317         Type *targetType = decl_node->buildType();
    318         if ( dynamic_cast< VoidType* >( targetType ) ) {
    319                 delete targetType;
    320                 return new CastExpr( maybeBuild<Expression>(expr_node) );
    321         } else {
    322                 return new CastExpr( maybeBuild<Expression>(expr_node), targetType );
    323         } // if
    324 }
    325 
    326 Expression *build_fieldSel( ExpressionNode *expr_node, VarRefNode *member ) {
    327         NameExpr* memberExpr = dynamic_cast<NameExpr*> ( maybeBuild<Expression>( member) );
    328         assert( memberExpr );
    329         UntypedMemberExpr *ret = new UntypedMemberExpr( memberExpr->get_name(), maybeBuild<Expression>(expr_node) );
    330         delete member;
    331         return ret;
    332 }
    333 
    334 Expression *build_pfieldSel( ExpressionNode *expr_node, VarRefNode *member ) {
    335         NameExpr* memberExpr = dynamic_cast<NameExpr*> ( maybeBuild<Expression>( member) );
    336         assert( memberExpr );
    337         UntypedExpr *deref = new UntypedExpr( new NameExpr( "*?" ) );
    338         deref->get_args().push_back( maybeBuild<Expression>(expr_node) );
    339         UntypedMemberExpr *ret = new UntypedMemberExpr( memberExpr->get_name(), deref );
    340         delete member;
    341         return ret;
    342 }
    343 
    344 Expression *build_addressOf( ExpressionNode *expr_node ) {
    345                 return new AddressExpr( maybeBuild<Expression>(expr_node) );
    346 }
    347 Expression *build_sizeOf( ExpressionNode *expr_node ) {
    348         if ( TypeValueNode * arg = dynamic_cast<TypeValueNode *>( expr_node ) ) {
    349                 return new SizeofExpr( arg->get_decl()->buildType() );
    350         } else {
    351                 return new SizeofExpr( maybeBuild<Expression>(expr_node) );
    352         } // if
    353 }
    354 Expression *build_alignOf( ExpressionNode *expr_node ) {
    355         if ( TypeValueNode * arg = dynamic_cast<TypeValueNode *>( expr_node ) ) {
    356                 return new AlignofExpr( arg->get_decl()->buildType() );
    357         } else {
    358                 return new AlignofExpr( maybeBuild<Expression>(expr_node) );
    359         } // if
    360 }
    361 Expression *build_offsetOf( TypeValueNode * arg, VarRefNode *member ) {
    362         NameExpr *memberExpr = dynamic_cast<NameExpr *>( maybeBuild<Expression>( member ) );
    363         assert( memberExpr );
    364         return new UntypedOffsetofExpr( arg->get_decl()->buildType(), memberExpr->get_name() );
    365 }
    366 
    367 Expression *build_and_or( ExpressionNode *expr_node1, ExpressionNode *expr_node2, bool kind ) {
    368         return new LogicalExpr( notZeroExpr( maybeBuild<Expression>(expr_node1) ), notZeroExpr( maybeBuild<Expression>(expr_node2) ), kind );
    369 }
    370 
    371 Expression *build_opr1( OperatorNode::Type op, ExpressionNode *expr_node ) {
    372         std::list<Expression *> args;
    373         args.push_back( new AddressExpr( maybeBuild<Expression>(expr_node) ) );
    374         return new UntypedExpr( new NameExpr( opName[ op ] ), args );
    375 }
    376 Expression *build_opr2( OperatorNode::Type op, ExpressionNode *expr_node1, ExpressionNode *expr_node2 ) {
    377         std::list<Expression *> args;
    378         args.push_back( maybeBuild<Expression>(expr_node1) );
    379         args.push_back( maybeBuild<Expression>(expr_node2) );
    380         return new UntypedExpr( new NameExpr( opName[ op ] ), args );
    381 }
    382 
    383 Expression *build_cond( ExpressionNode *expr_node1, ExpressionNode *expr_node2, ExpressionNode *expr_node3 ) {
    384         return new ConditionalExpr( notZeroExpr( maybeBuild<Expression>(expr_node1) ), maybeBuild<Expression>(expr_node2), maybeBuild<Expression>(expr_node3) );
    385 }
    386 
    387 Expression *build_comma( ExpressionNode *expr_node1, ExpressionNode *expr_node2 ) {
    388         return new CommaExpr( maybeBuild<Expression>(expr_node1), maybeBuild<Expression>(expr_node2) );
    389 }
    390 
    391 CompositeExprNode2::CompositeExprNode2( Expression *expr ) : expr( expr ) {}
    392 CompositeExprNode2::CompositeExprNode2( const CompositeExprNode2 &other ) : expr( other.expr->clone() ) {}
    393 CompositeExprNode2::~CompositeExprNode2() { delete expr; }
    394 void CompositeExprNode2::print( std::ostream &, int indent ) const { assert( false ); }
    395 void CompositeExprNode2::printOneLine( std::ostream &, int indent ) const { assert( false ); }
    396 
     313#include "Common/utility.h"
    397314
    398315Expression *CompositeExprNode::build() const {
     
    406323        } // if
    407324
    408         switch ( op->get_type() ) {
     325        switch ( op->get_type()) {
     326          case OperatorNode::Incr:
     327          case OperatorNode::Decr:
     328          case OperatorNode::IncrPost:
     329          case OperatorNode::DecrPost:
    409330          case OperatorNode::Assign:
    410331          case OperatorNode::MulAssn:
     
    418339          case OperatorNode::ERAssn:
    419340          case OperatorNode::OrAssn:
     341                // the rewrite rules for these expressions specify that the first argument has its address taken
    420342                assert( ! args.empty() );
    421343                args.front() = new AddressExpr( args.front() );
     344                break;
     345          default:              // do nothing
     346                ;
     347        } // switch
     348
     349        switch ( op->get_type() ) {
     350          case OperatorNode::Incr:
     351          case OperatorNode::Decr:
     352          case OperatorNode::IncrPost:
     353          case OperatorNode::DecrPost:
     354          case OperatorNode::Assign:
     355          case OperatorNode::MulAssn:
     356          case OperatorNode::DivAssn:
     357          case OperatorNode::ModAssn:
     358          case OperatorNode::PlusAssn:
     359          case OperatorNode::MinusAssn:
     360          case OperatorNode::LSAssn:
     361          case OperatorNode::RSAssn:
     362          case OperatorNode::AndAssn:
     363          case OperatorNode::ERAssn:
     364          case OperatorNode::OrAssn:
     365          case OperatorNode::Plus:
     366          case OperatorNode::Minus:
     367          case OperatorNode::Mul:
     368          case OperatorNode::Div:
     369          case OperatorNode::Mod:
     370          case OperatorNode::BitOr:
     371          case OperatorNode::BitAnd:
     372          case OperatorNode::Xor:
     373          case OperatorNode::LShift:
     374          case OperatorNode::RShift:
     375          case OperatorNode::LThan:
     376          case OperatorNode::GThan:
     377          case OperatorNode::LEThan:
     378          case OperatorNode::GEThan:
     379          case OperatorNode::Eq:
     380          case OperatorNode::Neq:
     381          case OperatorNode::Index:
     382          case OperatorNode::Range:
    422383          case OperatorNode::UnPlus:
    423384          case OperatorNode::UnMinus:
     
    427388          case OperatorNode::LabelAddress:
    428389                return new UntypedExpr( new NameExpr( opName[ op->get_type() ] ), args );
    429 
     390          case OperatorNode::AddressOf:
     391                assert( args.size() == 1 );
     392                assert( args.front() );
     393
     394                return new AddressExpr( args.front() );
     395          case OperatorNode::Cast:
     396                {
     397                        TypeValueNode * arg = dynamic_cast<TypeValueNode *>( get_args());
     398                        assert( arg );
     399
     400                        DeclarationNode *decl_node = arg->get_decl();
     401                        ExpressionNode *expr_node = dynamic_cast<ExpressionNode *>( arg->get_link());
     402
     403                        Type *targetType = decl_node->buildType();
     404                        if ( dynamic_cast< VoidType* >( targetType ) ) {
     405                                delete targetType;
     406                                return new CastExpr( maybeBuild<Expression>(expr_node), maybeBuild< Expression >( get_argName() ) );
     407                        } else {
     408                                return new CastExpr( maybeBuild<Expression>(expr_node),targetType, maybeBuild< Expression >( get_argName() ) );
     409                        } // if
     410                }
     411          case OperatorNode::FieldSel:
     412                {
     413                        assert( args.size() == 2 );
     414
     415                        NameExpr *member = dynamic_cast<NameExpr *>( args.back());
     416                        // TupleExpr *memberTup = dynamic_cast<TupleExpr *>( args.back());
     417
     418                        if ( member != 0 ) {
     419                                UntypedMemberExpr *ret = new UntypedMemberExpr( member->get_name(), args.front());
     420                                delete member;
     421                                return ret;
     422                                /* else if ( memberTup != 0 )
     423                                   {
     424                                   UntypedMemberExpr *ret = new UntypedMemberExpr( memberTup->get_name(), args.front());
     425                                   delete member;
     426                                   return ret;
     427                                   } */
     428                        } else
     429                                assert( false );
     430                }
     431          case OperatorNode::PFieldSel:
     432                {
     433                        assert( args.size() == 2 );
     434
     435                        NameExpr *member = dynamic_cast<NameExpr *>( args.back());  // modify for Tuples   xxx
     436                        assert( member != 0 );
     437
     438                        UntypedExpr *deref = new UntypedExpr( new NameExpr( "*?" ) );
     439                        deref->get_args().push_back( args.front() );
     440
     441                        UntypedMemberExpr *ret = new UntypedMemberExpr( member->get_name(), deref );
     442                        delete member;
     443                        return ret;
     444                }
     445          case OperatorNode::SizeOf:
     446                {
     447                        if ( TypeValueNode * arg = dynamic_cast<TypeValueNode *>( get_args()) ) {
     448                                return new SizeofExpr( arg->get_decl()->buildType());
     449                        } else {
     450                                return new SizeofExpr( args.front());
     451                        } // if
     452                }
     453          case OperatorNode::AlignOf:
     454                {
     455                        if ( TypeValueNode * arg = dynamic_cast<TypeValueNode *>( get_args()) ) {
     456                                return new AlignofExpr( arg->get_decl()->buildType());
     457                        } else {
     458                                return new AlignofExpr( args.front());
     459                        } // if
     460                }
     461          case OperatorNode::OffsetOf:
     462                {
     463                        assert( args.size() == 2 );
     464
     465                        if ( TypeValueNode * arg = dynamic_cast<TypeValueNode *>( get_args() ) ) {
     466                                NameExpr *member = dynamic_cast<NameExpr *>( args.back() );
     467                                assert( member != 0 );
     468
     469                                return new UntypedOffsetofExpr( arg->get_decl()->buildType(), member->get_name() );
     470                        } else assert( false );
     471                }
    430472          case OperatorNode::Attr:
    431473                {
    432                         VarRefNode *var = dynamic_cast<VarRefNode *>( get_args() );
     474                        VarRefNode *var = dynamic_cast<VarRefNode *>( get_args());
    433475                        assert( var );
    434476                        if ( ! get_args()->get_link() ) {
    435477                                return new AttrExpr( maybeBuild<Expression>(var), ( Expression*)0);
    436                         } else if ( TypeValueNode * arg = dynamic_cast<TypeValueNode *>( get_args()->get_link() ) ) {
    437                                 return new AttrExpr( maybeBuild<Expression>(var), arg->get_decl()->buildType() );
     478                        } else if ( TypeValueNode * arg = dynamic_cast<TypeValueNode *>( get_args()->get_link()) ) {
     479                                return new AttrExpr( maybeBuild<Expression>(var), arg->get_decl()->buildType());
    438480                        } else {
    439                                 return new AttrExpr( maybeBuild<Expression>(var), args.back() );
     481                                return new AttrExpr( maybeBuild<Expression>(var), args.back());
    440482                        } // if
    441483                }
     484          case OperatorNode::Or:
     485          case OperatorNode::And:
     486                assert( args.size() == 2);
     487                return new LogicalExpr( notZeroExpr( args.front() ), notZeroExpr( args.back() ), ( op->get_type() == OperatorNode::And ) );
    442488          case OperatorNode::Cond:
    443489                {
     
    451497          case OperatorNode::NCond:
    452498                throw UnimplementedError( "GNU 2-argument conditional expression" );
     499          case OperatorNode::Comma:
     500                {
     501                        assert( args.size() == 2);
     502                        std::list< Expression * >::const_iterator i = args.begin();
     503                        Expression *ret = *i++;
     504                        while ( i != args.end() ) {
     505                                ret = new CommaExpr( ret, *i++ );
     506                        }
     507                        return ret;
     508                }
    453509                // Tuples
    454510          case OperatorNode::TupleC:
     
    459515                }
    460516          default:
    461                 assert( ((void)"CompositeExprNode::build", false) );
     517                // shouldn't happen
     518                assert( false );
    462519                return 0;
    463520        } // switch
     
    548605
    549606void LabelNode::printOneLine( std::ostream &os, int indent ) const {}
     607
     608//##############################################################################
     609
     610CommaExprNode::CommaExprNode(): CompositeExprNode( new OperatorNode( OperatorNode::Comma )) {}
     611
     612CommaExprNode::CommaExprNode( ExpressionNode *exp ) : CompositeExprNode( new OperatorNode( OperatorNode::Comma ), exp ) {
     613}
     614
     615CommaExprNode::CommaExprNode( ExpressionNode *exp1, ExpressionNode *exp2) : CompositeExprNode( new OperatorNode( OperatorNode::Comma ), exp1, exp2) {
     616}
     617
     618CommaExprNode *CommaExprNode::add_to_list( ExpressionNode *exp ) {
     619        add_arg( exp );
     620
     621        return this;
     622}
     623
     624CommaExprNode::CommaExprNode( const CommaExprNode &other ) : CompositeExprNode( other ) {
     625}
    550626
    551627//##############################################################################
     
    698774}
    699775
     776
    700777ExpressionNode *flattenCommas( ExpressionNode *list ) {
    701778        if ( CompositeExprNode *composite = dynamic_cast< CompositeExprNode * >( list ) ) {
  • src/Parser/ParseNode.h

    rc331406 r5070fe4  
    1010// Created On       : Sat May 16 13:28:16 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Aug  5 07:49:32 2016
    13 // Update Count     : 288
     12// Last Modified On : Sun Jul 24 02:17:00 2016
     13// Update Count     : 269
    1414//
    1515
     
    7777        virtual ExpressionNode *clone() const = 0;
    7878
    79         // virtual CommaExprNode *add_to_list( ExpressionNode * );
     79        virtual CommaExprNode *add_to_list( ExpressionNode * );
    8080
    8181        ExpressionNode *get_argName() const { return argName; }
     
    225225};
    226226
    227 Expression *build_cast( TypeValueNode * arg, ExpressionNode *expr_node );
    228 Expression *build_fieldSel( ExpressionNode *expr_node, VarRefNode *member );
    229 Expression *build_pfieldSel( ExpressionNode *expr_node, VarRefNode *member );
    230 Expression *build_addressOf( ExpressionNode *expr_node );
    231 Expression *build_sizeOf( ExpressionNode *expr_node );
    232 Expression *build_alignOf( ExpressionNode *expr_node );
    233 Expression *build_offsetOf( TypeValueNode * arg, VarRefNode *member );
    234 Expression *build_and( ExpressionNode *expr_node1, ExpressionNode *expr_node2 );
    235 Expression *build_and_or( ExpressionNode *expr_node1, ExpressionNode *expr_node2, bool kind );
    236 Expression *build_opr1( OperatorNode::Type op, ExpressionNode *expr_node );
    237 Expression *build_opr2( OperatorNode::Type op, ExpressionNode *expr_node1, ExpressionNode *expr_node2 );
    238 Expression *build_cond( ExpressionNode *expr_node1, ExpressionNode *expr_node2, ExpressionNode *expr_node3 );
    239 Expression *build_comma( ExpressionNode *expr_node1, ExpressionNode *expr_node2 );
    240 
    241 class CompositeExprNode2 : public ExpressionNode {
    242   public:
    243         CompositeExprNode2( Expression *expr );
    244         CompositeExprNode2( const CompositeExprNode2 &other );
    245         virtual ~CompositeExprNode2();
    246 
    247         virtual CompositeExprNode2 *clone() const { return new CompositeExprNode2( *this ); }
    248         virtual Expression *build() const { return expr->clone(); }
    249 
    250         virtual void print( std::ostream &, int indent = 0) const;
    251         virtual void printOneLine( std::ostream &, int indent = 0) const;
    252   private:
    253         Expression *expr;
    254 };
    255 
    256227class CompositeExprNode : public ExpressionNode {
    257228  public:
     
    319290  private:
    320291        std::list< Label > labels;
     292};
     293
     294class CommaExprNode : public CompositeExprNode {
     295  public:
     296        CommaExprNode();
     297        CommaExprNode( ExpressionNode * );
     298        CommaExprNode( ExpressionNode *, ExpressionNode * );
     299        CommaExprNode( const CommaExprNode &other );
     300
     301        virtual CommaExprNode *add_to_list( ExpressionNode * );
     302        virtual CommaExprNode *clone() const { return new CommaExprNode( *this ); }
    321303};
    322304
     
    503485        std::string get_target() const;
    504486
    505         // StatementNode *add_controlexp( ExpressionNode * );
     487        StatementNode *add_controlexp( ExpressionNode * );
    506488        StatementNode *append_block( StatementNode * );
    507489        StatementNode *append_last_case( StatementNode * );
     
    549531        ConstantNode *clobber;
    550532        std::list< Label > gotolabels;
     533};
     534
     535class NullStmtNode : public CompoundStmtNode {
     536  public:
     537        Statement *build() const;
     538        void print( std::ostream &, int indent = 0 ) const;
    551539};
    552540
  • src/Parser/StatementNode.cc

    rc331406 r5070fe4  
    107107}
    108108
    109 // StatementNode *StatementNode::add_controlexp( ExpressionNode *e ) {
    110 //      if ( control && e )
    111 //              control->add_to_list( e ); // xxx - check this
    112 //      return this;
    113 // }
     109StatementNode *StatementNode::add_controlexp( ExpressionNode *e ) {
     110        if ( control && e )
     111                control->add_to_list( e ); // xxx - check this
     112        return this;
     113}
    114114
    115115StatementNode *StatementNode::append_block( StatementNode *stmt ) {
     
    417417}
    418418
     419
     420void NullStmtNode::print( ostream &os, int indent ) const {
     421        os << string( indent, ' ' ) << "Null Statement:" << endl;
     422}
     423
     424Statement *NullStmtNode::build() const {
     425        return new NullStmt;
     426}
     427
    419428// Local Variables: //
    420429// tab-width: 4 //
  • src/Parser/TypeData.cc

    rc331406 r5070fe4  
    510510                return buildVariable();
    511511        } else {
    512                 return new ObjectDecl( name, sc, linkage, bitfieldWidth, build(), init, std::list< Attribute * >(),  isInline, isNoreturn );
     512                return new ObjectDecl( name, sc, linkage, bitfieldWidth, build(), init, isInline, isNoreturn );
    513513        } // if
    514514        return 0;
  • src/Parser/parser.cc

    rc331406 r5070fe4  
    354354        LabelNode *label;
    355355        InitializerNode *in;
    356         OperatorNode::Type op;
    357356        bool flag;
    358357
     
    360359
    361360/* Line 293 of yacc.c  */
    362 #line 363 "Parser/parser.cc"
     361#line 362 "Parser/parser.cc"
    363362} YYSTYPE;
    364363# define YYSTYPE_IS_TRIVIAL 1
     
    372371
    373372/* Line 343 of yacc.c  */
    374 #line 375 "Parser/parser.cc"
     373#line 374 "Parser/parser.cc"
    375374
    376375#ifdef short
     
    10171016static const yytype_uint16 yyrline[] =
    10181017{
    1019        0,   292,   292,   298,   307,   308,   309,   313,   314,   315,
    1020      319,   320,   324,   325,   329,   330,   334,   335,   341,   343,
    1021      345,   347,   352,   353,   359,   363,   365,   366,   368,   369,
    1022      371,   373,   375,   383,   384,   390,   391,   392,   397,   399,
    1023      404,   405,   409,   413,   415,   417,   419,   424,   427,   429,
    1024      431,   436,   439,   441,   443,   445,   447,   449,   451,   453,
    1025      455,   457,   459,   466,   467,   469,   473,   474,   475,   476,
    1026      480,   481,   483,   488,   489,   491,   493,   498,   499,   501,
    1027      506,   507,   509,   514,   515,   517,   519,   521,   526,   527,
    1028      529,   534,   535,   540,   541,   546,   547,   552,   553,   558,
    1029      559,   564,   565,   568,   570,   575,   580,   581,   583,   585,
    1030      591,   592,   598,   600,   602,   604,   609,   610,   615,   616,
    1031      617,   618,   619,   620,   621,   622,   623,   624,   628,   629,
    1032      636,   637,   643,   644,   645,   646,   647,   648,   649,   650,
    1033      651,   661,   668,   670,   680,   681,   686,   688,   694,   696,
    1034      700,   701,   706,   711,   714,   716,   718,   728,   730,   741,
    1035      742,   744,   748,   750,   754,   755,   760,   761,   765,   770,
    1036      771,   775,   777,   783,   784,   788,   790,   792,   794,   800,
    1037      801,   805,   807,   812,   814,   816,   821,   823,   828,   830,
    1038      834,   837,   841,   844,   848,   850,   854,   856,   863,   865,
    1039      867,   876,   878,   880,   882,   884,   889,   891,   893,   895,
    1040      900,   913,   914,   919,   921,   926,   930,   932,   934,   936,
    1041      938,   944,   945,   951,   952,   956,   957,   962,   964,   970,
    1042      971,   973,   978,   980,   987,   989,   993,   994,   999,  1001,
    1043     1005,  1006,  1010,  1012,  1016,  1017,  1021,  1022,  1026,  1027,
    1044     1042,  1043,  1044,  1045,  1046,  1050,  1055,  1062,  1072,  1077,
    1045     1082,  1090,  1095,  1100,  1105,  1110,  1118,  1140,  1145,  1152,
    1046     1154,  1161,  1166,  1171,  1182,  1187,  1192,  1197,  1202,  1211,
    1047     1216,  1224,  1225,  1226,  1227,  1233,  1238,  1246,  1247,  1248,
    1048     1249,  1253,  1254,  1255,  1256,  1261,  1262,  1271,  1272,  1277,
    1049     1278,  1283,  1285,  1287,  1289,  1291,  1294,  1293,  1305,  1306,
    1050     1308,  1318,  1319,  1324,  1328,  1330,  1332,  1334,  1336,  1338,
    1051     1340,  1342,  1347,  1349,  1351,  1353,  1355,  1357,  1359,  1361,
    1052     1363,  1365,  1367,  1369,  1371,  1377,  1378,  1380,  1382,  1384,
    1053     1389,  1390,  1396,  1397,  1399,  1401,  1406,  1408,  1410,  1412,
    1054     1417,  1418,  1420,  1422,  1427,  1428,  1430,  1435,  1436,  1438,
    1055     1440,  1445,  1447,  1449,  1454,  1455,  1459,  1461,  1467,  1466,
    1056     1470,  1472,  1477,  1479,  1485,  1486,  1491,  1492,  1494,  1495,
    1057     1504,  1505,  1507,  1509,  1514,  1516,  1522,  1523,  1525,  1528,
    1058     1531,  1536,  1537,  1542,  1547,  1551,  1553,  1559,  1558,  1565,
    1059     1567,  1573,  1574,  1582,  1583,  1587,  1588,  1589,  1591,  1593,
    1060     1600,  1601,  1603,  1605,  1610,  1611,  1617,  1618,  1622,  1623,
    1061     1628,  1629,  1630,  1632,  1640,  1641,  1643,  1646,  1648,  1652,
    1062     1653,  1654,  1656,  1658,  1662,  1667,  1675,  1676,  1685,  1687,
    1063     1692,  1693,  1694,  1698,  1699,  1700,  1704,  1705,  1706,  1710,
    1064     1711,  1712,  1717,  1718,  1719,  1720,  1726,  1727,  1729,  1734,
    1065     1735,  1740,  1741,  1742,  1743,  1744,  1759,  1760,  1765,  1766,
    1066     1774,  1776,  1778,  1781,  1783,  1785,  1808,  1809,  1811,  1813,
    1067     1818,  1819,  1821,  1826,  1831,  1832,  1838,  1837,  1841,  1845,
    1068     1847,  1849,  1855,  1856,  1861,  1866,  1868,  1873,  1875,  1876,
    1069     1878,  1883,  1885,  1887,  1892,  1894,  1899,  1904,  1912,  1918,
    1070     1917,  1931,  1932,  1937,  1938,  1942,  1947,  1952,  1960,  1965,
    1071     1976,  1977,  1988,  1989,  1995,  1996,  2000,  2001,  2002,  2005,
    1072     2004,  2015,  2024,  2030,  2036,  2045,  2051,  2057,  2063,  2069,
    1073     2077,  2083,  2091,  2097,  2106,  2107,  2108,  2112,  2116,  2118,
    1074     2123,  2124,  2128,  2129,  2134,  2140,  2141,  2144,  2146,  2147,
    1075     2151,  2152,  2153,  2154,  2188,  2190,  2191,  2193,  2198,  2203,
    1076     2208,  2210,  2212,  2217,  2219,  2221,  2223,  2228,  2230,  2239,
    1077     2241,  2242,  2247,  2249,  2251,  2256,  2258,  2260,  2265,  2267,
    1078     2269,  2278,  2279,  2280,  2284,  2286,  2288,  2293,  2295,  2297,
    1079     2302,  2304,  2306,  2321,  2323,  2324,  2326,  2331,  2332,  2337,
    1080     2339,  2341,  2346,  2348,  2350,  2352,  2357,  2359,  2361,  2371,
    1081     2373,  2374,  2376,  2381,  2383,  2385,  2390,  2392,  2394,  2396,
    1082     2401,  2403,  2405,  2436,  2438,  2439,  2441,  2446,  2451,  2459,
    1083     2461,  2463,  2468,  2470,  2475,  2477,  2491,  2492,  2494,  2499,
    1084     2501,  2503,  2505,  2507,  2512,  2513,  2515,  2517,  2522,  2524,
    1085     2526,  2532,  2534,  2536,  2540,  2542,  2544,  2546,  2560,  2561,
    1086     2563,  2568,  2570,  2572,  2574,  2576,  2581,  2582,  2584,  2586,
    1087     2591,  2593,  2595,  2601,  2602,  2604,  2613,  2616,  2618,  2621,
    1088     2623,  2625,  2638,  2639,  2641,  2646,  2648,  2650,  2652,  2654,
    1089     2659,  2660,  2662,  2664,  2669,  2671,  2679,  2680,  2681,  2686,
    1090     2687,  2691,  2693,  2695,  2697,  2699,  2701,  2708,  2710,  2712,
    1091     2714,  2716,  2718,  2720,  2722,  2724,  2726,  2731,  2733,  2735,
    1092     2740,  2766,  2767,  2769,  2773,  2774,  2778,  2780,  2782,  2784,
    1093     2786,  2788,  2795,  2797,  2799,  2801,  2803,  2805,  2810,  2815,
    1094     2817,  2819,  2837,  2839,  2844,  2845
     1018       0,   290,   290,   296,   305,   306,   307,   311,   312,   313,
     1019     317,   318,   322,   323,   327,   328,   332,   333,   339,   341,
     1020     343,   345,   350,   351,   357,   361,   363,   364,   366,   367,
     1021     369,   371,   373,   381,   382,   388,   389,   390,   395,   397,
     1022     402,   403,   407,   411,   413,   415,   417,   422,   425,   427,
     1023     429,   431,   436,   438,   440,   442,   444,   446,   448,   450,
     1024     452,   454,   456,   463,   464,   466,   470,   471,   472,   473,
     1025     477,   478,   480,   485,   486,   488,   490,   495,   496,   498,
     1026     503,   504,   506,   511,   512,   514,   516,   518,   523,   524,
     1027     526,   531,   532,   537,   538,   543,   544,   549,   550,   555,
     1028     556,   561,   562,   564,   566,   571,   576,   577,   579,   581,
     1029     587,   588,   594,   596,   598,   600,   605,   606,   611,   612,
     1030     613,   614,   615,   616,   617,   618,   619,   620,   624,   625,
     1031     631,   632,   638,   639,   640,   641,   642,   643,   644,   645,
     1032     646,   656,   663,   665,   675,   676,   681,   683,   689,   691,
     1033     695,   696,   701,   706,   709,   711,   713,   722,   724,   735,
     1034     736,   738,   742,   743,   748,   749,   754,   755,   759,   764,
     1035     765,   769,   771,   777,   778,   782,   784,   786,   788,   794,
     1036     795,   799,   801,   806,   808,   810,   815,   817,   822,   824,
     1037     828,   831,   835,   838,   842,   844,   848,   850,   857,   859,
     1038     861,   870,   872,   874,   876,   878,   883,   885,   887,   889,
     1039     894,   907,   908,   913,   915,   920,   924,   926,   928,   930,
     1040     932,   938,   939,   945,   946,   950,   951,   956,   958,   964,
     1041     965,   967,   972,   974,   981,   983,   987,   988,   993,   995,
     1042     999,  1000,  1004,  1006,  1010,  1011,  1015,  1016,  1020,  1021,
     1043    1036,  1037,  1038,  1039,  1040,  1044,  1049,  1056,  1066,  1071,
     1044    1076,  1084,  1089,  1094,  1099,  1104,  1112,  1134,  1139,  1146,
     1045    1148,  1155,  1160,  1165,  1176,  1181,  1186,  1191,  1196,  1205,
     1046    1210,  1218,  1219,  1220,  1221,  1227,  1232,  1240,  1241,  1242,
     1047    1243,  1247,  1248,  1249,  1250,  1255,  1256,  1265,  1266,  1271,
     1048    1272,  1277,  1279,  1281,  1283,  1285,  1288,  1287,  1299,  1300,
     1049    1302,  1312,  1313,  1318,  1322,  1324,  1326,  1328,  1330,  1332,
     1050    1334,  1336,  1341,  1343,  1345,  1347,  1349,  1351,  1353,  1355,
     1051    1357,  1359,  1361,  1363,  1365,  1371,  1372,  1374,  1376,  1378,
     1052    1383,  1384,  1390,  1391,  1393,  1395,  1400,  1402,  1404,  1406,
     1053    1411,  1412,  1414,  1416,  1421,  1422,  1424,  1429,  1430,  1432,
     1054    1434,  1439,  1441,  1443,  1448,  1449,  1453,  1455,  1461,  1460,
     1055    1464,  1466,  1471,  1473,  1479,  1480,  1485,  1486,  1488,  1489,
     1056    1498,  1499,  1501,  1503,  1508,  1510,  1516,  1517,  1519,  1522,
     1057    1525,  1530,  1531,  1536,  1541,  1545,  1547,  1553,  1552,  1559,
     1058    1561,  1567,  1568,  1576,  1577,  1581,  1582,  1583,  1585,  1587,
     1059    1594,  1595,  1597,  1599,  1604,  1605,  1611,  1612,  1616,  1617,
     1060    1622,  1623,  1624,  1626,  1634,  1635,  1637,  1640,  1642,  1646,
     1061    1647,  1648,  1650,  1652,  1656,  1661,  1669,  1670,  1679,  1681,
     1062    1686,  1687,  1688,  1692,  1693,  1694,  1698,  1699,  1700,  1704,
     1063    1705,  1706,  1711,  1712,  1713,  1714,  1720,  1721,  1723,  1728,
     1064    1729,  1734,  1735,  1736,  1737,  1738,  1753,  1754,  1759,  1760,
     1065    1768,  1770,  1772,  1775,  1777,  1779,  1802,  1803,  1805,  1807,
     1066    1812,  1813,  1815,  1820,  1825,  1826,  1832,  1831,  1835,  1839,
     1067    1841,  1843,  1849,  1850,  1855,  1860,  1862,  1867,  1869,  1870,
     1068    1872,  1877,  1879,  1881,  1886,  1888,  1893,  1898,  1906,  1912,
     1069    1911,  1925,  1926,  1931,  1932,  1936,  1941,  1946,  1954,  1959,
     1070    1970,  1971,  1982,  1983,  1989,  1990,  1994,  1995,  1996,  1999,
     1071    1998,  2009,  2018,  2024,  2030,  2039,  2045,  2051,  2057,  2063,
     1072    2071,  2077,  2085,  2091,  2100,  2101,  2102,  2106,  2110,  2112,
     1073    2117,  2118,  2122,  2123,  2128,  2134,  2135,  2138,  2140,  2141,
     1074    2145,  2146,  2147,  2148,  2182,  2184,  2185,  2187,  2192,  2197,
     1075    2202,  2204,  2206,  2211,  2213,  2215,  2217,  2222,  2224,  2233,
     1076    2235,  2236,  2241,  2243,  2245,  2250,  2252,  2254,  2259,  2261,
     1077    2263,  2272,  2273,  2274,  2278,  2280,  2282,  2287,  2289,  2291,
     1078    2296,  2298,  2300,  2315,  2317,  2318,  2320,  2325,  2326,  2331,
     1079    2333,  2335,  2340,  2342,  2344,  2346,  2351,  2353,  2355,  2365,
     1080    2367,  2368,  2370,  2375,  2377,  2379,  2384,  2386,  2388,  2390,
     1081    2395,  2397,  2399,  2430,  2432,  2433,  2435,  2440,  2445,  2453,
     1082    2455,  2457,  2462,  2464,  2469,  2471,  2485,  2486,  2488,  2493,
     1083    2495,  2497,  2499,  2501,  2506,  2507,  2509,  2511,  2516,  2518,
     1084    2520,  2526,  2528,  2530,  2534,  2536,  2538,  2540,  2554,  2555,
     1085    2557,  2562,  2564,  2566,  2568,  2570,  2575,  2576,  2578,  2580,
     1086    2585,  2587,  2589,  2595,  2596,  2598,  2607,  2610,  2612,  2615,
     1087    2617,  2619,  2632,  2633,  2635,  2640,  2642,  2644,  2646,  2648,
     1088    2653,  2654,  2656,  2658,  2663,  2665,  2673,  2674,  2675,  2680,
     1089    2681,  2685,  2687,  2689,  2691,  2693,  2695,  2702,  2704,  2706,
     1090    2708,  2710,  2712,  2714,  2716,  2718,  2720,  2725,  2727,  2729,
     1091    2734,  2760,  2761,  2763,  2767,  2768,  2772,  2774,  2776,  2778,
     1092    2780,  2782,  2789,  2791,  2793,  2795,  2797,  2799,  2804,  2809,
     1093    2811,  2813,  2831,  2833,  2838,  2839
    10951094};
    10961095#endif
     
    52175216
    52185217/* Line 1806 of yacc.c  */
    5219 #line 292 "parser.yy"
     5218#line 290 "parser.yy"
    52205219    {
    52215220                        typedefTable.enterScope();
     
    52265225
    52275226/* Line 1806 of yacc.c  */
    5228 #line 298 "parser.yy"
     5227#line 296 "parser.yy"
    52295228    {
    52305229                        typedefTable.leaveScope();
     
    52355234
    52365235/* Line 1806 of yacc.c  */
     5236#line 305 "parser.yy"
     5237    { (yyval.constant) = makeConstantInteger( *(yyvsp[(1) - (1)].tok) ); }
     5238    break;
     5239
     5240  case 5:
     5241
     5242/* Line 1806 of yacc.c  */
     5243#line 306 "parser.yy"
     5244    { (yyval.constant) = makeConstantFloat( *(yyvsp[(1) - (1)].tok) ); }
     5245    break;
     5246
     5247  case 6:
     5248
     5249/* Line 1806 of yacc.c  */
    52375250#line 307 "parser.yy"
    5238     { (yyval.constant) = makeConstantInteger( *(yyvsp[(1) - (1)].tok) ); }
    5239     break;
    5240 
    5241   case 5:
    5242 
    5243 /* Line 1806 of yacc.c  */
    5244 #line 308 "parser.yy"
    5245     { (yyval.constant) = makeConstantFloat( *(yyvsp[(1) - (1)].tok) ); }
    5246     break;
    5247 
    5248   case 6:
    5249 
    5250 /* Line 1806 of yacc.c  */
    5251 #line 309 "parser.yy"
    52525251    { (yyval.constant) = makeConstantChar( *(yyvsp[(1) - (1)].tok) ); }
    52535252    break;
     
    52565255
    52575256/* Line 1806 of yacc.c  */
    5258 #line 334 "parser.yy"
     5257#line 332 "parser.yy"
    52595258    { (yyval.constant) = makeConstantStr( *(yyvsp[(1) - (1)].tok) ); }
    52605259    break;
     
    52635262
    52645263/* Line 1806 of yacc.c  */
    5265 #line 335 "parser.yy"
     5264#line 333 "parser.yy"
    52665265    { (yyval.constant) = (yyvsp[(1) - (2)].constant)->appendstr( (yyvsp[(2) - (2)].tok) ); }
    52675266    break;
    52685267
    52695268  case 18:
     5269
     5270/* Line 1806 of yacc.c  */
     5271#line 340 "parser.yy"
     5272    { (yyval.en) = new VarRefNode( (yyvsp[(1) - (1)].tok) ); }
     5273    break;
     5274
     5275  case 19:
    52705276
    52715277/* Line 1806 of yacc.c  */
     
    52745280    break;
    52755281
    5276   case 19:
     5282  case 20:
    52775283
    52785284/* Line 1806 of yacc.c  */
    52795285#line 344 "parser.yy"
    5280     { (yyval.en) = new VarRefNode( (yyvsp[(1) - (1)].tok) ); }
    5281     break;
    5282 
    5283   case 20:
     5286    { (yyval.en) = (yyvsp[(2) - (3)].en); }
     5287    break;
     5288
     5289  case 21:
    52845290
    52855291/* Line 1806 of yacc.c  */
    52865292#line 346 "parser.yy"
    5287     { (yyval.en) = (yyvsp[(2) - (3)].en); }
    5288     break;
    5289 
    5290   case 21:
    5291 
    5292 /* Line 1806 of yacc.c  */
    5293 #line 348 "parser.yy"
    52945293    { (yyval.en) = new ValofExprNode( (yyvsp[(2) - (3)].sn) ); }
    52955294    break;
     
    52985297
    52995298/* Line 1806 of yacc.c  */
     5299#line 356 "parser.yy"
     5300    { (yyval.en) = new CompositeExprNode( new OperatorNode( OperatorNode::Index ), (yyvsp[(1) - (6)].en), (yyvsp[(4) - (6)].en) ); }
     5301    break;
     5302
     5303  case 24:
     5304
     5305/* Line 1806 of yacc.c  */
    53005306#line 358 "parser.yy"
    5301     { (yyval.en) = new CompositeExprNode2( build_opr2( OperatorNode::Index, (yyvsp[(1) - (6)].en), (yyvsp[(4) - (6)].en) ) ); }
    5302     break;
    5303 
    5304   case 24:
    5305 
    5306 /* Line 1806 of yacc.c  */
    5307 #line 360 "parser.yy"
    53085307    { (yyval.en) = new CompositeExprNode( (yyvsp[(1) - (4)].en), (yyvsp[(3) - (4)].en) ); }
    53095308    break;
     
    53125311
    53135312/* Line 1806 of yacc.c  */
    5314 #line 364 "parser.yy"
    5315     { (yyval.en) = new CompositeExprNode2( build_fieldSel( (yyvsp[(1) - (3)].en), new VarRefNode( (yyvsp[(3) - (3)].tok) ) ) ); }
     5313#line 362 "parser.yy"
     5314    { (yyval.en) = new CompositeExprNode( new OperatorNode( OperatorNode::FieldSel ), (yyvsp[(1) - (3)].en), new VarRefNode( (yyvsp[(3) - (3)].tok) )); }
    53165315    break;
    53175316
     
    53195318
    53205319/* Line 1806 of yacc.c  */
    5321 #line 367 "parser.yy"
    5322     { (yyval.en) = new CompositeExprNode2( build_pfieldSel( (yyvsp[(1) - (3)].en), new VarRefNode( (yyvsp[(3) - (3)].tok) ) ) ); }
     5320#line 365 "parser.yy"
     5321    { (yyval.en) = new CompositeExprNode( new OperatorNode( OperatorNode::PFieldSel ), (yyvsp[(1) - (3)].en), new VarRefNode( (yyvsp[(3) - (3)].tok) )); }
    53235322    break;
    53245323
     
    53265325
    53275326/* Line 1806 of yacc.c  */
     5327#line 368 "parser.yy"
     5328    { (yyval.en) = new CompositeExprNode( new OperatorNode( OperatorNode::IncrPost ), (yyvsp[(1) - (2)].en) ); }
     5329    break;
     5330
     5331  case 30:
     5332
     5333/* Line 1806 of yacc.c  */
    53285334#line 370 "parser.yy"
    5329     { (yyval.en) = new CompositeExprNode2( build_opr1( OperatorNode::IncrPost, (yyvsp[(1) - (2)].en) ) ); }
    5330     break;
    5331 
    5332   case 30:
     5335    { (yyval.en) = new CompositeExprNode( new OperatorNode( OperatorNode::DecrPost ), (yyvsp[(1) - (2)].en) ); }
     5336    break;
     5337
     5338  case 31:
    53335339
    53345340/* Line 1806 of yacc.c  */
    53355341#line 372 "parser.yy"
    5336     { (yyval.en) = new CompositeExprNode2( build_opr1( OperatorNode::DecrPost, (yyvsp[(1) - (2)].en) ) ); }
    5337     break;
    5338 
    5339   case 31:
     5342    { (yyval.en) = new CompoundLiteralNode( (yyvsp[(2) - (7)].decl), new InitializerNode( (yyvsp[(5) - (7)].in), true ) ); }
     5343    break;
     5344
     5345  case 32:
    53405346
    53415347/* Line 1806 of yacc.c  */
    53425348#line 374 "parser.yy"
    5343     { (yyval.en) = new CompoundLiteralNode( (yyvsp[(2) - (7)].decl), new InitializerNode( (yyvsp[(5) - (7)].in), true ) ); }
    5344     break;
    5345 
    5346   case 32:
    5347 
    5348 /* Line 1806 of yacc.c  */
    5349 #line 376 "parser.yy"
    53505349    {
    53515350                        Token fn; fn.str = new std::string( "?{}" ); // location undefined
     
    53575356
    53585357/* Line 1806 of yacc.c  */
    5359 #line 385 "parser.yy"
     5358#line 383 "parser.yy"
    53605359    { (yyval.en) = (ExpressionNode *)( (yyvsp[(1) - (3)].en)->set_link( (yyvsp[(3) - (3)].en) )); }
    53615360    break;
     
    53645363
    53655364/* Line 1806 of yacc.c  */
    5366 #line 390 "parser.yy"
     5365#line 388 "parser.yy"
    53675366    { (yyval.en) = 0; }
    53685367    break;
     
    53715370
    53725371/* Line 1806 of yacc.c  */
    5373 #line 393 "parser.yy"
     5372#line 391 "parser.yy"
    53745373    { (yyval.en) = (yyvsp[(3) - (3)].en)->set_argName( (yyvsp[(1) - (3)].tok) ); }
    53755374    break;
     
    53785377
    53795378/* Line 1806 of yacc.c  */
     5379#line 396 "parser.yy"
     5380    { (yyval.en) = (yyvsp[(7) - (7)].en)->set_argName( (yyvsp[(3) - (7)].en) ); }
     5381    break;
     5382
     5383  case 39:
     5384
     5385/* Line 1806 of yacc.c  */
    53805386#line 398 "parser.yy"
    5381     { (yyval.en) = (yyvsp[(7) - (7)].en)->set_argName( (yyvsp[(3) - (7)].en) ); }
    5382     break;
    5383 
    5384   case 39:
    5385 
    5386 /* Line 1806 of yacc.c  */
    5387 #line 400 "parser.yy"
    53885387    { (yyval.en) = (yyvsp[(9) - (9)].en)->set_argName( new CompositeExprNode( new OperatorNode( OperatorNode::TupleC ), (ExpressionNode *)(yyvsp[(3) - (9)].en)->set_link( flattenCommas( (yyvsp[(5) - (9)].en) )))); }
    53895388    break;
     
    53925391
    53935392/* Line 1806 of yacc.c  */
    5394 #line 405 "parser.yy"
     5393#line 403 "parser.yy"
    53955394    { (yyval.en) = (ExpressionNode *)(yyvsp[(1) - (3)].en)->set_link( (yyvsp[(3) - (3)].en) ); }
    53965395    break;
     
    53995398
    54005399/* Line 1806 of yacc.c  */
    5401 #line 410 "parser.yy"
     5400#line 408 "parser.yy"
    54025401    { (yyval.en) = new VarRefNode( (yyvsp[(1) - (1)].tok) ); }
    54035402    break;
     
    54065405
    54075406/* Line 1806 of yacc.c  */
     5407#line 412 "parser.yy"
     5408    { (yyval.en) = new CompositeExprNode( new OperatorNode( OperatorNode::FieldSel ), new VarRefNode( (yyvsp[(1) - (3)].tok) ), (yyvsp[(3) - (3)].en) ); }
     5409    break;
     5410
     5411  case 44:
     5412
     5413/* Line 1806 of yacc.c  */
    54085414#line 414 "parser.yy"
    5409     { (yyval.en) = new CompositeExprNode2( build_fieldSel( (yyvsp[(3) - (3)].en), new VarRefNode( (yyvsp[(1) - (3)].tok) ) ) ); }
    5410     break;
    5411 
    5412   case 44:
     5415    { (yyval.en) = new CompositeExprNode( new OperatorNode( OperatorNode::FieldSel ), new VarRefNode( (yyvsp[(1) - (7)].tok) ), (yyvsp[(5) - (7)].en) ); }
     5416    break;
     5417
     5418  case 45:
    54135419
    54145420/* Line 1806 of yacc.c  */
    54155421#line 416 "parser.yy"
    5416     { (yyval.en) = new CompositeExprNode2( build_fieldSel( (yyvsp[(5) - (7)].en), new VarRefNode( (yyvsp[(1) - (7)].tok) ) ) ); }
    5417     break;
    5418 
    5419   case 45:
     5422    { (yyval.en) = new CompositeExprNode( new OperatorNode( OperatorNode::PFieldSel ), new VarRefNode( (yyvsp[(1) - (3)].tok) ), (yyvsp[(3) - (3)].en) ); }
     5423    break;
     5424
     5425  case 46:
    54205426
    54215427/* Line 1806 of yacc.c  */
    54225428#line 418 "parser.yy"
    5423     { (yyval.en) = new CompositeExprNode2( build_pfieldSel( (yyvsp[(3) - (3)].en), new VarRefNode( (yyvsp[(1) - (3)].tok) ) ) ); }
    5424     break;
    5425 
    5426   case 46:
    5427 
    5428 /* Line 1806 of yacc.c  */
    5429 #line 420 "parser.yy"
    5430     { (yyval.en) = new CompositeExprNode2( build_pfieldSel( (yyvsp[(5) - (7)].en), new VarRefNode( (yyvsp[(1) - (7)].tok) ) ) ); }
     5429    { (yyval.en) = new CompositeExprNode( new OperatorNode( OperatorNode::PFieldSel ), new VarRefNode( (yyvsp[(1) - (7)].tok) ), (yyvsp[(5) - (7)].en) ); }
    54315430    break;
    54325431
    54335432  case 48:
     5433
     5434/* Line 1806 of yacc.c  */
     5435#line 426 "parser.yy"
     5436    { (yyval.en) = (yyvsp[(1) - (1)].constant); }
     5437    break;
     5438
     5439  case 49:
    54345440
    54355441/* Line 1806 of yacc.c  */
     
    54385444    break;
    54395445
    5440   case 49:
     5446  case 50:
    54415447
    54425448/* Line 1806 of yacc.c  */
    54435449#line 430 "parser.yy"
    5444     { (yyval.en) = (yyvsp[(1) - (1)].constant); }
    5445     break;
    5446 
    5447   case 50:
     5450    { (yyval.en) = (yyvsp[(2) - (2)].en)->set_extension( true ); }
     5451    break;
     5452
     5453  case 51:
    54485454
    54495455/* Line 1806 of yacc.c  */
    54505456#line 432 "parser.yy"
    5451     { (yyval.en) = (yyvsp[(2) - (2)].en)->set_extension( true ); }
    5452     break;
    5453 
    5454   case 51:
     5457    { (yyval.en) = new CompositeExprNode( (yyvsp[(1) - (2)].en), (yyvsp[(2) - (2)].en) ); }
     5458    break;
     5459
     5460  case 52:
    54555461
    54565462/* Line 1806 of yacc.c  */
    54575463#line 437 "parser.yy"
    5458     { (yyval.en) = (yyvsp[(1) - (2)].op) == OperatorNode::AddressOf ? (ExpressionNode*) new CompositeExprNode2( build_addressOf( (yyvsp[(2) - (2)].en) ) )
    5459                                                                                         : (ExpressionNode*)new CompositeExprNode( new OperatorNode ( (yyvsp[(1) - (2)].op) ), (yyvsp[(2) - (2)].en) ); }
    5460     break;
    5461 
    5462   case 52:
    5463 
    5464 /* Line 1806 of yacc.c  */
    5465 #line 440 "parser.yy"
    54665464    { (yyval.en) = new CompositeExprNode( (yyvsp[(1) - (2)].en), (yyvsp[(2) - (2)].en) ); }
    54675465    break;
     
    54705468
    54715469/* Line 1806 of yacc.c  */
    5472 #line 442 "parser.yy"
    5473     { (yyval.en) = new CompositeExprNode2( build_opr1( OperatorNode::Incr, (yyvsp[(2) - (2)].en) ) ); }
     5470#line 439 "parser.yy"
     5471    { (yyval.en) = new CompositeExprNode( new OperatorNode( OperatorNode::Incr ), (yyvsp[(2) - (2)].en) ); }
    54745472    break;
    54755473
     
    54775475
    54785476/* Line 1806 of yacc.c  */
    5479 #line 444 "parser.yy"
    5480     { (yyval.en) = new CompositeExprNode2( build_opr1( OperatorNode::Decr, (yyvsp[(2) - (2)].en) ) ); }
     5477#line 441 "parser.yy"
     5478    { (yyval.en) = new CompositeExprNode( new OperatorNode( OperatorNode::Decr ), (yyvsp[(2) - (2)].en) ); }
    54815479    break;
    54825480
     
    54845482
    54855483/* Line 1806 of yacc.c  */
    5486 #line 446 "parser.yy"
    5487     { (yyval.en) = new CompositeExprNode2( build_sizeOf( (yyvsp[(2) - (2)].en) ) ); }
     5484#line 443 "parser.yy"
     5485    { (yyval.en) = new CompositeExprNode( new OperatorNode( OperatorNode::SizeOf ), (yyvsp[(2) - (2)].en) ); }
    54885486    break;
    54895487
     
    54915489
    54925490/* Line 1806 of yacc.c  */
    5493 #line 448 "parser.yy"
    5494     { (yyval.en) = new CompositeExprNode2( build_sizeOf( new TypeValueNode( (yyvsp[(3) - (4)].decl) ) ) ); }
     5491#line 445 "parser.yy"
     5492    { (yyval.en) = new CompositeExprNode( new OperatorNode( OperatorNode::SizeOf ), new TypeValueNode( (yyvsp[(3) - (4)].decl) )); }
    54955493    break;
    54965494
     
    54985496
    54995497/* Line 1806 of yacc.c  */
    5500 #line 450 "parser.yy"
    5501     { (yyval.en) = new CompositeExprNode2( build_offsetOf( new TypeValueNode( (yyvsp[(3) - (6)].decl) ), new VarRefNode( (yyvsp[(5) - (6)].tok) ) ) ); }
     5498#line 447 "parser.yy"
     5499    { (yyval.en) = new CompositeExprNode( new OperatorNode( OperatorNode::OffsetOf ), new TypeValueNode( (yyvsp[(3) - (6)].decl) ), new VarRefNode( (yyvsp[(5) - (6)].tok) )); }
    55025500    break;
    55035501
     
    55055503
    55065504/* Line 1806 of yacc.c  */
    5507 #line 452 "parser.yy"
    5508     { (yyval.en) = new CompositeExprNode( new OperatorNode( OperatorNode::Attr ), new VarRefNode( (yyvsp[(1) - (1)].tok) ) ); }
     5505#line 449 "parser.yy"
     5506    { (yyval.en) = new CompositeExprNode( new OperatorNode( OperatorNode::Attr ), new VarRefNode( (yyvsp[(1) - (1)].tok) )); }
    55095507    break;
    55105508
     
    55125510
    55135511/* Line 1806 of yacc.c  */
    5514 #line 454 "parser.yy"
    5515     { (yyval.en) = new CompositeExprNode( new OperatorNode( OperatorNode::Attr ), new VarRefNode( (yyvsp[(1) - (4)].tok) ), new TypeValueNode( (yyvsp[(3) - (4)].decl) ) ); }
     5512#line 451 "parser.yy"
     5513    { (yyval.en) = new CompositeExprNode( new OperatorNode( OperatorNode::Attr ), new VarRefNode( (yyvsp[(1) - (4)].tok) ), new TypeValueNode( (yyvsp[(3) - (4)].decl) )); }
    55165514    break;
    55175515
     
    55195517
    55205518/* Line 1806 of yacc.c  */
    5521 #line 456 "parser.yy"
     5519#line 453 "parser.yy"
    55225520    { (yyval.en) = new CompositeExprNode( new OperatorNode( OperatorNode::Attr ), new VarRefNode( (yyvsp[(1) - (4)].tok) ), (yyvsp[(3) - (4)].en) ); }
    55235521    break;
     
    55265524
    55275525/* Line 1806 of yacc.c  */
    5528 #line 458 "parser.yy"
    5529     { (yyval.en) = new CompositeExprNode2( build_alignOf( (yyvsp[(2) - (2)].en) ) ); }
     5526#line 455 "parser.yy"
     5527    { (yyval.en) = new CompositeExprNode( new OperatorNode( OperatorNode::AlignOf ), (yyvsp[(2) - (2)].en) ); }
    55305528    break;
    55315529
     
    55335531
    55345532/* Line 1806 of yacc.c  */
    5535 #line 460 "parser.yy"
    5536     { (yyval.en) = new CompositeExprNode2( build_alignOf( new TypeValueNode( (yyvsp[(3) - (4)].decl) ) ) ); }
     5533#line 457 "parser.yy"
     5534    { (yyval.en) = new CompositeExprNode( new OperatorNode( OperatorNode::AlignOf ), new TypeValueNode( (yyvsp[(3) - (4)].decl) ) ); }
    55375535    break;
    55385536
     
    55405538
    55415539/* Line 1806 of yacc.c  */
     5540#line 463 "parser.yy"
     5541    { (yyval.en) = new OperatorNode( OperatorNode::PointTo ); }
     5542    break;
     5543
     5544  case 64:
     5545
     5546/* Line 1806 of yacc.c  */
     5547#line 464 "parser.yy"
     5548    { (yyval.en) = new OperatorNode( OperatorNode::AddressOf ); }
     5549    break;
     5550
     5551  case 65:
     5552
     5553/* Line 1806 of yacc.c  */
    55425554#line 466 "parser.yy"
    5543     { (yyval.op) = OperatorNode::PointTo; }
    5544     break;
    5545 
    5546   case 64:
    5547 
    5548 /* Line 1806 of yacc.c  */
    5549 #line 467 "parser.yy"
    5550     { (yyval.op) = OperatorNode::AddressOf; }
    5551     break;
    5552 
    5553   case 65:
    5554 
    5555 /* Line 1806 of yacc.c  */
    5556 #line 469 "parser.yy"
    5557     { (yyval.op) = OperatorNode::And; }
     5555    { (yyval.en) = new OperatorNode( OperatorNode::And ); }
    55585556    break;
    55595557
     
    55615559
    55625560/* Line 1806 of yacc.c  */
     5561#line 470 "parser.yy"
     5562    { (yyval.en) = new OperatorNode( OperatorNode::UnPlus ); }
     5563    break;
     5564
     5565  case 67:
     5566
     5567/* Line 1806 of yacc.c  */
     5568#line 471 "parser.yy"
     5569    { (yyval.en) = new OperatorNode( OperatorNode::UnMinus ); }
     5570    break;
     5571
     5572  case 68:
     5573
     5574/* Line 1806 of yacc.c  */
     5575#line 472 "parser.yy"
     5576    { (yyval.en) = new OperatorNode( OperatorNode::Neg ); }
     5577    break;
     5578
     5579  case 69:
     5580
     5581/* Line 1806 of yacc.c  */
    55635582#line 473 "parser.yy"
    5564     { (yyval.en) = new OperatorNode( OperatorNode::UnPlus ); }
    5565     break;
    5566 
    5567   case 67:
    5568 
    5569 /* Line 1806 of yacc.c  */
    5570 #line 474 "parser.yy"
    5571     { (yyval.en) = new OperatorNode( OperatorNode::UnMinus ); }
    5572     break;
    5573 
    5574   case 68:
    5575 
    5576 /* Line 1806 of yacc.c  */
    5577 #line 475 "parser.yy"
    5578     { (yyval.en) = new OperatorNode( OperatorNode::Neg ); }
    5579     break;
    5580 
    5581   case 69:
    5582 
    5583 /* Line 1806 of yacc.c  */
    5584 #line 476 "parser.yy"
    55855583    { (yyval.en) = new OperatorNode( OperatorNode::BitNeg ); }
    55865584    break;
     
    55895587
    55905588/* Line 1806 of yacc.c  */
    5591 #line 482 "parser.yy"
    5592     { (yyval.en) = new CompositeExprNode2( build_cast( new TypeValueNode( (yyvsp[(2) - (4)].decl) ), (yyvsp[(4) - (4)].en) ) ); }
     5589#line 479 "parser.yy"
     5590    { (yyval.en) = new CompositeExprNode( new OperatorNode( OperatorNode::Cast ), new TypeValueNode( (yyvsp[(2) - (4)].decl) ), (yyvsp[(4) - (4)].en) ); }
    55935591    break;
    55945592
     
    55965594
    55975595/* Line 1806 of yacc.c  */
    5598 #line 484 "parser.yy"
    5599     { (yyval.en) = new CompositeExprNode2( build_cast( new TypeValueNode( (yyvsp[(2) - (4)].decl) ), (yyvsp[(4) - (4)].en) ) ); }
     5596#line 481 "parser.yy"
     5597    { (yyval.en) = new CompositeExprNode( new OperatorNode( OperatorNode::Cast ), new TypeValueNode( (yyvsp[(2) - (4)].decl) ), (yyvsp[(4) - (4)].en) ); }
    56005598    break;
    56015599
     
    56035601
    56045602/* Line 1806 of yacc.c  */
    5605 #line 490 "parser.yy"
    5606     { (yyval.en) = new CompositeExprNode2( build_opr2( OperatorNode::Mul, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
     5603#line 487 "parser.yy"
     5604    { (yyval.en) = new CompositeExprNode( new OperatorNode( OperatorNode::Mul ), (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ); }
    56075605    break;
    56085606
     
    56105608
    56115609/* Line 1806 of yacc.c  */
    5612 #line 492 "parser.yy"
    5613     { (yyval.en) = new CompositeExprNode2( build_opr2( OperatorNode::Div, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
     5610#line 489 "parser.yy"
     5611    { (yyval.en) = new CompositeExprNode( new OperatorNode( OperatorNode::Div ), (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ); }
    56145612    break;
    56155613
     
    56175615
    56185616/* Line 1806 of yacc.c  */
    5619 #line 494 "parser.yy"
    5620     { (yyval.en) = new CompositeExprNode2( build_opr2( OperatorNode::Mod, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
     5617#line 491 "parser.yy"
     5618    { (yyval.en) = new CompositeExprNode( new OperatorNode( OperatorNode::Mod ), (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ); }
    56215619    break;
    56225620
     
    56245622
    56255623/* Line 1806 of yacc.c  */
    5626 #line 500 "parser.yy"
    5627     { (yyval.en) = new CompositeExprNode2( build_opr2( OperatorNode::Plus, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
     5624#line 497 "parser.yy"
     5625    { (yyval.en) = new CompositeExprNode( new OperatorNode( OperatorNode::Plus ), (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ); }
    56285626    break;
    56295627
     
    56315629
    56325630/* Line 1806 of yacc.c  */
    5633 #line 502 "parser.yy"
    5634     { (yyval.en) = new CompositeExprNode2( build_opr2( OperatorNode::Minus, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
     5631#line 499 "parser.yy"
     5632    { (yyval.en) = new CompositeExprNode( new OperatorNode( OperatorNode::Minus ), (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ); }
    56355633    break;
    56365634
     
    56385636
    56395637/* Line 1806 of yacc.c  */
    5640 #line 508 "parser.yy"
    5641     { (yyval.en) = new CompositeExprNode2( build_opr2( OperatorNode::LShift, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
     5638#line 505 "parser.yy"
     5639    { (yyval.en) = new CompositeExprNode( new OperatorNode( OperatorNode::LShift ), (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ); }
    56425640    break;
    56435641
     
    56455643
    56465644/* Line 1806 of yacc.c  */
    5647 #line 510 "parser.yy"
    5648     { (yyval.en) = new CompositeExprNode2( build_opr2( OperatorNode::RShift, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
     5645#line 507 "parser.yy"
     5646    { (yyval.en) = new CompositeExprNode( new OperatorNode( OperatorNode::RShift ), (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ); }
    56495647    break;
    56505648
     
    56525650
    56535651/* Line 1806 of yacc.c  */
    5654 #line 516 "parser.yy"
    5655     { (yyval.en) = new CompositeExprNode2( build_opr2( OperatorNode::LThan, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
     5652#line 513 "parser.yy"
     5653    { (yyval.en) = new CompositeExprNode( new OperatorNode( OperatorNode::LThan ), (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ); }
    56565654    break;
    56575655
     
    56595657
    56605658/* Line 1806 of yacc.c  */
    5661 #line 518 "parser.yy"
    5662     { (yyval.en) = new CompositeExprNode2( build_opr2( OperatorNode::GThan, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
     5659#line 515 "parser.yy"
     5660    { (yyval.en) = new CompositeExprNode( new OperatorNode( OperatorNode::GThan ), (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ); }
    56635661    break;
    56645662
     
    56665664
    56675665/* Line 1806 of yacc.c  */
    5668 #line 520 "parser.yy"
    5669     { (yyval.en) = new CompositeExprNode2( build_opr2( OperatorNode::LEThan, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
     5666#line 517 "parser.yy"
     5667    { (yyval.en) = new CompositeExprNode( new OperatorNode( OperatorNode::LEThan ), (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ); }
    56705668    break;
    56715669
     
    56735671
    56745672/* Line 1806 of yacc.c  */
    5675 #line 522 "parser.yy"
    5676     { (yyval.en) = new CompositeExprNode2( build_opr2( OperatorNode::GEThan, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
     5673#line 519 "parser.yy"
     5674    { (yyval.en) = new CompositeExprNode( new OperatorNode( OperatorNode::GEThan ), (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ); }
    56775675    break;
    56785676
     
    56805678
    56815679/* Line 1806 of yacc.c  */
    5682 #line 528 "parser.yy"
    5683     { (yyval.en) = new CompositeExprNode2( build_opr2( OperatorNode::Eq, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
     5680#line 525 "parser.yy"
     5681    { (yyval.en) = new CompositeExprNode( new OperatorNode( OperatorNode::Eq ), (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ); }
    56845682    break;
    56855683
     
    56875685
    56885686/* Line 1806 of yacc.c  */
    5689 #line 530 "parser.yy"
    5690     { (yyval.en) = new CompositeExprNode2( build_opr2( OperatorNode::Neq, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
     5687#line 527 "parser.yy"
     5688    { (yyval.en) = new CompositeExprNode( new OperatorNode( OperatorNode::Neq ), (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ); }
    56915689    break;
    56925690
     
    56945692
    56955693/* Line 1806 of yacc.c  */
    5696 #line 536 "parser.yy"
    5697     { (yyval.en) = new CompositeExprNode2( build_opr2( OperatorNode::BitAnd, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
     5694#line 533 "parser.yy"
     5695    { (yyval.en) =new CompositeExprNode( new OperatorNode( OperatorNode::BitAnd ), (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ); }
    56985696    break;
    56995697
     
    57015699
    57025700/* Line 1806 of yacc.c  */
    5703 #line 542 "parser.yy"
    5704     { (yyval.en) = new CompositeExprNode2( build_opr2( OperatorNode::Xor, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
     5701#line 539 "parser.yy"
     5702    { (yyval.en) = new CompositeExprNode( new OperatorNode( OperatorNode::Xor ), (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ); }
    57055703    break;
    57065704
     
    57085706
    57095707/* Line 1806 of yacc.c  */
    5710 #line 548 "parser.yy"
    5711     { (yyval.en) = new CompositeExprNode2( build_opr2( OperatorNode::BitOr, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
     5708#line 545 "parser.yy"
     5709    { (yyval.en) = new CompositeExprNode( new OperatorNode( OperatorNode::BitOr ), (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ); }
    57125710    break;
    57135711
     
    57155713
    57165714/* Line 1806 of yacc.c  */
    5717 #line 554 "parser.yy"
    5718     { (yyval.en) = new CompositeExprNode2( build_and_or( (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en), true ) ); }
     5715#line 551 "parser.yy"
     5716    { (yyval.en) = new CompositeExprNode( new OperatorNode( OperatorNode::And ), (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ); }
    57195717    break;
    57205718
     
    57225720
    57235721/* Line 1806 of yacc.c  */
    5724 #line 560 "parser.yy"
    5725     { (yyval.en) = new CompositeExprNode2( build_and_or( (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en), false ) ); }
     5722#line 557 "parser.yy"
     5723    { (yyval.en) = new CompositeExprNode( new OperatorNode( OperatorNode::Or ), (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ); }
    57265724    break;
    57275725
     
    57295727
    57305728/* Line 1806 of yacc.c  */
     5729#line 563 "parser.yy"
     5730    { (yyval.en) = new CompositeExprNode( new OperatorNode( OperatorNode::Cond ), (ExpressionNode *)mkList( (*(yyvsp[(1) - (5)].en), *(yyvsp[(3) - (5)].en), *(yyvsp[(5) - (5)].en) ) ) ); }
     5731    break;
     5732
     5733  case 103:
     5734
     5735/* Line 1806 of yacc.c  */
     5736#line 565 "parser.yy"
     5737    { (yyval.en)=new CompositeExprNode( new OperatorNode( OperatorNode::NCond ), (yyvsp[(1) - (4)].en), (yyvsp[(4) - (4)].en) ); }
     5738    break;
     5739
     5740  case 104:
     5741
     5742/* Line 1806 of yacc.c  */
    57315743#line 567 "parser.yy"
    5732     { (yyval.en) = new CompositeExprNode2( build_cond( (yyvsp[(1) - (5)].en), (yyvsp[(3) - (5)].en), (yyvsp[(5) - (5)].en) ) ); }
    5733     break;
    5734 
    5735   case 103:
    5736 
    5737 /* Line 1806 of yacc.c  */
    5738 #line 569 "parser.yy"
    5739     { (yyval.en) = new CompositeExprNode( new OperatorNode( OperatorNode::NCond ), (yyvsp[(1) - (4)].en), (yyvsp[(4) - (4)].en) ); }
    5740     break;
    5741 
    5742   case 104:
    5743 
    5744 /* Line 1806 of yacc.c  */
    5745 #line 571 "parser.yy"
    5746     { (yyval.en) = new CompositeExprNode2( build_cond( (yyvsp[(1) - (5)].en), (yyvsp[(3) - (5)].en), (yyvsp[(5) - (5)].en) ) ); }
     5744    { (yyval.en) = new CompositeExprNode( new OperatorNode( OperatorNode::Cond ), (ExpressionNode *)mkList( (*(yyvsp[(1) - (5)].en), *(yyvsp[(3) - (5)].en), *(yyvsp[(5) - (5)].en) ) ) ); }
    57475745    break;
    57485746
     
    57505748
    57515749/* Line 1806 of yacc.c  */
     5750#line 578 "parser.yy"
     5751    { (yyval.en) =new CompositeExprNode( new OperatorNode( OperatorNode::Assign ), (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ); }
     5752    break;
     5753
     5754  case 108:
     5755
     5756/* Line 1806 of yacc.c  */
     5757#line 580 "parser.yy"
     5758    { (yyval.en) =new CompositeExprNode( (yyvsp[(2) - (3)].en), (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ); }
     5759    break;
     5760
     5761  case 109:
     5762
     5763/* Line 1806 of yacc.c  */
    57525764#line 582 "parser.yy"
    5753     { (yyval.en) = new CompositeExprNode( new OperatorNode( OperatorNode::Assign ), (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ); }
    5754     break;
    5755 
    5756   case 108:
    5757 
    5758 /* Line 1806 of yacc.c  */
    5759 #line 584 "parser.yy"
    5760     { (yyval.en) = new CompositeExprNode( (yyvsp[(2) - (3)].en), (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ); }
    5761     break;
    5762 
    5763   case 109:
    5764 
    5765 /* Line 1806 of yacc.c  */
    5766 #line 586 "parser.yy"
    57675765    { (yyval.en) = ( (yyvsp[(2) - (2)].en) == 0 ) ? (yyvsp[(1) - (2)].en) : new CompositeExprNode( new OperatorNode( OperatorNode::Assign ), (yyvsp[(1) - (2)].en), (yyvsp[(2) - (2)].en) ); }
    57685766    break;
     
    57715769
    57725770/* Line 1806 of yacc.c  */
    5773 #line 591 "parser.yy"
     5771#line 587 "parser.yy"
    57745772    { (yyval.en) = new NullExprNode; }
    57755773    break;
     
    57785776
    57795777/* Line 1806 of yacc.c  */
     5778#line 595 "parser.yy"
     5779    { (yyval.en) = new CompositeExprNode( new OperatorNode( OperatorNode::TupleC ) ); }
     5780    break;
     5781
     5782  case 113:
     5783
     5784/* Line 1806 of yacc.c  */
     5785#line 597 "parser.yy"
     5786    { (yyval.en) = new CompositeExprNode( new OperatorNode( OperatorNode::TupleC ), (yyvsp[(3) - (5)].en) ); }
     5787    break;
     5788
     5789  case 114:
     5790
     5791/* Line 1806 of yacc.c  */
    57805792#line 599 "parser.yy"
    5781     { (yyval.en) = new CompositeExprNode( new OperatorNode( OperatorNode::TupleC ) ); }
    5782     break;
    5783 
    5784   case 113:
     5793    { (yyval.en) = new CompositeExprNode( new OperatorNode( OperatorNode::TupleC ), (ExpressionNode *)(new NullExprNode)->set_link( (yyvsp[(4) - (6)].en) ) ); }
     5794    break;
     5795
     5796  case 115:
    57855797
    57865798/* Line 1806 of yacc.c  */
    57875799#line 601 "parser.yy"
    5788     { (yyval.en) = new CompositeExprNode( new OperatorNode( OperatorNode::TupleC ), (yyvsp[(3) - (5)].en) ); }
    5789     break;
    5790 
    5791   case 114:
    5792 
    5793 /* Line 1806 of yacc.c  */
    5794 #line 603 "parser.yy"
    5795     { (yyval.en) = new CompositeExprNode( new OperatorNode( OperatorNode::TupleC ), (ExpressionNode *)(new NullExprNode)->set_link( (yyvsp[(4) - (6)].en) ) ); }
    5796     break;
    5797 
    5798   case 115:
    5799 
    5800 /* Line 1806 of yacc.c  */
    5801 #line 605 "parser.yy"
    58025800    { (yyval.en) = new CompositeExprNode( new OperatorNode( OperatorNode::TupleC ), (ExpressionNode *)(yyvsp[(3) - (7)].en)->set_link( flattenCommas( (yyvsp[(5) - (7)].en) ) ) ); }
    58035801    break;
     
    58065804
    58075805/* Line 1806 of yacc.c  */
     5806#line 607 "parser.yy"
     5807    { (yyval.en) = (ExpressionNode *)(yyvsp[(1) - (3)].en)->set_link( (yyvsp[(3) - (3)].en) ); }
     5808    break;
     5809
     5810  case 118:
     5811
     5812/* Line 1806 of yacc.c  */
    58085813#line 611 "parser.yy"
    5809     { (yyval.en) = (ExpressionNode *)(yyvsp[(1) - (3)].en)->set_link( (yyvsp[(3) - (3)].en) ); }
    5810     break;
    5811 
    5812   case 118:
     5814    { (yyval.en) = new OperatorNode( OperatorNode::MulAssn ); }
     5815    break;
     5816
     5817  case 119:
     5818
     5819/* Line 1806 of yacc.c  */
     5820#line 612 "parser.yy"
     5821    { (yyval.en) = new OperatorNode( OperatorNode::DivAssn ); }
     5822    break;
     5823
     5824  case 120:
     5825
     5826/* Line 1806 of yacc.c  */
     5827#line 613 "parser.yy"
     5828    { (yyval.en) = new OperatorNode( OperatorNode::ModAssn ); }
     5829    break;
     5830
     5831  case 121:
     5832
     5833/* Line 1806 of yacc.c  */
     5834#line 614 "parser.yy"
     5835    { (yyval.en) = new OperatorNode( OperatorNode::PlusAssn ); }
     5836    break;
     5837
     5838  case 122:
    58135839
    58145840/* Line 1806 of yacc.c  */
    58155841#line 615 "parser.yy"
    5816     { (yyval.en) = new OperatorNode( OperatorNode::MulAssn ); }
    5817     break;
    5818 
    5819   case 119:
     5842    { (yyval.en) = new OperatorNode( OperatorNode::MinusAssn ); }
     5843    break;
     5844
     5845  case 123:
    58205846
    58215847/* Line 1806 of yacc.c  */
    58225848#line 616 "parser.yy"
    5823     { (yyval.en) = new OperatorNode( OperatorNode::DivAssn ); }
    5824     break;
    5825 
    5826   case 120:
     5849    { (yyval.en) = new OperatorNode( OperatorNode::LSAssn ); }
     5850    break;
     5851
     5852  case 124:
    58275853
    58285854/* Line 1806 of yacc.c  */
    58295855#line 617 "parser.yy"
    5830     { (yyval.en) = new OperatorNode( OperatorNode::ModAssn ); }
    5831     break;
    5832 
    5833   case 121:
     5856    { (yyval.en) = new OperatorNode( OperatorNode::RSAssn ); }
     5857    break;
     5858
     5859  case 125:
    58345860
    58355861/* Line 1806 of yacc.c  */
    58365862#line 618 "parser.yy"
    5837     { (yyval.en) = new OperatorNode( OperatorNode::PlusAssn ); }
    5838     break;
    5839 
    5840   case 122:
     5863    { (yyval.en) = new OperatorNode( OperatorNode::AndAssn ); }
     5864    break;
     5865
     5866  case 126:
    58415867
    58425868/* Line 1806 of yacc.c  */
    58435869#line 619 "parser.yy"
    5844     { (yyval.en) = new OperatorNode( OperatorNode::MinusAssn ); }
    5845     break;
    5846 
    5847   case 123:
     5870    { (yyval.en) = new OperatorNode( OperatorNode::ERAssn ); }
     5871    break;
     5872
     5873  case 127:
    58485874
    58495875/* Line 1806 of yacc.c  */
    58505876#line 620 "parser.yy"
    5851     { (yyval.en) = new OperatorNode( OperatorNode::LSAssn ); }
    5852     break;
    5853 
    5854   case 124:
    5855 
    5856 /* Line 1806 of yacc.c  */
    5857 #line 621 "parser.yy"
    5858     { (yyval.en) = new OperatorNode( OperatorNode::RSAssn ); }
    5859     break;
    5860 
    5861   case 125:
    5862 
    5863 /* Line 1806 of yacc.c  */
    5864 #line 622 "parser.yy"
    5865     { (yyval.en) = new OperatorNode( OperatorNode::AndAssn ); }
    5866     break;
    5867 
    5868   case 126:
    5869 
    5870 /* Line 1806 of yacc.c  */
    5871 #line 623 "parser.yy"
    5872     { (yyval.en) = new OperatorNode( OperatorNode::ERAssn ); }
    5873     break;
    5874 
    5875   case 127:
    5876 
    5877 /* Line 1806 of yacc.c  */
    5878 #line 624 "parser.yy"
    58795877    { (yyval.en) = new OperatorNode( OperatorNode::OrAssn ); }
    58805878    break;
     
    58835881
    58845882/* Line 1806 of yacc.c  */
     5883#line 626 "parser.yy"
     5884    { (yyval.en) = new CompositeExprNode( new OperatorNode( OperatorNode::Comma ), (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ); }
     5885    break;
     5886
     5887  case 130:
     5888
     5889/* Line 1806 of yacc.c  */
    58855890#line 631 "parser.yy"
    5886     { (yyval.en) = new CompositeExprNode2( build_comma( (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
    5887     break;
    5888 
    5889   case 130:
    5890 
    5891 /* Line 1806 of yacc.c  */
    5892 #line 636 "parser.yy"
    58935891    { (yyval.en) = 0; }
    58945892    break;
     
    58975895
    58985896/* Line 1806 of yacc.c  */
    5899 #line 645 "parser.yy"
     5897#line 640 "parser.yy"
    59005898    { (yyval.sn) = (yyvsp[(1) - (1)].sn); }
    59015899    break;
     
    59045902
    59055903/* Line 1806 of yacc.c  */
    5906 #line 652 "parser.yy"
     5904#line 647 "parser.yy"
    59075905    {
    59085906                        Token fn; fn.str = new std::string( "^?{}" ); // location undefined
     
    59155913
    59165914/* Line 1806 of yacc.c  */
    5917 #line 662 "parser.yy"
     5915#line 657 "parser.yy"
    59185916    {
    59195917                        (yyval.sn) = (yyvsp[(4) - (4)].sn)->add_label( (yyvsp[(1) - (4)].tok) );
     
    59245922
    59255923/* Line 1806 of yacc.c  */
    5926 #line 669 "parser.yy"
     5924#line 664 "parser.yy"
    59275925    { (yyval.sn) = new CompoundStmtNode( (StatementNode *)0 ); }
    59285926    break;
     
    59315929
    59325930/* Line 1806 of yacc.c  */
    5933 #line 676 "parser.yy"
     5931#line 671 "parser.yy"
    59345932    { (yyval.sn) = new CompoundStmtNode( (yyvsp[(5) - (7)].sn) ); }
    59355933    break;
     
    59385936
    59395937/* Line 1806 of yacc.c  */
     5938#line 677 "parser.yy"
     5939    { if ( (yyvsp[(1) - (3)].sn) != 0 ) { (yyvsp[(1) - (3)].sn)->set_link( (yyvsp[(3) - (3)].sn) ); (yyval.sn) = (yyvsp[(1) - (3)].sn); } }
     5940    break;
     5941
     5942  case 146:
     5943
     5944/* Line 1806 of yacc.c  */
    59405945#line 682 "parser.yy"
    5941     { if ( (yyvsp[(1) - (3)].sn) != 0 ) { (yyvsp[(1) - (3)].sn)->set_link( (yyvsp[(3) - (3)].sn) ); (yyval.sn) = (yyvsp[(1) - (3)].sn); } }
    5942     break;
    5943 
    5944   case 146:
    5945 
    5946 /* Line 1806 of yacc.c  */
    5947 #line 687 "parser.yy"
    59485946    { (yyval.sn) = new StatementNode( (yyvsp[(1) - (1)].decl) ); }
    59495947    break;
     
    59525950
    59535951/* Line 1806 of yacc.c  */
    5954 #line 689 "parser.yy"
     5952#line 684 "parser.yy"
    59555953    {   // mark all fields in list
    59565954                        for ( DeclarationNode *iter = (yyvsp[(2) - (2)].decl); iter != NULL; iter = (DeclarationNode *)iter->get_link() )
     
    59635961
    59645962/* Line 1806 of yacc.c  */
    5965 #line 695 "parser.yy"
     5963#line 690 "parser.yy"
    59665964    { (yyval.sn) = new StatementNode( (yyvsp[(1) - (1)].decl) ); }
    59675965    break;
     
    59705968
    59715969/* Line 1806 of yacc.c  */
     5970#line 697 "parser.yy"
     5971    { if ( (yyvsp[(1) - (2)].sn) != 0 ) { (yyvsp[(1) - (2)].sn)->set_link( (yyvsp[(2) - (2)].sn) ); (yyval.sn) = (yyvsp[(1) - (2)].sn); } }
     5972    break;
     5973
     5974  case 152:
     5975
     5976/* Line 1806 of yacc.c  */
    59725977#line 702 "parser.yy"
    5973     { if ( (yyvsp[(1) - (2)].sn) != 0 ) { (yyvsp[(1) - (2)].sn)->set_link( (yyvsp[(2) - (2)].sn) ); (yyval.sn) = (yyvsp[(1) - (2)].sn); } }
    5974     break;
    5975 
    5976   case 152:
    5977 
    5978 /* Line 1806 of yacc.c  */
    5979 #line 707 "parser.yy"
    59805978    { (yyval.sn) = new StatementNode( StatementNode::Exp, (yyvsp[(1) - (2)].en), 0 ); }
    59815979    break;
     
    59845982
    59855983/* Line 1806 of yacc.c  */
    5986 #line 713 "parser.yy"
     5984#line 708 "parser.yy"
    59875985    { (yyval.sn) = new StatementNode( StatementNode::If, (yyvsp[(3) - (5)].en), (yyvsp[(5) - (5)].sn) ); }
    59885986    break;
     
    59915989
    59925990/* Line 1806 of yacc.c  */
    5993 #line 715 "parser.yy"
     5991#line 710 "parser.yy"
    59945992    { (yyval.sn) = new StatementNode( StatementNode::If, (yyvsp[(3) - (7)].en), (StatementNode *)mkList((*(yyvsp[(5) - (7)].sn), *(yyvsp[(7) - (7)].sn) )) ); }
    59955993    break;
     
    59985996
    59995997/* Line 1806 of yacc.c  */
    6000 #line 717 "parser.yy"
     5998#line 712 "parser.yy"
    60015999    { (yyval.sn) = new StatementNode( StatementNode::Switch, (yyvsp[(3) - (5)].en), (yyvsp[(5) - (5)].sn) ); }
    60026000    break;
     
    60056003
    60066004/* Line 1806 of yacc.c  */
    6007 #line 719 "parser.yy"
     6005#line 714 "parser.yy"
    60086006    {
    60096007                        StatementNode *sw = new StatementNode( StatementNode::Switch, (yyvsp[(3) - (9)].en), (yyvsp[(8) - (9)].sn) );
     
    60116009                        // *before* the transfer to the appropriate case clause by hoisting the declarations into a compound
    60126010                        // statement around the switch.  Statements after the initial declaration list can never be executed, and
    6013                         // therefore, are removed from the grammar even though C allows it. The change also applies to choose
    6014                         // statement.
     6011                        // therefore, are removed from the grammar even though C allows it. Change also applies to choose statement.
    60156012                        (yyval.sn) = (yyvsp[(7) - (9)].decl) != 0 ? new CompoundStmtNode( (StatementNode *)((new StatementNode( (yyvsp[(7) - (9)].decl) ))->set_link( sw )) ) : sw;
    60166013                }
     
    60206017
    60216018/* Line 1806 of yacc.c  */
    6022 #line 729 "parser.yy"
     6019#line 723 "parser.yy"
    60236020    { (yyval.sn) = new StatementNode( StatementNode::Switch, (yyvsp[(3) - (5)].en), (yyvsp[(5) - (5)].sn) ); }
    60246021    break;
     
    60276024
    60286025/* Line 1806 of yacc.c  */
    6029 #line 731 "parser.yy"
     6026#line 725 "parser.yy"
    60306027    {
    60316028                        StatementNode *sw = new StatementNode( StatementNode::Switch, (yyvsp[(3) - (9)].en), (yyvsp[(8) - (9)].sn) );
     
    60376034
    60386035/* Line 1806 of yacc.c  */
    6039 #line 741 "parser.yy"
     6036#line 735 "parser.yy"
    60406037    { (yyval.en) = (yyvsp[(1) - (1)].en); }
    60416038    break;
     
    60446041
    60456042/* Line 1806 of yacc.c  */
    6046 #line 743 "parser.yy"
    6047     { (yyval.en) = new CompositeExprNode2( build_opr2( OperatorNode::Range, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
    6048     break;
    6049 
    6050   case 162:
     6043#line 737 "parser.yy"
     6044    { (yyval.en) = new CompositeExprNode( new OperatorNode( OperatorNode::Range ), (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ); }
     6045    break;
     6046
     6047  case 163:
     6048
     6049/* Line 1806 of yacc.c  */
     6050#line 744 "parser.yy"
     6051    { (yyval.en) = new CompositeExprNode( new OperatorNode( OperatorNode::TupleC ), (ExpressionNode *)(tupleContents( (yyvsp[(1) - (3)].en) ))->set_link( (yyvsp[(3) - (3)].en) ) ); }
     6052    break;
     6053
     6054  case 164:
    60516055
    60526056/* Line 1806 of yacc.c  */
    60536057#line 748 "parser.yy"
    6054     { (yyval.sn) = new StatementNode( StatementNode::Case, (yyvsp[(1) - (1)].en), 0 ); }
    6055     break;
    6056 
    6057   case 163:
    6058 
    6059 /* Line 1806 of yacc.c  */
    6060 #line 750 "parser.yy"
    6061     { (yyval.sn) = (StatementNode *)((yyvsp[(1) - (3)].sn)->set_link( new StatementNode( StatementNode::Case, (yyvsp[(3) - (3)].en), 0 ) ) ); }
    6062     break;
    6063 
    6064   case 164:
    6065 
    6066 /* Line 1806 of yacc.c  */
    6067 #line 754 "parser.yy"
    6068     { (yyval.sn) = (yyvsp[(2) - (3)].sn); }
     6058    { (yyval.sn) = new StatementNode( StatementNode::Case, (yyvsp[(2) - (3)].en), 0 ); }
    60696059    break;
    60706060
     
    60726062
    60736063/* Line 1806 of yacc.c  */
     6064#line 749 "parser.yy"
     6065    { (yyval.sn) = new StatementNode( StatementNode::Default ); }
     6066    break;
     6067
     6068  case 167:
     6069
     6070/* Line 1806 of yacc.c  */
    60746071#line 755 "parser.yy"
    6075     { (yyval.sn) = new StatementNode( StatementNode::Default ); }
    6076     break;
    6077 
    6078   case 167:
    6079 
    6080 /* Line 1806 of yacc.c  */
    6081 #line 761 "parser.yy"
    60826072    { (yyval.sn) = (StatementNode *)( (yyvsp[(1) - (2)].sn)->set_link( (yyvsp[(2) - (2)].sn) )); }
    60836073    break;
     
    60866076
    60876077/* Line 1806 of yacc.c  */
    6088 #line 765 "parser.yy"
     6078#line 759 "parser.yy"
    60896079    { (yyval.sn) = (yyvsp[(1) - (2)].sn)->append_last_case( new CompoundStmtNode( (yyvsp[(2) - (2)].sn) ) ); }
    60906080    break;
     
    60936083
    60946084/* Line 1806 of yacc.c  */
     6085#line 764 "parser.yy"
     6086    { (yyval.sn) = 0; }
     6087    break;
     6088
     6089  case 171:
     6090
     6091/* Line 1806 of yacc.c  */
    60956092#line 770 "parser.yy"
     6093    { (yyval.sn) = (yyvsp[(1) - (2)].sn)->append_last_case( new CompoundStmtNode( (yyvsp[(2) - (2)].sn) ) ); }
     6094    break;
     6095
     6096  case 172:
     6097
     6098/* Line 1806 of yacc.c  */
     6099#line 772 "parser.yy"
     6100    { (yyval.sn) = (StatementNode *)( (yyvsp[(1) - (3)].sn)->set_link( (yyvsp[(2) - (3)].sn)->append_last_case( new CompoundStmtNode( (yyvsp[(3) - (3)].sn) ) ) ) ); }
     6101    break;
     6102
     6103  case 173:
     6104
     6105/* Line 1806 of yacc.c  */
     6106#line 777 "parser.yy"
    60966107    { (yyval.sn) = 0; }
    60976108    break;
    60986109
    6099   case 171:
    6100 
    6101 /* Line 1806 of yacc.c  */
    6102 #line 776 "parser.yy"
    6103     { (yyval.sn) = (yyvsp[(1) - (2)].sn)->append_last_case( new CompoundStmtNode( (yyvsp[(2) - (2)].sn) ) ); }
    6104     break;
    6105 
    6106   case 172:
    6107 
    6108 /* Line 1806 of yacc.c  */
    6109 #line 778 "parser.yy"
    6110     { (yyval.sn) = (StatementNode *)( (yyvsp[(1) - (3)].sn)->set_link( (yyvsp[(2) - (3)].sn)->append_last_case( new CompoundStmtNode( (yyvsp[(3) - (3)].sn) ) ) ) ); }
    6111     break;
    6112 
    6113   case 173:
     6110  case 175:
    61146111
    61156112/* Line 1806 of yacc.c  */
    61166113#line 783 "parser.yy"
     6114    { (yyval.sn) = (yyvsp[(1) - (2)].sn)->append_last_case( (yyvsp[(2) - (2)].sn) ); }
     6115    break;
     6116
     6117  case 176:
     6118
     6119/* Line 1806 of yacc.c  */
     6120#line 785 "parser.yy"
     6121    { (yyval.sn) = (yyvsp[(1) - (3)].sn)->append_last_case( new CompoundStmtNode( (StatementNode *)mkList( (*(yyvsp[(2) - (3)].sn), *(yyvsp[(3) - (3)].sn) ) ) ) ); }
     6122    break;
     6123
     6124  case 177:
     6125
     6126/* Line 1806 of yacc.c  */
     6127#line 787 "parser.yy"
     6128    { (yyval.sn) = (StatementNode *)( (yyvsp[(1) - (3)].sn)->set_link( (yyvsp[(2) - (3)].sn)->append_last_case( (yyvsp[(3) - (3)].sn) ))); }
     6129    break;
     6130
     6131  case 178:
     6132
     6133/* Line 1806 of yacc.c  */
     6134#line 789 "parser.yy"
     6135    { (yyval.sn) = (StatementNode *)( (yyvsp[(1) - (4)].sn)->set_link( (yyvsp[(2) - (4)].sn)->append_last_case( new CompoundStmtNode( (StatementNode *)mkList( (*(yyvsp[(3) - (4)].sn), *(yyvsp[(4) - (4)].sn) ) ) ) ) ) ); }
     6136    break;
     6137
     6138  case 179:
     6139
     6140/* Line 1806 of yacc.c  */
     6141#line 794 "parser.yy"
     6142    { (yyval.sn) = new StatementNode( StatementNode::Break ); }
     6143    break;
     6144
     6145  case 181:
     6146
     6147/* Line 1806 of yacc.c  */
     6148#line 800 "parser.yy"
    61176149    { (yyval.sn) = 0; }
    61186150    break;
    61196151
    6120   case 175:
    6121 
    6122 /* Line 1806 of yacc.c  */
    6123 #line 789 "parser.yy"
    6124     { (yyval.sn) = (yyvsp[(1) - (2)].sn)->append_last_case( (yyvsp[(2) - (2)].sn) ); }
    6125     break;
    6126 
    6127   case 176:
    6128 
    6129 /* Line 1806 of yacc.c  */
    6130 #line 791 "parser.yy"
    6131     { (yyval.sn) = (yyvsp[(1) - (3)].sn)->append_last_case( new CompoundStmtNode( (StatementNode *)mkList( (*(yyvsp[(2) - (3)].sn), *(yyvsp[(3) - (3)].sn) ) ) ) ); }
    6132     break;
    6133 
    6134   case 177:
    6135 
    6136 /* Line 1806 of yacc.c  */
    6137 #line 793 "parser.yy"
    6138     { (yyval.sn) = (StatementNode *)( (yyvsp[(1) - (3)].sn)->set_link( (yyvsp[(2) - (3)].sn)->append_last_case( (yyvsp[(3) - (3)].sn) ))); }
    6139     break;
    6140 
    6141   case 178:
    6142 
    6143 /* Line 1806 of yacc.c  */
    6144 #line 795 "parser.yy"
    6145     { (yyval.sn) = (StatementNode *)( (yyvsp[(1) - (4)].sn)->set_link( (yyvsp[(2) - (4)].sn)->append_last_case( new CompoundStmtNode( (StatementNode *)mkList( (*(yyvsp[(3) - (4)].sn), *(yyvsp[(4) - (4)].sn) ) ) ) ) ) ); }
    6146     break;
    6147 
    6148   case 179:
    6149 
    6150 /* Line 1806 of yacc.c  */
    6151 #line 800 "parser.yy"
     6152  case 182:
     6153
     6154/* Line 1806 of yacc.c  */
     6155#line 802 "parser.yy"
     6156    { (yyval.sn) = 0; }
     6157    break;
     6158
     6159  case 183:
     6160
     6161/* Line 1806 of yacc.c  */
     6162#line 807 "parser.yy"
     6163    { (yyval.sn) = new StatementNode( StatementNode::While, (yyvsp[(3) - (5)].en), (yyvsp[(5) - (5)].sn) ); }
     6164    break;
     6165
     6166  case 184:
     6167
     6168/* Line 1806 of yacc.c  */
     6169#line 809 "parser.yy"
     6170    { (yyval.sn) = new StatementNode( StatementNode::Do, (yyvsp[(5) - (7)].en), (yyvsp[(2) - (7)].sn) ); }
     6171    break;
     6172
     6173  case 185:
     6174
     6175/* Line 1806 of yacc.c  */
     6176#line 811 "parser.yy"
     6177    { (yyval.sn) = new StatementNode( StatementNode::For, (yyvsp[(4) - (6)].en), (yyvsp[(6) - (6)].sn) ); }
     6178    break;
     6179
     6180  case 186:
     6181
     6182/* Line 1806 of yacc.c  */
     6183#line 816 "parser.yy"
     6184    { (yyval.en) = new ForCtlExprNode( (yyvsp[(1) - (6)].en), (yyvsp[(4) - (6)].en), (yyvsp[(6) - (6)].en) ); }
     6185    break;
     6186
     6187  case 187:
     6188
     6189/* Line 1806 of yacc.c  */
     6190#line 818 "parser.yy"
     6191    { (yyval.en) = new ForCtlExprNode( (yyvsp[(1) - (4)].decl), (yyvsp[(2) - (4)].en), (yyvsp[(4) - (4)].en) ); }
     6192    break;
     6193
     6194  case 188:
     6195
     6196/* Line 1806 of yacc.c  */
     6197#line 823 "parser.yy"
     6198    { (yyval.sn) = new StatementNode( StatementNode::Goto, (yyvsp[(2) - (3)].tok) ); }
     6199    break;
     6200
     6201  case 189:
     6202
     6203/* Line 1806 of yacc.c  */
     6204#line 827 "parser.yy"
     6205    { (yyval.sn) = new StatementNode( StatementNode::Goto, (yyvsp[(3) - (4)].en) ); }
     6206    break;
     6207
     6208  case 190:
     6209
     6210/* Line 1806 of yacc.c  */
     6211#line 830 "parser.yy"
     6212    { (yyval.sn) = new StatementNode( StatementNode::Continue ); }
     6213    break;
     6214
     6215  case 191:
     6216
     6217/* Line 1806 of yacc.c  */
     6218#line 834 "parser.yy"
     6219    { (yyval.sn) = new StatementNode( StatementNode::Continue, (yyvsp[(2) - (3)].tok) ); }
     6220    break;
     6221
     6222  case 192:
     6223
     6224/* Line 1806 of yacc.c  */
     6225#line 837 "parser.yy"
    61526226    { (yyval.sn) = new StatementNode( StatementNode::Break ); }
    61536227    break;
    61546228
    6155   case 181:
    6156 
    6157 /* Line 1806 of yacc.c  */
    6158 #line 806 "parser.yy"
    6159     { (yyval.sn) = 0; }
    6160     break;
    6161 
    6162   case 182:
    6163 
    6164 /* Line 1806 of yacc.c  */
    6165 #line 808 "parser.yy"
    6166     { (yyval.sn) = 0; }
    6167     break;
    6168 
    6169   case 183:
    6170 
    6171 /* Line 1806 of yacc.c  */
    6172 #line 813 "parser.yy"
    6173     { (yyval.sn) = new StatementNode( StatementNode::While, (yyvsp[(3) - (5)].en), (yyvsp[(5) - (5)].sn) ); }
    6174     break;
    6175 
    6176   case 184:
    6177 
    6178 /* Line 1806 of yacc.c  */
    6179 #line 815 "parser.yy"
    6180     { (yyval.sn) = new StatementNode( StatementNode::Do, (yyvsp[(5) - (7)].en), (yyvsp[(2) - (7)].sn) ); }
    6181     break;
    6182 
    6183   case 185:
    6184 
    6185 /* Line 1806 of yacc.c  */
    6186 #line 817 "parser.yy"
    6187     { (yyval.sn) = new StatementNode( StatementNode::For, (yyvsp[(4) - (6)].en), (yyvsp[(6) - (6)].sn) ); }
    6188     break;
    6189 
    6190   case 186:
    6191 
    6192 /* Line 1806 of yacc.c  */
    6193 #line 822 "parser.yy"
    6194     { (yyval.en) = new ForCtlExprNode( (yyvsp[(1) - (6)].en), (yyvsp[(4) - (6)].en), (yyvsp[(6) - (6)].en) ); }
    6195     break;
    6196 
    6197   case 187:
    6198 
    6199 /* Line 1806 of yacc.c  */
    6200 #line 824 "parser.yy"
    6201     { (yyval.en) = new ForCtlExprNode( (yyvsp[(1) - (4)].decl), (yyvsp[(2) - (4)].en), (yyvsp[(4) - (4)].en) ); }
    6202     break;
    6203 
    6204   case 188:
    6205 
    6206 /* Line 1806 of yacc.c  */
    6207 #line 829 "parser.yy"
    6208     { (yyval.sn) = new StatementNode( StatementNode::Goto, (yyvsp[(2) - (3)].tok) ); }
    6209     break;
    6210 
    6211   case 189:
    6212 
    6213 /* Line 1806 of yacc.c  */
    6214 #line 833 "parser.yy"
    6215     { (yyval.sn) = new StatementNode( StatementNode::Goto, (yyvsp[(3) - (4)].en) ); }
    6216     break;
    6217 
    6218   case 190:
    6219 
    6220 /* Line 1806 of yacc.c  */
    6221 #line 836 "parser.yy"
    6222     { (yyval.sn) = new StatementNode( StatementNode::Continue ); }
    6223     break;
    6224 
    6225   case 191:
    6226 
    6227 /* Line 1806 of yacc.c  */
    6228 #line 840 "parser.yy"
    6229     { (yyval.sn) = new StatementNode( StatementNode::Continue, (yyvsp[(2) - (3)].tok) ); }
    6230     break;
    6231 
    6232   case 192:
     6229  case 193:
     6230
     6231/* Line 1806 of yacc.c  */
     6232#line 841 "parser.yy"
     6233    { (yyval.sn) = new StatementNode( StatementNode::Break, (yyvsp[(2) - (3)].tok) ); }
     6234    break;
     6235
     6236  case 194:
    62336237
    62346238/* Line 1806 of yacc.c  */
    62356239#line 843 "parser.yy"
    6236     { (yyval.sn) = new StatementNode( StatementNode::Break ); }
    6237     break;
    6238 
    6239   case 193:
    6240 
    6241 /* Line 1806 of yacc.c  */
    6242 #line 847 "parser.yy"
    6243     { (yyval.sn) = new StatementNode( StatementNode::Break, (yyvsp[(2) - (3)].tok) ); }
    6244     break;
    6245 
    6246   case 194:
     6240    { (yyval.sn) = new StatementNode( StatementNode::Return, (yyvsp[(2) - (3)].en), 0 ); }
     6241    break;
     6242
     6243  case 195:
     6244
     6245/* Line 1806 of yacc.c  */
     6246#line 845 "parser.yy"
     6247    { (yyval.sn) = new StatementNode( StatementNode::Throw, (yyvsp[(2) - (3)].en), 0 ); }
     6248    break;
     6249
     6250  case 196:
    62476251
    62486252/* Line 1806 of yacc.c  */
    62496253#line 849 "parser.yy"
    6250     { (yyval.sn) = new StatementNode( StatementNode::Return, (yyvsp[(2) - (3)].en), 0 ); }
    6251     break;
    6252 
    6253   case 195:
     6254    { (yyval.sn) = new StatementNode( StatementNode::Throw, (yyvsp[(2) - (3)].en), 0 ); }
     6255    break;
     6256
     6257  case 197:
    62546258
    62556259/* Line 1806 of yacc.c  */
    62566260#line 851 "parser.yy"
    6257     { (yyval.sn) = new StatementNode( StatementNode::Throw, (yyvsp[(2) - (3)].en), 0 ); }
    6258     break;
    6259 
    6260   case 196:
    6261 
    6262 /* Line 1806 of yacc.c  */
    6263 #line 855 "parser.yy"
    6264     { (yyval.sn) = new StatementNode( StatementNode::Throw, (yyvsp[(2) - (3)].en), 0 ); }
    6265     break;
    6266 
    6267   case 197:
    6268 
    6269 /* Line 1806 of yacc.c  */
    6270 #line 857 "parser.yy"
    62716261    { (yyval.sn) = new StatementNode( StatementNode::Throw, (yyvsp[(2) - (5)].en), 0 ); }
    62726262    break;
     
    62756265
    62766266/* Line 1806 of yacc.c  */
    6277 #line 864 "parser.yy"
     6267#line 858 "parser.yy"
    62786268    { (yyval.sn) = new StatementNode( StatementNode::Try, 0,(StatementNode *)(mkList((*(yyvsp[(2) - (3)].sn),*(yyvsp[(3) - (3)].pn) )))); }
    62796269    break;
     
    62826272
    62836273/* Line 1806 of yacc.c  */
    6284 #line 866 "parser.yy"
     6274#line 860 "parser.yy"
    62856275    { (yyval.sn) = new StatementNode( StatementNode::Try, 0,(StatementNode *)(mkList((*(yyvsp[(2) - (3)].sn),*(yyvsp[(3) - (3)].pn) )))); }
    62866276    break;
     
    62896279
    62906280/* Line 1806 of yacc.c  */
    6291 #line 868 "parser.yy"
     6281#line 862 "parser.yy"
    62926282    {
    62936283                        (yyvsp[(3) - (4)].pn)->set_link( (yyvsp[(4) - (4)].pn) );
     
    62996289
    63006290/* Line 1806 of yacc.c  */
     6291#line 873 "parser.yy"
     6292    { (yyval.pn) = StatementNode::newCatchStmt( 0, (yyvsp[(5) - (5)].sn), true ); }
     6293    break;
     6294
     6295  case 203:
     6296
     6297/* Line 1806 of yacc.c  */
     6298#line 875 "parser.yy"
     6299    { (yyval.pn) = (yyvsp[(1) - (6)].pn)->set_link( StatementNode::newCatchStmt( 0, (yyvsp[(6) - (6)].sn), true ) ); }
     6300    break;
     6301
     6302  case 204:
     6303
     6304/* Line 1806 of yacc.c  */
     6305#line 877 "parser.yy"
     6306    { (yyval.pn) = StatementNode::newCatchStmt( 0, (yyvsp[(5) - (5)].sn), true ); }
     6307    break;
     6308
     6309  case 205:
     6310
     6311/* Line 1806 of yacc.c  */
    63016312#line 879 "parser.yy"
    6302     { (yyval.pn) = StatementNode::newCatchStmt( 0, (yyvsp[(5) - (5)].sn), true ); }
    6303     break;
    6304 
    6305   case 203:
    6306 
    6307 /* Line 1806 of yacc.c  */
    6308 #line 881 "parser.yy"
    63096313    { (yyval.pn) = (yyvsp[(1) - (6)].pn)->set_link( StatementNode::newCatchStmt( 0, (yyvsp[(6) - (6)].sn), true ) ); }
    63106314    break;
    63116315
    6312   case 204:
    6313 
    6314 /* Line 1806 of yacc.c  */
    6315 #line 883 "parser.yy"
    6316     { (yyval.pn) = StatementNode::newCatchStmt( 0, (yyvsp[(5) - (5)].sn), true ); }
    6317     break;
    6318 
    6319   case 205:
    6320 
    6321 /* Line 1806 of yacc.c  */
    6322 #line 885 "parser.yy"
    6323     { (yyval.pn) = (yyvsp[(1) - (6)].pn)->set_link( StatementNode::newCatchStmt( 0, (yyvsp[(6) - (6)].sn), true ) ); }
    6324     break;
    6325 
    63266316  case 206:
    63276317
    63286318/* Line 1806 of yacc.c  */
     6319#line 884 "parser.yy"
     6320    { (yyval.pn) = StatementNode::newCatchStmt( (yyvsp[(5) - (9)].decl), (yyvsp[(8) - (9)].sn) ); }
     6321    break;
     6322
     6323  case 207:
     6324
     6325/* Line 1806 of yacc.c  */
     6326#line 886 "parser.yy"
     6327    { (yyval.pn) = (yyvsp[(1) - (10)].pn)->set_link( StatementNode::newCatchStmt( (yyvsp[(6) - (10)].decl), (yyvsp[(9) - (10)].sn) ) ); }
     6328    break;
     6329
     6330  case 208:
     6331
     6332/* Line 1806 of yacc.c  */
     6333#line 888 "parser.yy"
     6334    { (yyval.pn) = StatementNode::newCatchStmt( (yyvsp[(5) - (9)].decl), (yyvsp[(8) - (9)].sn) ); }
     6335    break;
     6336
     6337  case 209:
     6338
     6339/* Line 1806 of yacc.c  */
    63296340#line 890 "parser.yy"
    6330     { (yyval.pn) = StatementNode::newCatchStmt( (yyvsp[(5) - (9)].decl), (yyvsp[(8) - (9)].sn) ); }
    6331     break;
    6332 
    6333   case 207:
    6334 
    6335 /* Line 1806 of yacc.c  */
    6336 #line 892 "parser.yy"
    63376341    { (yyval.pn) = (yyvsp[(1) - (10)].pn)->set_link( StatementNode::newCatchStmt( (yyvsp[(6) - (10)].decl), (yyvsp[(9) - (10)].sn) ) ); }
    63386342    break;
    63396343
    6340   case 208:
    6341 
    6342 /* Line 1806 of yacc.c  */
    6343 #line 894 "parser.yy"
    6344     { (yyval.pn) = StatementNode::newCatchStmt( (yyvsp[(5) - (9)].decl), (yyvsp[(8) - (9)].sn) ); }
    6345     break;
    6346 
    6347   case 209:
    6348 
    6349 /* Line 1806 of yacc.c  */
    6350 #line 896 "parser.yy"
    6351     { (yyval.pn) = (yyvsp[(1) - (10)].pn)->set_link( StatementNode::newCatchStmt( (yyvsp[(6) - (10)].decl), (yyvsp[(9) - (10)].sn) ) ); }
    6352     break;
    6353 
    63546344  case 210:
    63556345
    63566346/* Line 1806 of yacc.c  */
    6357 #line 901 "parser.yy"
     6347#line 895 "parser.yy"
    63586348    {
    63596349                        (yyval.pn) = new StatementNode( StatementNode::Finally, 0, (yyvsp[(2) - (2)].sn) );
     
    63656355
    63666356/* Line 1806 of yacc.c  */
    6367 #line 915 "parser.yy"
     6357#line 909 "parser.yy"
    63686358    {
    63696359                        typedefTable.addToEnclosingScope( TypedefTable::ID );
     
    63756365
    63766366/* Line 1806 of yacc.c  */
    6377 #line 920 "parser.yy"
     6367#line 914 "parser.yy"
    63786368    { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addType( (yyvsp[(1) - (2)].decl) ); }
    63796369    break;
     
    63826372
    63836373/* Line 1806 of yacc.c  */
    6384 #line 922 "parser.yy"
     6374#line 916 "parser.yy"
    63856375    {
    63866376                        typedefTable.addToEnclosingScope( TypedefTable::ID );
     
    63926382
    63936383/* Line 1806 of yacc.c  */
     6384#line 925 "parser.yy"
     6385    { (yyval.sn) = new AsmStmtNode( StatementNode::Asm, (yyvsp[(2) - (6)].flag), (yyvsp[(4) - (6)].constant), 0 ); }
     6386    break;
     6387
     6388  case 217:
     6389
     6390/* Line 1806 of yacc.c  */
     6391#line 927 "parser.yy"
     6392    { (yyval.sn) = new AsmStmtNode( StatementNode::Asm, (yyvsp[(2) - (8)].flag), (yyvsp[(4) - (8)].constant), (yyvsp[(6) - (8)].en) ); }
     6393    break;
     6394
     6395  case 218:
     6396
     6397/* Line 1806 of yacc.c  */
     6398#line 929 "parser.yy"
     6399    { (yyval.sn) = new AsmStmtNode( StatementNode::Asm, (yyvsp[(2) - (10)].flag), (yyvsp[(4) - (10)].constant), (yyvsp[(6) - (10)].en), (yyvsp[(8) - (10)].en) ); }
     6400    break;
     6401
     6402  case 219:
     6403
     6404/* Line 1806 of yacc.c  */
    63946405#line 931 "parser.yy"
    6395     { (yyval.sn) = new AsmStmtNode( StatementNode::Asm, (yyvsp[(2) - (6)].flag), (yyvsp[(4) - (6)].constant), 0 ); }
    6396     break;
    6397 
    6398   case 217:
     6406    { (yyval.sn) = new AsmStmtNode( StatementNode::Asm, (yyvsp[(2) - (12)].flag), (yyvsp[(4) - (12)].constant), (yyvsp[(6) - (12)].en), (yyvsp[(8) - (12)].en), (yyvsp[(10) - (12)].constant) ); }
     6407    break;
     6408
     6409  case 220:
    63996410
    64006411/* Line 1806 of yacc.c  */
    64016412#line 933 "parser.yy"
    6402     { (yyval.sn) = new AsmStmtNode( StatementNode::Asm, (yyvsp[(2) - (8)].flag), (yyvsp[(4) - (8)].constant), (yyvsp[(6) - (8)].en) ); }
    6403     break;
    6404 
    6405   case 218:
    6406 
    6407 /* Line 1806 of yacc.c  */
    6408 #line 935 "parser.yy"
    6409     { (yyval.sn) = new AsmStmtNode( StatementNode::Asm, (yyvsp[(2) - (10)].flag), (yyvsp[(4) - (10)].constant), (yyvsp[(6) - (10)].en), (yyvsp[(8) - (10)].en) ); }
    6410     break;
    6411 
    6412   case 219:
    6413 
    6414 /* Line 1806 of yacc.c  */
    6415 #line 937 "parser.yy"
    6416     { (yyval.sn) = new AsmStmtNode( StatementNode::Asm, (yyvsp[(2) - (12)].flag), (yyvsp[(4) - (12)].constant), (yyvsp[(6) - (12)].en), (yyvsp[(8) - (12)].en), (yyvsp[(10) - (12)].constant) ); }
    6417     break;
    6418 
    6419   case 220:
    6420 
    6421 /* Line 1806 of yacc.c  */
    6422 #line 939 "parser.yy"
    64236413    { (yyval.sn) = new AsmStmtNode( StatementNode::Asm, (yyvsp[(2) - (14)].flag), (yyvsp[(5) - (14)].constant), 0, (yyvsp[(8) - (14)].en), (yyvsp[(10) - (14)].constant), (yyvsp[(12) - (14)].label) ); }
    64246414    break;
     
    64276417
    64286418/* Line 1806 of yacc.c  */
    6429 #line 944 "parser.yy"
     6419#line 938 "parser.yy"
    64306420    { (yyval.flag) = false; }
    64316421    break;
     
    64346424
    64356425/* Line 1806 of yacc.c  */
    6436 #line 946 "parser.yy"
     6426#line 940 "parser.yy"
    64376427    { (yyval.flag) = true; }
    64386428    break;
     
    64416431
    64426432/* Line 1806 of yacc.c  */
    6443 #line 951 "parser.yy"
     6433#line 945 "parser.yy"
    64446434    { (yyval.en) = 0; }
    64456435    break;
     
    64486438
    64496439/* Line 1806 of yacc.c  */
    6450 #line 958 "parser.yy"
     6440#line 952 "parser.yy"
    64516441    { (yyval.en) = (ExpressionNode *)(yyvsp[(1) - (3)].en)->set_link( (yyvsp[(3) - (3)].en) ); }
    64526442    break;
     
    64556445
    64566446/* Line 1806 of yacc.c  */
    6457 #line 963 "parser.yy"
     6447#line 957 "parser.yy"
    64586448    { (yyval.en) = new AsmExprNode( 0, (yyvsp[(1) - (4)].constant), (yyvsp[(3) - (4)].en) ); }
    64596449    break;
     
    64626452
    64636453/* Line 1806 of yacc.c  */
    6464 #line 965 "parser.yy"
     6454#line 959 "parser.yy"
    64656455    { (yyval.en) = new AsmExprNode( (yyvsp[(2) - (7)].en), (yyvsp[(4) - (7)].constant), (yyvsp[(6) - (7)].en) ); }
    64666456    break;
     
    64696459
    64706460/* Line 1806 of yacc.c  */
    6471 #line 970 "parser.yy"
     6461#line 964 "parser.yy"
    64726462    { (yyval.constant) = 0; }
    64736463    break;
     
    64766466
    64776467/* Line 1806 of yacc.c  */
    6478 #line 972 "parser.yy"
     6468#line 966 "parser.yy"
    64796469    { (yyval.constant) = (yyvsp[(1) - (1)].constant); }
    64806470    break;
     
    64836473
    64846474/* Line 1806 of yacc.c  */
    6485 #line 974 "parser.yy"
     6475#line 968 "parser.yy"
    64866476    { (yyval.constant) = (ConstantNode *)(yyvsp[(1) - (3)].constant)->set_link( (yyvsp[(3) - (3)].constant) ); }
    64876477    break;
     
    64906480
    64916481/* Line 1806 of yacc.c  */
    6492 #line 979 "parser.yy"
     6482#line 973 "parser.yy"
    64936483    { (yyval.label) = new LabelNode(); (yyval.label)->append_label( (yyvsp[(1) - (1)].tok) ); }
    64946484    break;
     
    64976487
    64986488/* Line 1806 of yacc.c  */
    6499 #line 981 "parser.yy"
     6489#line 975 "parser.yy"
    65006490    { (yyval.label) = (yyvsp[(1) - (3)].label); (yyvsp[(1) - (3)].label)->append_label( (yyvsp[(3) - (3)].tok) ); }
    65016491    break;
     
    65046494
    65056495/* Line 1806 of yacc.c  */
    6506 #line 988 "parser.yy"
     6496#line 982 "parser.yy"
    65076497    { (yyval.decl) = 0; }
    65086498    break;
     
    65116501
    65126502/* Line 1806 of yacc.c  */
    6513 #line 995 "parser.yy"
     6503#line 989 "parser.yy"
    65146504    { (yyval.decl) = (yyvsp[(1) - (3)].decl)->appendList( (yyvsp[(3) - (3)].decl) ); }
    65156505    break;
     
    65186508
    65196509/* Line 1806 of yacc.c  */
    6520 #line 1000 "parser.yy"
     6510#line 994 "parser.yy"
    65216511    { (yyval.decl) = 0; }
    65226512    break;
     
    65256515
    65266516/* Line 1806 of yacc.c  */
    6527 #line 1007 "parser.yy"
     6517#line 1001 "parser.yy"
    65286518    { (yyval.decl) = (yyvsp[(1) - (3)].decl)->appendList( (yyvsp[(3) - (3)].decl) ); }
    65296519    break;
     
    65326522
    65336523/* Line 1806 of yacc.c  */
    6534 #line 1021 "parser.yy"
     6524#line 1015 "parser.yy"
    65356525    {}
    65366526    break;
     
    65396529
    65406530/* Line 1806 of yacc.c  */
    6541 #line 1022 "parser.yy"
     6531#line 1016 "parser.yy"
    65426532    {}
    65436533    break;
     
    65466536
    65476537/* Line 1806 of yacc.c  */
    6548 #line 1051 "parser.yy"
     6538#line 1045 "parser.yy"
    65496539    {
    65506540                        typedefTable.addToEnclosingScope( TypedefTable::ID );
     
    65566546
    65576547/* Line 1806 of yacc.c  */
    6558 #line 1058 "parser.yy"
     6548#line 1052 "parser.yy"
    65596549    {
    65606550                        typedefTable.addToEnclosingScope( TypedefTable::ID );
     
    65666556
    65676557/* Line 1806 of yacc.c  */
    6568 #line 1063 "parser.yy"
     6558#line 1057 "parser.yy"
    65696559    {
    65706560                        typedefTable.addToEnclosingScope( *(yyvsp[(5) - (6)].tok), TypedefTable::ID );
     
    65766566
    65776567/* Line 1806 of yacc.c  */
    6578 #line 1073 "parser.yy"
     6568#line 1067 "parser.yy"
    65796569    {
    65806570                        typedefTable.setNextIdentifier( *(yyvsp[(2) - (3)].tok) );
     
    65866576
    65876577/* Line 1806 of yacc.c  */
    6588 #line 1078 "parser.yy"
     6578#line 1072 "parser.yy"
    65896579    {
    65906580                        typedefTable.setNextIdentifier( *(yyvsp[(2) - (3)].tok) );
     
    65966586
    65976587/* Line 1806 of yacc.c  */
    6598 #line 1083 "parser.yy"
     6588#line 1077 "parser.yy"
    65996589    {
    66006590                        typedefTable.setNextIdentifier( *(yyvsp[(3) - (4)].tok) );
     
    66066596
    66076597/* Line 1806 of yacc.c  */
    6608 #line 1091 "parser.yy"
     6598#line 1085 "parser.yy"
    66096599    {
    66106600                        typedefTable.addToEnclosingScope( TypedefTable::ID );
     
    66166606
    66176607/* Line 1806 of yacc.c  */
    6618 #line 1096 "parser.yy"
     6608#line 1090 "parser.yy"
    66196609    {
    66206610                        typedefTable.addToEnclosingScope( TypedefTable::ID );
     
    66266616
    66276617/* Line 1806 of yacc.c  */
    6628 #line 1101 "parser.yy"
     6618#line 1095 "parser.yy"
    66296619    {
    66306620                        typedefTable.addToEnclosingScope( TypedefTable::ID );
     
    66366626
    66376627/* Line 1806 of yacc.c  */
    6638 #line 1106 "parser.yy"
     6628#line 1100 "parser.yy"
    66396629    {
    66406630                        typedefTable.addToEnclosingScope( TypedefTable::ID );
     
    66466636
    66476637/* Line 1806 of yacc.c  */
    6648 #line 1111 "parser.yy"
     6638#line 1105 "parser.yy"
    66496639    {
    66506640                        typedefTable.addToEnclosingScope( *(yyvsp[(5) - (5)].tok), TypedefTable::ID );
     
    66566646
    66576647/* Line 1806 of yacc.c  */
    6658 #line 1119 "parser.yy"
     6648#line 1113 "parser.yy"
    66596649    {
    66606650                        (yyval.decl) = DeclarationNode::newFunction( (yyvsp[(3) - (8)].tok), DeclarationNode::newTuple( 0 ), (yyvsp[(6) - (8)].decl), 0, true );
     
    66656655
    66666656/* Line 1806 of yacc.c  */
    6667 #line 1142 "parser.yy"
     6657#line 1136 "parser.yy"
    66686658    {
    66696659                        (yyval.decl) = DeclarationNode::newFunction( (yyvsp[(2) - (7)].tok), (yyvsp[(1) - (7)].decl), (yyvsp[(5) - (7)].decl), 0, true );
     
    66746664
    66756665/* Line 1806 of yacc.c  */
    6676 #line 1146 "parser.yy"
     6666#line 1140 "parser.yy"
    66776667    {
    66786668                        (yyval.decl) = DeclarationNode::newFunction( (yyvsp[(2) - (7)].tok), (yyvsp[(1) - (7)].decl), (yyvsp[(5) - (7)].decl), 0, true );
     
    66836673
    66846674/* Line 1806 of yacc.c  */
    6685 #line 1153 "parser.yy"
     6675#line 1147 "parser.yy"
    66866676    { (yyval.decl) = DeclarationNode::newTuple( (yyvsp[(3) - (5)].decl) ); }
    66876677    break;
     
    66906680
    66916681/* Line 1806 of yacc.c  */
    6692 #line 1157 "parser.yy"
     6682#line 1151 "parser.yy"
    66936683    { (yyval.decl) = DeclarationNode::newTuple( (yyvsp[(3) - (9)].decl)->appendList( (yyvsp[(7) - (9)].decl) ) ); }
    66946684    break;
     
    66976687
    66986688/* Line 1806 of yacc.c  */
    6699 #line 1162 "parser.yy"
     6689#line 1156 "parser.yy"
    67006690    {
    67016691                        typedefTable.addToEnclosingScope( TypedefTable::TD );
     
    67076697
    67086698/* Line 1806 of yacc.c  */
    6709 #line 1167 "parser.yy"
     6699#line 1161 "parser.yy"
    67106700    {
    67116701                        typedefTable.addToEnclosingScope( TypedefTable::TD );
     
    67176707
    67186708/* Line 1806 of yacc.c  */
    6719 #line 1172 "parser.yy"
     6709#line 1166 "parser.yy"
    67206710    {
    67216711                        typedefTable.addToEnclosingScope( *(yyvsp[(5) - (5)].tok), TypedefTable::TD );
     
    67276717
    67286718/* Line 1806 of yacc.c  */
    6729 #line 1183 "parser.yy"
     6719#line 1177 "parser.yy"
    67306720    {
    67316721                        typedefTable.addToEnclosingScope( TypedefTable::TD );
     
    67376727
    67386728/* Line 1806 of yacc.c  */
    6739 #line 1188 "parser.yy"
     6729#line 1182 "parser.yy"
    67406730    {
    67416731                        typedefTable.addToEnclosingScope( TypedefTable::TD );
     
    67476737
    67486738/* Line 1806 of yacc.c  */
    6749 #line 1193 "parser.yy"
     6739#line 1187 "parser.yy"
    67506740    {
    67516741                        typedefTable.addToEnclosingScope( TypedefTable::TD );
     
    67576747
    67586748/* Line 1806 of yacc.c  */
    6759 #line 1198 "parser.yy"
     6749#line 1192 "parser.yy"
    67606750    {
    67616751                        typedefTable.addToEnclosingScope( TypedefTable::TD );
     
    67676757
    67686758/* Line 1806 of yacc.c  */
    6769 #line 1203 "parser.yy"
     6759#line 1197 "parser.yy"
    67706760    {
    67716761                        typedefTable.addToEnclosingScope( TypedefTable::TD );
     
    67776767
    67786768/* Line 1806 of yacc.c  */
    6779 #line 1212 "parser.yy"
     6769#line 1206 "parser.yy"
    67806770    {
    67816771                        typedefTable.addToEnclosingScope( *(yyvsp[(2) - (4)].tok), TypedefTable::TD );
     
    67876777
    67886778/* Line 1806 of yacc.c  */
    6789 #line 1217 "parser.yy"
     6779#line 1211 "parser.yy"
    67906780    {
    67916781                        typedefTable.addToEnclosingScope( *(yyvsp[(5) - (7)].tok), TypedefTable::TD );
     
    67976787
    67986788/* Line 1806 of yacc.c  */
    6799 #line 1234 "parser.yy"
     6789#line 1228 "parser.yy"
    68006790    {
    68016791                        typedefTable.addToEnclosingScope( TypedefTable::ID );
     
    68076797
    68086798/* Line 1806 of yacc.c  */
    6809 #line 1239 "parser.yy"
     6799#line 1233 "parser.yy"
    68106800    {
    68116801                        typedefTable.addToEnclosingScope( TypedefTable::ID );
     
    68176807
    68186808/* Line 1806 of yacc.c  */
    6819 #line 1261 "parser.yy"
     6809#line 1255 "parser.yy"
    68206810    { (yyval.decl) = 0; }
    68216811    break;
     
    68246814
    68256815/* Line 1806 of yacc.c  */
    6826 #line 1273 "parser.yy"
     6816#line 1267 "parser.yy"
    68276817    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
    68286818    break;
     
    68316821
    68326822/* Line 1806 of yacc.c  */
     6823#line 1278 "parser.yy"
     6824    { (yyval.decl) = DeclarationNode::newQualifier( DeclarationNode::Const ); }
     6825    break;
     6826
     6827  case 302:
     6828
     6829/* Line 1806 of yacc.c  */
     6830#line 1280 "parser.yy"
     6831    { (yyval.decl) = DeclarationNode::newQualifier( DeclarationNode::Restrict ); }
     6832    break;
     6833
     6834  case 303:
     6835
     6836/* Line 1806 of yacc.c  */
     6837#line 1282 "parser.yy"
     6838    { (yyval.decl) = DeclarationNode::newQualifier( DeclarationNode::Volatile ); }
     6839    break;
     6840
     6841  case 304:
     6842
     6843/* Line 1806 of yacc.c  */
    68336844#line 1284 "parser.yy"
    6834     { (yyval.decl) = DeclarationNode::newQualifier( DeclarationNode::Const ); }
    6835     break;
    6836 
    6837   case 302:
     6845    { (yyval.decl) = DeclarationNode::newQualifier( DeclarationNode::Lvalue ); }
     6846    break;
     6847
     6848  case 305:
    68386849
    68396850/* Line 1806 of yacc.c  */
    68406851#line 1286 "parser.yy"
    6841     { (yyval.decl) = DeclarationNode::newQualifier( DeclarationNode::Restrict ); }
    6842     break;
    6843 
    6844   case 303:
     6852    { (yyval.decl) = DeclarationNode::newQualifier( DeclarationNode::Atomic ); }
     6853    break;
     6854
     6855  case 306:
    68456856
    68466857/* Line 1806 of yacc.c  */
    68476858#line 1288 "parser.yy"
    6848     { (yyval.decl) = DeclarationNode::newQualifier( DeclarationNode::Volatile ); }
    6849     break;
    6850 
    6851   case 304:
    6852 
    6853 /* Line 1806 of yacc.c  */
    6854 #line 1290 "parser.yy"
    6855     { (yyval.decl) = DeclarationNode::newQualifier( DeclarationNode::Lvalue ); }
    6856     break;
    6857 
    6858   case 305:
    6859 
    6860 /* Line 1806 of yacc.c  */
    6861 #line 1292 "parser.yy"
    6862     { (yyval.decl) = DeclarationNode::newQualifier( DeclarationNode::Atomic ); }
    6863     break;
    6864 
    6865   case 306:
    6866 
    6867 /* Line 1806 of yacc.c  */
    6868 #line 1294 "parser.yy"
    68696859    {
    68706860                        typedefTable.enterScope();
     
    68756865
    68766866/* Line 1806 of yacc.c  */
    6877 #line 1298 "parser.yy"
     6867#line 1292 "parser.yy"
    68786868    {
    68796869                        typedefTable.leaveScope();
     
    68856875
    68866876/* Line 1806 of yacc.c  */
    6887 #line 1307 "parser.yy"
     6877#line 1301 "parser.yy"
    68886878    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
    68896879    break;
     
    68926882
    68936883/* Line 1806 of yacc.c  */
    6894 #line 1309 "parser.yy"
     6884#line 1303 "parser.yy"
    68956885    { (yyval.decl) = (yyvsp[(1) - (3)].decl)->addQualifiers( (yyvsp[(2) - (3)].decl) )->addQualifiers( (yyvsp[(3) - (3)].decl) ); }
    68966886    break;
     
    68996889
    69006890/* Line 1806 of yacc.c  */
    6901 #line 1320 "parser.yy"
     6891#line 1314 "parser.yy"
    69026892    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
    69036893    break;
     
    69066896
    69076897/* Line 1806 of yacc.c  */
     6898#line 1323 "parser.yy"
     6899    { (yyval.decl) = DeclarationNode::newStorageClass( DeclarationNode::Extern ); }
     6900    break;
     6901
     6902  case 315:
     6903
     6904/* Line 1806 of yacc.c  */
     6905#line 1325 "parser.yy"
     6906    { (yyval.decl) = DeclarationNode::newStorageClass( DeclarationNode::Static ); }
     6907    break;
     6908
     6909  case 316:
     6910
     6911/* Line 1806 of yacc.c  */
     6912#line 1327 "parser.yy"
     6913    { (yyval.decl) = DeclarationNode::newStorageClass( DeclarationNode::Auto ); }
     6914    break;
     6915
     6916  case 317:
     6917
     6918/* Line 1806 of yacc.c  */
    69086919#line 1329 "parser.yy"
    6909     { (yyval.decl) = DeclarationNode::newStorageClass( DeclarationNode::Extern ); }
    6910     break;
    6911 
    6912   case 315:
     6920    { (yyval.decl) = DeclarationNode::newStorageClass( DeclarationNode::Register ); }
     6921    break;
     6922
     6923  case 318:
    69136924
    69146925/* Line 1806 of yacc.c  */
    69156926#line 1331 "parser.yy"
    6916     { (yyval.decl) = DeclarationNode::newStorageClass( DeclarationNode::Static ); }
    6917     break;
    6918 
    6919   case 316:
     6927    { (yyval.decl) = DeclarationNode::newStorageClass( DeclarationNode::Inline ); }
     6928    break;
     6929
     6930  case 319:
    69206931
    69216932/* Line 1806 of yacc.c  */
    69226933#line 1333 "parser.yy"
    6923     { (yyval.decl) = DeclarationNode::newStorageClass( DeclarationNode::Auto ); }
    6924     break;
    6925 
    6926   case 317:
     6934    { (yyval.decl) = DeclarationNode::newStorageClass( DeclarationNode::Fortran ); }
     6935    break;
     6936
     6937  case 320:
    69276938
    69286939/* Line 1806 of yacc.c  */
    69296940#line 1335 "parser.yy"
    6930     { (yyval.decl) = DeclarationNode::newStorageClass( DeclarationNode::Register ); }
    6931     break;
    6932 
    6933   case 318:
     6941    { (yyval.decl) = DeclarationNode::newStorageClass( DeclarationNode::Noreturn ); }
     6942    break;
     6943
     6944  case 321:
    69346945
    69356946/* Line 1806 of yacc.c  */
    69366947#line 1337 "parser.yy"
    6937     { (yyval.decl) = DeclarationNode::newStorageClass( DeclarationNode::Inline ); }
    6938     break;
    6939 
    6940   case 319:
    6941 
    6942 /* Line 1806 of yacc.c  */
    6943 #line 1339 "parser.yy"
    6944     { (yyval.decl) = DeclarationNode::newStorageClass( DeclarationNode::Fortran ); }
    6945     break;
    6946 
    6947   case 320:
    6948 
    6949 /* Line 1806 of yacc.c  */
    6950 #line 1341 "parser.yy"
    6951     { (yyval.decl) = DeclarationNode::newStorageClass( DeclarationNode::Noreturn ); }
    6952     break;
    6953 
    6954   case 321:
    6955 
    6956 /* Line 1806 of yacc.c  */
    6957 #line 1343 "parser.yy"
    69586948    { (yyval.decl) = DeclarationNode::newStorageClass( DeclarationNode::Threadlocal ); }
    69596949    break;
     
    69626952
    69636953/* Line 1806 of yacc.c  */
     6954#line 1342 "parser.yy"
     6955    { (yyval.decl) = DeclarationNode::newBasicType( DeclarationNode::Char ); }
     6956    break;
     6957
     6958  case 323:
     6959
     6960/* Line 1806 of yacc.c  */
     6961#line 1344 "parser.yy"
     6962    { (yyval.decl) = DeclarationNode::newBasicType( DeclarationNode::Double ); }
     6963    break;
     6964
     6965  case 324:
     6966
     6967/* Line 1806 of yacc.c  */
     6968#line 1346 "parser.yy"
     6969    { (yyval.decl) = DeclarationNode::newBasicType( DeclarationNode::Float ); }
     6970    break;
     6971
     6972  case 325:
     6973
     6974/* Line 1806 of yacc.c  */
    69646975#line 1348 "parser.yy"
    6965     { (yyval.decl) = DeclarationNode::newBasicType( DeclarationNode::Char ); }
    6966     break;
    6967 
    6968   case 323:
     6976    { (yyval.decl) = DeclarationNode::newBasicType( DeclarationNode::Int ); }
     6977    break;
     6978
     6979  case 326:
    69696980
    69706981/* Line 1806 of yacc.c  */
    69716982#line 1350 "parser.yy"
    6972     { (yyval.decl) = DeclarationNode::newBasicType( DeclarationNode::Double ); }
    6973     break;
    6974 
    6975   case 324:
     6983    { (yyval.decl) = DeclarationNode::newModifier( DeclarationNode::Long ); }
     6984    break;
     6985
     6986  case 327:
    69766987
    69776988/* Line 1806 of yacc.c  */
    69786989#line 1352 "parser.yy"
    6979     { (yyval.decl) = DeclarationNode::newBasicType( DeclarationNode::Float ); }
    6980     break;
    6981 
    6982   case 325:
     6990    { (yyval.decl) = DeclarationNode::newModifier( DeclarationNode::Short ); }
     6991    break;
     6992
     6993  case 328:
    69836994
    69846995/* Line 1806 of yacc.c  */
    69856996#line 1354 "parser.yy"
    6986     { (yyval.decl) = DeclarationNode::newBasicType( DeclarationNode::Int ); }
    6987     break;
    6988 
    6989   case 326:
     6997    { (yyval.decl) = DeclarationNode::newModifier( DeclarationNode::Signed ); }
     6998    break;
     6999
     7000  case 329:
    69907001
    69917002/* Line 1806 of yacc.c  */
    69927003#line 1356 "parser.yy"
    6993     { (yyval.decl) = DeclarationNode::newModifier( DeclarationNode::Long ); }
    6994     break;
    6995 
    6996   case 327:
     7004    { (yyval.decl) = DeclarationNode::newModifier( DeclarationNode::Unsigned ); }
     7005    break;
     7006
     7007  case 330:
    69977008
    69987009/* Line 1806 of yacc.c  */
    69997010#line 1358 "parser.yy"
    7000     { (yyval.decl) = DeclarationNode::newModifier( DeclarationNode::Short ); }
    7001     break;
    7002 
    7003   case 328:
     7011    { (yyval.decl) = DeclarationNode::newBasicType( DeclarationNode::Void ); }
     7012    break;
     7013
     7014  case 331:
    70047015
    70057016/* Line 1806 of yacc.c  */
    70067017#line 1360 "parser.yy"
    7007     { (yyval.decl) = DeclarationNode::newModifier( DeclarationNode::Signed ); }
    7008     break;
    7009 
    7010   case 329:
     7018    { (yyval.decl) = DeclarationNode::newBasicType( DeclarationNode::Bool ); }
     7019    break;
     7020
     7021  case 332:
    70117022
    70127023/* Line 1806 of yacc.c  */
    70137024#line 1362 "parser.yy"
    7014     { (yyval.decl) = DeclarationNode::newModifier( DeclarationNode::Unsigned ); }
    7015     break;
    7016 
    7017   case 330:
     7025    { (yyval.decl) = DeclarationNode::newBasicType( DeclarationNode::Complex ); }
     7026    break;
     7027
     7028  case 333:
    70187029
    70197030/* Line 1806 of yacc.c  */
    70207031#line 1364 "parser.yy"
    7021     { (yyval.decl) = DeclarationNode::newBasicType( DeclarationNode::Void ); }
    7022     break;
    7023 
    7024   case 331:
     7032    { (yyval.decl) = DeclarationNode::newBasicType( DeclarationNode::Imaginary ); }
     7033    break;
     7034
     7035  case 334:
    70257036
    70267037/* Line 1806 of yacc.c  */
    70277038#line 1366 "parser.yy"
    7028     { (yyval.decl) = DeclarationNode::newBasicType( DeclarationNode::Bool ); }
    7029     break;
    7030 
    7031   case 332:
    7032 
    7033 /* Line 1806 of yacc.c  */
    7034 #line 1368 "parser.yy"
    7035     { (yyval.decl) = DeclarationNode::newBasicType( DeclarationNode::Complex ); }
    7036     break;
    7037 
    7038   case 333:
    7039 
    7040 /* Line 1806 of yacc.c  */
    7041 #line 1370 "parser.yy"
    7042     { (yyval.decl) = DeclarationNode::newBasicType( DeclarationNode::Imaginary ); }
    7043     break;
    7044 
    7045   case 334:
    7046 
    7047 /* Line 1806 of yacc.c  */
    7048 #line 1372 "parser.yy"
    70497039    { (yyval.decl) = DeclarationNode::newBuiltinType( DeclarationNode::Valist ); }
    70507040    break;
     
    70537043
    70547044/* Line 1806 of yacc.c  */
     7045#line 1373 "parser.yy"
     7046    { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); }
     7047    break;
     7048
     7049  case 337:
     7050
     7051/* Line 1806 of yacc.c  */
     7052#line 1375 "parser.yy"
     7053    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
     7054    break;
     7055
     7056  case 338:
     7057
     7058/* Line 1806 of yacc.c  */
     7059#line 1377 "parser.yy"
     7060    { (yyval.decl) = (yyvsp[(1) - (3)].decl)->addQualifiers( (yyvsp[(2) - (3)].decl) )->addQualifiers( (yyvsp[(3) - (3)].decl) ); }
     7061    break;
     7062
     7063  case 339:
     7064
     7065/* Line 1806 of yacc.c  */
    70557066#line 1379 "parser.yy"
     7067    { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addQualifiers( (yyvsp[(2) - (3)].decl) )->addType( (yyvsp[(1) - (3)].decl) ); }
     7068    break;
     7069
     7070  case 341:
     7071
     7072/* Line 1806 of yacc.c  */
     7073#line 1385 "parser.yy"
     7074    { (yyval.decl) = (yyvsp[(2) - (3)].decl)->addQualifiers( (yyvsp[(1) - (3)].decl) )->addQualifiers( (yyvsp[(3) - (3)].decl) ); }
     7075    break;
     7076
     7077  case 343:
     7078
     7079/* Line 1806 of yacc.c  */
     7080#line 1392 "parser.yy"
    70567081    { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); }
    70577082    break;
    70587083
    7059   case 337:
    7060 
    7061 /* Line 1806 of yacc.c  */
    7062 #line 1381 "parser.yy"
     7084  case 344:
     7085
     7086/* Line 1806 of yacc.c  */
     7087#line 1394 "parser.yy"
    70637088    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
    70647089    break;
    70657090
    7066   case 338:
    7067 
    7068 /* Line 1806 of yacc.c  */
    7069 #line 1383 "parser.yy"
     7091  case 345:
     7092
     7093/* Line 1806 of yacc.c  */
     7094#line 1396 "parser.yy"
     7095    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addType( (yyvsp[(2) - (2)].decl) ); }
     7096    break;
     7097
     7098  case 346:
     7099
     7100/* Line 1806 of yacc.c  */
     7101#line 1401 "parser.yy"
     7102    { (yyval.decl) = (yyvsp[(3) - (4)].decl); }
     7103    break;
     7104
     7105  case 347:
     7106
     7107/* Line 1806 of yacc.c  */
     7108#line 1403 "parser.yy"
     7109    { (yyval.decl) = DeclarationNode::newTypeof( (yyvsp[(3) - (4)].en) ); }
     7110    break;
     7111
     7112  case 348:
     7113
     7114/* Line 1806 of yacc.c  */
     7115#line 1405 "parser.yy"
     7116    { (yyval.decl) = DeclarationNode::newAttr( (yyvsp[(1) - (4)].tok), (yyvsp[(3) - (4)].decl) ); }
     7117    break;
     7118
     7119  case 349:
     7120
     7121/* Line 1806 of yacc.c  */
     7122#line 1407 "parser.yy"
     7123    { (yyval.decl) = DeclarationNode::newAttr( (yyvsp[(1) - (4)].tok), (yyvsp[(3) - (4)].en) ); }
     7124    break;
     7125
     7126  case 351:
     7127
     7128/* Line 1806 of yacc.c  */
     7129#line 1413 "parser.yy"
     7130    { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); }
     7131    break;
     7132
     7133  case 352:
     7134
     7135/* Line 1806 of yacc.c  */
     7136#line 1415 "parser.yy"
     7137    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
     7138    break;
     7139
     7140  case 353:
     7141
     7142/* Line 1806 of yacc.c  */
     7143#line 1417 "parser.yy"
    70707144    { (yyval.decl) = (yyvsp[(1) - (3)].decl)->addQualifiers( (yyvsp[(2) - (3)].decl) )->addQualifiers( (yyvsp[(3) - (3)].decl) ); }
    70717145    break;
    70727146
    7073   case 339:
    7074 
    7075 /* Line 1806 of yacc.c  */
    7076 #line 1385 "parser.yy"
    7077     { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addQualifiers( (yyvsp[(2) - (3)].decl) )->addType( (yyvsp[(1) - (3)].decl) ); }
    7078     break;
    7079 
    7080   case 341:
    7081 
    7082 /* Line 1806 of yacc.c  */
    7083 #line 1391 "parser.yy"
    7084     { (yyval.decl) = (yyvsp[(2) - (3)].decl)->addQualifiers( (yyvsp[(1) - (3)].decl) )->addQualifiers( (yyvsp[(3) - (3)].decl) ); }
    7085     break;
    7086 
    7087   case 343:
    7088 
    7089 /* Line 1806 of yacc.c  */
    7090 #line 1398 "parser.yy"
     7147  case 355:
     7148
     7149/* Line 1806 of yacc.c  */
     7150#line 1423 "parser.yy"
    70917151    { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); }
    70927152    break;
    70937153
    7094   case 344:
    7095 
    7096 /* Line 1806 of yacc.c  */
    7097 #line 1400 "parser.yy"
     7154  case 356:
     7155
     7156/* Line 1806 of yacc.c  */
     7157#line 1425 "parser.yy"
    70987158    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
    70997159    break;
    71007160
    7101   case 345:
    7102 
    7103 /* Line 1806 of yacc.c  */
    7104 #line 1402 "parser.yy"
    7105     { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addType( (yyvsp[(2) - (2)].decl) ); }
    7106     break;
    7107 
    7108   case 346:
    7109 
    7110 /* Line 1806 of yacc.c  */
    7111 #line 1407 "parser.yy"
    7112     { (yyval.decl) = (yyvsp[(3) - (4)].decl); }
    7113     break;
    7114 
    7115   case 347:
    7116 
    7117 /* Line 1806 of yacc.c  */
    7118 #line 1409 "parser.yy"
    7119     { (yyval.decl) = DeclarationNode::newTypeof( (yyvsp[(3) - (4)].en) ); }
    7120     break;
    7121 
    7122   case 348:
    7123 
    7124 /* Line 1806 of yacc.c  */
    7125 #line 1411 "parser.yy"
    7126     { (yyval.decl) = DeclarationNode::newAttr( (yyvsp[(1) - (4)].tok), (yyvsp[(3) - (4)].decl) ); }
    7127     break;
    7128 
    7129   case 349:
    7130 
    7131 /* Line 1806 of yacc.c  */
    7132 #line 1413 "parser.yy"
    7133     { (yyval.decl) = DeclarationNode::newAttr( (yyvsp[(1) - (4)].tok), (yyvsp[(3) - (4)].en) ); }
    7134     break;
    7135 
    7136   case 351:
    7137 
    7138 /* Line 1806 of yacc.c  */
    7139 #line 1419 "parser.yy"
     7161  case 358:
     7162
     7163/* Line 1806 of yacc.c  */
     7164#line 1431 "parser.yy"
    71407165    { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); }
    71417166    break;
    71427167
    7143   case 352:
    7144 
    7145 /* Line 1806 of yacc.c  */
    7146 #line 1421 "parser.yy"
     7168  case 359:
     7169
     7170/* Line 1806 of yacc.c  */
     7171#line 1433 "parser.yy"
    71477172    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
    71487173    break;
    71497174
    7150   case 353:
    7151 
    7152 /* Line 1806 of yacc.c  */
    7153 #line 1423 "parser.yy"
     7175  case 360:
     7176
     7177/* Line 1806 of yacc.c  */
     7178#line 1435 "parser.yy"
    71547179    { (yyval.decl) = (yyvsp[(1) - (3)].decl)->addQualifiers( (yyvsp[(2) - (3)].decl) )->addQualifiers( (yyvsp[(3) - (3)].decl) ); }
    71557180    break;
    71567181
    7157   case 355:
    7158 
    7159 /* Line 1806 of yacc.c  */
    7160 #line 1429 "parser.yy"
    7161     { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); }
    7162     break;
    7163 
    7164   case 356:
    7165 
    7166 /* Line 1806 of yacc.c  */
    7167 #line 1431 "parser.yy"
     7182  case 361:
     7183
     7184/* Line 1806 of yacc.c  */
     7185#line 1440 "parser.yy"
     7186    { (yyval.decl) = DeclarationNode::newFromTypedef( (yyvsp[(1) - (1)].tok) ); }
     7187    break;
     7188
     7189  case 362:
     7190
     7191/* Line 1806 of yacc.c  */
     7192#line 1442 "parser.yy"
     7193    { (yyval.decl) = DeclarationNode::newFromTypedef( (yyvsp[(2) - (2)].tok) )->addQualifiers( (yyvsp[(1) - (2)].decl) ); }
     7194    break;
     7195
     7196  case 363:
     7197
     7198/* Line 1806 of yacc.c  */
     7199#line 1444 "parser.yy"
    71687200    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
    71697201    break;
    71707202
    7171   case 358:
    7172 
    7173 /* Line 1806 of yacc.c  */
    7174 #line 1437 "parser.yy"
    7175     { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); }
    7176     break;
    7177 
    7178   case 359:
    7179 
    7180 /* Line 1806 of yacc.c  */
    7181 #line 1439 "parser.yy"
    7182     { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
    7183     break;
    7184 
    7185   case 360:
    7186 
    7187 /* Line 1806 of yacc.c  */
    7188 #line 1441 "parser.yy"
    7189     { (yyval.decl) = (yyvsp[(1) - (3)].decl)->addQualifiers( (yyvsp[(2) - (3)].decl) )->addQualifiers( (yyvsp[(3) - (3)].decl) ); }
    7190     break;
    7191 
    7192   case 361:
    7193 
    7194 /* Line 1806 of yacc.c  */
    7195 #line 1446 "parser.yy"
    7196     { (yyval.decl) = DeclarationNode::newFromTypedef( (yyvsp[(1) - (1)].tok) ); }
    7197     break;
    7198 
    7199   case 362:
    7200 
    7201 /* Line 1806 of yacc.c  */
    7202 #line 1448 "parser.yy"
    7203     { (yyval.decl) = DeclarationNode::newFromTypedef( (yyvsp[(2) - (2)].tok) )->addQualifiers( (yyvsp[(1) - (2)].decl) ); }
    7204     break;
    7205 
    7206   case 363:
    7207 
    7208 /* Line 1806 of yacc.c  */
    7209 #line 1450 "parser.yy"
    7210     { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
    7211     break;
    7212 
    72137203  case 366:
    72147204
    72157205/* Line 1806 of yacc.c  */
    7216 #line 1460 "parser.yy"
     7206#line 1454 "parser.yy"
    72177207    { (yyval.decl) = DeclarationNode::newAggregate( (yyvsp[(1) - (4)].aggKey), 0, 0, (yyvsp[(3) - (4)].decl), true ); }
    72187208    break;
     
    72217211
    72227212/* Line 1806 of yacc.c  */
    7223 #line 1462 "parser.yy"
     7213#line 1456 "parser.yy"
    72247214    {
    72257215                        typedefTable.makeTypedef( *(yyvsp[(2) - (2)].tok) );
     
    72317221
    72327222/* Line 1806 of yacc.c  */
     7223#line 1461 "parser.yy"
     7224    { typedefTable.makeTypedef( *(yyvsp[(2) - (2)].tok) ); }
     7225    break;
     7226
     7227  case 369:
     7228
     7229/* Line 1806 of yacc.c  */
     7230#line 1463 "parser.yy"
     7231    { (yyval.decl) = DeclarationNode::newAggregate( (yyvsp[(1) - (6)].aggKey), (yyvsp[(2) - (6)].tok), 0, (yyvsp[(5) - (6)].decl), true ); }
     7232    break;
     7233
     7234  case 370:
     7235
     7236/* Line 1806 of yacc.c  */
     7237#line 1465 "parser.yy"
     7238    { (yyval.decl) = DeclarationNode::newAggregate( (yyvsp[(1) - (7)].aggKey), 0, (yyvsp[(3) - (7)].en), (yyvsp[(6) - (7)].decl), false ); }
     7239    break;
     7240
     7241  case 371:
     7242
     7243/* Line 1806 of yacc.c  */
    72337244#line 1467 "parser.yy"
    7234     { typedefTable.makeTypedef( *(yyvsp[(2) - (2)].tok) ); }
    7235     break;
    7236 
    7237   case 369:
    7238 
    7239 /* Line 1806 of yacc.c  */
    7240 #line 1469 "parser.yy"
    7241     { (yyval.decl) = DeclarationNode::newAggregate( (yyvsp[(1) - (6)].aggKey), (yyvsp[(2) - (6)].tok), 0, (yyvsp[(5) - (6)].decl), true ); }
    7242     break;
    7243 
    7244   case 370:
    7245 
    7246 /* Line 1806 of yacc.c  */
    7247 #line 1471 "parser.yy"
    7248     { (yyval.decl) = DeclarationNode::newAggregate( (yyvsp[(1) - (7)].aggKey), 0, (yyvsp[(3) - (7)].en), (yyvsp[(6) - (7)].decl), false ); }
    7249     break;
    7250 
    7251   case 371:
    7252 
    7253 /* Line 1806 of yacc.c  */
    7254 #line 1473 "parser.yy"
    72557245    { (yyval.decl) = (yyvsp[(2) - (2)].decl); }
    72567246    break;
     
    72597249
    72607250/* Line 1806 of yacc.c  */
    7261 #line 1478 "parser.yy"
     7251#line 1472 "parser.yy"
    72627252    { (yyval.aggKey) = DeclarationNode::Struct; }
    72637253    break;
     
    72667256
    72677257/* Line 1806 of yacc.c  */
    7268 #line 1480 "parser.yy"
     7258#line 1474 "parser.yy"
    72697259    { (yyval.aggKey) = DeclarationNode::Union; }
    72707260    break;
     
    72737263
    72747264/* Line 1806 of yacc.c  */
    7275 #line 1485 "parser.yy"
     7265#line 1479 "parser.yy"
    72767266    { (yyval.decl) = 0; }
    72777267    break;
     
    72807270
    72817271/* Line 1806 of yacc.c  */
     7272#line 1481 "parser.yy"
     7273    { (yyval.decl) = (yyvsp[(1) - (2)].decl) != 0 ? (yyvsp[(1) - (2)].decl)->appendList( (yyvsp[(2) - (2)].decl) ) : (yyvsp[(2) - (2)].decl); }
     7274    break;
     7275
     7276  case 377:
     7277
     7278/* Line 1806 of yacc.c  */
    72827279#line 1487 "parser.yy"
    7283     { (yyval.decl) = (yyvsp[(1) - (2)].decl) != 0 ? (yyvsp[(1) - (2)].decl)->appendList( (yyvsp[(2) - (2)].decl) ) : (yyvsp[(2) - (2)].decl); }
    7284     break;
    7285 
    7286   case 377:
    7287 
    7288 /* Line 1806 of yacc.c  */
    7289 #line 1493 "parser.yy"
    72907280    { (yyval.decl) = (yyvsp[(2) - (3)].decl)->set_extension( true ); }
    72917281    break;
     
    72947284
    72957285/* Line 1806 of yacc.c  */
    7296 #line 1496 "parser.yy"
     7286#line 1490 "parser.yy"
    72977287    {   // mark all fields in list
    72987288                        for ( DeclarationNode *iter = (yyvsp[(2) - (3)].decl); iter != NULL; iter = (DeclarationNode *)iter->get_link() )
     
    73057295
    73067296/* Line 1806 of yacc.c  */
    7307 #line 1506 "parser.yy"
     7297#line 1500 "parser.yy"
    73087298    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addName( (yyvsp[(2) - (2)].tok) ); }
    73097299    break;
     
    73127302
    73137303/* Line 1806 of yacc.c  */
    7314 #line 1508 "parser.yy"
     7304#line 1502 "parser.yy"
    73157305    { (yyval.decl) = (yyvsp[(1) - (3)].decl)->appendList( (yyvsp[(1) - (3)].decl)->cloneType( (yyvsp[(3) - (3)].tok) ) ); }
    73167306    break;
     
    73197309
    73207310/* Line 1806 of yacc.c  */
    7321 #line 1510 "parser.yy"
     7311#line 1504 "parser.yy"
    73227312    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->appendList( (yyvsp[(1) - (2)].decl)->cloneType( 0 ) ); }
    73237313    break;
     
    73267316
    73277317/* Line 1806 of yacc.c  */
    7328 #line 1515 "parser.yy"
     7318#line 1509 "parser.yy"
    73297319    { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addType( (yyvsp[(1) - (2)].decl) ); }
    73307320    break;
     
    73337323
    73347324/* Line 1806 of yacc.c  */
    7335 #line 1517 "parser.yy"
     7325#line 1511 "parser.yy"
    73367326    { (yyval.decl) = (yyvsp[(1) - (4)].decl)->appendList( (yyvsp[(1) - (4)].decl)->cloneBaseType( (yyvsp[(4) - (4)].decl) ) ); }
    73377327    break;
     
    73407330
    73417331/* Line 1806 of yacc.c  */
    7342 #line 1522 "parser.yy"
     7332#line 1516 "parser.yy"
    73437333    { (yyval.decl) = DeclarationNode::newName( 0 ); /* XXX */ }
    73447334    break;
     
    73477337
    73487338/* Line 1806 of yacc.c  */
     7339#line 1518 "parser.yy"
     7340    { (yyval.decl) = DeclarationNode::newBitfield( (yyvsp[(1) - (1)].en) ); }
     7341    break;
     7342
     7343  case 388:
     7344
     7345/* Line 1806 of yacc.c  */
     7346#line 1521 "parser.yy"
     7347    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addBitfield( (yyvsp[(2) - (2)].en) ); }
     7348    break;
     7349
     7350  case 389:
     7351
     7352/* Line 1806 of yacc.c  */
    73497353#line 1524 "parser.yy"
    7350     { (yyval.decl) = DeclarationNode::newBitfield( (yyvsp[(1) - (1)].en) ); }
    7351     break;
    7352 
    7353   case 388:
    7354 
    7355 /* Line 1806 of yacc.c  */
    7356 #line 1527 "parser.yy"
    73577354    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addBitfield( (yyvsp[(2) - (2)].en) ); }
    73587355    break;
    73597356
    7360   case 389:
     7357  case 391:
    73617358
    73627359/* Line 1806 of yacc.c  */
    73637360#line 1530 "parser.yy"
    7364     { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addBitfield( (yyvsp[(2) - (2)].en) ); }
    7365     break;
    7366 
    7367   case 391:
    7368 
    7369 /* Line 1806 of yacc.c  */
    7370 #line 1536 "parser.yy"
    73717361    { (yyval.en) = 0; }
    73727362    break;
     
    73757365
    73767366/* Line 1806 of yacc.c  */
    7377 #line 1538 "parser.yy"
     7367#line 1532 "parser.yy"
    73787368    { (yyval.en) = (yyvsp[(1) - (1)].en); }
    73797369    break;
     
    73827372
    73837373/* Line 1806 of yacc.c  */
    7384 #line 1543 "parser.yy"
     7374#line 1537 "parser.yy"
    73857375    { (yyval.en) = (yyvsp[(2) - (2)].en); }
    73867376    break;
     
    73897379
    73907380/* Line 1806 of yacc.c  */
    7391 #line 1552 "parser.yy"
     7381#line 1546 "parser.yy"
    73927382    { (yyval.decl) = DeclarationNode::newEnum( 0, (yyvsp[(3) - (5)].decl) ); }
    73937383    break;
     
    73967386
    73977387/* Line 1806 of yacc.c  */
    7398 #line 1554 "parser.yy"
     7388#line 1548 "parser.yy"
    73997389    {
    74007390                        typedefTable.makeTypedef( *(yyvsp[(2) - (2)].tok) );
     
    74067396
    74077397/* Line 1806 of yacc.c  */
    7408 #line 1559 "parser.yy"
     7398#line 1553 "parser.yy"
    74097399    { typedefTable.makeTypedef( *(yyvsp[(2) - (2)].tok) ); }
    74107400    break;
     
    74137403
    74147404/* Line 1806 of yacc.c  */
    7415 #line 1561 "parser.yy"
     7405#line 1555 "parser.yy"
    74167406    { (yyval.decl) = DeclarationNode::newEnum( (yyvsp[(2) - (7)].tok), (yyvsp[(5) - (7)].decl) ); }
    74177407    break;
     
    74207410
    74217411/* Line 1806 of yacc.c  */
    7422 #line 1566 "parser.yy"
     7412#line 1560 "parser.yy"
    74237413    { (yyval.decl) = DeclarationNode::newEnumConstant( (yyvsp[(1) - (2)].tok), (yyvsp[(2) - (2)].en) ); }
    74247414    break;
     
    74277417
    74287418/* Line 1806 of yacc.c  */
    7429 #line 1568 "parser.yy"
     7419#line 1562 "parser.yy"
    74307420    { (yyval.decl) = (yyvsp[(1) - (4)].decl)->appendList( DeclarationNode::newEnumConstant( (yyvsp[(3) - (4)].tok), (yyvsp[(4) - (4)].en) ) ); }
    74317421    break;
     
    74347424
    74357425/* Line 1806 of yacc.c  */
    7436 #line 1573 "parser.yy"
     7426#line 1567 "parser.yy"
    74377427    { (yyval.en) = 0; }
    74387428    break;
     
    74417431
    74427432/* Line 1806 of yacc.c  */
    7443 #line 1575 "parser.yy"
     7433#line 1569 "parser.yy"
    74447434    { (yyval.en) = (yyvsp[(2) - (2)].en); }
    74457435    break;
     
    74487438
    74497439/* Line 1806 of yacc.c  */
    7450 #line 1582 "parser.yy"
     7440#line 1576 "parser.yy"
    74517441    { (yyval.decl) = 0; }
    74527442    break;
     
    74557445
    74567446/* Line 1806 of yacc.c  */
    7457 #line 1590 "parser.yy"
     7447#line 1584 "parser.yy"
    74587448    { (yyval.decl) = (yyvsp[(1) - (5)].decl)->appendList( (yyvsp[(5) - (5)].decl) ); }
    74597449    break;
     
    74627452
    74637453/* Line 1806 of yacc.c  */
    7464 #line 1592 "parser.yy"
     7454#line 1586 "parser.yy"
    74657455    { (yyval.decl) = (yyvsp[(1) - (5)].decl)->addVarArgs(); }
    74667456    break;
     
    74697459
    74707460/* Line 1806 of yacc.c  */
    7471 #line 1594 "parser.yy"
     7461#line 1588 "parser.yy"
    74727462    { (yyval.decl) = (yyvsp[(1) - (5)].decl)->addVarArgs(); }
    74737463    break;
     
    74767466
    74777467/* Line 1806 of yacc.c  */
    7478 #line 1602 "parser.yy"
     7468#line 1596 "parser.yy"
    74797469    { (yyval.decl) = (yyvsp[(1) - (5)].decl)->appendList( (yyvsp[(5) - (5)].decl) ); }
    74807470    break;
     
    74837473
    74847474/* Line 1806 of yacc.c  */
    7485 #line 1604 "parser.yy"
     7475#line 1598 "parser.yy"
    74867476    { (yyval.decl) = (yyvsp[(1) - (5)].decl)->appendList( (yyvsp[(5) - (5)].decl) ); }
    74877477    break;
     
    74907480
    74917481/* Line 1806 of yacc.c  */
     7482#line 1600 "parser.yy"
     7483    { (yyval.decl) = (yyvsp[(1) - (9)].decl)->appendList( (yyvsp[(5) - (9)].decl) )->appendList( (yyvsp[(9) - (9)].decl) ); }
     7484    break;
     7485
     7486  case 415:
     7487
     7488/* Line 1806 of yacc.c  */
    74927489#line 1606 "parser.yy"
    7493     { (yyval.decl) = (yyvsp[(1) - (9)].decl)->appendList( (yyvsp[(5) - (9)].decl) )->appendList( (yyvsp[(9) - (9)].decl) ); }
    7494     break;
    7495 
    7496   case 415:
    7497 
    7498 /* Line 1806 of yacc.c  */
    7499 #line 1612 "parser.yy"
    75007490    { (yyval.decl) = (yyvsp[(1) - (5)].decl)->appendList( (yyvsp[(5) - (5)].decl) ); }
    75017491    break;
     
    75047494
    75057495/* Line 1806 of yacc.c  */
    7506 #line 1617 "parser.yy"
     7496#line 1611 "parser.yy"
    75077497    { (yyval.decl) = 0; }
    75087498    break;
     
    75117501
    75127502/* Line 1806 of yacc.c  */
    7513 #line 1624 "parser.yy"
     7503#line 1618 "parser.yy"
    75147504    { (yyval.decl) = (yyvsp[(1) - (5)].decl)->addVarArgs(); }
    75157505    break;
     
    75187508
    75197509/* Line 1806 of yacc.c  */
    7520 #line 1631 "parser.yy"
     7510#line 1625 "parser.yy"
    75217511    { (yyval.decl) = (yyvsp[(1) - (5)].decl)->appendList( (yyvsp[(5) - (5)].decl) ); }
    75227512    break;
     
    75257515
    75267516/* Line 1806 of yacc.c  */
    7527 #line 1633 "parser.yy"
     7517#line 1627 "parser.yy"
    75287518    { (yyval.decl) = (yyvsp[(1) - (5)].decl)->appendList( (yyvsp[(5) - (5)].decl) ); }
    75297519    break;
     
    75327522
    75337523/* Line 1806 of yacc.c  */
    7534 #line 1642 "parser.yy"
     7524#line 1636 "parser.yy"
    75357525    { (yyval.decl) = (yyvsp[(1) - (3)].decl)->addName( (yyvsp[(2) - (3)].tok) ); }
    75367526    break;
     
    75397529
    75407530/* Line 1806 of yacc.c  */
    7541 #line 1645 "parser.yy"
     7531#line 1639 "parser.yy"
    75427532    { (yyval.decl) = (yyvsp[(1) - (3)].decl)->addName( (yyvsp[(2) - (3)].tok) ); }
    75437533    break;
     
    75467536
    75477537/* Line 1806 of yacc.c  */
    7548 #line 1647 "parser.yy"
     7538#line 1641 "parser.yy"
    75497539    { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addName( (yyvsp[(3) - (4)].tok) )->addQualifiers( (yyvsp[(1) - (4)].decl) ); }
    75507540    break;
     
    75537543
    75547544/* Line 1806 of yacc.c  */
     7545#line 1651 "parser.yy"
     7546    { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); }
     7547    break;
     7548
     7549  case 434:
     7550
     7551/* Line 1806 of yacc.c  */
    75557552#line 1657 "parser.yy"
    7556     { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); }
    7557     break;
    7558 
    7559   case 434:
    7560 
    7561 /* Line 1806 of yacc.c  */
    7562 #line 1663 "parser.yy"
    75637553    {
    75647554                        typedefTable.addToEnclosingScope( TypedefTable::ID );
     
    75707560
    75717561/* Line 1806 of yacc.c  */
    7572 #line 1668 "parser.yy"
     7562#line 1662 "parser.yy"
    75737563    {
    75747564                        typedefTable.addToEnclosingScope( TypedefTable::ID );
     
    75807570
    75817571/* Line 1806 of yacc.c  */
    7582 #line 1677 "parser.yy"
     7572#line 1671 "parser.yy"
    75837573    { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addType( (yyvsp[(1) - (2)].decl) ); }
    75847574    break;
     
    75877577
    75887578/* Line 1806 of yacc.c  */
    7589 #line 1686 "parser.yy"
     7579#line 1680 "parser.yy"
    75907580    { (yyval.decl) = DeclarationNode::newName( (yyvsp[(1) - (1)].tok) ); }
    75917581    break;
     
    75947584
    75957585/* Line 1806 of yacc.c  */
    7596 #line 1688 "parser.yy"
     7586#line 1682 "parser.yy"
    75977587    { (yyval.decl) = (yyvsp[(1) - (3)].decl)->appendList( DeclarationNode::newName( (yyvsp[(3) - (3)].tok) ) ); }
    75987588    break;
     
    76017591
    76027592/* Line 1806 of yacc.c  */
    7603 #line 1713 "parser.yy"
     7593#line 1707 "parser.yy"
    76047594    { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addType( (yyvsp[(1) - (2)].decl) ); }
    76057595    break;
     
    76087598
    76097599/* Line 1806 of yacc.c  */
    7610 #line 1721 "parser.yy"
     7600#line 1715 "parser.yy"
    76117601    { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addType( (yyvsp[(1) - (2)].decl) ); }
    76127602    break;
     
    76157605
    76167606/* Line 1806 of yacc.c  */
    7617 #line 1726 "parser.yy"
     7607#line 1720 "parser.yy"
    76187608    { (yyval.in) = 0; }
    76197609    break;
     
    76227612
    76237613/* Line 1806 of yacc.c  */
     7614#line 1722 "parser.yy"
     7615    { (yyval.in) = (yyvsp[(2) - (2)].in); }
     7616    break;
     7617
     7618  case 458:
     7619
     7620/* Line 1806 of yacc.c  */
     7621#line 1724 "parser.yy"
     7622    { (yyval.in) = (yyvsp[(2) - (2)].in)->set_maybeConstructed( false ); }
     7623    break;
     7624
     7625  case 459:
     7626
     7627/* Line 1806 of yacc.c  */
    76247628#line 1728 "parser.yy"
    7625     { (yyval.in) = (yyvsp[(2) - (2)].in); }
    7626     break;
    7627 
    7628   case 458:
    7629 
    7630 /* Line 1806 of yacc.c  */
    7631 #line 1730 "parser.yy"
    7632     { (yyval.in) = (yyvsp[(2) - (2)].in)->set_maybeConstructed( false ); }
    7633     break;
    7634 
    7635   case 459:
     7629    { (yyval.in) = new InitializerNode( (yyvsp[(1) - (1)].en) ); }
     7630    break;
     7631
     7632  case 460:
     7633
     7634/* Line 1806 of yacc.c  */
     7635#line 1729 "parser.yy"
     7636    { (yyval.in) = new InitializerNode( (yyvsp[(2) - (4)].in), true ); }
     7637    break;
     7638
     7639  case 461:
    76367640
    76377641/* Line 1806 of yacc.c  */
    76387642#line 1734 "parser.yy"
    7639     { (yyval.in) = new InitializerNode( (yyvsp[(1) - (1)].en) ); }
    7640     break;
    7641 
    7642   case 460:
    7643 
    7644 /* Line 1806 of yacc.c  */
    7645 #line 1735 "parser.yy"
    7646     { (yyval.in) = new InitializerNode( (yyvsp[(2) - (4)].in), true ); }
    7647     break;
    7648 
    7649   case 461:
    7650 
    7651 /* Line 1806 of yacc.c  */
    7652 #line 1740 "parser.yy"
    76537643    { (yyval.in) = 0; }
    76547644    break;
     
    76577647
    76587648/* Line 1806 of yacc.c  */
    7659 #line 1742 "parser.yy"
     7649#line 1736 "parser.yy"
    76607650    { (yyval.in) = (yyvsp[(2) - (2)].in)->set_designators( (yyvsp[(1) - (2)].en) ); }
    76617651    break;
     
    76647654
    76657655/* Line 1806 of yacc.c  */
    7666 #line 1743 "parser.yy"
     7656#line 1737 "parser.yy"
    76677657    { (yyval.in) = (InitializerNode *)( (yyvsp[(1) - (3)].in)->set_link( (yyvsp[(3) - (3)].in) ) ); }
    76687658    break;
     
    76717661
    76727662/* Line 1806 of yacc.c  */
    7673 #line 1745 "parser.yy"
     7663#line 1739 "parser.yy"
    76747664    { (yyval.in) = (InitializerNode *)( (yyvsp[(1) - (4)].in)->set_link( (yyvsp[(4) - (4)].in)->set_designators( (yyvsp[(3) - (4)].en) ) ) ); }
    76757665    break;
     
    76787668
    76797669/* Line 1806 of yacc.c  */
     7670#line 1755 "parser.yy"
     7671    { (yyval.en) = new VarRefNode( (yyvsp[(1) - (2)].tok) ); }
     7672    break;
     7673
     7674  case 469:
     7675
     7676/* Line 1806 of yacc.c  */
    76807677#line 1761 "parser.yy"
    7681     { (yyval.en) = new VarRefNode( (yyvsp[(1) - (2)].tok) ); }
    7682     break;
    7683 
    7684   case 469:
    7685 
    7686 /* Line 1806 of yacc.c  */
    7687 #line 1767 "parser.yy"
    76887678    { (yyval.en) = (ExpressionNode *)( (yyvsp[(1) - (2)].en)->set_link( (yyvsp[(2) - (2)].en) )); }
    76897679    break;
     
    76927682
    76937683/* Line 1806 of yacc.c  */
    7694 #line 1775 "parser.yy"
     7684#line 1769 "parser.yy"
    76957685    { (yyval.en) = new DesignatorNode( new VarRefNode( (yyvsp[(1) - (1)].tok) ) ); }
    76967686    break;
     
    76997689
    77007690/* Line 1806 of yacc.c  */
    7701 #line 1777 "parser.yy"
     7691#line 1771 "parser.yy"
    77027692    { (yyval.en) = new DesignatorNode( new VarRefNode( (yyvsp[(2) - (2)].tok) ) ); }
    77037693    break;
     
    77067696
    77077697/* Line 1806 of yacc.c  */
     7698#line 1774 "parser.yy"
     7699    { (yyval.en) = new DesignatorNode( (yyvsp[(3) - (5)].en), true ); }
     7700    break;
     7701
     7702  case 473:
     7703
     7704/* Line 1806 of yacc.c  */
     7705#line 1776 "parser.yy"
     7706    { (yyval.en) = new DesignatorNode( (yyvsp[(3) - (5)].en), true ); }
     7707    break;
     7708
     7709  case 474:
     7710
     7711/* Line 1806 of yacc.c  */
     7712#line 1778 "parser.yy"
     7713    { (yyval.en) = new DesignatorNode( new CompositeExprNode( new OperatorNode( OperatorNode::Range ), (yyvsp[(3) - (7)].en), (yyvsp[(5) - (7)].en) ), true ); }
     7714    break;
     7715
     7716  case 475:
     7717
     7718/* Line 1806 of yacc.c  */
    77087719#line 1780 "parser.yy"
    7709     { (yyval.en) = new DesignatorNode( (yyvsp[(3) - (5)].en), true ); }
    7710     break;
    7711 
    7712   case 473:
    7713 
    7714 /* Line 1806 of yacc.c  */
    7715 #line 1782 "parser.yy"
    7716     { (yyval.en) = new DesignatorNode( (yyvsp[(3) - (5)].en), true ); }
    7717     break;
    7718 
    7719   case 474:
    7720 
    7721 /* Line 1806 of yacc.c  */
    7722 #line 1784 "parser.yy"
    7723     { (yyval.en) = new DesignatorNode( new CompositeExprNode2( build_opr2( OperatorNode::Range, (yyvsp[(3) - (7)].en), (yyvsp[(5) - (7)].en) ) ), true ); }
    7724     break;
    7725 
    7726   case 475:
    7727 
    7728 /* Line 1806 of yacc.c  */
    7729 #line 1786 "parser.yy"
    77307720    { (yyval.en) = new DesignatorNode( (yyvsp[(4) - (6)].en) ); }
    77317721    break;
     
    77347724
    77357725/* Line 1806 of yacc.c  */
    7736 #line 1810 "parser.yy"
     7726#line 1804 "parser.yy"
    77377727    { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); }
    77387728    break;
     
    77417731
    77427732/* Line 1806 of yacc.c  */
    7743 #line 1812 "parser.yy"
     7733#line 1806 "parser.yy"
    77447734    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
    77457735    break;
     
    77487738
    77497739/* Line 1806 of yacc.c  */
     7740#line 1808 "parser.yy"
     7741    { (yyval.decl) = (yyvsp[(1) - (3)].decl)->addQualifiers( (yyvsp[(2) - (3)].decl) )->addQualifiers( (yyvsp[(3) - (3)].decl) ); }
     7742    break;
     7743
     7744  case 481:
     7745
     7746/* Line 1806 of yacc.c  */
    77507747#line 1814 "parser.yy"
    7751     { (yyval.decl) = (yyvsp[(1) - (3)].decl)->addQualifiers( (yyvsp[(2) - (3)].decl) )->addQualifiers( (yyvsp[(3) - (3)].decl) ); }
    7752     break;
    7753 
    7754   case 481:
    7755 
    7756 /* Line 1806 of yacc.c  */
    7757 #line 1820 "parser.yy"
    77587748    { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); }
    77597749    break;
     
    77627752
    77637753/* Line 1806 of yacc.c  */
    7764 #line 1822 "parser.yy"
     7754#line 1816 "parser.yy"
    77657755    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
    77667756    break;
     
    77697759
    77707760/* Line 1806 of yacc.c  */
     7761#line 1821 "parser.yy"
     7762    { (yyval.decl) = DeclarationNode::newFromTypeGen( (yyvsp[(1) - (4)].tok), (yyvsp[(3) - (4)].en) ); }
     7763    break;
     7764
     7765  case 485:
     7766
     7767/* Line 1806 of yacc.c  */
    77717768#line 1827 "parser.yy"
    7772     { (yyval.decl) = DeclarationNode::newFromTypeGen( (yyvsp[(1) - (4)].tok), (yyvsp[(3) - (4)].en) ); }
    7773     break;
    7774 
    7775   case 485:
    7776 
    7777 /* Line 1806 of yacc.c  */
    7778 #line 1833 "parser.yy"
    77797769    { (yyval.decl) = (yyvsp[(1) - (4)].decl)->appendList( (yyvsp[(3) - (4)].decl) ); }
    77807770    break;
     
    77837773
    77847774/* Line 1806 of yacc.c  */
    7785 #line 1838 "parser.yy"
     7775#line 1832 "parser.yy"
    77867776    { typedefTable.addToEnclosingScope( *(yyvsp[(2) - (2)].tok), TypedefTable::TD ); }
    77877777    break;
     
    77907780
    77917781/* Line 1806 of yacc.c  */
     7782#line 1834 "parser.yy"
     7783    { (yyval.decl) = DeclarationNode::newTypeParam( (yyvsp[(1) - (4)].tclass), (yyvsp[(2) - (4)].tok) )->addAssertions( (yyvsp[(4) - (4)].decl) ); }
     7784    break;
     7785
     7786  case 489:
     7787
     7788/* Line 1806 of yacc.c  */
    77927789#line 1840 "parser.yy"
    7793     { (yyval.decl) = DeclarationNode::newTypeParam( (yyvsp[(1) - (4)].tclass), (yyvsp[(2) - (4)].tok) )->addAssertions( (yyvsp[(4) - (4)].decl) ); }
    7794     break;
    7795 
    7796   case 489:
    7797 
    7798 /* Line 1806 of yacc.c  */
    7799 #line 1846 "parser.yy"
    78007790    { (yyval.tclass) = DeclarationNode::Type; }
    78017791    break;
     
    78047794
    78057795/* Line 1806 of yacc.c  */
    7806 #line 1848 "parser.yy"
     7796#line 1842 "parser.yy"
    78077797    { (yyval.tclass) = DeclarationNode::Ftype; }
    78087798    break;
     
    78117801
    78127802/* Line 1806 of yacc.c  */
    7813 #line 1850 "parser.yy"
     7803#line 1844 "parser.yy"
    78147804    { (yyval.tclass) = DeclarationNode::Dtype; }
    78157805    break;
     
    78187808
    78197809/* Line 1806 of yacc.c  */
    7820 #line 1855 "parser.yy"
     7810#line 1849 "parser.yy"
    78217811    { (yyval.decl) = 0; }
    78227812    break;
     
    78257815
    78267816/* Line 1806 of yacc.c  */
    7827 #line 1857 "parser.yy"
     7817#line 1851 "parser.yy"
    78287818    { (yyval.decl) = (yyvsp[(1) - (2)].decl) != 0 ? (yyvsp[(1) - (2)].decl)->appendList( (yyvsp[(2) - (2)].decl) ) : (yyvsp[(2) - (2)].decl); }
    78297819    break;
     
    78327822
    78337823/* Line 1806 of yacc.c  */
    7834 #line 1862 "parser.yy"
     7824#line 1856 "parser.yy"
    78357825    {
    78367826                        typedefTable.openTrait( *(yyvsp[(2) - (5)].tok) );
     
    78427832
    78437833/* Line 1806 of yacc.c  */
    7844 #line 1867 "parser.yy"
     7834#line 1861 "parser.yy"
    78457835    { (yyval.decl) = (yyvsp[(4) - (5)].decl); }
    78467836    break;
     
    78497839
    78507840/* Line 1806 of yacc.c  */
    7851 #line 1869 "parser.yy"
     7841#line 1863 "parser.yy"
    78527842    { (yyval.decl) = 0; }
    78537843    break;
     
    78567846
    78577847/* Line 1806 of yacc.c  */
    7858 #line 1874 "parser.yy"
     7848#line 1868 "parser.yy"
    78597849    { (yyval.en) = new TypeValueNode( (yyvsp[(1) - (1)].decl) ); }
    78607850    break;
     
    78637853
    78647854/* Line 1806 of yacc.c  */
    7865 #line 1877 "parser.yy"
     7855#line 1871 "parser.yy"
    78667856    { (yyval.en) = (ExpressionNode *)( (yyvsp[(1) - (3)].en)->set_link( new TypeValueNode( (yyvsp[(3) - (3)].decl) ))); }
    78677857    break;
     
    78707860
    78717861/* Line 1806 of yacc.c  */
    7872 #line 1879 "parser.yy"
     7862#line 1873 "parser.yy"
    78737863    { (yyval.en) = (ExpressionNode *)( (yyvsp[(1) - (3)].en)->set_link( (yyvsp[(3) - (3)].en) )); }
    78747864    break;
     
    78777867
    78787868/* Line 1806 of yacc.c  */
    7879 #line 1884 "parser.yy"
     7869#line 1878 "parser.yy"
    78807870    { (yyval.decl) = (yyvsp[(2) - (2)].decl); }
    78817871    break;
     
    78847874
    78857875/* Line 1806 of yacc.c  */
    7886 #line 1886 "parser.yy"
     7876#line 1880 "parser.yy"
    78877877    { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addQualifiers( (yyvsp[(1) - (3)].decl) ); }
    78887878    break;
     
    78917881
    78927882/* Line 1806 of yacc.c  */
    7893 #line 1888 "parser.yy"
     7883#line 1882 "parser.yy"
    78947884    { (yyval.decl) = (yyvsp[(1) - (3)].decl)->appendList( (yyvsp[(3) - (3)].decl)->copyStorageClasses( (yyvsp[(1) - (3)].decl) ) ); }
    78957885    break;
     
    78987888
    78997889/* Line 1806 of yacc.c  */
    7900 #line 1893 "parser.yy"
     7890#line 1887 "parser.yy"
    79017891    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addAssertions( (yyvsp[(2) - (2)].decl) ); }
    79027892    break;
     
    79057895
    79067896/* Line 1806 of yacc.c  */
    7907 #line 1895 "parser.yy"
     7897#line 1889 "parser.yy"
    79087898    { (yyval.decl) = (yyvsp[(1) - (4)].decl)->addAssertions( (yyvsp[(2) - (4)].decl) )->addType( (yyvsp[(4) - (4)].decl) ); }
    79097899    break;
     
    79127902
    79137903/* Line 1806 of yacc.c  */
    7914 #line 1900 "parser.yy"
     7904#line 1894 "parser.yy"
    79157905    {
    79167906                        typedefTable.addToEnclosingScope( *(yyvsp[(1) - (1)].tok), TypedefTable::TD );
     
    79227912
    79237913/* Line 1806 of yacc.c  */
    7924 #line 1905 "parser.yy"
     7914#line 1899 "parser.yy"
    79257915    {
    79267916                        typedefTable.addToEnclosingScope( *(yyvsp[(1) - (6)].tok), TypedefTable::TG );
     
    79327922
    79337923/* Line 1806 of yacc.c  */
    7934 #line 1913 "parser.yy"
     7924#line 1907 "parser.yy"
    79357925    {
    79367926                        typedefTable.addToEnclosingScope( *(yyvsp[(2) - (9)].tok), TypedefTable::ID );
     
    79427932
    79437933/* Line 1806 of yacc.c  */
    7944 #line 1918 "parser.yy"
     7934#line 1912 "parser.yy"
    79457935    {
    79467936                        typedefTable.enterTrait( *(yyvsp[(2) - (8)].tok) );
     
    79527942
    79537943/* Line 1806 of yacc.c  */
    7954 #line 1923 "parser.yy"
     7944#line 1917 "parser.yy"
    79557945    {
    79567946                        typedefTable.leaveTrait();
     
    79637953
    79647954/* Line 1806 of yacc.c  */
    7965 #line 1933 "parser.yy"
     7955#line 1927 "parser.yy"
    79667956    { (yyval.decl) = (yyvsp[(1) - (3)].decl)->appendList( (yyvsp[(3) - (3)].decl) ); }
    79677957    break;
     
    79707960
    79717961/* Line 1806 of yacc.c  */
    7972 #line 1943 "parser.yy"
     7962#line 1937 "parser.yy"
    79737963    {
    79747964                        typedefTable.addToEnclosingScope2( TypedefTable::ID );
     
    79807970
    79817971/* Line 1806 of yacc.c  */
    7982 #line 1948 "parser.yy"
     7972#line 1942 "parser.yy"
    79837973    {
    79847974                        typedefTable.addToEnclosingScope2( TypedefTable::ID );
     
    79907980
    79917981/* Line 1806 of yacc.c  */
    7992 #line 1953 "parser.yy"
     7982#line 1947 "parser.yy"
    79937983    {
    79947984                        typedefTable.addToEnclosingScope2( *(yyvsp[(5) - (5)].tok), TypedefTable::ID );
     
    80007990
    80017991/* Line 1806 of yacc.c  */
    8002 #line 1961 "parser.yy"
     7992#line 1955 "parser.yy"
    80037993    {
    80047994                        typedefTable.addToEnclosingScope2( TypedefTable::ID );
     
    80108000
    80118001/* Line 1806 of yacc.c  */
    8012 #line 1966 "parser.yy"
     8002#line 1960 "parser.yy"
    80138003    {
    80148004                        typedefTable.addToEnclosingScope2( TypedefTable::ID );
     
    80208010
    80218011/* Line 1806 of yacc.c  */
    8022 #line 1976 "parser.yy"
     8012#line 1970 "parser.yy"
    80238013    {}
    80248014    break;
     
    80278017
    80288018/* Line 1806 of yacc.c  */
    8029 #line 1978 "parser.yy"
     8019#line 1972 "parser.yy"
    80308020    {
    80318021                        if ( theTree ) {
     
    80408030
    80418031/* Line 1806 of yacc.c  */
    8042 #line 1990 "parser.yy"
     8032#line 1984 "parser.yy"
    80438033    { (yyval.decl) = ( (yyvsp[(1) - (3)].decl) != NULL ) ? (yyvsp[(1) - (3)].decl)->appendList( (yyvsp[(3) - (3)].decl) ) : (yyvsp[(3) - (3)].decl); }
    80448034    break;
     
    80478037
    80488038/* Line 1806 of yacc.c  */
    8049 #line 1995 "parser.yy"
     8039#line 1989 "parser.yy"
    80508040    { (yyval.decl) = 0; }
    80518041    break;
     
    80548044
    80558045/* Line 1806 of yacc.c  */
    8056 #line 2003 "parser.yy"
     8046#line 1997 "parser.yy"
    80578047    {}
    80588048    break;
     
    80618051
    80628052/* Line 1806 of yacc.c  */
    8063 #line 2005 "parser.yy"
     8053#line 1999 "parser.yy"
    80648054    {
    80658055                        linkageStack.push( linkage );
     
    80718061
    80728062/* Line 1806 of yacc.c  */
    8073 #line 2010 "parser.yy"
     8063#line 2004 "parser.yy"
    80748064    {
    80758065                        linkage = linkageStack.top();
     
    80828072
    80838073/* Line 1806 of yacc.c  */
    8084 #line 2016 "parser.yy"
     8074#line 2010 "parser.yy"
    80858075    {   // mark all fields in list
    80868076                        for ( DeclarationNode *iter = (yyvsp[(2) - (2)].decl); iter != NULL; iter = (DeclarationNode *)iter->get_link() )
     
    80938083
    80948084/* Line 1806 of yacc.c  */
    8095 #line 2031 "parser.yy"
     8085#line 2025 "parser.yy"
    80968086    {
    80978087                        typedefTable.addToEnclosingScope( TypedefTable::ID );
     
    81048094
    81058095/* Line 1806 of yacc.c  */
    8106 #line 2037 "parser.yy"
     8096#line 2031 "parser.yy"
    81078097    {
    81088098                        typedefTable.addToEnclosingScope( TypedefTable::ID );
     
    81158105
    81168106/* Line 1806 of yacc.c  */
    8117 #line 2046 "parser.yy"
     8107#line 2040 "parser.yy"
    81188108    {
    81198109                        typedefTable.addToEnclosingScope( TypedefTable::ID );
     
    81268116
    81278117/* Line 1806 of yacc.c  */
    8128 #line 2052 "parser.yy"
     8118#line 2046 "parser.yy"
    81298119    {
    81308120                        typedefTable.addToEnclosingScope( TypedefTable::ID );
     
    81358125
    81368126  case 537:
     8127
     8128/* Line 1806 of yacc.c  */
     8129#line 2052 "parser.yy"
     8130    {
     8131                        typedefTable.addToEnclosingScope( TypedefTable::ID );
     8132                        typedefTable.leaveScope();
     8133                        (yyval.decl) = (yyvsp[(2) - (3)].decl)->addFunctionBody( (yyvsp[(3) - (3)].sn) )->addQualifiers( (yyvsp[(1) - (3)].decl) );
     8134                }
     8135    break;
     8136
     8137  case 538:
    81378138
    81388139/* Line 1806 of yacc.c  */
     
    81458146    break;
    81468147
    8147   case 538:
     8148  case 539:
    81488149
    81498150/* Line 1806 of yacc.c  */
    81508151#line 2064 "parser.yy"
    8151     {
    8152                         typedefTable.addToEnclosingScope( TypedefTable::ID );
    8153                         typedefTable.leaveScope();
    8154                         (yyval.decl) = (yyvsp[(2) - (3)].decl)->addFunctionBody( (yyvsp[(3) - (3)].sn) )->addQualifiers( (yyvsp[(1) - (3)].decl) );
    8155                 }
    8156     break;
    8157 
    8158   case 539:
    8159 
    8160 /* Line 1806 of yacc.c  */
    8161 #line 2070 "parser.yy"
    81628152    {
    81638153                        typedefTable.addToEnclosingScope( TypedefTable::ID );
     
    81708160
    81718161/* Line 1806 of yacc.c  */
    8172 #line 2078 "parser.yy"
     8162#line 2072 "parser.yy"
    81738163    {
    81748164                        typedefTable.addToEnclosingScope( TypedefTable::ID );
     
    81818171
    81828172/* Line 1806 of yacc.c  */
    8183 #line 2084 "parser.yy"
     8173#line 2078 "parser.yy"
    81848174    {
    81858175                        typedefTable.addToEnclosingScope( TypedefTable::ID );
     
    81928182
    81938183/* Line 1806 of yacc.c  */
    8194 #line 2092 "parser.yy"
     8184#line 2086 "parser.yy"
    81958185    {
    81968186                        typedefTable.addToEnclosingScope( TypedefTable::ID );
     
    82038193
    82048194/* Line 1806 of yacc.c  */
    8205 #line 2098 "parser.yy"
     8195#line 2092 "parser.yy"
    82068196    {
    82078197                        typedefTable.addToEnclosingScope( TypedefTable::ID );
     
    82148204
    82158205/* Line 1806 of yacc.c  */
    8216 #line 2113 "parser.yy"
    8217     { (yyval.en) = new CompositeExprNode2( build_opr2( OperatorNode::Range, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
     8206#line 2107 "parser.yy"
     8207    { (yyval.en) = new CompositeExprNode( new OperatorNode( OperatorNode::Range ), (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ); }
    82188208    break;
    82198209
     
    82218211
    82228212/* Line 1806 of yacc.c  */
    8223 #line 2123 "parser.yy"
     8213#line 2117 "parser.yy"
    82248214    { (yyval.decl) = 0; }
    82258215    break;
     
    82288218
    82298219/* Line 1806 of yacc.c  */
     8220#line 2124 "parser.yy"
     8221    { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); }
     8222    break;
     8223
     8224  case 554:
     8225
     8226/* Line 1806 of yacc.c  */
    82308227#line 2130 "parser.yy"
    8231     { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); }
    8232     break;
    8233 
    8234   case 554:
    8235 
    8236 /* Line 1806 of yacc.c  */
    8237 #line 2136 "parser.yy"
    82388228    { (yyval.decl) = 0; }
    82398229    break;
     
    82428232
    82438233/* Line 1806 of yacc.c  */
    8244 #line 2151 "parser.yy"
     8234#line 2145 "parser.yy"
    82458235    {}
    82468236    break;
     
    82498239
    82508240/* Line 1806 of yacc.c  */
    8251 #line 2152 "parser.yy"
     8241#line 2146 "parser.yy"
    82528242    {}
    82538243    break;
     
    82568246
    82578247/* Line 1806 of yacc.c  */
    8258 #line 2153 "parser.yy"
     8248#line 2147 "parser.yy"
    82598249    {}
    82608250    break;
     
    82638253
    82648254/* Line 1806 of yacc.c  */
    8265 #line 2154 "parser.yy"
     8255#line 2148 "parser.yy"
    82668256    {}
    82678257    break;
     
    82708260
    82718261/* Line 1806 of yacc.c  */
    8272 #line 2189 "parser.yy"
     8262#line 2183 "parser.yy"
    82738263    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
    82748264    break;
     
    82778267
    82788268/* Line 1806 of yacc.c  */
    8279 #line 2192 "parser.yy"
     8269#line 2186 "parser.yy"
    82808270    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
    82818271    break;
     
    82848274
    82858275/* Line 1806 of yacc.c  */
    8286 #line 2194 "parser.yy"
     8276#line 2188 "parser.yy"
    82878277    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
    82888278    break;
     
    82918281
    82928282/* Line 1806 of yacc.c  */
    8293 #line 2199 "parser.yy"
     8283#line 2193 "parser.yy"
    82948284    {
    82958285                        typedefTable.setNextIdentifier( *(yyvsp[(1) - (1)].tok) );
     
    83018291
    83028292/* Line 1806 of yacc.c  */
    8303 #line 2204 "parser.yy"
     8293#line 2198 "parser.yy"
    83048294    { (yyval.decl) = (yyvsp[(2) - (3)].decl); }
    83058295    break;
     
    83088298
    83098299/* Line 1806 of yacc.c  */
    8310 #line 2209 "parser.yy"
     8300#line 2203 "parser.yy"
    83118301    { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); }
    83128302    break;
     
    83158305
    83168306/* Line 1806 of yacc.c  */
    8317 #line 2211 "parser.yy"
     8307#line 2205 "parser.yy"
    83188308    { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[(2) - (3)].decl) ) ); }
    83198309    break;
     
    83228312
    83238313/* Line 1806 of yacc.c  */
    8324 #line 2213 "parser.yy"
     8314#line 2207 "parser.yy"
    83258315    { (yyval.decl) = (yyvsp[(2) - (3)].decl); }
    83268316    break;
     
    83298319
    83308320/* Line 1806 of yacc.c  */
     8321#line 2212 "parser.yy"
     8322    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addArray( (yyvsp[(2) - (2)].decl) ); }
     8323    break;
     8324
     8325  case 574:
     8326
     8327/* Line 1806 of yacc.c  */
     8328#line 2214 "parser.yy"
     8329    { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); }
     8330    break;
     8331
     8332  case 575:
     8333
     8334/* Line 1806 of yacc.c  */
     8335#line 2216 "parser.yy"
     8336    { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); }
     8337    break;
     8338
     8339  case 576:
     8340
     8341/* Line 1806 of yacc.c  */
    83318342#line 2218 "parser.yy"
     8343    { (yyval.decl) = (yyvsp[(2) - (3)].decl); }
     8344    break;
     8345
     8346  case 577:
     8347
     8348/* Line 1806 of yacc.c  */
     8349#line 2223 "parser.yy"
     8350    { (yyval.decl) = (yyvsp[(2) - (8)].decl)->addParamList( (yyvsp[(6) - (8)].decl) ); }
     8351    break;
     8352
     8353  case 578:
     8354
     8355/* Line 1806 of yacc.c  */
     8356#line 2225 "parser.yy"
     8357    { (yyval.decl) = (yyvsp[(2) - (3)].decl); }
     8358    break;
     8359
     8360  case 579:
     8361
     8362/* Line 1806 of yacc.c  */
     8363#line 2234 "parser.yy"
     8364    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
     8365    break;
     8366
     8367  case 581:
     8368
     8369/* Line 1806 of yacc.c  */
     8370#line 2237 "parser.yy"
     8371    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
     8372    break;
     8373
     8374  case 582:
     8375
     8376/* Line 1806 of yacc.c  */
     8377#line 2242 "parser.yy"
     8378    { (yyval.decl) = (yyvsp[(1) - (6)].decl)->addParamList( (yyvsp[(4) - (6)].decl) ); }
     8379    break;
     8380
     8381  case 583:
     8382
     8383/* Line 1806 of yacc.c  */
     8384#line 2244 "parser.yy"
     8385    { (yyval.decl) = (yyvsp[(2) - (8)].decl)->addParamList( (yyvsp[(6) - (8)].decl) ); }
     8386    break;
     8387
     8388  case 584:
     8389
     8390/* Line 1806 of yacc.c  */
     8391#line 2246 "parser.yy"
     8392    { (yyval.decl) = (yyvsp[(2) - (3)].decl); }
     8393    break;
     8394
     8395  case 585:
     8396
     8397/* Line 1806 of yacc.c  */
     8398#line 2251 "parser.yy"
     8399    { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); }
     8400    break;
     8401
     8402  case 586:
     8403
     8404/* Line 1806 of yacc.c  */
     8405#line 2253 "parser.yy"
     8406    { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[(2) - (3)].decl) ) ); }
     8407    break;
     8408
     8409  case 587:
     8410
     8411/* Line 1806 of yacc.c  */
     8412#line 2255 "parser.yy"
     8413    { (yyval.decl) = (yyvsp[(2) - (3)].decl); }
     8414    break;
     8415
     8416  case 588:
     8417
     8418/* Line 1806 of yacc.c  */
     8419#line 2260 "parser.yy"
     8420    { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); }
     8421    break;
     8422
     8423  case 589:
     8424
     8425/* Line 1806 of yacc.c  */
     8426#line 2262 "parser.yy"
     8427    { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); }
     8428    break;
     8429
     8430  case 590:
     8431
     8432/* Line 1806 of yacc.c  */
     8433#line 2264 "parser.yy"
     8434    { (yyval.decl) = (yyvsp[(2) - (3)].decl); }
     8435    break;
     8436
     8437  case 594:
     8438
     8439/* Line 1806 of yacc.c  */
     8440#line 2279 "parser.yy"
     8441    { (yyval.decl) = (yyvsp[(1) - (4)].decl)->addIdList( (yyvsp[(3) - (4)].decl) ); }
     8442    break;
     8443
     8444  case 595:
     8445
     8446/* Line 1806 of yacc.c  */
     8447#line 2281 "parser.yy"
     8448    { (yyval.decl) = (yyvsp[(2) - (6)].decl)->addIdList( (yyvsp[(5) - (6)].decl) ); }
     8449    break;
     8450
     8451  case 596:
     8452
     8453/* Line 1806 of yacc.c  */
     8454#line 2283 "parser.yy"
     8455    { (yyval.decl) = (yyvsp[(2) - (3)].decl); }
     8456    break;
     8457
     8458  case 597:
     8459
     8460/* Line 1806 of yacc.c  */
     8461#line 2288 "parser.yy"
     8462    { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); }
     8463    break;
     8464
     8465  case 598:
     8466
     8467/* Line 1806 of yacc.c  */
     8468#line 2290 "parser.yy"
     8469    { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[(2) - (3)].decl) ) ); }
     8470    break;
     8471
     8472  case 599:
     8473
     8474/* Line 1806 of yacc.c  */
     8475#line 2292 "parser.yy"
     8476    { (yyval.decl) = (yyvsp[(2) - (3)].decl); }
     8477    break;
     8478
     8479  case 600:
     8480
     8481/* Line 1806 of yacc.c  */
     8482#line 2297 "parser.yy"
     8483    { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); }
     8484    break;
     8485
     8486  case 601:
     8487
     8488/* Line 1806 of yacc.c  */
     8489#line 2299 "parser.yy"
     8490    { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); }
     8491    break;
     8492
     8493  case 602:
     8494
     8495/* Line 1806 of yacc.c  */
     8496#line 2301 "parser.yy"
     8497    { (yyval.decl) = (yyvsp[(2) - (3)].decl); }
     8498    break;
     8499
     8500  case 603:
     8501
     8502/* Line 1806 of yacc.c  */
     8503#line 2316 "parser.yy"
     8504    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
     8505    break;
     8506
     8507  case 605:
     8508
     8509/* Line 1806 of yacc.c  */
     8510#line 2319 "parser.yy"
     8511    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
     8512    break;
     8513
     8514  case 606:
     8515
     8516/* Line 1806 of yacc.c  */
     8517#line 2321 "parser.yy"
     8518    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
     8519    break;
     8520
     8521  case 608:
     8522
     8523/* Line 1806 of yacc.c  */
     8524#line 2327 "parser.yy"
     8525    { (yyval.decl) = (yyvsp[(2) - (3)].decl); }
     8526    break;
     8527
     8528  case 609:
     8529
     8530/* Line 1806 of yacc.c  */
     8531#line 2332 "parser.yy"
     8532    { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); }
     8533    break;
     8534
     8535  case 610:
     8536
     8537/* Line 1806 of yacc.c  */
     8538#line 2334 "parser.yy"
     8539    { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[(2) - (3)].decl) ) ); }
     8540    break;
     8541
     8542  case 611:
     8543
     8544/* Line 1806 of yacc.c  */
     8545#line 2336 "parser.yy"
     8546    { (yyval.decl) = (yyvsp[(2) - (3)].decl); }
     8547    break;
     8548
     8549  case 612:
     8550
     8551/* Line 1806 of yacc.c  */
     8552#line 2341 "parser.yy"
    83328553    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addArray( (yyvsp[(2) - (2)].decl) ); }
    83338554    break;
    83348555
    8335   case 574:
    8336 
    8337 /* Line 1806 of yacc.c  */
    8338 #line 2220 "parser.yy"
     8556  case 613:
     8557
     8558/* Line 1806 of yacc.c  */
     8559#line 2343 "parser.yy"
    83398560    { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); }
    83408561    break;
    83418562
    8342   case 575:
    8343 
    8344 /* Line 1806 of yacc.c  */
    8345 #line 2222 "parser.yy"
     8563  case 614:
     8564
     8565/* Line 1806 of yacc.c  */
     8566#line 2345 "parser.yy"
    83468567    { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); }
    83478568    break;
    83488569
    8349   case 576:
    8350 
    8351 /* Line 1806 of yacc.c  */
    8352 #line 2224 "parser.yy"
     8570  case 615:
     8571
     8572/* Line 1806 of yacc.c  */
     8573#line 2347 "parser.yy"
    83538574    { (yyval.decl) = (yyvsp[(2) - (3)].decl); }
    83548575    break;
    83558576
    8356   case 577:
    8357 
    8358 /* Line 1806 of yacc.c  */
    8359 #line 2229 "parser.yy"
     8577  case 616:
     8578
     8579/* Line 1806 of yacc.c  */
     8580#line 2352 "parser.yy"
     8581    { (yyval.decl) = (yyvsp[(1) - (6)].decl)->addParamList( (yyvsp[(4) - (6)].decl) ); }
     8582    break;
     8583
     8584  case 617:
     8585
     8586/* Line 1806 of yacc.c  */
     8587#line 2354 "parser.yy"
    83608588    { (yyval.decl) = (yyvsp[(2) - (8)].decl)->addParamList( (yyvsp[(6) - (8)].decl) ); }
    83618589    break;
    83628590
    8363   case 578:
    8364 
    8365 /* Line 1806 of yacc.c  */
    8366 #line 2231 "parser.yy"
     8591  case 618:
     8592
     8593/* Line 1806 of yacc.c  */
     8594#line 2356 "parser.yy"
    83678595    { (yyval.decl) = (yyvsp[(2) - (3)].decl); }
    83688596    break;
    83698597
    8370   case 579:
    8371 
    8372 /* Line 1806 of yacc.c  */
    8373 #line 2240 "parser.yy"
     8598  case 619:
     8599
     8600/* Line 1806 of yacc.c  */
     8601#line 2366 "parser.yy"
    83748602    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
    83758603    break;
    83768604
    8377   case 581:
    8378 
    8379 /* Line 1806 of yacc.c  */
    8380 #line 2243 "parser.yy"
     8605  case 621:
     8606
     8607/* Line 1806 of yacc.c  */
     8608#line 2369 "parser.yy"
    83818609    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
    83828610    break;
    83838611
    8384   case 582:
    8385 
    8386 /* Line 1806 of yacc.c  */
    8387 #line 2248 "parser.yy"
     8612  case 622:
     8613
     8614/* Line 1806 of yacc.c  */
     8615#line 2371 "parser.yy"
     8616    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
     8617    break;
     8618
     8619  case 623:
     8620
     8621/* Line 1806 of yacc.c  */
     8622#line 2376 "parser.yy"
     8623    { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); }
     8624    break;
     8625
     8626  case 624:
     8627
     8628/* Line 1806 of yacc.c  */
     8629#line 2378 "parser.yy"
     8630    { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[(2) - (3)].decl) ) ); }
     8631    break;
     8632
     8633  case 625:
     8634
     8635/* Line 1806 of yacc.c  */
     8636#line 2380 "parser.yy"
     8637    { (yyval.decl) = (yyvsp[(2) - (3)].decl); }
     8638    break;
     8639
     8640  case 626:
     8641
     8642/* Line 1806 of yacc.c  */
     8643#line 2385 "parser.yy"
     8644    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addArray( (yyvsp[(2) - (2)].decl) ); }
     8645    break;
     8646
     8647  case 627:
     8648
     8649/* Line 1806 of yacc.c  */
     8650#line 2387 "parser.yy"
     8651    { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); }
     8652    break;
     8653
     8654  case 628:
     8655
     8656/* Line 1806 of yacc.c  */
     8657#line 2389 "parser.yy"
     8658    { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); }
     8659    break;
     8660
     8661  case 629:
     8662
     8663/* Line 1806 of yacc.c  */
     8664#line 2391 "parser.yy"
     8665    { (yyval.decl) = (yyvsp[(2) - (3)].decl); }
     8666    break;
     8667
     8668  case 630:
     8669
     8670/* Line 1806 of yacc.c  */
     8671#line 2396 "parser.yy"
    83888672    { (yyval.decl) = (yyvsp[(1) - (6)].decl)->addParamList( (yyvsp[(4) - (6)].decl) ); }
    83898673    break;
    83908674
    8391   case 583:
    8392 
    8393 /* Line 1806 of yacc.c  */
    8394 #line 2250 "parser.yy"
     8675  case 631:
     8676
     8677/* Line 1806 of yacc.c  */
     8678#line 2398 "parser.yy"
    83958679    { (yyval.decl) = (yyvsp[(2) - (8)].decl)->addParamList( (yyvsp[(6) - (8)].decl) ); }
    83968680    break;
    83978681
    8398   case 584:
    8399 
    8400 /* Line 1806 of yacc.c  */
    8401 #line 2252 "parser.yy"
     8682  case 632:
     8683
     8684/* Line 1806 of yacc.c  */
     8685#line 2400 "parser.yy"
    84028686    { (yyval.decl) = (yyvsp[(2) - (3)].decl); }
    84038687    break;
    84048688
    8405   case 585:
    8406 
    8407 /* Line 1806 of yacc.c  */
    8408 #line 2257 "parser.yy"
    8409     { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); }
    8410     break;
    8411 
    8412   case 586:
    8413 
    8414 /* Line 1806 of yacc.c  */
    8415 #line 2259 "parser.yy"
    8416     { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[(2) - (3)].decl) ) ); }
    8417     break;
    8418 
    8419   case 587:
    8420 
    8421 /* Line 1806 of yacc.c  */
    8422 #line 2261 "parser.yy"
    8423     { (yyval.decl) = (yyvsp[(2) - (3)].decl); }
    8424     break;
    8425 
    8426   case 588:
    8427 
    8428 /* Line 1806 of yacc.c  */
    8429 #line 2266 "parser.yy"
    8430     { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); }
    8431     break;
    8432 
    8433   case 589:
    8434 
    8435 /* Line 1806 of yacc.c  */
    8436 #line 2268 "parser.yy"
    8437     { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); }
    8438     break;
    8439 
    8440   case 590:
    8441 
    8442 /* Line 1806 of yacc.c  */
    8443 #line 2270 "parser.yy"
    8444     { (yyval.decl) = (yyvsp[(2) - (3)].decl); }
    8445     break;
    8446 
    8447   case 594:
    8448 
    8449 /* Line 1806 of yacc.c  */
    8450 #line 2285 "parser.yy"
    8451     { (yyval.decl) = (yyvsp[(1) - (4)].decl)->addIdList( (yyvsp[(3) - (4)].decl) ); }
    8452     break;
    8453 
    8454   case 595:
    8455 
    8456 /* Line 1806 of yacc.c  */
    8457 #line 2287 "parser.yy"
    8458     { (yyval.decl) = (yyvsp[(2) - (6)].decl)->addIdList( (yyvsp[(5) - (6)].decl) ); }
    8459     break;
    8460 
    8461   case 596:
    8462 
    8463 /* Line 1806 of yacc.c  */
    8464 #line 2289 "parser.yy"
    8465     { (yyval.decl) = (yyvsp[(2) - (3)].decl); }
    8466     break;
    8467 
    8468   case 597:
    8469 
    8470 /* Line 1806 of yacc.c  */
    8471 #line 2294 "parser.yy"
    8472     { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); }
    8473     break;
    8474 
    8475   case 598:
    8476 
    8477 /* Line 1806 of yacc.c  */
    8478 #line 2296 "parser.yy"
    8479     { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[(2) - (3)].decl) ) ); }
    8480     break;
    8481 
    8482   case 599:
    8483 
    8484 /* Line 1806 of yacc.c  */
    8485 #line 2298 "parser.yy"
    8486     { (yyval.decl) = (yyvsp[(2) - (3)].decl); }
    8487     break;
    8488 
    8489   case 600:
    8490 
    8491 /* Line 1806 of yacc.c  */
    8492 #line 2303 "parser.yy"
    8493     { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); }
    8494     break;
    8495 
    8496   case 601:
    8497 
    8498 /* Line 1806 of yacc.c  */
    8499 #line 2305 "parser.yy"
    8500     { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); }
    8501     break;
    8502 
    8503   case 602:
    8504 
    8505 /* Line 1806 of yacc.c  */
    8506 #line 2307 "parser.yy"
    8507     { (yyval.decl) = (yyvsp[(2) - (3)].decl); }
    8508     break;
    8509 
    8510   case 603:
    8511 
    8512 /* Line 1806 of yacc.c  */
    8513 #line 2322 "parser.yy"
     8689  case 633:
     8690
     8691/* Line 1806 of yacc.c  */
     8692#line 2431 "parser.yy"
    85148693    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
    85158694    break;
    85168695
    8517   case 605:
    8518 
    8519 /* Line 1806 of yacc.c  */
    8520 #line 2325 "parser.yy"
     8696  case 635:
     8697
     8698/* Line 1806 of yacc.c  */
     8699#line 2434 "parser.yy"
    85218700    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
    85228701    break;
    85238702
    8524   case 606:
    8525 
    8526 /* Line 1806 of yacc.c  */
    8527 #line 2327 "parser.yy"
     8703  case 636:
     8704
     8705/* Line 1806 of yacc.c  */
     8706#line 2436 "parser.yy"
    85288707    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
    85298708    break;
    85308709
    8531   case 608:
    8532 
    8533 /* Line 1806 of yacc.c  */
    8534 #line 2333 "parser.yy"
    8535     { (yyval.decl) = (yyvsp[(2) - (3)].decl); }
    8536     break;
    8537 
    8538   case 609:
    8539 
    8540 /* Line 1806 of yacc.c  */
    8541 #line 2338 "parser.yy"
    8542     { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); }
    8543     break;
    8544 
    8545   case 610:
    8546 
    8547 /* Line 1806 of yacc.c  */
    8548 #line 2340 "parser.yy"
    8549     { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[(2) - (3)].decl) ) ); }
    8550     break;
    8551 
    8552   case 611:
    8553 
    8554 /* Line 1806 of yacc.c  */
    8555 #line 2342 "parser.yy"
    8556     { (yyval.decl) = (yyvsp[(2) - (3)].decl); }
    8557     break;
    8558 
    8559   case 612:
    8560 
    8561 /* Line 1806 of yacc.c  */
    8562 #line 2347 "parser.yy"
    8563     { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addArray( (yyvsp[(2) - (2)].decl) ); }
    8564     break;
    8565 
    8566   case 613:
    8567 
    8568 /* Line 1806 of yacc.c  */
    8569 #line 2349 "parser.yy"
    8570     { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); }
    8571     break;
    8572 
    8573   case 614:
    8574 
    8575 /* Line 1806 of yacc.c  */
    8576 #line 2351 "parser.yy"
    8577     { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); }
    8578     break;
    8579 
    8580   case 615:
    8581 
    8582 /* Line 1806 of yacc.c  */
    8583 #line 2353 "parser.yy"
    8584     { (yyval.decl) = (yyvsp[(2) - (3)].decl); }
    8585     break;
    8586 
    8587   case 616:
    8588 
    8589 /* Line 1806 of yacc.c  */
    8590 #line 2358 "parser.yy"
    8591     { (yyval.decl) = (yyvsp[(1) - (6)].decl)->addParamList( (yyvsp[(4) - (6)].decl) ); }
    8592     break;
    8593 
    8594   case 617:
    8595 
    8596 /* Line 1806 of yacc.c  */
    8597 #line 2360 "parser.yy"
    8598     { (yyval.decl) = (yyvsp[(2) - (8)].decl)->addParamList( (yyvsp[(6) - (8)].decl) ); }
    8599     break;
    8600 
    8601   case 618:
    8602 
    8603 /* Line 1806 of yacc.c  */
    8604 #line 2362 "parser.yy"
    8605     { (yyval.decl) = (yyvsp[(2) - (3)].decl); }
    8606     break;
    8607 
    8608   case 619:
    8609 
    8610 /* Line 1806 of yacc.c  */
    8611 #line 2372 "parser.yy"
    8612     { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
    8613     break;
    8614 
    8615   case 621:
    8616 
    8617 /* Line 1806 of yacc.c  */
    8618 #line 2375 "parser.yy"
    8619     { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
    8620     break;
    8621 
    8622   case 622:
    8623 
    8624 /* Line 1806 of yacc.c  */
    8625 #line 2377 "parser.yy"
    8626     { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
    8627     break;
    8628 
    8629   case 623:
    8630 
    8631 /* Line 1806 of yacc.c  */
    8632 #line 2382 "parser.yy"
    8633     { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); }
    8634     break;
    8635 
    8636   case 624:
    8637 
    8638 /* Line 1806 of yacc.c  */
    8639 #line 2384 "parser.yy"
    8640     { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[(2) - (3)].decl) ) ); }
    8641     break;
    8642 
    8643   case 625:
    8644 
    8645 /* Line 1806 of yacc.c  */
    8646 #line 2386 "parser.yy"
    8647     { (yyval.decl) = (yyvsp[(2) - (3)].decl); }
    8648     break;
    8649 
    8650   case 626:
    8651 
    8652 /* Line 1806 of yacc.c  */
    8653 #line 2391 "parser.yy"
    8654     { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addArray( (yyvsp[(2) - (2)].decl) ); }
    8655     break;
    8656 
    8657   case 627:
    8658 
    8659 /* Line 1806 of yacc.c  */
    8660 #line 2393 "parser.yy"
    8661     { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); }
    8662     break;
    8663 
    8664   case 628:
    8665 
    8666 /* Line 1806 of yacc.c  */
    8667 #line 2395 "parser.yy"
    8668     { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); }
    8669     break;
    8670 
    8671   case 629:
    8672 
    8673 /* Line 1806 of yacc.c  */
    8674 #line 2397 "parser.yy"
    8675     { (yyval.decl) = (yyvsp[(2) - (3)].decl); }
    8676     break;
    8677 
    8678   case 630:
    8679 
    8680 /* Line 1806 of yacc.c  */
    8681 #line 2402 "parser.yy"
    8682     { (yyval.decl) = (yyvsp[(1) - (6)].decl)->addParamList( (yyvsp[(4) - (6)].decl) ); }
    8683     break;
    8684 
    8685   case 631:
    8686 
    8687 /* Line 1806 of yacc.c  */
    8688 #line 2404 "parser.yy"
    8689     { (yyval.decl) = (yyvsp[(2) - (8)].decl)->addParamList( (yyvsp[(6) - (8)].decl) ); }
    8690     break;
    8691 
    8692   case 632:
    8693 
    8694 /* Line 1806 of yacc.c  */
    8695 #line 2406 "parser.yy"
    8696     { (yyval.decl) = (yyvsp[(2) - (3)].decl); }
    8697     break;
    8698 
    8699   case 633:
    8700 
    8701 /* Line 1806 of yacc.c  */
    8702 #line 2437 "parser.yy"
    8703     { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
    8704     break;
    8705 
    8706   case 635:
    8707 
    8708 /* Line 1806 of yacc.c  */
    8709 #line 2440 "parser.yy"
    8710     { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
    8711     break;
    8712 
    8713   case 636:
    8714 
    8715 /* Line 1806 of yacc.c  */
    8716 #line 2442 "parser.yy"
    8717     { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
    8718     break;
    8719 
    87208710  case 637:
    87218711
    87228712/* Line 1806 of yacc.c  */
    8723 #line 2447 "parser.yy"
     8713#line 2441 "parser.yy"
    87248714    {
    87258715                        typedefTable.setNextIdentifier( *(yyvsp[(1) - (1)].tok) );
     
    87318721
    87328722/* Line 1806 of yacc.c  */
    8733 #line 2452 "parser.yy"
     8723#line 2446 "parser.yy"
    87348724    {
    87358725                        typedefTable.setNextIdentifier( *(yyvsp[(1) - (1)].tok) );
     
    87418731
    87428732/* Line 1806 of yacc.c  */
    8743 #line 2460 "parser.yy"
     8733#line 2454 "parser.yy"
    87448734    { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); }
    87458735    break;
     
    87488738
    87498739/* Line 1806 of yacc.c  */
    8750 #line 2462 "parser.yy"
     8740#line 2456 "parser.yy"
    87518741    { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[(2) - (3)].decl) ) ); }
    87528742    break;
     
    87558745
    87568746/* Line 1806 of yacc.c  */
    8757 #line 2464 "parser.yy"
     8747#line 2458 "parser.yy"
    87588748    { (yyval.decl) = (yyvsp[(2) - (3)].decl); }
    87598749    break;
     
    87628752
    87638753/* Line 1806 of yacc.c  */
    8764 #line 2469 "parser.yy"
     8754#line 2463 "parser.yy"
    87658755    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addArray( (yyvsp[(2) - (2)].decl) ); }
    87668756    break;
     
    87698759
    87708760/* Line 1806 of yacc.c  */
    8771 #line 2471 "parser.yy"
     8761#line 2465 "parser.yy"
    87728762    { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); }
    87738763    break;
     
    87768766
    87778767/* Line 1806 of yacc.c  */
    8778 #line 2476 "parser.yy"
     8768#line 2470 "parser.yy"
    87798769    { (yyval.decl) = (yyvsp[(1) - (6)].decl)->addParamList( (yyvsp[(4) - (6)].decl) ); }
    87808770    break;
     
    87838773
    87848774/* Line 1806 of yacc.c  */
    8785 #line 2478 "parser.yy"
     8775#line 2472 "parser.yy"
    87868776    { (yyval.decl) = (yyvsp[(2) - (8)].decl)->addParamList( (yyvsp[(6) - (8)].decl) ); }
    87878777    break;
     
    87908780
    87918781/* Line 1806 of yacc.c  */
    8792 #line 2493 "parser.yy"
     8782#line 2487 "parser.yy"
    87938783    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
    87948784    break;
     
    87978787
    87988788/* Line 1806 of yacc.c  */
    8799 #line 2495 "parser.yy"
     8789#line 2489 "parser.yy"
    88008790    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
    88018791    break;
     
    88048794
    88058795/* Line 1806 of yacc.c  */
     8796#line 2494 "parser.yy"
     8797    { (yyval.decl) = DeclarationNode::newPointer( 0 ); }
     8798    break;
     8799
     8800  case 650:
     8801
     8802/* Line 1806 of yacc.c  */
     8803#line 2496 "parser.yy"
     8804    { (yyval.decl) = DeclarationNode::newPointer( (yyvsp[(2) - (2)].decl) ); }
     8805    break;
     8806
     8807  case 651:
     8808
     8809/* Line 1806 of yacc.c  */
     8810#line 2498 "parser.yy"
     8811    { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); }
     8812    break;
     8813
     8814  case 652:
     8815
     8816/* Line 1806 of yacc.c  */
    88068817#line 2500 "parser.yy"
     8818    { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[(2) - (3)].decl) ) ); }
     8819    break;
     8820
     8821  case 653:
     8822
     8823/* Line 1806 of yacc.c  */
     8824#line 2502 "parser.yy"
     8825    { (yyval.decl) = (yyvsp[(2) - (3)].decl); }
     8826    break;
     8827
     8828  case 655:
     8829
     8830/* Line 1806 of yacc.c  */
     8831#line 2508 "parser.yy"
     8832    { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); }
     8833    break;
     8834
     8835  case 656:
     8836
     8837/* Line 1806 of yacc.c  */
     8838#line 2510 "parser.yy"
     8839    { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); }
     8840    break;
     8841
     8842  case 657:
     8843
     8844/* Line 1806 of yacc.c  */
     8845#line 2512 "parser.yy"
     8846    { (yyval.decl) = (yyvsp[(2) - (3)].decl); }
     8847    break;
     8848
     8849  case 658:
     8850
     8851/* Line 1806 of yacc.c  */
     8852#line 2517 "parser.yy"
     8853    { (yyval.decl) = DeclarationNode::newFunction( 0, 0, (yyvsp[(3) - (5)].decl), 0 ); }
     8854    break;
     8855
     8856  case 659:
     8857
     8858/* Line 1806 of yacc.c  */
     8859#line 2519 "parser.yy"
     8860    { (yyval.decl) = (yyvsp[(2) - (8)].decl)->addParamList( (yyvsp[(6) - (8)].decl) ); }
     8861    break;
     8862
     8863  case 660:
     8864
     8865/* Line 1806 of yacc.c  */
     8866#line 2521 "parser.yy"
     8867    { (yyval.decl) = (yyvsp[(2) - (3)].decl); }
     8868    break;
     8869
     8870  case 661:
     8871
     8872/* Line 1806 of yacc.c  */
     8873#line 2527 "parser.yy"
     8874    { (yyval.decl) = DeclarationNode::newArray( 0, 0, false ); }
     8875    break;
     8876
     8877  case 662:
     8878
     8879/* Line 1806 of yacc.c  */
     8880#line 2529 "parser.yy"
     8881    { (yyval.decl) = DeclarationNode::newArray( 0, 0, false )->addArray( (yyvsp[(3) - (3)].decl) ); }
     8882    break;
     8883
     8884  case 664:
     8885
     8886/* Line 1806 of yacc.c  */
     8887#line 2535 "parser.yy"
     8888    { (yyval.decl) = DeclarationNode::newArray( (yyvsp[(3) - (5)].en), 0, false ); }
     8889    break;
     8890
     8891  case 665:
     8892
     8893/* Line 1806 of yacc.c  */
     8894#line 2537 "parser.yy"
     8895    { (yyval.decl) = DeclarationNode::newVarArray( 0 ); }
     8896    break;
     8897
     8898  case 666:
     8899
     8900/* Line 1806 of yacc.c  */
     8901#line 2539 "parser.yy"
     8902    { (yyval.decl) = (yyvsp[(1) - (6)].decl)->addArray( DeclarationNode::newArray( (yyvsp[(4) - (6)].en), 0, false ) ); }
     8903    break;
     8904
     8905  case 667:
     8906
     8907/* Line 1806 of yacc.c  */
     8908#line 2541 "parser.yy"
     8909    { (yyval.decl) = (yyvsp[(1) - (6)].decl)->addArray( DeclarationNode::newVarArray( 0 ) ); }
     8910    break;
     8911
     8912  case 669:
     8913
     8914/* Line 1806 of yacc.c  */
     8915#line 2556 "parser.yy"
     8916    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
     8917    break;
     8918
     8919  case 670:
     8920
     8921/* Line 1806 of yacc.c  */
     8922#line 2558 "parser.yy"
     8923    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
     8924    break;
     8925
     8926  case 671:
     8927
     8928/* Line 1806 of yacc.c  */
     8929#line 2563 "parser.yy"
    88078930    { (yyval.decl) = DeclarationNode::newPointer( 0 ); }
    88088931    break;
    88098932
    8810   case 650:
    8811 
    8812 /* Line 1806 of yacc.c  */
    8813 #line 2502 "parser.yy"
     8933  case 672:
     8934
     8935/* Line 1806 of yacc.c  */
     8936#line 2565 "parser.yy"
    88148937    { (yyval.decl) = DeclarationNode::newPointer( (yyvsp[(2) - (2)].decl) ); }
    88158938    break;
    88168939
    8817   case 651:
    8818 
    8819 /* Line 1806 of yacc.c  */
    8820 #line 2504 "parser.yy"
     8940  case 673:
     8941
     8942/* Line 1806 of yacc.c  */
     8943#line 2567 "parser.yy"
    88218944    { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); }
    88228945    break;
    88238946
    8824   case 652:
    8825 
    8826 /* Line 1806 of yacc.c  */
    8827 #line 2506 "parser.yy"
     8947  case 674:
     8948
     8949/* Line 1806 of yacc.c  */
     8950#line 2569 "parser.yy"
    88288951    { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[(2) - (3)].decl) ) ); }
    88298952    break;
    88308953
    8831   case 653:
    8832 
    8833 /* Line 1806 of yacc.c  */
    8834 #line 2508 "parser.yy"
     8954  case 675:
     8955
     8956/* Line 1806 of yacc.c  */
     8957#line 2571 "parser.yy"
    88358958    { (yyval.decl) = (yyvsp[(2) - (3)].decl); }
    88368959    break;
    88378960
    8838   case 655:
    8839 
    8840 /* Line 1806 of yacc.c  */
    8841 #line 2514 "parser.yy"
     8961  case 677:
     8962
     8963/* Line 1806 of yacc.c  */
     8964#line 2577 "parser.yy"
    88428965    { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); }
    88438966    break;
    88448967
    8845   case 656:
    8846 
    8847 /* Line 1806 of yacc.c  */
    8848 #line 2516 "parser.yy"
     8968  case 678:
     8969
     8970/* Line 1806 of yacc.c  */
     8971#line 2579 "parser.yy"
    88498972    { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); }
    88508973    break;
    88518974
    8852   case 657:
    8853 
    8854 /* Line 1806 of yacc.c  */
    8855 #line 2518 "parser.yy"
     8975  case 679:
     8976
     8977/* Line 1806 of yacc.c  */
     8978#line 2581 "parser.yy"
    88568979    { (yyval.decl) = (yyvsp[(2) - (3)].decl); }
    88578980    break;
    88588981
    8859   case 658:
    8860 
    8861 /* Line 1806 of yacc.c  */
    8862 #line 2523 "parser.yy"
     8982  case 680:
     8983
     8984/* Line 1806 of yacc.c  */
     8985#line 2586 "parser.yy"
    88638986    { (yyval.decl) = DeclarationNode::newFunction( 0, 0, (yyvsp[(3) - (5)].decl), 0 ); }
    88648987    break;
    88658988
    8866   case 659:
    8867 
    8868 /* Line 1806 of yacc.c  */
    8869 #line 2525 "parser.yy"
     8989  case 681:
     8990
     8991/* Line 1806 of yacc.c  */
     8992#line 2588 "parser.yy"
    88708993    { (yyval.decl) = (yyvsp[(2) - (8)].decl)->addParamList( (yyvsp[(6) - (8)].decl) ); }
    88718994    break;
    88728995
    8873   case 660:
    8874 
    8875 /* Line 1806 of yacc.c  */
    8876 #line 2527 "parser.yy"
     8996  case 682:
     8997
     8998/* Line 1806 of yacc.c  */
     8999#line 2590 "parser.yy"
    88779000    { (yyval.decl) = (yyvsp[(2) - (3)].decl); }
    88789001    break;
    88799002
    8880   case 661:
    8881 
    8882 /* Line 1806 of yacc.c  */
    8883 #line 2533 "parser.yy"
     9003  case 684:
     9004
     9005/* Line 1806 of yacc.c  */
     9006#line 2597 "parser.yy"
     9007    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addArray( (yyvsp[(2) - (2)].decl) ); }
     9008    break;
     9009
     9010  case 686:
     9011
     9012/* Line 1806 of yacc.c  */
     9013#line 2608 "parser.yy"
    88849014    { (yyval.decl) = DeclarationNode::newArray( 0, 0, false ); }
    88859015    break;
    88869016
    8887   case 662:
    8888 
    8889 /* Line 1806 of yacc.c  */
    8890 #line 2535 "parser.yy"
    8891     { (yyval.decl) = DeclarationNode::newArray( 0, 0, false )->addArray( (yyvsp[(3) - (3)].decl) ); }
    8892     break;
    8893 
    8894   case 664:
    8895 
    8896 /* Line 1806 of yacc.c  */
    8897 #line 2541 "parser.yy"
    8898     { (yyval.decl) = DeclarationNode::newArray( (yyvsp[(3) - (5)].en), 0, false ); }
    8899     break;
    8900 
    8901   case 665:
    8902 
    8903 /* Line 1806 of yacc.c  */
    8904 #line 2543 "parser.yy"
    8905     { (yyval.decl) = DeclarationNode::newVarArray( 0 ); }
    8906     break;
    8907 
    8908   case 666:
    8909 
    8910 /* Line 1806 of yacc.c  */
    8911 #line 2545 "parser.yy"
    8912     { (yyval.decl) = (yyvsp[(1) - (6)].decl)->addArray( DeclarationNode::newArray( (yyvsp[(4) - (6)].en), 0, false ) ); }
    8913     break;
    8914 
    8915   case 667:
    8916 
    8917 /* Line 1806 of yacc.c  */
    8918 #line 2547 "parser.yy"
    8919     { (yyval.decl) = (yyvsp[(1) - (6)].decl)->addArray( DeclarationNode::newVarArray( 0 ) ); }
    8920     break;
    8921 
    8922   case 669:
    8923 
    8924 /* Line 1806 of yacc.c  */
    8925 #line 2562 "parser.yy"
     9017  case 687:
     9018
     9019/* Line 1806 of yacc.c  */
     9020#line 2611 "parser.yy"
     9021    { (yyval.decl) = DeclarationNode::newVarArray( (yyvsp[(3) - (6)].decl) ); }
     9022    break;
     9023
     9024  case 688:
     9025
     9026/* Line 1806 of yacc.c  */
     9027#line 2613 "parser.yy"
     9028    { (yyval.decl) = DeclarationNode::newArray( 0, (yyvsp[(3) - (5)].decl), false ); }
     9029    break;
     9030
     9031  case 689:
     9032
     9033/* Line 1806 of yacc.c  */
     9034#line 2616 "parser.yy"
     9035    { (yyval.decl) = DeclarationNode::newArray( (yyvsp[(4) - (6)].en), (yyvsp[(3) - (6)].decl), false ); }
     9036    break;
     9037
     9038  case 690:
     9039
     9040/* Line 1806 of yacc.c  */
     9041#line 2618 "parser.yy"
     9042    { (yyval.decl) = DeclarationNode::newArray( (yyvsp[(5) - (7)].en), (yyvsp[(4) - (7)].decl), true ); }
     9043    break;
     9044
     9045  case 691:
     9046
     9047/* Line 1806 of yacc.c  */
     9048#line 2620 "parser.yy"
     9049    { (yyval.decl) = DeclarationNode::newArray( (yyvsp[(5) - (7)].en), (yyvsp[(3) - (7)].decl), true ); }
     9050    break;
     9051
     9052  case 693:
     9053
     9054/* Line 1806 of yacc.c  */
     9055#line 2634 "parser.yy"
    89269056    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
    89279057    break;
    89289058
    8929   case 670:
    8930 
    8931 /* Line 1806 of yacc.c  */
    8932 #line 2564 "parser.yy"
     9059  case 694:
     9060
     9061/* Line 1806 of yacc.c  */
     9062#line 2636 "parser.yy"
    89339063    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
    89349064    break;
    89359065
    8936   case 671:
    8937 
    8938 /* Line 1806 of yacc.c  */
    8939 #line 2569 "parser.yy"
     9066  case 695:
     9067
     9068/* Line 1806 of yacc.c  */
     9069#line 2641 "parser.yy"
    89409070    { (yyval.decl) = DeclarationNode::newPointer( 0 ); }
    89419071    break;
    89429072
    8943   case 672:
    8944 
    8945 /* Line 1806 of yacc.c  */
    8946 #line 2571 "parser.yy"
     9073  case 696:
     9074
     9075/* Line 1806 of yacc.c  */
     9076#line 2643 "parser.yy"
    89479077    { (yyval.decl) = DeclarationNode::newPointer( (yyvsp[(2) - (2)].decl) ); }
    89489078    break;
    89499079
    8950   case 673:
    8951 
    8952 /* Line 1806 of yacc.c  */
    8953 #line 2573 "parser.yy"
     9080  case 697:
     9081
     9082/* Line 1806 of yacc.c  */
     9083#line 2645 "parser.yy"
    89549084    { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); }
    89559085    break;
    89569086
    8957   case 674:
    8958 
    8959 /* Line 1806 of yacc.c  */
    8960 #line 2575 "parser.yy"
     9087  case 698:
     9088
     9089/* Line 1806 of yacc.c  */
     9090#line 2647 "parser.yy"
    89619091    { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[(2) - (3)].decl) ) ); }
    89629092    break;
    89639093
    8964   case 675:
    8965 
    8966 /* Line 1806 of yacc.c  */
    8967 #line 2577 "parser.yy"
     9094  case 699:
     9095
     9096/* Line 1806 of yacc.c  */
     9097#line 2649 "parser.yy"
    89689098    { (yyval.decl) = (yyvsp[(2) - (3)].decl); }
    89699099    break;
    89709100
    8971   case 677:
    8972 
    8973 /* Line 1806 of yacc.c  */
    8974 #line 2583 "parser.yy"
     9101  case 701:
     9102
     9103/* Line 1806 of yacc.c  */
     9104#line 2655 "parser.yy"
    89759105    { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); }
    89769106    break;
    89779107
    8978   case 678:
    8979 
    8980 /* Line 1806 of yacc.c  */
    8981 #line 2585 "parser.yy"
     9108  case 702:
     9109
     9110/* Line 1806 of yacc.c  */
     9111#line 2657 "parser.yy"
    89829112    { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); }
    89839113    break;
    89849114
    8985   case 679:
    8986 
    8987 /* Line 1806 of yacc.c  */
    8988 #line 2587 "parser.yy"
     9115  case 703:
     9116
     9117/* Line 1806 of yacc.c  */
     9118#line 2659 "parser.yy"
    89899119    { (yyval.decl) = (yyvsp[(2) - (3)].decl); }
    89909120    break;
    89919121
    8992   case 680:
    8993 
    8994 /* Line 1806 of yacc.c  */
    8995 #line 2592 "parser.yy"
    8996     { (yyval.decl) = DeclarationNode::newFunction( 0, 0, (yyvsp[(3) - (5)].decl), 0 ); }
    8997     break;
    8998 
    8999   case 681:
    9000 
    9001 /* Line 1806 of yacc.c  */
    9002 #line 2594 "parser.yy"
     9122  case 704:
     9123
     9124/* Line 1806 of yacc.c  */
     9125#line 2664 "parser.yy"
    90039126    { (yyval.decl) = (yyvsp[(2) - (8)].decl)->addParamList( (yyvsp[(6) - (8)].decl) ); }
    90049127    break;
    90059128
    9006   case 682:
    9007 
    9008 /* Line 1806 of yacc.c  */
    9009 #line 2596 "parser.yy"
     9129  case 705:
     9130
     9131/* Line 1806 of yacc.c  */
     9132#line 2666 "parser.yy"
    90109133    { (yyval.decl) = (yyvsp[(2) - (3)].decl); }
    90119134    break;
    90129135
    9013   case 684:
    9014 
    9015 /* Line 1806 of yacc.c  */
    9016 #line 2603 "parser.yy"
    9017     { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addArray( (yyvsp[(2) - (2)].decl) ); }
    9018     break;
    9019 
    9020   case 686:
    9021 
    9022 /* Line 1806 of yacc.c  */
    9023 #line 2614 "parser.yy"
    9024     { (yyval.decl) = DeclarationNode::newArray( 0, 0, false ); }
    9025     break;
    9026 
    9027   case 687:
    9028 
    9029 /* Line 1806 of yacc.c  */
    9030 #line 2617 "parser.yy"
    9031     { (yyval.decl) = DeclarationNode::newVarArray( (yyvsp[(3) - (6)].decl) ); }
    9032     break;
    9033 
    9034   case 688:
    9035 
    9036 /* Line 1806 of yacc.c  */
    9037 #line 2619 "parser.yy"
    9038     { (yyval.decl) = DeclarationNode::newArray( 0, (yyvsp[(3) - (5)].decl), false ); }
    9039     break;
    9040 
    9041   case 689:
    9042 
    9043 /* Line 1806 of yacc.c  */
    9044 #line 2622 "parser.yy"
    9045     { (yyval.decl) = DeclarationNode::newArray( (yyvsp[(4) - (6)].en), (yyvsp[(3) - (6)].decl), false ); }
    9046     break;
    9047 
    9048   case 690:
    9049 
    9050 /* Line 1806 of yacc.c  */
    9051 #line 2624 "parser.yy"
    9052     { (yyval.decl) = DeclarationNode::newArray( (yyvsp[(5) - (7)].en), (yyvsp[(4) - (7)].decl), true ); }
    9053     break;
    9054 
    9055   case 691:
    9056 
    9057 /* Line 1806 of yacc.c  */
    9058 #line 2626 "parser.yy"
    9059     { (yyval.decl) = DeclarationNode::newArray( (yyvsp[(5) - (7)].en), (yyvsp[(3) - (7)].decl), true ); }
    9060     break;
    9061 
    9062   case 693:
    9063 
    9064 /* Line 1806 of yacc.c  */
    9065 #line 2640 "parser.yy"
    9066     { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
    9067     break;
    9068 
    9069   case 694:
    9070 
    9071 /* Line 1806 of yacc.c  */
    9072 #line 2642 "parser.yy"
    9073     { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
    9074     break;
    9075 
    9076   case 695:
    9077 
    9078 /* Line 1806 of yacc.c  */
    9079 #line 2647 "parser.yy"
    9080     { (yyval.decl) = DeclarationNode::newPointer( 0 ); }
    9081     break;
    9082 
    9083   case 696:
    9084 
    9085 /* Line 1806 of yacc.c  */
    9086 #line 2649 "parser.yy"
    9087     { (yyval.decl) = DeclarationNode::newPointer( (yyvsp[(2) - (2)].decl) ); }
    9088     break;
    9089 
    9090   case 697:
    9091 
    9092 /* Line 1806 of yacc.c  */
    9093 #line 2651 "parser.yy"
    9094     { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); }
    9095     break;
    9096 
    9097   case 698:
    9098 
    9099 /* Line 1806 of yacc.c  */
    9100 #line 2653 "parser.yy"
    9101     { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[(2) - (3)].decl) ) ); }
    9102     break;
    9103 
    9104   case 699:
    9105 
    9106 /* Line 1806 of yacc.c  */
    9107 #line 2655 "parser.yy"
    9108     { (yyval.decl) = (yyvsp[(2) - (3)].decl); }
    9109     break;
    9110 
    9111   case 701:
    9112 
    9113 /* Line 1806 of yacc.c  */
    9114 #line 2661 "parser.yy"
    9115     { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); }
    9116     break;
    9117 
    9118   case 702:
    9119 
    9120 /* Line 1806 of yacc.c  */
    9121 #line 2663 "parser.yy"
    9122     { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addArray( (yyvsp[(4) - (4)].decl) ); }
    9123     break;
    9124 
    9125   case 703:
    9126 
    9127 /* Line 1806 of yacc.c  */
    9128 #line 2665 "parser.yy"
    9129     { (yyval.decl) = (yyvsp[(2) - (3)].decl); }
    9130     break;
    9131 
    9132   case 704:
    9133 
    9134 /* Line 1806 of yacc.c  */
    9135 #line 2670 "parser.yy"
    9136     { (yyval.decl) = (yyvsp[(2) - (8)].decl)->addParamList( (yyvsp[(6) - (8)].decl) ); }
    9137     break;
    9138 
    9139   case 705:
    9140 
    9141 /* Line 1806 of yacc.c  */
    9142 #line 2672 "parser.yy"
    9143     { (yyval.decl) = (yyvsp[(2) - (3)].decl); }
    9144     break;
    9145 
    91469136  case 708:
    91479137
    91489138/* Line 1806 of yacc.c  */
    9149 #line 2682 "parser.yy"
     9139#line 2676 "parser.yy"
    91509140    { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); }
    91519141    break;
     
    91549144
    91559145/* Line 1806 of yacc.c  */
     9146#line 2686 "parser.yy"
     9147    { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addNewPointer( DeclarationNode::newPointer( 0 ) ); }
     9148    break;
     9149
     9150  case 712:
     9151
     9152/* Line 1806 of yacc.c  */
     9153#line 2688 "parser.yy"
     9154    { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addNewPointer( DeclarationNode::newPointer( (yyvsp[(1) - (3)].decl) ) ); }
     9155    break;
     9156
     9157  case 713:
     9158
     9159/* Line 1806 of yacc.c  */
     9160#line 2690 "parser.yy"
     9161    { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addNewPointer( DeclarationNode::newPointer( 0 ) ); }
     9162    break;
     9163
     9164  case 714:
     9165
     9166/* Line 1806 of yacc.c  */
    91569167#line 2692 "parser.yy"
     9168    { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addNewPointer( DeclarationNode::newPointer( (yyvsp[(1) - (3)].decl) ) ); }
     9169    break;
     9170
     9171  case 715:
     9172
     9173/* Line 1806 of yacc.c  */
     9174#line 2694 "parser.yy"
    91579175    { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addNewPointer( DeclarationNode::newPointer( 0 ) ); }
    91589176    break;
    91599177
    9160   case 712:
    9161 
    9162 /* Line 1806 of yacc.c  */
    9163 #line 2694 "parser.yy"
     9178  case 716:
     9179
     9180/* Line 1806 of yacc.c  */
     9181#line 2696 "parser.yy"
    91649182    { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addNewPointer( DeclarationNode::newPointer( (yyvsp[(1) - (3)].decl) ) ); }
    91659183    break;
    91669184
    9167   case 713:
    9168 
    9169 /* Line 1806 of yacc.c  */
    9170 #line 2696 "parser.yy"
    9171     { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addNewPointer( DeclarationNode::newPointer( 0 ) ); }
    9172     break;
    9173 
    9174   case 714:
    9175 
    9176 /* Line 1806 of yacc.c  */
    9177 #line 2698 "parser.yy"
    9178     { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addNewPointer( DeclarationNode::newPointer( (yyvsp[(1) - (3)].decl) ) ); }
    9179     break;
    9180 
    9181   case 715:
    9182 
    9183 /* Line 1806 of yacc.c  */
    9184 #line 2700 "parser.yy"
    9185     { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addNewPointer( DeclarationNode::newPointer( 0 ) ); }
    9186     break;
    9187 
    9188   case 716:
    9189 
    9190 /* Line 1806 of yacc.c  */
    9191 #line 2702 "parser.yy"
    9192     { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addNewPointer( DeclarationNode::newPointer( (yyvsp[(1) - (3)].decl) ) ); }
    9193     break;
    9194 
    91959185  case 717:
    91969186
    91979187/* Line 1806 of yacc.c  */
     9188#line 2703 "parser.yy"
     9189    { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addNewArray( DeclarationNode::newArray( 0, 0, false ) ); }
     9190    break;
     9191
     9192  case 718:
     9193
     9194/* Line 1806 of yacc.c  */
     9195#line 2705 "parser.yy"
     9196    { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addNewArray( (yyvsp[(1) - (2)].decl) ); }
     9197    break;
     9198
     9199  case 719:
     9200
     9201/* Line 1806 of yacc.c  */
     9202#line 2707 "parser.yy"
     9203    { (yyval.decl) = (yyvsp[(4) - (4)].decl)->addNewArray( (yyvsp[(3) - (4)].decl) )->addNewArray( DeclarationNode::newArray( 0, 0, false ) ); }
     9204    break;
     9205
     9206  case 720:
     9207
     9208/* Line 1806 of yacc.c  */
    91989209#line 2709 "parser.yy"
    9199     { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addNewArray( DeclarationNode::newArray( 0, 0, false ) ); }
    9200     break;
    9201 
    9202   case 718:
     9210    { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addNewArray( (yyvsp[(2) - (3)].decl) )->addNewArray( (yyvsp[(1) - (3)].decl) ); }
     9211    break;
     9212
     9213  case 721:
    92039214
    92049215/* Line 1806 of yacc.c  */
     
    92079218    break;
    92089219
    9209   case 719:
     9220  case 722:
    92109221
    92119222/* Line 1806 of yacc.c  */
    92129223#line 2713 "parser.yy"
     9224    { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addNewArray( DeclarationNode::newArray( 0, 0, false ) ); }
     9225    break;
     9226
     9227  case 723:
     9228
     9229/* Line 1806 of yacc.c  */
     9230#line 2715 "parser.yy"
     9231    { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addNewArray( (yyvsp[(1) - (2)].decl) ); }
     9232    break;
     9233
     9234  case 724:
     9235
     9236/* Line 1806 of yacc.c  */
     9237#line 2717 "parser.yy"
    92139238    { (yyval.decl) = (yyvsp[(4) - (4)].decl)->addNewArray( (yyvsp[(3) - (4)].decl) )->addNewArray( DeclarationNode::newArray( 0, 0, false ) ); }
    92149239    break;
    92159240
    9216   case 720:
    9217 
    9218 /* Line 1806 of yacc.c  */
    9219 #line 2715 "parser.yy"
     9241  case 725:
     9242
     9243/* Line 1806 of yacc.c  */
     9244#line 2719 "parser.yy"
    92209245    { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addNewArray( (yyvsp[(2) - (3)].decl) )->addNewArray( (yyvsp[(1) - (3)].decl) ); }
    92219246    break;
    92229247
    9223   case 721:
    9224 
    9225 /* Line 1806 of yacc.c  */
    9226 #line 2717 "parser.yy"
    9227     { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addNewArray( (yyvsp[(1) - (2)].decl) ); }
    9228     break;
    9229 
    9230   case 722:
    9231 
    9232 /* Line 1806 of yacc.c  */
    9233 #line 2719 "parser.yy"
    9234     { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addNewArray( DeclarationNode::newArray( 0, 0, false ) ); }
    9235     break;
    9236 
    9237   case 723:
     9248  case 726:
    92389249
    92399250/* Line 1806 of yacc.c  */
     
    92429253    break;
    92439254
    9244   case 724:
    9245 
    9246 /* Line 1806 of yacc.c  */
    9247 #line 2723 "parser.yy"
     9255  case 727:
     9256
     9257/* Line 1806 of yacc.c  */
     9258#line 2726 "parser.yy"
     9259    { (yyval.decl) = DeclarationNode::newVarArray( (yyvsp[(3) - (6)].decl) ); }
     9260    break;
     9261
     9262  case 728:
     9263
     9264/* Line 1806 of yacc.c  */
     9265#line 2728 "parser.yy"
     9266    { (yyval.decl) = DeclarationNode::newArray( (yyvsp[(4) - (6)].en), (yyvsp[(3) - (6)].decl), false ); }
     9267    break;
     9268
     9269  case 729:
     9270
     9271/* Line 1806 of yacc.c  */
     9272#line 2733 "parser.yy"
     9273    { (yyval.decl) = DeclarationNode::newArray( (yyvsp[(4) - (6)].en), (yyvsp[(3) - (6)].decl), true ); }
     9274    break;
     9275
     9276  case 730:
     9277
     9278/* Line 1806 of yacc.c  */
     9279#line 2735 "parser.yy"
     9280    { (yyval.decl) = DeclarationNode::newArray( (yyvsp[(5) - (7)].en), (yyvsp[(4) - (7)].decl)->addQualifiers( (yyvsp[(3) - (7)].decl) ), true ); }
     9281    break;
     9282
     9283  case 732:
     9284
     9285/* Line 1806 of yacc.c  */
     9286#line 2762 "parser.yy"
     9287    { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); }
     9288    break;
     9289
     9290  case 736:
     9291
     9292/* Line 1806 of yacc.c  */
     9293#line 2773 "parser.yy"
     9294    { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addNewPointer( DeclarationNode::newPointer( 0 ) ); }
     9295    break;
     9296
     9297  case 737:
     9298
     9299/* Line 1806 of yacc.c  */
     9300#line 2775 "parser.yy"
     9301    { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addNewPointer( DeclarationNode::newPointer( (yyvsp[(1) - (3)].decl) ) ); }
     9302    break;
     9303
     9304  case 738:
     9305
     9306/* Line 1806 of yacc.c  */
     9307#line 2777 "parser.yy"
     9308    { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addNewPointer( DeclarationNode::newPointer( 0 ) ); }
     9309    break;
     9310
     9311  case 739:
     9312
     9313/* Line 1806 of yacc.c  */
     9314#line 2779 "parser.yy"
     9315    { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addNewPointer( DeclarationNode::newPointer( (yyvsp[(1) - (3)].decl) ) ); }
     9316    break;
     9317
     9318  case 740:
     9319
     9320/* Line 1806 of yacc.c  */
     9321#line 2781 "parser.yy"
     9322    { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addNewPointer( DeclarationNode::newPointer( 0 ) ); }
     9323    break;
     9324
     9325  case 741:
     9326
     9327/* Line 1806 of yacc.c  */
     9328#line 2783 "parser.yy"
     9329    { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addNewPointer( DeclarationNode::newPointer( (yyvsp[(1) - (3)].decl) ) ); }
     9330    break;
     9331
     9332  case 742:
     9333
     9334/* Line 1806 of yacc.c  */
     9335#line 2790 "parser.yy"
     9336    { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addNewArray( DeclarationNode::newArray( 0, 0, false ) ); }
     9337    break;
     9338
     9339  case 743:
     9340
     9341/* Line 1806 of yacc.c  */
     9342#line 2792 "parser.yy"
    92489343    { (yyval.decl) = (yyvsp[(4) - (4)].decl)->addNewArray( (yyvsp[(3) - (4)].decl) )->addNewArray( DeclarationNode::newArray( 0, 0, false ) ); }
    92499344    break;
    92509345
    9251   case 725:
    9252 
    9253 /* Line 1806 of yacc.c  */
    9254 #line 2725 "parser.yy"
    9255     { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addNewArray( (yyvsp[(2) - (3)].decl) )->addNewArray( (yyvsp[(1) - (3)].decl) ); }
    9256     break;
    9257 
    9258   case 726:
    9259 
    9260 /* Line 1806 of yacc.c  */
    9261 #line 2727 "parser.yy"
     9346  case 744:
     9347
     9348/* Line 1806 of yacc.c  */
     9349#line 2794 "parser.yy"
    92629350    { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addNewArray( (yyvsp[(1) - (2)].decl) ); }
    92639351    break;
    92649352
    9265   case 727:
    9266 
    9267 /* Line 1806 of yacc.c  */
    9268 #line 2732 "parser.yy"
    9269     { (yyval.decl) = DeclarationNode::newVarArray( (yyvsp[(3) - (6)].decl) ); }
    9270     break;
    9271 
    9272   case 728:
    9273 
    9274 /* Line 1806 of yacc.c  */
    9275 #line 2734 "parser.yy"
    9276     { (yyval.decl) = DeclarationNode::newArray( (yyvsp[(4) - (6)].en), (yyvsp[(3) - (6)].decl), false ); }
    9277     break;
    9278 
    9279   case 729:
    9280 
    9281 /* Line 1806 of yacc.c  */
    9282 #line 2739 "parser.yy"
    9283     { (yyval.decl) = DeclarationNode::newArray( (yyvsp[(4) - (6)].en), (yyvsp[(3) - (6)].decl), true ); }
    9284     break;
    9285 
    9286   case 730:
    9287 
    9288 /* Line 1806 of yacc.c  */
    9289 #line 2741 "parser.yy"
    9290     { (yyval.decl) = DeclarationNode::newArray( (yyvsp[(5) - (7)].en), (yyvsp[(4) - (7)].decl)->addQualifiers( (yyvsp[(3) - (7)].decl) ), true ); }
    9291     break;
    9292 
    9293   case 732:
    9294 
    9295 /* Line 1806 of yacc.c  */
    9296 #line 2768 "parser.yy"
    9297     { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); }
    9298     break;
    9299 
    9300   case 736:
    9301 
    9302 /* Line 1806 of yacc.c  */
    9303 #line 2779 "parser.yy"
    9304     { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addNewPointer( DeclarationNode::newPointer( 0 ) ); }
    9305     break;
    9306 
    9307   case 737:
    9308 
    9309 /* Line 1806 of yacc.c  */
    9310 #line 2781 "parser.yy"
    9311     { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addNewPointer( DeclarationNode::newPointer( (yyvsp[(1) - (3)].decl) ) ); }
    9312     break;
    9313 
    9314   case 738:
    9315 
    9316 /* Line 1806 of yacc.c  */
    9317 #line 2783 "parser.yy"
    9318     { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addNewPointer( DeclarationNode::newPointer( 0 ) ); }
    9319     break;
    9320 
    9321   case 739:
    9322 
    9323 /* Line 1806 of yacc.c  */
    9324 #line 2785 "parser.yy"
    9325     { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addNewPointer( DeclarationNode::newPointer( (yyvsp[(1) - (3)].decl) ) ); }
    9326     break;
    9327 
    9328   case 740:
    9329 
    9330 /* Line 1806 of yacc.c  */
    9331 #line 2787 "parser.yy"
    9332     { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addNewPointer( DeclarationNode::newPointer( 0 ) ); }
    9333     break;
    9334 
    9335   case 741:
    9336 
    9337 /* Line 1806 of yacc.c  */
    9338 #line 2789 "parser.yy"
    9339     { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addNewPointer( DeclarationNode::newPointer( (yyvsp[(1) - (3)].decl) ) ); }
    9340     break;
    9341 
    9342   case 742:
     9353  case 745:
    93439354
    93449355/* Line 1806 of yacc.c  */
     
    93479358    break;
    93489359
    9349   case 743:
     9360  case 746:
    93509361
    93519362/* Line 1806 of yacc.c  */
     
    93549365    break;
    93559366
    9356   case 744:
     9367  case 747:
    93579368
    93589369/* Line 1806 of yacc.c  */
     
    93619372    break;
    93629373
    9363   case 745:
    9364 
    9365 /* Line 1806 of yacc.c  */
    9366 #line 2802 "parser.yy"
    9367     { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addNewArray( DeclarationNode::newArray( 0, 0, false ) ); }
    9368     break;
    9369 
    9370   case 746:
    9371 
    9372 /* Line 1806 of yacc.c  */
    9373 #line 2804 "parser.yy"
    9374     { (yyval.decl) = (yyvsp[(4) - (4)].decl)->addNewArray( (yyvsp[(3) - (4)].decl) )->addNewArray( DeclarationNode::newArray( 0, 0, false ) ); }
    9375     break;
    9376 
    9377   case 747:
    9378 
    9379 /* Line 1806 of yacc.c  */
    9380 #line 2806 "parser.yy"
    9381     { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addNewArray( (yyvsp[(1) - (2)].decl) ); }
    9382     break;
    9383 
    93849374  case 748:
    93859375
    93869376/* Line 1806 of yacc.c  */
    9387 #line 2811 "parser.yy"
     9377#line 2805 "parser.yy"
    93889378    { (yyval.decl) = DeclarationNode::newTuple( (yyvsp[(3) - (5)].decl) ); }
    93899379    break;
     
    93929382
    93939383/* Line 1806 of yacc.c  */
    9394 #line 2816 "parser.yy"
     9384#line 2810 "parser.yy"
    93959385    { (yyval.decl) = DeclarationNode::newFunction( 0, DeclarationNode::newTuple( 0 ), (yyvsp[(4) - (5)].decl), 0 ); }
    93969386    break;
     
    93999389
    94009390/* Line 1806 of yacc.c  */
    9401 #line 2818 "parser.yy"
     9391#line 2812 "parser.yy"
    94029392    { (yyval.decl) = DeclarationNode::newFunction( 0, (yyvsp[(1) - (6)].decl), (yyvsp[(4) - (6)].decl), 0 ); }
    94039393    break;
     
    94069396
    94079397/* Line 1806 of yacc.c  */
    9408 #line 2820 "parser.yy"
     9398#line 2814 "parser.yy"
    94099399    { (yyval.decl) = DeclarationNode::newFunction( 0, (yyvsp[(1) - (6)].decl), (yyvsp[(4) - (6)].decl), 0 ); }
    94109400    break;
     
    94139403
    94149404/* Line 1806 of yacc.c  */
    9415 #line 2844 "parser.yy"
     9405#line 2838 "parser.yy"
    94169406    { (yyval.en) = 0; }
    94179407    break;
     
    94209410
    94219411/* Line 1806 of yacc.c  */
    9422 #line 2846 "parser.yy"
     9412#line 2840 "parser.yy"
    94239413    { (yyval.en) = (yyvsp[(2) - (2)].en); }
    94249414    break;
     
    94279417
    94289418/* Line 1806 of yacc.c  */
    9429 #line 9430 "Parser/parser.cc"
     9419#line 9420 "Parser/parser.cc"
    94309420      default: break;
    94319421    }
     
    96589648
    96599649/* Line 2067 of yacc.c  */
    9660 #line 2849 "parser.yy"
     9650#line 2843 "parser.yy"
    96619651
    96629652// ----end of grammar----
  • src/Parser/parser.h

    rc331406 r5070fe4  
    274274        LabelNode *label;
    275275        InitializerNode *in;
    276         OperatorNode::Type op;
    277276        bool flag;
    278277
     
    280279
    281280/* Line 2068 of yacc.c  */
    282 #line 283 "Parser/parser.h"
     281#line 282 "Parser/parser.h"
    283282} YYSTYPE;
    284283# define YYSTYPE_IS_TRIVIAL 1
  • src/Parser/parser.yy

    rc331406 r5070fe4  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Aug  5 08:15:57 2016
    13 // Update Count     : 1721
     12// Last Modified On : Sat Jul 23 17:01:30 2016
     13// Update Count     : 1668
    1414//
    1515
     
    119119        LabelNode *label;
    120120        InitializerNode *in;
    121         OperatorNode::Type op;
    122121        bool flag;
    123122}
     
    130129%type<constant> constant
    131130%type<en> tuple                                                 tuple_expression_list
    132 %type<op> ptrref_operator
    133 %type<en> unary_operator                                assignment_operator
     131%type<en> ptrref_operator                               unary_operator                          assignment_operator
    134132%type<en> primary_expression                    postfix_expression                      unary_expression
    135133%type<en> cast_expression                               multiplicative_expression       additive_expression                     shift_expression
     
    152150%type<sn> block_item_list                               block_item
    153151%type<sn> case_clause
    154 %type<en> case_value
    155 %type<sn> case_value_list                               case_label                                      case_label_list
     152%type<en> case_value                                    case_value_list
     153%type<sn> case_label                                    case_label_list
    156154%type<sn> switch_clause_list_opt                switch_clause_list                      choose_clause_list_opt          choose_clause_list
    157155%type<pn> handler_list                                  handler_clause                          finally_clause
     
    356354                // little advantage to this feature and many disadvantages. It is possible to write x[(i,j)] in CFA, which is
    357355                // equivalent to the old x[i,j].
    358                 { $$ = new CompositeExprNode2( build_opr2( OperatorNode::Index, $1, $4 ) ); }
     356                { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::Index ), $1, $4 ); }
    359357        | postfix_expression '(' argument_expression_list ')'
    360358                { $$ = new CompositeExprNode( $1, $3 ); }
     
    362360                //   struct S { int 0, 1; } s; s. 0 = 0; s. 1 = 1;
    363361        | postfix_expression '.' no_attr_identifier
    364                 { $$ = new CompositeExprNode2( build_fieldSel( $1, new VarRefNode( $3 ) ) ); }
     362                { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::FieldSel ), $1, new VarRefNode( $3 )); }
    365363        | postfix_expression '.' '[' push field_list pop ']' // CFA, tuple field selector
    366364        | postfix_expression ARROW no_attr_identifier
    367                 { $$ = new CompositeExprNode2( build_pfieldSel( $1, new VarRefNode( $3 ) ) ); }
     365                { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::PFieldSel ), $1, new VarRefNode( $3 )); }
    368366        | postfix_expression ARROW '[' push field_list pop ']' // CFA, tuple field selector
    369367        | postfix_expression ICR
    370                 { $$ = new CompositeExprNode2( build_opr1( OperatorNode::IncrPost, $1 ) ); }
     368                { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::IncrPost ), $1 ); }
    371369        | postfix_expression DECR
    372                 { $$ = new CompositeExprNode2( build_opr1( OperatorNode::DecrPost, $1 ) ); }
     370                { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::DecrPost ), $1 ); }
    373371        | '(' type_name_no_function ')' '{' initializer_list comma_opt '}' // C99
    374372                { $$ = new CompoundLiteralNode( $2, new InitializerNode( $5, true ) ); }
     
    412410                //   struct S { int 0, 1; } s; s. 0 = 0; s. 1 = 1;
    413411        | no_attr_identifier '.' field
    414                 { $$ = new CompositeExprNode2( build_fieldSel( $3, new VarRefNode( $1 ) ) ); }
     412                { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::FieldSel ), new VarRefNode( $1 ), $3 ); }
    415413        | no_attr_identifier '.' '[' push field_list pop ']'
    416                 { $$ = new CompositeExprNode2( build_fieldSel( $5, new VarRefNode( $1 ) ) ); }
     414                { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::FieldSel ), new VarRefNode( $1 ), $5 ); }
    417415        | no_attr_identifier ARROW field
    418                 { $$ = new CompositeExprNode2( build_pfieldSel( $3, new VarRefNode( $1 ) ) ); }
     416                { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::PFieldSel ), new VarRefNode( $1 ), $3 ); }
    419417        | no_attr_identifier ARROW '[' push field_list pop ']'
    420                 { $$ = new CompositeExprNode2( build_pfieldSel( $5, new VarRefNode( $1 ) ) ); }
     418                { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::PFieldSel ), new VarRefNode( $1 ), $5 ); }
    421419        ;
    422420
     
    431429        | EXTENSION cast_expression                                                     // GCC
    432430                { $$ = $2->set_extension( true ); }
     431        | ptrref_operator cast_expression                                       // CFA
     432                { $$ = new CompositeExprNode( $1, $2 ); }
    433433                // '*' ('&') is separated from unary_operator because of shift/reduce conflict in:
    434434                //              { * X; }         // dereference X
    435435                //              { * int X; } // CFA declaration of pointer to int
    436         | ptrref_operator cast_expression                                       // CFA
    437                 { $$ = $1 == OperatorNode::AddressOf ? (ExpressionNode*) new CompositeExprNode2( build_addressOf( $2 ) )
    438                                                                                         : (ExpressionNode*)new CompositeExprNode( new OperatorNode ( $1 ), $2 ); }
    439436        | unary_operator cast_expression
    440437                { $$ = new CompositeExprNode( $1, $2 ); }
    441438        | ICR unary_expression
    442                 { $$ = new CompositeExprNode2( build_opr1( OperatorNode::Incr, $2 ) ); }
     439                { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::Incr ), $2 ); }
    443440        | DECR unary_expression
    444                 { $$ = new CompositeExprNode2( build_opr1( OperatorNode::Decr, $2 ) ); }
     441                { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::Decr ), $2 ); }
    445442        | SIZEOF unary_expression
    446                 { $$ = new CompositeExprNode2( build_sizeOf( $2 ) ); }
     443                { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::SizeOf ), $2 ); }
    447444        | SIZEOF '(' type_name_no_function ')'
    448                 { $$ = new CompositeExprNode2( build_sizeOf( new TypeValueNode( $3 ) ) ); }
     445                { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::SizeOf ), new TypeValueNode( $3 )); }
    449446        | OFFSETOF '(' type_name_no_function ',' no_attr_identifier ')'
    450                 { $$ = new CompositeExprNode2( build_offsetOf( new TypeValueNode( $3 ), new VarRefNode( $5 ) ) ); }
     447                { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::OffsetOf ), new TypeValueNode( $3 ), new VarRefNode( $5 )); }
    451448        | ATTR_IDENTIFIER
    452                 { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::Attr ), new VarRefNode( $1 ) ); }
     449                { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::Attr ), new VarRefNode( $1 )); }
    453450        | ATTR_IDENTIFIER '(' type_name ')'
    454                 { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::Attr ), new VarRefNode( $1 ), new TypeValueNode( $3 ) ); }
     451                { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::Attr ), new VarRefNode( $1 ), new TypeValueNode( $3 )); }
    455452        | ATTR_IDENTIFIER '(' argument_expression ')'
    456453                { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::Attr ), new VarRefNode( $1 ), $3 ); }
    457454        | ALIGNOF unary_expression                                                      // GCC, variable alignment
    458                 { $$ = new CompositeExprNode2( build_alignOf( $2 ) ); }
     455                { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::AlignOf ), $2 ); }
    459456        | ALIGNOF '(' type_name_no_function ')'                         // GCC, type alignment
    460                 { $$ = new CompositeExprNode2( build_alignOf( new TypeValueNode( $3 ) ) ); }
     457                { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::AlignOf ), new TypeValueNode( $3 ) ); }
    461458//      | ANDAND IDENTIFIER                                                                     // GCC, address of label
    462459//              { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::LabelAddress ), new VarRefNode( $2, true ) ); }
     
    464461
    465462ptrref_operator:
    466         '*'                                                                                     { $$ = OperatorNode::PointTo; }
    467         | '&'                                                                           { $$ = OperatorNode::AddressOf; }
     463        '*'                                                                                     { $$ = new OperatorNode( OperatorNode::PointTo ); }
     464        | '&'                                                                           { $$ = new OperatorNode( OperatorNode::AddressOf ); }
    468465                // GCC, address of label must be handled by semantic check for ref,ref,label
    469         | ANDAND                                                                        { $$ = OperatorNode::And; }
     466        | ANDAND                                                                        { $$ = new OperatorNode( OperatorNode::And ); }
    470467        ;
    471468
     
    480477        unary_expression
    481478        | '(' type_name_no_function ')' cast_expression
    482                 { $$ = new CompositeExprNode2( build_cast( new TypeValueNode( $2 ), $4 ) ); }
     479                { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::Cast ), new TypeValueNode( $2 ), $4 ); }
    483480        | '(' type_name_no_function ')' tuple
    484                 { $$ = new CompositeExprNode2( build_cast( new TypeValueNode( $2 ), $4 ) ); }
     481                { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::Cast ), new TypeValueNode( $2 ), $4 ); }
    485482        ;
    486483
     
    488485        cast_expression
    489486        | multiplicative_expression '*' cast_expression
    490                 { $$ = new CompositeExprNode2( build_opr2( OperatorNode::Mul, $1, $3 ) ); }
     487                { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::Mul ), $1, $3 ); }
    491488        | multiplicative_expression '/' cast_expression
    492                 { $$ = new CompositeExprNode2( build_opr2( OperatorNode::Div, $1, $3 ) ); }
     489                { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::Div ), $1, $3 ); }
    493490        | multiplicative_expression '%' cast_expression
    494                 { $$ = new CompositeExprNode2( build_opr2( OperatorNode::Mod, $1, $3 ) ); }
     491                { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::Mod ), $1, $3 ); }
    495492        ;
    496493
     
    498495        multiplicative_expression
    499496        | additive_expression '+' multiplicative_expression
    500                 { $$ = new CompositeExprNode2( build_opr2( OperatorNode::Plus, $1, $3 ) ); }
     497                { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::Plus ), $1, $3 ); }
    501498        | additive_expression '-' multiplicative_expression
    502                 { $$ = new CompositeExprNode2( build_opr2( OperatorNode::Minus, $1, $3 ) ); }
     499                { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::Minus ), $1, $3 ); }
    503500        ;
    504501
     
    506503        additive_expression
    507504        | shift_expression LS additive_expression
    508                 { $$ = new CompositeExprNode2( build_opr2( OperatorNode::LShift, $1, $3 ) ); }
     505                { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::LShift ), $1, $3 ); }
    509506        | shift_expression RS additive_expression
    510                 { $$ = new CompositeExprNode2( build_opr2( OperatorNode::RShift, $1, $3 ) ); }
     507                { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::RShift ), $1, $3 ); }
    511508        ;
    512509
     
    514511        shift_expression
    515512        | relational_expression '<' shift_expression
    516                 { $$ = new CompositeExprNode2( build_opr2( OperatorNode::LThan, $1, $3 ) ); }
     513                { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::LThan ), $1, $3 ); }
    517514        | relational_expression '>' shift_expression
    518                 { $$ = new CompositeExprNode2( build_opr2( OperatorNode::GThan, $1, $3 ) ); }
     515                { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::GThan ), $1, $3 ); }
    519516        | relational_expression LE shift_expression
    520                 { $$ = new CompositeExprNode2( build_opr2( OperatorNode::LEThan, $1, $3 ) ); }
     517                { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::LEThan ), $1, $3 ); }
    521518        | relational_expression GE shift_expression
    522                 { $$ = new CompositeExprNode2( build_opr2( OperatorNode::GEThan, $1, $3 ) ); }
     519                { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::GEThan ), $1, $3 ); }
    523520        ;
    524521
     
    526523        relational_expression
    527524        | equality_expression EQ relational_expression
    528                 { $$ = new CompositeExprNode2( build_opr2( OperatorNode::Eq, $1, $3 ) ); }
     525                { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::Eq ), $1, $3 ); }
    529526        | equality_expression NE relational_expression
    530                 { $$ = new CompositeExprNode2( build_opr2( OperatorNode::Neq, $1, $3 ) ); }
     527                { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::Neq ), $1, $3 ); }
    531528        ;
    532529
     
    534531        equality_expression
    535532        | AND_expression '&' equality_expression
    536                 { $$ = new CompositeExprNode2( build_opr2( OperatorNode::BitAnd, $1, $3 ) ); }
     533                { $$ =new CompositeExprNode( new OperatorNode( OperatorNode::BitAnd ), $1, $3 ); }
    537534        ;
    538535
     
    540537        AND_expression
    541538        | exclusive_OR_expression '^' AND_expression
    542                 { $$ = new CompositeExprNode2( build_opr2( OperatorNode::Xor, $1, $3 ) ); }
     539                { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::Xor ), $1, $3 ); }
    543540        ;
    544541
     
    546543        exclusive_OR_expression
    547544        | inclusive_OR_expression '|' exclusive_OR_expression
    548                 { $$ = new CompositeExprNode2( build_opr2( OperatorNode::BitOr, $1, $3 ) ); }
     545                { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::BitOr ), $1, $3 ); }
    549546        ;
    550547
     
    552549        inclusive_OR_expression
    553550        | logical_AND_expression ANDAND inclusive_OR_expression
    554                 { $$ = new CompositeExprNode2( build_and_or( $1, $3, true ) ); }
     551                { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::And ), $1, $3 ); }
    555552        ;
    556553
     
    558555        logical_AND_expression
    559556        | logical_OR_expression OROR logical_AND_expression
    560                 { $$ = new CompositeExprNode2( build_and_or( $1, $3, false ) ); }
     557                { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::Or ), $1, $3 ); }
    561558        ;
    562559
     
    564561        logical_OR_expression
    565562        | logical_OR_expression '?' comma_expression ':' conditional_expression
    566                 { $$ = new CompositeExprNode2( build_cond( $1, $3, $5 ) ); }
     563                { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::Cond ), (ExpressionNode *)mkList( (*$1, *$3, *$5 ) ) ); }
    567564        | logical_OR_expression '?' /* empty */ ':' conditional_expression // GCC, omitted first operand
    568                 { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::NCond ), $1, $4 ); }
     565                { $$=new CompositeExprNode( new OperatorNode( OperatorNode::NCond ), $1, $4 ); }
    569566        | logical_OR_expression '?' comma_expression ':' tuple // CFA, tuple expression
    570                 { $$ = new CompositeExprNode2( build_cond( $1, $3, $5 ) ); }
     567                { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::Cond ), (ExpressionNode *)mkList( (*$1, *$3, *$5 ) ) ); }
    571568        ;
    572569
     
    579576        conditional_expression
    580577        | unary_expression '=' assignment_expression
    581                 { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::Assign ), $1, $3 ); }
     578                { $$ =new CompositeExprNode( new OperatorNode( OperatorNode::Assign ), $1, $3 ); }
    582579        | unary_expression assignment_operator assignment_expression
    583                 { $$ = new CompositeExprNode( $2, $1, $3 ); }
     580                { $$ =new CompositeExprNode( $2, $1, $3 ); }
    584581        | tuple assignment_opt                                                          // CFA, tuple expression
    585582                { $$ = ( $2 == 0 ) ? $1 : new CompositeExprNode( new OperatorNode( OperatorNode::Assign ), $1, $2 ); }
     
    627624        assignment_expression
    628625        | comma_expression ',' assignment_expression    // { $$ = (ExpressionNode *)$1->add_to_list( $3 ); }
    629         //{ $$ = new CompositeExprNode( new OperatorNode( OperatorNode::Comma ), $1, $3 ); }
    630                 { $$ = new CompositeExprNode2( build_comma( $1, $3 ) ); }
     626                { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::Comma ), $1, $3 ); }
    631627        ;
    632628
     
    721717                        // *before* the transfer to the appropriate case clause by hoisting the declarations into a compound
    722718                        // statement around the switch.  Statements after the initial declaration list can never be executed, and
    723                         // therefore, are removed from the grammar even though C allows it. The change also applies to choose
    724                         // statement.
     719                        // therefore, are removed from the grammar even though C allows it. Change also applies to choose statement.
    725720                        $$ = $7 != 0 ? new CompoundStmtNode( (StatementNode *)((new StatementNode( $7 ))->set_link( sw )) ) : sw;
    726721                }
     
    740735        constant_expression                                                     { $$ = $1; }
    741736        | constant_expression ELLIPSIS constant_expression      // GCC, subrange
    742                 { $$ = new CompositeExprNode2( build_opr2( OperatorNode::Range, $1, $3 ) ); }
     737                { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::Range ), $1, $3 ); }
    743738        | subrange                                                                                      // CFA, subrange
    744739        ;
    745740
    746741case_value_list:                                                                                // CFA
    747         case_value                                                                      { $$ = new StatementNode( StatementNode::Case, $1, 0 ); }
    748                 // convert case list, e.g., "case 1, 3, 5:" into "case 1: case 3: case 5"
    749         | case_value_list ',' case_value                        { $$ = (StatementNode *)($1->set_link( new StatementNode( StatementNode::Case, $3, 0 ) ) ); }
     742        case_value
     743        | case_value_list ',' case_value
     744                { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::TupleC ), (ExpressionNode *)(tupleContents( $1 ))->set_link( $3 ) ); }
    750745        ;
    751746
    752747case_label:                                                                                             // CFA
    753         CASE case_value_list ':'                                        { $$ = $2; }
     748        CASE case_value_list ':'                                        { $$ = new StatementNode( StatementNode::Case, $2, 0 ); }
    754749        | DEFAULT ':'                                                           { $$ = new StatementNode( StatementNode::Default ); }
    755750                // A semantic check is required to ensure only one default clause per switch/choose statement.
     
    17811776                { $$ = new DesignatorNode( $3, true ); }
    17821777        | '[' push constant_expression ELLIPSIS constant_expression pop ']' // GCC, multiple array elements
    1783                 { $$ = new DesignatorNode( new CompositeExprNode2( build_opr2( OperatorNode::Range, $3, $5 ) ), true ); }
     1778                { $$ = new DesignatorNode( new CompositeExprNode( new OperatorNode( OperatorNode::Range ), $3, $5 ), true ); }
    17841779        | '.' '[' push field_list pop ']'                                       // CFA, tuple field selector
    17851780                { $$ = new DesignatorNode( $4 ); }
     
    21102105subrange:
    21112106        constant_expression '~' constant_expression                     // CFA, integer subrange
    2112                 { $$ = new CompositeExprNode2( build_opr2( OperatorNode::Range, $1, $3 ) ); }
     2107                { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::Range ), $1, $3 ); }
    21132108        ;
    21142109
  • src/ResolvExpr/Resolver.cc

    rc331406 r5070fe4  
    2424#include "SynTree/Initializer.h"
    2525#include "SymTab/Indexer.h"
    26 #include "SymTab/Autogen.h"
    2726#include "Common/utility.h"
    2827#include "InitTweak/InitTweak.h"
     
    4241
    4342                virtual void visit( ArrayType * at );
    44                 virtual void visit( PointerType * at );
    4543
    4644                virtual void visit( ExprStmt *exprStmt );
     
    5452                virtual void visit( BranchStmt *branchStmt );
    5553                virtual void visit( ReturnStmt *returnStmt );
     54                virtual void visit( ImplicitCtorDtorStmt * impCtorDtorStmt );
    5655
    5756                virtual void visit( SingleInit *singleInit );
     
    6059          private:
    6160        typedef std::list< Initializer * >::iterator InitIterator;
    62 
    63                 template< typename PtrType >
    64                 void handlePtrType( PtrType * type );
    6561
    6662          void resolveAggrInit( AggregateDecl *, InitIterator &, InitIterator & );
     
    196192        }
    197193
    198         template< typename PtrType >
    199         void Resolver::handlePtrType( PtrType * type ) {
    200                 if ( type->get_dimension() ) {
    201                         CastExpr *castExpr = new CastExpr( type->get_dimension(), SymTab::SizeType->clone() );
     194        void Resolver::visit( ArrayType * at ) {
     195                if ( at->get_dimension() ) {
     196                        BasicType arrayLenType = BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt );
     197                        CastExpr *castExpr = new CastExpr( at->get_dimension(), arrayLenType.clone() );
    202198                        Expression *newExpr = findSingleExpression( castExpr, *this );
    203                         delete type->get_dimension();
    204                         type->set_dimension( newExpr );
    205                 }
    206         }
    207 
    208         void Resolver::visit( ArrayType * at ) {
    209                 handlePtrType( at );
     199                        delete at->get_dimension();
     200                        at->set_dimension( newExpr );
     201                }
    210202                Visitor::visit( at );
    211         }
    212 
    213         void Resolver::visit( PointerType * pt ) {
    214                 handlePtrType( pt );
    215                 Visitor::visit( pt );
    216203        }
    217204
     
    435422
    436423        void Resolver::visit( ListInit * listInit ) {
    437                 InitIterator iter = listInit->begin();
    438                 InitIterator end = listInit->end();
     424                InitIterator iter = listInit->begin_initializers();
     425                InitIterator end = listInit->end_initializers();
    439426
    440427                if ( ArrayType * at = dynamic_cast< ArrayType * >( initContext ) ) {
     
    534521                // implicitly generated, there's no way for it to have side effects, so get rid of it
    535522                // to clean up generated code.
    536                 if ( InitTweak::isIntrinsicSingleArgCallStmt( ctorInit->get_ctor() ) ) {
     523                if ( InitTweak::isInstrinsicSingleArgCallStmt( ctorInit->get_ctor() ) ) {
    537524                        delete ctorInit->get_ctor();
    538525                        ctorInit->set_ctor( NULL );
    539526                }
    540 
    541                 // xxx - todo
    542                 // if ( InitTweak::isIntrinsicCallStmt( ctorInit->get_ctor() ) ) {
    543                 //      // can reduce the constructor down to a SingleInit using the
    544                 //      // second argument from the ctor call
    545                 // }
    546 
    547                 if ( InitTweak::isIntrinsicSingleArgCallStmt( ctorInit->get_dtor() ) ) {
     527                if ( InitTweak::isInstrinsicSingleArgCallStmt( ctorInit->get_ctor() ) ) {
    548528                        delete ctorInit->get_dtor();
    549529                        ctorInit->set_dtor( NULL );
    550530                }
     531        }
     532
     533        void Resolver::visit( ImplicitCtorDtorStmt * impCtorDtorStmt ) {
     534                // before resolving ctor/dtor, need to remove type qualifiers from the first argument (the object being constructed).
     535                // Do this through a cast expression to greatly simplify the code.
     536                Expression * callExpr = InitTweak::getCtorDtorCall( impCtorDtorStmt );
     537                assert( callExpr );
     538                Expression *& constructee = InitTweak::getCallArg( callExpr, 0 );
     539                Type * type = 0;
     540
     541                // need to find the type of the first argument, which is unfortunately not uniform since array construction
     542                // includes an untyped '+' expression.
     543                if ( UntypedExpr * plusExpr = dynamic_cast< UntypedExpr * >( constructee ) ) {
     544                        // constructee is <array>+<index>
     545                        // get Variable <array>, then get the base type of the VariableExpr - this is the type that needs to be fixed
     546                        Expression * arr = InitTweak::getCallArg( plusExpr, 0 );
     547                        assert( dynamic_cast< VariableExpr * >( arr ) || dynamic_cast< MemberExpr *>( arr ) );
     548                        assert( arr && arr->get_results().size() == 1 );
     549                        type = arr->get_results().front()->clone();
     550                } else {
     551                        // otherwise, constructing a plain object, which means the object's address is being taken.
     552                        // Need to get the type of the VariableExpr object, because the AddressExpr is rebuilt and uses the
     553                        // type of the VariableExpr to do so.
     554                        assert( constructee->get_results().size() == 1 );
     555                        AddressExpr * addrExpr = dynamic_cast< AddressExpr * > ( constructee );
     556                        assert( addrExpr && addrExpr->get_results().size() == 1 );
     557                        type = addrExpr->get_results().front()->clone();
     558                }
     559                // cast to T* with qualifiers removed.
     560                // unfortunately, lvalue is considered a qualifier. For AddressExpr to resolve, its argument
     561                // must have an lvalue qualified type, so remove all qualifiers except lvalue. If we ever
     562                // remove lvalue as a qualifier, this can change to
     563                //   type->get_qualifiers() = Type::Qualifiers();
     564                Type * base = InitTweak::getPointerBase( type );
     565                assert( base );
     566                base->get_qualifiers() -= Type::Qualifiers(true, true, true, false, true, true);
     567                // if pointer has lvalue qualifier, cast won't appear in output
     568                type->set_isLvalue( false );
     569                constructee = new CastExpr( constructee, type );
     570
     571                // finally, resolve the ctor/dtor
     572                impCtorDtorStmt->get_callStmt()->accept( *this );
    551573        }
    552574} // namespace ResolvExpr
  • src/SymTab/AddVisit.h

    rc331406 r5070fe4  
    1010// Created On       : Sun May 17 16:14:32 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Aug  4 11:22:01 2016
    13 // Update Count     : 9
     12// Last Modified On : Tue Jul 12 17:46:33 2016
     13// Update Count     : 6
    1414//
    1515
     
    3333        template< typename Visitor >
    3434        inline void addVisit(SwitchStmt *switchStmt, Visitor &visitor) {
    35                 addVisitStatementList( switchStmt->get_statements(), visitor );
     35                addVisitStatementList( switchStmt->get_branches(), visitor );
    3636                maybeAccept( switchStmt->get_condition(), visitor );
    3737        }
  • src/SymTab/Autogen.cc

    rc331406 r5070fe4  
    2626
    2727namespace SymTab {
    28         Type * SizeType = 0;
    29 
    3028        class AutogenerateRoutines : public Visitor {
    3129                public:
     
    6159        bool isUnnamedBitfield( ObjectDecl * obj ) {
    6260                return obj != NULL && obj->get_name() == "" && obj->get_bitfieldWidth() != NULL;
     61        }
     62
     63        template< typename OutputIterator >
     64        void makeScalarFunction( Expression *src, ObjectDecl *dstParam, DeclarationWithType *member, std::string fname, OutputIterator out ) {
     65                ObjectDecl *obj = dynamic_cast<ObjectDecl *>( member );
     66                // unnamed bit fields are not copied as they cannot be accessed
     67                if ( isUnnamedBitfield( obj ) ) return;
     68
     69                // want to be able to generate assignment, ctor, and dtor generically,
     70                // so fname is either ?=?, ?{}, or ^?{}
     71                UntypedExpr *fExpr = new UntypedExpr( new NameExpr( fname ) );
     72
     73                UntypedExpr *derefExpr = new UntypedExpr( new NameExpr( "*?" ) );
     74                derefExpr->get_args().push_back( new VariableExpr( dstParam ) );
     75
     76                // do something special for unnamed members
     77                Expression *dstselect = new AddressExpr( new MemberExpr( member, derefExpr ) );
     78                fExpr->get_args().push_back( dstselect );
     79
     80                if ( src ) {
     81                        fExpr->get_args().push_back( src );
     82                }
     83
     84                Statement * callStmt = new ExprStmt( noLabels, fExpr );
     85                if ( (fname == "?{}" || fname == "^?{}") && ( !obj || ( obj && obj->get_bitfieldWidth() == NULL ) ) ) {
     86                        // implicitly generated ctor/dtor calls should be wrapped
     87                        // so that later passes are aware they were generated.
     88                        // xxx - don't mark as an implicit ctor/dtor if obj is a bitfield,
     89                        // because this causes the address to be taken at codegen, which is illegal in C.
     90                        callStmt = new ImplicitCtorDtorStmt( callStmt );
     91                }
     92                *out++ = callStmt;
    6393        }
    6494
     
    189219                }
    190220
    191                 InitTweak::InitExpander srcParam( src );
    192 
    193221                // assign to destination (and return value if generic)
    194                 UntypedExpr *derefExpr = new UntypedExpr( new NameExpr( "*?" ) );
    195                 derefExpr->get_args().push_back( new VariableExpr( dstParam ) );
    196                 Expression *dstselect = new MemberExpr( field, derefExpr );
    197                 genImplicitCall( srcParam, dstselect, func->get_name(), back_inserter( func->get_statements()->get_kids() ), field, forward );
    198 
    199                 if ( isDynamicLayout && returnVal ) {
    200                         UntypedExpr *derefRet = new UntypedExpr( new NameExpr( "*?" ) );
    201                         derefRet->get_args().push_back( new VariableExpr( returnVal ) );
    202                         Expression *retselect = new MemberExpr( field, derefRet );
    203                         genImplicitCall( srcParam, retselect, func->get_name(), back_inserter( func->get_statements()->get_kids() ), field, forward );
     222                if ( ArrayType *array = dynamic_cast< ArrayType * >( field->get_type() ) ) {
     223                        UntypedExpr *derefExpr = new UntypedExpr( new NameExpr( "*?" ) );
     224                        derefExpr->get_args().push_back( new VariableExpr( dstParam ) );
     225                        Expression *dstselect = new MemberExpr( field, derefExpr );
     226
     227                        makeArrayFunction( src, dstselect, array, func->get_name(), back_inserter( func->get_statements()->get_kids() ), forward );
     228                        if ( isDynamicLayout && returnVal ) {
     229                                UntypedExpr *derefRet = new UntypedExpr( new NameExpr( "*?" ) );
     230                                derefRet->get_args().push_back( new VariableExpr( returnVal ) );
     231                                Expression *retselect = new MemberExpr( field, derefRet );
     232
     233                                makeArrayFunction( src, retselect, array, func->get_name(), back_inserter( func->get_statements()->get_kids() ), forward );
     234                        }
     235                } else {
     236                        makeScalarFunction( src, dstParam, field, func->get_name(), back_inserter( func->get_statements()->get_kids() ) );
     237                        if ( isDynamicLayout && returnVal ) makeScalarFunction( src, returnVal, field, func->get_name(), back_inserter( func->get_statements()->get_kids() ) );
    204238                } // if
    205239        }
  • src/SymTab/Autogen.h

    rc331406 r5070fe4  
    2222#include "SynTree/Declaration.h"
    2323#include "SynTree/Initializer.h"
    24 #include "InitTweak/InitTweak.h"
    2524
    2625namespace SymTab {
    27         /// Generates assignment operators, constructors, and destructor for aggregate types as required
    28         void autogenerateRoutines( std::list< Declaration * > &translationUnit );
     26  /// Generates assignment operators, constructors, and destructor for aggregate types as required
     27  void autogenerateRoutines( std::list< Declaration * > &translationUnit );
    2928
    30         /// returns true if obj's name is the empty string and it has a bitfield width
    31         bool isUnnamedBitfield( ObjectDecl * obj );
     29  // originally makeArrayAssignment - changed to Function because it is now used for ctors and dtors as well
     30  // admittedly not a great name change. This used to live in Validate.cc, but has been moved so it can be reused elsewhere
    3231
    33         /// size_t type - set when size_t typedef is seen. Useful in a few places,
    34         /// such as in determining array dimension type
    35         extern Type * SizeType;
     32  /// Store in out a loop which calls fname on each element of the array with srcParam and dstParam as arguments.
     33  /// If forward is true, loop goes from 0 to N-1, else N-1 to 0
     34  template< typename OutputIterator >
     35  void makeArrayFunction( Expression *srcParam, Expression *dstParam, ArrayType *array, std::string fname, OutputIterator out, bool forward = true ) {
     36    static UniqueName indexName( "_index" );
    3637
    37         /// inserts into out a generated call expression to function fname with arguments dstParam and srcParam. Intended to be used with generated ?=?, ?{}, and ^?{} calls.
    38         template< typename OutputIterator >
    39         Statement * genCall( InitTweak::InitExpander & srcParam, Expression * dstParam, const std::string & fname, OutputIterator out, Type * type, bool addCast = false, bool forward = true );
     38    // for a flexible array member nothing is done -- user must define own assignment
     39    if ( ! array->get_dimension() ) return;
    4040
    41         /// inserts into out a generated call expression to function fname with arguments dstParam and srcParam. Should only be called with non-array types.
    42         /// optionally returns a statement which must be inserted prior to the containing loop, if there is one
    43         template< typename OutputIterator >
    44         Statement * genScalarCall( InitTweak::InitExpander & srcParam, Expression *dstParam, const std::string & fname, OutputIterator out, Type * type, bool addCast = false ) {
    45                 // want to be able to generate assignment, ctor, and dtor generically,
    46                 // so fname is either ?=?, ?{}, or ^?{}
    47                 UntypedExpr *fExpr = new UntypedExpr( new NameExpr( fname ) );
     41    Expression * begin, * end, * update, * cmp;
     42    if ( forward ) {
     43      // generate: for ( int i = 0; i < 0; ++i )
     44      begin = new NameExpr( "0" );
     45      end = array->get_dimension()->clone();
     46      cmp = new NameExpr( "?<?" );
     47      update = new NameExpr( "++?" );
     48    } else {
     49      // generate: for ( int i = N-1; i >= 0; --i )
     50      begin = new UntypedExpr( new NameExpr( "?-?" ) );
     51      ((UntypedExpr*)begin)->get_args().push_back( array->get_dimension()->clone() );
     52      ((UntypedExpr*)begin)->get_args().push_back( new NameExpr( "1" ) );
     53      end = new NameExpr( "0" );
     54      cmp = new NameExpr( "?>=?" );
     55      update = new NameExpr( "--?" );
     56    }
    4857
    49                 // do something special for unnamed members
    50                 dstParam = new AddressExpr( dstParam );
    51                 if ( addCast ) {
    52                         // cast to T* with qualifiers removed, so that qualified objects can be constructed
    53                         // and destructed with the same functions as non-qualified objects.
    54                         // unfortunately, lvalue is considered a qualifier. For AddressExpr to resolve, its argument
    55                         // must have an lvalue qualified type, so remove all qualifiers except lvalue. If we ever
    56                         // remove lvalue as a qualifier, this can change to
    57                         //   type->get_qualifiers() = Type::Qualifiers();
    58                         assert( type );
    59                         Type * castType = type->clone();
    60                         castType->get_qualifiers() -= Type::Qualifiers(true, true, true, false, true, true);
    61                         castType->set_isLvalue( true ); // xxx - might not need this
    62                         dstParam = new CastExpr( dstParam, new PointerType( Type::Qualifiers(), castType ) );
    63                 }
    64                 fExpr->get_args().push_back( dstParam );
     58    ObjectDecl *index = new ObjectDecl( indexName.newName(), DeclarationNode::NoStorageClass, LinkageSpec::C, 0, new BasicType( Type::Qualifiers(), BasicType::SignedInt ), NULL );
    6559
    66                 Statement * listInit = srcParam.buildListInit( fExpr );
     60    UntypedExpr *init = new UntypedExpr( new NameExpr( "?=?" ) );
     61    init->get_args().push_back( new AddressExpr( new VariableExpr( index ) ) );
     62    init->get_args().push_back( begin );
     63    index->set_init( new SingleInit( init, std::list<Expression*>() ) );
    6764
    68                 std::list< Expression * > args = *++srcParam;
    69                 fExpr->get_args().splice( fExpr->get_args().end(), args );
     65    UntypedExpr *cond = new UntypedExpr( cmp );
     66    cond->get_args().push_back( new VariableExpr( index ) );
     67    cond->get_args().push_back( end );
    7068
    71                 *out++ = new ExprStmt( noLabels, fExpr );
     69    UntypedExpr *inc = new UntypedExpr( update );
     70    inc->get_args().push_back( new AddressExpr( new VariableExpr( index ) ) );
    7271
    73                 srcParam.clearArrayIndices();
     72    // want to be able to generate assignment, ctor, and dtor generically,
     73    // so fname is either ?=?, ?{}, or ^?{}
     74    UntypedExpr *fExpr = new UntypedExpr( new NameExpr( fname ) );
    7475
    75                 return listInit;
    76         }
     76    UntypedExpr *dstIndex = new UntypedExpr( new NameExpr( "?+?" ) );
     77    dstIndex->get_args().push_back( dstParam );
     78    dstIndex->get_args().push_back( new VariableExpr( index ) );
     79    fExpr->get_args().push_back( dstIndex );
    7780
    78         /// Store in out a loop which calls fname on each element of the array with srcParam and dstParam as arguments.
    79         /// If forward is true, loop goes from 0 to N-1, else N-1 to 0
    80         template< typename OutputIterator >
    81         void genArrayCall( InitTweak::InitExpander & srcParam, Expression *dstParam, const std::string & fname, OutputIterator out, ArrayType *array, bool addCast = false, bool forward = true ) {
    82                 static UniqueName indexName( "_index" );
     81    // srcParam is NULL for default ctor/dtor
     82    if ( srcParam ) {
     83      UntypedExpr *srcIndex = new UntypedExpr( new NameExpr( "?[?]" ) );
     84      srcIndex->get_args().push_back( srcParam );
     85      srcIndex->get_args().push_back( new VariableExpr( index ) );
     86      fExpr->get_args().push_back( srcIndex );
     87    }
    8388
    84                 // for a flexible array member nothing is done -- user must define own assignment
    85                 if ( ! array->get_dimension() ) return ;
     89    std::list<Statement *> initList;
     90    CompoundStmt * block = new CompoundStmt( noLabels );
     91    block->get_kids().push_back( new DeclStmt( noLabels, index ) );
     92    block->get_kids().push_back( new ForStmt( noLabels, initList, cond, inc, new ExprStmt( noLabels, fExpr ) ) );
    8693
    87                 Expression * begin, * end, * update, * cmp;
    88                 if ( forward ) {
    89                         // generate: for ( int i = 0; i < 0; ++i )
    90                         begin = new NameExpr( "0" );
    91                         end = array->get_dimension()->clone();
    92                         cmp = new NameExpr( "?<?" );
    93                         update = new NameExpr( "++?" );
    94                 } else {
    95                         // generate: for ( int i = N-1; i >= 0; --i )
    96                         begin = new UntypedExpr( new NameExpr( "?-?" ) );
    97                         ((UntypedExpr*)begin)->get_args().push_back( array->get_dimension()->clone() );
    98                         ((UntypedExpr*)begin)->get_args().push_back( new NameExpr( "1" ) );
    99                         end = new NameExpr( "0" );
    100                         cmp = new NameExpr( "?>=?" );
    101                         update = new NameExpr( "--?" );
    102                 }
    103 
    104                 ObjectDecl *index = new ObjectDecl( indexName.newName(), DeclarationNode::NoStorageClass, LinkageSpec::C, 0, new BasicType( Type::Qualifiers(), BasicType::SignedInt ), NULL );
    105 
    106                 UntypedExpr *init = new UntypedExpr( new NameExpr( "?=?" ) );
    107                 init->get_args().push_back( new AddressExpr( new VariableExpr( index ) ) );
    108                 init->get_args().push_back( begin );
    109                 index->set_init( new SingleInit( init, std::list<Expression*>() ) );
    110 
    111                 UntypedExpr *cond = new UntypedExpr( cmp );
    112                 cond->get_args().push_back( new VariableExpr( index ) );
    113                 cond->get_args().push_back( end );
    114 
    115                 UntypedExpr *inc = new UntypedExpr( update );
    116                 inc->get_args().push_back( new AddressExpr( new VariableExpr( index ) ) );
    117 
    118                 UntypedExpr *dstIndex = new UntypedExpr( new NameExpr( "?[?]" ) );
    119                 dstIndex->get_args().push_back( dstParam );
    120                 dstIndex->get_args().push_back( new VariableExpr( index ) );
    121                 dstParam = dstIndex;
    122 
    123                 // srcParam must keep track of the array indices to build the
    124                 // source parameter and/or array list initializer
    125                 srcParam.addArrayIndex( new VariableExpr( index ), array->get_dimension()->clone() );
    126 
    127                 // for stmt's body, eventually containing call
    128                 CompoundStmt * body = new CompoundStmt( noLabels );
    129                 Statement * listInit = genCall( srcParam, dstParam, fname, back_inserter( body->get_kids() ), array->get_base(), addCast, forward );
    130 
    131                 // block containing for stmt and index variable
    132                 std::list<Statement *> initList;
    133                 CompoundStmt * block = new CompoundStmt( noLabels );
    134                 block->get_kids().push_back( new DeclStmt( noLabels, index ) );
    135                 if ( listInit ) block->get_kids().push_back( listInit );
    136                 block->get_kids().push_back( new ForStmt( noLabels, initList, cond, inc, body ) );
    137 
    138                 *out++ = block;
    139         }
    140 
    141         template< typename OutputIterator >
    142         Statement * genCall( InitTweak::InitExpander &  srcParam, Expression * dstParam, const std::string & fname, OutputIterator out, Type * type, bool addCast, bool forward ) {
    143                 if ( ArrayType * at = dynamic_cast< ArrayType * >( type ) ) {
    144                         genArrayCall( srcParam, dstParam, fname, out, at, addCast, forward );
    145                         return 0;
    146                 } else {
    147                         return genScalarCall( srcParam, dstParam, fname, out, type, addCast );
    148                 }
    149         }
    150 
    151         /// inserts into out a generated call expression to function fname with arguments dstParam
    152         /// and srcParam. Intended to be used with generated ?=?, ?{}, and ^?{} calls. decl is the
    153         /// object being constructed. The function wraps constructor and destructor calls in an
    154         /// ImplicitCtorDtorStmt node.
    155         template< typename OutputIterator >
    156         void genImplicitCall( InitTweak::InitExpander &  srcParam, Expression * dstParam, const std::string & fname, OutputIterator out, DeclarationWithType * decl, bool forward = true ) {
    157                 ObjectDecl *obj = dynamic_cast<ObjectDecl *>( decl );
    158                 assert( obj );
    159                 // unnamed bit fields are not copied as they cannot be accessed
    160                 if ( isUnnamedBitfield( obj ) ) return;
    161 
    162                 bool addCast = (fname == "?{}" || fname == "^?{}") && ( !obj || ( obj && obj->get_bitfieldWidth() == NULL ) );
    163                 std::list< Statement * > stmts;
    164                 genCall( srcParam, dstParam, fname, back_inserter( stmts ), obj->get_type(), addCast, forward );
    165 
    166                 // currently genCall should produce at most one element, but if that changes then the next line needs to be updated to grab the statement which contains the call
    167                 assert( stmts.size() <= 1 );
    168                 if ( stmts.size() == 1 ) {
    169                         Statement * callStmt = stmts.front();
    170                         if ( addCast ) {
    171                                 // implicitly generated ctor/dtor calls should be wrapped
    172                                 // so that later passes are aware they were generated.
    173                                 // xxx - don't mark as an implicit ctor/dtor if obj is a bitfield,
    174                                 // because this causes the address to be taken at codegen, which is illegal in C.
    175                                 callStmt = new ImplicitCtorDtorStmt( callStmt );
    176                         }
    177                         *out++ = callStmt;
    178                 }
    179         }
     94    Statement * stmt = block;
     95    if ( fname == "?{}" || fname == "^?{}" ) {
     96      // implicitly generated ctor/dtor calls should be wrapped
     97      // so that later passes are aware they were generated
     98      stmt = new ImplicitCtorDtorStmt( stmt );
     99    }
     100    *out++ = stmt;
     101  }
    180102} // namespace SymTab
    181103#endif // AUTOGEN_H
  • src/SymTab/FixFunction.cc

    rc331406 r5070fe4  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // FixFunction.cc --
     7// FixFunction.cc -- 
    88//
    99// Author           : Richard C. Bilson
     
    4444
    4545        Type * FixFunction::mutate(ArrayType *arrayType) {
    46                 // need to recursively mutate the base type in order for multi-dimensional arrays to work.
    47                 PointerType *pointerType = new PointerType( arrayType->get_qualifiers(), arrayType->get_base()->clone()->acceptMutator( *this ), maybeClone( arrayType->get_dimension() ), arrayType->get_isVarLen(), arrayType->get_isStatic() );
     46                PointerType *pointerType = new PointerType( arrayType->get_qualifiers(), maybeClone( arrayType->get_base()->clone() ), maybeClone( arrayType->get_dimension() ), arrayType->get_isVarLen(), arrayType->get_isStatic() );
    4847                delete arrayType;
    4948                return pointerType;
  • src/SymTab/Validate.cc

    rc331406 r5070fe4  
    174174
    175175                virtual void visit( FunctionDecl *funcDecl );
    176         };
     176};
    177177
    178178        class CompoundLiteral : public GenPoly::DeclMutator {
     
    191191                EliminateTypedef::eliminateTypedef( translationUnit );
    192192                HoistStruct::hoistStruct( translationUnit );
    193                 autogenerateRoutines( translationUnit ); // moved up, used to be below compoundLiteral - currently needs Pass1
    194193                acceptAll( translationUnit, pass1 );
    195194                acceptAll( translationUnit, pass2 );
    196195                ReturnChecker::checkFunctionReturns( translationUnit );
    197                 compoundliteral.mutateDeclarationList( translationUnit );
     196                mutateAll( translationUnit, compoundliteral );
     197                autogenerateRoutines( translationUnit );
    198198                acceptAll( translationUnit, pass3 );
    199199                VerifyCtorDtor::verify( translationUnit );
     
    490490                EliminateTypedef eliminator;
    491491                mutateAll( translationUnit, eliminator );
    492                 if ( eliminator.typedefNames.count( "size_t" ) ) {
    493                         // grab and remember declaration of size_t
    494                         SizeType = eliminator.typedefNames["size_t"].first->get_base()->clone();
    495                 } else {
    496                         // xxx - missing global typedef for size_t - default to long unsigned int, even though that may be wrong
    497                         // eventually should have a warning for this case.
    498                         SizeType = new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt );
    499                 }
    500492                filter( translationUnit, isTypedef, true );
    501 
    502493        }
    503494
     
    527518        Declaration *EliminateTypedef::mutate( TypedefDecl * tyDecl ) {
    528519                Declaration *ret = Mutator::mutate( tyDecl );
    529 
    530520                if ( typedefNames.count( tyDecl->get_name() ) == 1 && typedefNames[ tyDecl->get_name() ].second == scopeLevel ) {
    531521                        // typedef to the same name from the same scope
  • src/SynTree/AddStmtVisitor.cc

    rc331406 r5070fe4  
    1010// Created On       : Wed Jun 22 12:11:17 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Aug  4 11:23:47 2016
    13 // Update Count     : 16
     12// Last Modified On : Tue Jul 12 17:49:59 2016
     13// Update Count     : 12
    1414//
    1515
     
    7171
    7272void AddStmtVisitor::visit(SwitchStmt *switchStmt) {
    73         visitStatementList( switchStmt->get_statements() );
     73        visitStatementList( switchStmt->get_branches() );
    7474        maybeAccept( switchStmt->get_condition(), *this );
    7575}
  • src/SynTree/Declaration.cc

    rc331406 r5070fe4  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // Declaration.cc --
     7// Declaration.cc -- 
    88//
    99// Author           : Richard C. Bilson
     
    2020#include "Initializer.h"
    2121#include "Type.h"
    22 #include "Attribute.h"
    2322#include "Common/utility.h"
    2423
  • src/SynTree/Declaration.h

    rc331406 r5070fe4  
    6464class DeclarationWithType : public Declaration {
    6565  public:
    66         DeclarationWithType( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, const std::list< Attribute * > & attributes );
     66        DeclarationWithType( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage );
    6767        DeclarationWithType( const DeclarationWithType &other );
    6868        virtual ~DeclarationWithType();
     
    7575        int get_scopeLevel() const { return scopeLevel; }
    7676        void set_scopeLevel( int newValue ) { scopeLevel = newValue; }
    77 
    78         std::list< Attribute * >& get_attributes() { return attributes; }
    79         const std::list< Attribute * >& get_attributes() const { return attributes; }
    8077
    8178        virtual DeclarationWithType *clone() const = 0;
     
    9087        // shadowed identifiers can be accessed
    9188        int scopeLevel = 0;
    92 
    93         std::list< Attribute * > attributes;
    9489};
    9590
     
    9792        typedef DeclarationWithType Parent;
    9893  public:
    99         ObjectDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, Expression *bitfieldWidth, Type *type, Initializer *init, const std::list< Attribute * > attributes = std::list< Attribute * >(), bool isInline = false, bool isNoreturn = false );
     94        ObjectDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, Expression *bitfieldWidth, Type *type, Initializer *init, bool isInline = false, bool isNoreturn = false );
    10095        ObjectDecl( const ObjectDecl &other );
    10196        virtual ~ObjectDecl();
     
    136131        std::list< std::string >& get_oldIdents() { return oldIdents; }
    137132        std::list< Declaration* >& get_oldDecls() { return oldDecls; }
     133        std::list< Attribute * >& get_attributes() { return attributes; }
    138134
    139135        virtual FunctionDecl *clone() const { return new FunctionDecl( *this ); }
     
    147143        std::list< std::string > oldIdents;
    148144        std::list< Declaration* > oldDecls;
     145        std::list< Attribute * > attributes;
    149146};
    150147
  • src/SynTree/DeclarationWithType.cc

    rc331406 r5070fe4  
    1616#include "Declaration.h"
    1717#include "Type.h"
    18 #include "Attribute.h"
    1918#include "Common/utility.h"
    2019
    21 DeclarationWithType::DeclarationWithType( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, const std::list< Attribute * > & attributes )
    22                 : Declaration( name, sc, linkage ), attributes( attributes ) {
     20DeclarationWithType::DeclarationWithType( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage )
     21                : Declaration( name, sc, linkage ) {
    2322}
    2423
    2524DeclarationWithType::DeclarationWithType( const DeclarationWithType &other )
    2625                : Declaration( other ), mangleName( other.mangleName ), scopeLevel( other.scopeLevel ) {
    27         cloneAll( other.attributes, attributes );
    2826}
    2927
    3028DeclarationWithType::~DeclarationWithType() {
    31         deleteAll( attributes );
    3229}
    3330
  • src/SynTree/Expression.cc

    rc331406 r5070fe4  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Aug  3 17:06:51 2016
    13 // Update Count     : 45
     12// Last Modified On : Mon Jun 13 16:03:39 2016
     13// Update Count     : 42
    1414//
    1515
     
    344344}
    345345
    346 //// is this right? It's cloning the member, but the member is a declaration so probably shouldn't be cloned...
    347346MemberExpr::MemberExpr( const MemberExpr &other ) :
    348                 Expression( other ), member( other.member ), aggregate( maybeClone( other.aggregate ) ) {
     347                Expression( other ), member( maybeClone( other.member ) ), aggregate( maybeClone( other.aggregate ) ) {
    349348}
    350349
    351350MemberExpr::~MemberExpr() {
    352         // delete member;
     351        delete member;
    353352        delete aggregate;
    354353}
     
    529528}
    530529
    531 RangeExpr::RangeExpr( ConstantExpr *low, ConstantExpr *high ) : low( low ), high( high ) {}
    532 RangeExpr::RangeExpr( const RangeExpr &other ) : low( other.low->clone() ), high( other.high->clone() ) {}
    533 void RangeExpr::print( std::ostream &os, int indent ) const {
    534         os << std::string( indent, ' ' ) << "Range Expression: ";
    535         low->print( os, indent );
    536         os << " ... ";
    537         high->print( os, indent );
    538 }
    539530
    540531std::ostream & operator<<( std::ostream & out, Expression * expr ) {
  • src/SynTree/Expression.h

    rc331406 r5070fe4  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Aug  3 17:08:44 2016
    13 // Update Count     : 27
     12// Last Modified On : Mon Jul  4 14:45:32 2016
     13// Update Count     : 23
    1414//
    1515
     
    1818
    1919#include <map>
    20 #include <memory>
    2120#include "SynTree.h"
    2221#include "Visitor.h"
     
    635634};
    636635
    637 class RangeExpr : public Expression {
    638   public:
    639         RangeExpr( ConstantExpr *low, ConstantExpr *high );
    640         RangeExpr( const RangeExpr &other );
    641 
    642         ConstantExpr * get_low() const { return low.get(); }
    643         ConstantExpr * get_high() const { return high.get(); }
    644         RangeExpr * set_low( ConstantExpr *low ) { RangeExpr::low.reset( low ); return this; }
    645         RangeExpr * set_high( ConstantExpr *high ) { RangeExpr::high.reset( high ); return this; }
    646 
    647         virtual RangeExpr *clone() const { return new RangeExpr( *this ); }
    648         virtual void accept( Visitor &v ) { v.visit( this ); }
    649         virtual Expression *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    650         virtual void print( std::ostream &os, int indent = 0 ) const;
    651   private:
    652         std::unique_ptr<ConstantExpr> low, high;
    653 };
    654 
    655636std::ostream & operator<<( std::ostream & out, Expression * expr );
    656637
  • src/SynTree/FunctionDecl.cc

    rc331406 r5070fe4  
    2323
    2424FunctionDecl::FunctionDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, FunctionType *type, CompoundStmt *statements, bool isInline, bool isNoreturn, std::list< Attribute * > attributes )
    25                 : Parent( name, sc, linkage, attributes ), type( type ), statements( statements ) {
     25                : Parent( name, sc, linkage ), type( type ), statements( statements ), attributes( attributes ) {
    2626        set_isInline( isInline );
    2727        set_isNoreturn( isNoreturn );
     
    3434FunctionDecl::FunctionDecl( const FunctionDecl &other )
    3535        : Parent( other ), type( maybeClone( other.type ) ), statements( maybeClone( other.statements ) ) {
     36                cloneAll( other.attributes, attributes );
    3637}
    3738
     
    3940        delete type;
    4041        delete statements;
     42        deleteAll( attributes );
    4143}
    4244
     
    6769        } // if
    6870
    69         printAll( get_attributes(), os, indent );
     71        printAll( attributes, os, indent );
    7072
    7173        if ( get_storageClass() != DeclarationNode::NoStorageClass ) {
  • src/SynTree/Initializer.h

    rc331406 r5070fe4  
    9393        std::list<Initializer*> &get_initializers() { return initializers; }
    9494
    95         typedef std::list<Initializer*>::iterator iterator;
    96         iterator begin() { return initializers.begin(); }
    97         iterator end() { return initializers.end(); }
     95        std::list<Initializer*>::iterator begin_initializers() { return initializers.begin(); }
     96        std::list<Initializer*>::iterator end_initializers() { return initializers.end(); }
    9897
    9998        virtual ListInit *clone() const { return new ListInit( *this ); }
  • src/SynTree/Label.h

    rc331406 r5070fe4  
    2424class Label {
    2525  public:
    26         Label( const std::string & name = "", Statement * labelled = 0, const std::list< Attribute * > & attributes = std::list< Attribute * >() ) : name( name ), labelled( labelled ), attributes( attributes ) {}
     26        Label( const std::string & name = "", Statement * labelled = 0 ) : name( name ), labelled( labelled ) {}
    2727        Label( const char * name, Statement * labelled = 0 ) : name( name ), labelled( labelled ) {}
    2828
  • src/SynTree/Mutator.cc

    rc331406 r5070fe4  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Aug  4 11:23:21 2016
    13 // Update Count     : 19
     12// Last Modified On : Tue Jul 12 17:51:19 2016
     13// Update Count     : 17
    1414//
    1515
     
    126126Statement *Mutator::mutate( SwitchStmt *switchStmt ) {
    127127        switchStmt->set_condition( maybeMutate( switchStmt->get_condition(), *this ) );
    128         mutateAll( switchStmt->get_statements(), *this );
     128        mutateAll( switchStmt->get_branches(), *this );
    129129        return switchStmt;
    130130}
     
    349349        compLitExpr->set_initializer( maybeMutate( compLitExpr->get_initializer(), *this ) );
    350350        return compLitExpr;
    351 }
    352 
    353 Expression *Mutator::mutate( RangeExpr *rangeExpr ) {
    354         rangeExpr->set_low( maybeMutate( rangeExpr->get_low(), *this ) );
    355         rangeExpr->set_high( maybeMutate( rangeExpr->get_high(), *this ) );
    356         return rangeExpr;
    357351}
    358352
  • src/SynTree/Mutator.h

    rc331406 r5070fe4  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Aug  3 16:59:45 2016
    13 // Update Count     : 12
     12// Last Modified On : Tue Jul 12 17:51:43 2016
     13// Update Count     : 11
    1414//
    1515#include <cassert>
     
    7878        virtual Expression* mutate( UntypedValofExpr *valofExpr );
    7979        virtual Expression* mutate( CompoundLiteralExpr *compLitExpr );
    80         virtual Expression* mutate( RangeExpr *rangeExpr );
    8180
    8281        virtual Type* mutate( VoidType *basicType );
  • src/SynTree/ObjectDecl.cc

    rc331406 r5070fe4  
    1818#include "Initializer.h"
    1919#include "Expression.h"
    20 #include "Attribute.h"
    2120#include "Common/utility.h"
    2221#include "Statement.h"
    2322
    24 ObjectDecl::ObjectDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, Expression *bitfieldWidth, Type *type, Initializer *init, const std::list< Attribute * > attributes, bool isInline, bool isNoreturn )
    25         : Parent( name, sc, linkage, attributes ), type( type ), init( init ), bitfieldWidth( bitfieldWidth ) {
     23ObjectDecl::ObjectDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, Expression *bitfieldWidth, Type *type, Initializer *init, bool isInline, bool isNoreturn )
     24        : Parent( name, sc, linkage ), type( type ), init( init ), bitfieldWidth( bitfieldWidth ) {
    2625        set_isInline( isInline );
    2726        set_isNoreturn( isNoreturn );
     
    4645                os << LinkageSpec::toString( get_linkage() ) << " ";
    4746        } // if
    48 
    49         printAll( get_attributes(), os, indent );
    5047
    5148        if ( get_storageClass() != DeclarationNode::NoStorageClass ) {
     
    8380        } // if
    8481
    85         // xxx - should printShort print attributes?
    86 
    8782        if ( get_storageClass() != DeclarationNode::NoStorageClass ) {
    8883                os << DeclarationNode::storageName[ get_storageClass() ] << ' ';
  • src/SynTree/Statement.cc

    rc331406 r5070fe4  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Aug  4 11:25:20 2016
    13 // Update Count     : 61
     12// Last Modified On : Tue Jul 12 17:52:32 2016
     13// Update Count     : 55
    1414//
    1515
     
    143143}
    144144
    145 SwitchStmt::SwitchStmt( std::list<Label> _labels, Expression * _condition, std::list<Statement *> &_statements ):
    146         Statement( _labels ), condition( _condition ), statements( _statements ) {
     145SwitchStmt::SwitchStmt( std::list<Label> _labels, Expression * _condition, std::list<Statement *> &_branches ):
     146        Statement( _labels ), condition( _condition ), branches( _branches ) {
    147147}
    148148
    149149SwitchStmt::SwitchStmt( const SwitchStmt & other ):
    150150        Statement( other ), condition( maybeClone( other.condition ) ) {
    151         cloneAll( other.statements, statements );
     151        cloneAll( other.branches, branches );
    152152}
    153153
    154154SwitchStmt::~SwitchStmt() {
    155155        delete condition;
    156         // destroy statements
    157 }
     156        // destroy branches
     157}
     158
     159void SwitchStmt::add_case( CaseStmt *c ) {}
    158160
    159161void SwitchStmt::print( std::ostream &os, int indent ) const {
     
    162164        os << endl;
    163165
    164         // statements
     166        // branches
    165167        std::list<Statement *>::const_iterator i;
    166         for ( i = statements.begin(); i != statements.end(); i++)
     168        for ( i = branches.begin(); i != branches.end(); i++)
    167169                (*i)->print( os, indent + 4 );
    168170
    169         //for_each( statements.begin(), statements.end(), mem_fun( bind1st(&Statement::print ), os ));
     171        //for_each( branches.begin(), branches.end(), mem_fun( bind1st(&Statement::print ), os ));
    170172}
    171173
     
    185187}
    186188
    187 CaseStmt * CaseStmt::makeDefault( std::list<Label> labels, std::list<Statement *> stmts ) {
    188         return new CaseStmt( labels, 0, stmts, true );
     189CaseStmt * CaseStmt::makeDefault( std::list<Label> labels, std::list<Statement *> branches ) {
     190        return new CaseStmt( labels, 0, branches, true );
    189191}
    190192
  • src/SynTree/Statement.h

    rc331406 r5070fe4  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Aug  4 11:26:02 2016
    13 // Update Count     : 64
     12// Last Modified On : Tue Jul 12 17:53:29 2016
     13// Update Count     : 47
    1414//
    1515
     
    129129class SwitchStmt : public Statement {
    130130  public:
    131         SwitchStmt( std::list<Label> labels, Expression *condition, std::list<Statement *> &statements );
     131        SwitchStmt( std::list<Label> labels, Expression *condition, std::list<Statement *> &branches );
    132132        SwitchStmt( const SwitchStmt &other );
    133133        virtual ~SwitchStmt();
     
    136136        void set_condition( Expression *newValue ) { condition = newValue; }
    137137
    138         std::list<Statement *> & get_statements() { return statements; }
     138        std::list<Statement *> & get_branches() { return branches; }
     139        void add_case( CaseStmt * );
    139140
    140141        virtual void accept( Visitor &v ) { v.visit( this ); }
     
    145146  private:
    146147        Expression * condition;
    147         std::list<Statement *> statements;
     148        std::list<Statement *> branches; // should be list of CaseStmt
    148149};
    149150
    150151class CaseStmt : public Statement {
    151152  public:
    152         CaseStmt( std::list<Label> labels, Expression *conditions, std::list<Statement *> &stmts, bool isdef = false ) throw(SemanticError);
     153        CaseStmt( std::list<Label> labels, Expression *conditions,
     154              std::list<Statement *> &stmts, bool isdef = false ) throw(SemanticError);
    153155        CaseStmt( const CaseStmt &other );
    154156        virtual ~CaseStmt();
    155157
    156         static CaseStmt * makeDefault( std::list<Label> labels = std::list<Label>(), std::list<Statement *> stmts = std::list<Statement *>() );
     158        static CaseStmt * makeDefault( std::list<Label> labels = std::list<Label>(),
     159                std::list<Statement *> stmts = std::list<Statement *>() );
    157160
    158161        bool isDefault() const { return _isDefault; }
  • src/SynTree/SynTree.h

    rc331406 r5070fe4  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Aug  3 17:02:34 2016
    13 // Update Count     : 7
     12// Last Modified On : Tue Jul 12 17:54:02 2016
     13// Update Count     : 6
    1414//
    1515
     
    8383class UntypedValofExpr;
    8484class CompoundLiteralExpr;
    85 class RangeExpr;
    8685
    8786class Type;
  • src/SynTree/Visitor.cc

    rc331406 r5070fe4  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Aug  4 11:24:25 2016
    13 // Update Count     : 21
     12// Last Modified On : Tue Jul 12 17:54:39 2016
     13// Update Count     : 19
    1414//
    1515
     
    109109void Visitor::visit( SwitchStmt *switchStmt ) {
    110110        maybeAccept( switchStmt->get_condition(), *this );
    111         acceptAll( switchStmt->get_statements(), *this );
     111        acceptAll( switchStmt->get_branches(), *this );
    112112}
    113113
     
    296296        maybeAccept( compLitExpr->get_type(), *this );
    297297        maybeAccept( compLitExpr->get_initializer(), *this );
    298 }
    299 
    300 void Visitor::visit( RangeExpr *rangeExpr ) {
    301         maybeAccept( rangeExpr->get_low(), *this );
    302         maybeAccept( rangeExpr->get_high(), *this );
    303298}
    304299
  • src/SynTree/Visitor.h

    rc331406 r5070fe4  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Aug  3 17:01:50 2016
    13 // Update Count     : 9
     12// Last Modified On : Tue Jul 12 17:55:09 2016
     13// Update Count     : 8
    1414//
    1515
     
    7878        virtual void visit( UntypedValofExpr *valofExpr );
    7979        virtual void visit( CompoundLiteralExpr *compLitExpr );
    80         virtual void visit( RangeExpr *rangeExpr );
    8180
    8281        virtual void visit( VoidType *basicType );
  • src/examples/gc_no_raii/bug-repro/return_template.c

    rc331406 r5070fe4  
    55};
    66
    7 forall(otype T) void ?{}(wrap(T)* this);
    8 forall(otype T) void ?{}(wrap(T)* this, wrap(T)* rhs);
    9 forall(otype T) void ^?{}(wrap(T)* this);
    10 forall(otype T) void ?=?(wrap(T)* this, wrap(T)* rhs);
    11 
    127forall(otype T)
    13 wrap(T) test()
     8static inline wrap(T) test()
    149{
    1510        wrap(T) tester;
  • src/examples/gc_no_raii/src/gc.h

    rc331406 r5070fe4  
    77static inline gcpointer(T) gcmalloc()
    88{
    9     gcpointer(T) ptr;
    10     void* address = gc_allocate(sizeof(T));
    11     (&ptr){ address };
    12     ctor(&ptr, address);
    13     gc_conditional_collect();
    14     return ptr;
     9    gcpointer(T) test;
     10    // ctor(&test, gc_allocate(sizeof(T)));
     11    // gc_conditional_collect();
     12    return test;
    1513}
  • src/examples/gc_no_raii/src/gcpointers.c

    rc331406 r5070fe4  
    11#include "gcpointers.h"
    22
    3 // #include "gc.h"
     3#include "gc.h"
    44#include "internal/collector.h"
    55#include "internal/object_header.h"
  • src/examples/gc_no_raii/src/gcpointers.h

    rc331406 r5070fe4  
    1010};
    1111
    12 void ?{}(gcpointer_t* this);
    13 void ?{}(gcpointer_t* this, void* address);
    14 void ?{}(gcpointer_t* this, gcpointer_t other);
    15 void ^?{}(gcpointer_t* this);
    16 gcpointer_t* ?=?(gcpointer_t this, gcpointer_t rhs);
     12void gcpointer_ctor(gcpointer_t* this);
     13void gcpointer_ctor(gcpointer_t* this, void* address);
     14void gcpointer_ctor(gcpointer_t* this, gcpointer_t* other);
     15void gcpointer_dtor(gcpointer_t* this);
     16gcpointer_t* gcpointer_assign(gcpointer_t* this, gcpointer_t* rhs);
    1717
    1818//Logical operators
     
    2727};
    2828
    29 //
    30 forall(otype T) void ?{}(gcpointer(T)* this);
    31 forall(otype T) void ?{}(gcpointer(T)* this, void* address);
    32 forall(otype T) void ctor(gcpointer(T)* this, void* address);
    33 forall(otype T) void ?{}(gcpointer(T)* this, gcpointer(T)* other);
    34 forall(otype T) void ^?{}(gcpointer(T)* this);
    35 forall(otype T) gcpointer(T) ?=?(gcpointer(T) this, gcpointer(T) rhs);
     29forall(otype T)
     30static inline void ctor(gcpointer(T)* this)
     31{
     32        gcpointer_ctor(&this->internal);
     33}
    3634
     35// forall(otype T)
     36// static inline void ctor(gcpointer(T)* this, int null)
     37// {
     38//      gcpointer_ctor(&this->internal, NULL);
     39// }
    3740
    38 forall(otype T) T *?(gcpointer(T) this);
     41forall(otype T)
     42static inline void ctor(gcpointer(T)* this, void* address)
     43{
     44        gcpointer_ctor(&this->internal, address);
     45}
     46
     47forall(otype T)
     48static inline void ctor(gcpointer(T)* this, gcpointer(T)* other)
     49{
     50        gcpointer_ctor(&this->internal, other);
     51}
     52
     53forall(otype T)
     54static inline void dtor(gcpointer(T)* this)
     55{
     56        gcpointer_dtor(&this->internal);
     57}
     58
     59forall(otype T)
     60static inline gcpointer(T)* ?=?(gcpointer(T)* this, gcpointer(T)* rhs)
     61{
     62        gcpointer_assign(&this->internal, &rhs->internal);
     63        return this;
     64}
     65
     66forall(otype T)
     67static inline T *?(gcpointer(T) this)
     68{
     69        return *(T*)this.internal.ptr;
     70}
    3971
    4072//Logical operators
    41 forall(otype T) int ?!=?(gcpointer(T) this, gcpointer(T) rhs);
    42 forall(otype T) int ?==?(gcpointer(T) this, gcpointer(T) rhs);
     73forall(otype T)
     74static inline int ?!=?(gcpointer(T) this, gcpointer(T) rhs)
     75{
     76        return this.internal.ptr != rhs.internal.ptr;
     77}
     78
     79forall(otype T)
     80static inline int ?==?(gcpointer(T) this, gcpointer(T) rhs)
     81{
     82        return !(this == rhs);
     83}
     84
     85forall(otype T)
     86extern struct gcpointer(T) 0;
  • src/examples/gc_no_raii/src/internal/memory_pool.h

    rc331406 r5070fe4  
    33extern "C" {
    44#include <stdbool.h>
    5 #include <stddef.h>
    65#include <stdint.h>
    76}
  • src/examples/gc_no_raii/src/internal/state.h

    rc331406 r5070fe4  
    11#pragma once
    22
    3 #ifdef __cforall
    4 extern "C" {
    5 #endif
    63#include <stddef.h>
    74#include <stdint.h>
    8 #ifdef __cforall
    9 }
    10 #endif
    11 #include <vector>
    125
    136#include "tools.h"
     7#include "vector.h"
    148
    159typedef vector(struct gc_memory_pool*, heap_allocator(struct gc_memory_pool*)) pools_table_t;
  • src/examples/gc_no_raii/src/tools/worklist.h

    rc331406 r5070fe4  
    1010#endif
    1111
    12 #include <vector>
     12#include "vector.h"
    1313
    1414typedef vector(intptr_t*, heap_allocator(intptr_t*)) worklist_t;
  • src/examples/gc_no_raii/test/badlll.c

    rc331406 r5070fe4  
    77};
    88
    9 void ?{}(List_t* this);
    10 List_t* ?=?(List_t* this, List_t* rhs);
    11 
    129typedef gcpointer(List_t) LLL;
    1310
    1411#define MAX (1024 * 1024)
    1512
    16 // LLL buildLLL(int sz)
    17 void bla()
     13LLL buildLLL(int sz)
    1814{
    1915        int i;
    20         // LLL ll0;//, lll, llc;
    21 //
    22 //      ll0 = gcmalloc();
    23 //      ll0->val = 0;
    24 //      lll = ll0;
    25 //
    26 //      for (i = 1; i < sz; i++)
    27 //      {
    28 //              llc = gcmalloc();
    29 //              llc->val = i;
    30 //              lll->next = llc;
    31 //              lll = llc;
    32 //      }
    33 //
    34         // return ll0;
     16        LLL ll0, lll, llc;
     17
     18        ll0 = gcmalloc();
     19        ll0->val = 0;
     20        lll = ll0;
     21
     22        for (i = 1; i < sz; i++)
     23        {
     24                llc = gcmalloc();
     25                llc->val = i;
     26                lll->next = llc;
     27                lll = llc;
     28        }
     29
     30        return ll0;
    3531}
    36 //
    37 // void testLLL(LLL lll)
    38 // {
    39 //      unsigned char *counted;
    40 //
    41 //      counted = (unsigned char *) calloc(MAX, sizeof(unsigned char));
    42 //      while (lll)
    43 //      {
    44 //              counted[lll->val]++;
    45 //              if (counted[lll->val] > 1)
    46 //              {
    47 //                      fprintf(stderr, "ERROR! Encountered %d twice!\n", lll->val);
    48 //                      exit(1);
    49 //              }
    50 //              lll = lll->next;
    51 //      }
    52 //
    53 //      return;
    54 // }
     32
     33void testLLL(LLL lll)
     34{
     35        unsigned char *counted;
     36
     37        counted = (unsigned char *) calloc(MAX, sizeof(unsigned char));
     38        while (lll)
     39        {
     40                counted[lll->val]++;
     41                if (counted[lll->val] > 1)
     42                {
     43                        fprintf(stderr, "ERROR! Encountered %d twice!\n", lll->val);
     44                        exit(1);
     45                }
     46                lll = lll->next;
     47        }
     48
     49        return;
     50}
    5551
    5652int main(void)
     
    5854        LLL mylll;
    5955
    60         // mylll = buildLLL(MAX);
    61         //
    62         // testLLL(mylll);
     56        mylll = buildLLL(MAX);
     57
     58        testLLL(mylll);
    6359
    6460        return 0;
  • src/examples/gc_no_raii/test/gctest.c

    rc331406 r5070fe4  
    77int main() {
    88        sout | "Bonjour au monde!\n";
    9 
    10         gcpointer(int) anInt = gcmalloc();
    119}
  • src/main.cc

    rc331406 r5070fe4  
    4343#include "InitTweak/GenInit.h"
    4444#include "InitTweak/FixInit.h"
     45#include "InitTweak/FixGlobalInit.h"
    4546//#include "Explain/GenProlog.h"
    4647//#include "Try/Visit.h"
     
    282283                OPTPRINT( "fixNames" )
    283284                CodeGen::fixNames( translationUnit );
     285                OPTPRINT( "fixGlobalInit" );
     286                InitTweak::fixGlobalInit( translationUnit, filename, libcfap || treep );
    284287                OPTPRINT( "tweakInit" )
    285288                InitTweak::genInit( translationUnit );
     
    302305                }
    303306
     307                OPTPRINT( "fixInit" )
    304308                // fix ObjectDecl - replaces ConstructorInit nodes
    305                 OPTPRINT( "fixInit" )
    306                 InitTweak::fix( translationUnit, filename, libcfap || treep );
     309                InitTweak::fix( translationUnit );
    307310                if ( ctorinitp ) {
    308311                        dump ( translationUnit );
  • src/tests/.expect/64/extension.txt

    rc331406 r5070fe4  
    100100    ((void)((__extension__ __a__i_2 , __extension__ __b__i_2) , __extension__ __c__i_2));
    101101}
     102__attribute__ ((constructor(),)) static void _init_extension(void){
     103    int _global_init0;
     104    ((void)((*((int *)(&__a__i_1)))=_global_init0) /* ?{} */);
     105    int _global_init1;
     106    ((void)((*((int *)(&__b__i_1)))=_global_init1) /* ?{} */);
     107    int _global_init2;
     108    ((void)((*((int *)(&__c__i_1)))=_global_init2) /* ?{} */);
     109}
     110__attribute__ ((destructor(),)) static void _destroy_extension(void){
     111    ((void)((*((int *)(&__c__i_1)))) /* ^?{} */);
     112    ((void)((*((int *)(&__b__i_1)))) /* ^?{} */);
     113    ((void)((*((int *)(&__a__i_1)))) /* ^?{} */);
     114}
  • src/tests/init_once.c

    rc331406 r5070fe4  
    9292init_once y = x;
    9393
    94 void static_variable() {
    95         static init_once x;
    96 }
    97 
    9894int main() {
    9995        // local variables
     
    183179                }
    184180        }
    185 
    186         // function-scoped static variable
    187         for (int i = 0; i < 10; i++) {
    188                 static_variable();
    189         }
    190181}
    191182
  • src/tests/switch.c

    rc331406 r5070fe4  
    1010// Created On       : Tue Jul 12 06:50:22 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Aug  4 11:44:29 2016
    13 // Update Count     : 31
     12// Last Modified On : Sat Jul 30 14:41:32 2016
     13// Update Count     : 30
    1414//
    1515
     
    3939          case 4:
    4040                j = 0;
    41         }
    42 
    43         switch ( i ) {
    44           case 1, 2, 3:
    45                 switch ( i ) {
    46                   case 2, 3, 4:
    47                         7;
    48                 }
    4941        }
    5042
Note: See TracChangeset for help on using the changeset viewer.