Changeset 6603c1d


Ignore:
Timestamp:
Aug 15, 2016, 10:18:22 AM (7 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
b1848a0
Parents:
38736854 (diff), 797347f (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

Files:
20 edited

Legend:

Unmodified
Added
Removed
  • doc/LaTeXmacros/common.tex

    r38736854 r6603c1d  
    1111%% Created On       : Sat Apr  9 10:06:17 2016
    1212%% Last Modified By : Peter A. Buhr
    13 %% Last Modified On : Tue Aug  2 17:02:02 2016
    14 %% Update Count     : 228
     13%% Last Modified On : Sun Aug 14 08:27:29 2016
     14%% Update Count     : 231
    1515%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    1616
     
    153153        {\abbrevFont{etc}.\xspace}%
    154154}%
     155\newcommand{\etal}{%
     156        \@ifnextchar{.}{\abbrevFont{et~al}}%
     157                {\abbrevFont{et al}.\xspace}%
     158}%
    155159\makeatother
    156160
     
    251255literate={-}{\raisebox{-0.15ex}{\texttt{-}}}1 {^}{\raisebox{0.6ex}{$\scriptscriptstyle\land\,$}}1
    252256        {~}{\raisebox{0.3ex}{$\scriptstyle\sim\,$}}1 {_}{\makebox[1.2ex][c]{\rule{1ex}{0.1ex}}}1 {`}{\ttfamily\upshape\hspace*{-0.1ex}`}1
    253         {<-}{$\leftarrow$}2 {=>}{$\Rightarrow$}2 {...}{$\dots$}2,
     257        {<-}{$\leftarrow$}2 {=>}{$\Rightarrow$}2,
    254258}%
    255259
  • doc/aaron_comp_II/comp_II.tex

    r38736854 r6603c1d  
    413413\subsection{Argument-Parameter Matching}
    414414The first axis for consideration is argument-parameter matching direction --- whether the type matching for a candidate function to a set of candidate arguments is directed by the argument types or the parameter types.
     415For programming languages without implicit conversions, argument-parameter matching is essentially the entirety of the expression resolution problem, and is generally referred to as ``overload resolution'' in the literature.
    415416All expression resolution algorithms form a DAG of interpretations, some explicitly, some implicitly; in this DAG, arcs point from function-call interpretations to argument interpretations, as below:
    416417\begin{figure}[h]
     
    422423
    423424double *f(int*, int*); // $f_d$
    424 char *f(char*, char*); // $f_c$
     425char *f(char*, int*); // $f_c$
    425426
    426427f( f( p, p ), p );
     
    463464Deciding when to switch between bottom-up and top-down resolution to minimize wasted work in a hybrid algorithm is a necessarily heuristic process, and though finding good heuristics for which subexpressions to swich matching strategies on is an open question, one reasonable approach might be to set a threshold $t$ for the number of candidate functions, and to use top-down resolution for any subexpression with fewer than $t$ candidate functions, to minimize the number of unmatchable argument interpretations computed, but to use bottom-up resolution for any subexpression with at least $t$ candidate functions, to reduce duplication in argument interpretation computation between the different candidate functions.
    464465
     466Ganzinger and Ripken~\cite{Ganzinger80} propose an approach (later refined by Pennello~\etal~\cite{Pennello80}) that uses a top-down filtering pass followed by a bottom-up filtering pass to reduce the number of candidate interpretations; they prove that for the Ada programming language a small number of such iterations is sufficient to converge to a solution for the expression resolution problem.
     467Persch~\etal~\cite{PW:overload} developed a similar two-pass approach where the bottom-up pass is followed by the top-down pass.
     468These algorithms differ from the hybrid approach under investigation in that they take multiple passes over the expression tree to yield a solution, and also in that they apply both filtering heuristics to all expression nodes; \CFA's polymorphic functions and implicit conversions make the approach of filtering out invalid types taken by all of these algorithms infeasible.
     469
    465470\subsubsection{Common Subexpression Caching}
    466471With any of these argument-parameter approaches, it may be a useful optimization to cache the resolution results for common subexpressions; in Figure~\ref{fig:res_dag} this optimization would result in the list of interpretations $[p_c, p_i]$ for ©p© only being calculated once, and re-used for each of the three instances of ©p©.
    467472
    468473\subsection{Implicit Conversion Application}
    469 Baker's and Cormack's algorithms do not account for implicit conversions\footnote{Baker does briefly comment on an approach for handling implicit conversions, but does not provide an implementable algorithm.}; both assume that there is at most one valid interpretation of a given expression for each distinct type.
    470 Integrating implicit conversion handling into their algorithms provides some choice of implementation approach.
     474With the exception of Bilson, the authors mentioned above do not account for implicit conversions in their algorithms\footnote{Baker does briefly comment on an approach for handling implicit conversions, but does not provide an implementable algorithm.}; all assume that there is at most one valid interpretation of a given expression for each distinct type.
     475Integrating implicit conversion handling into the presented argument-parameter matching algorithms thus provides some choice of implementation approach.
     476
     477Inference of polymorphic type variables can be considered a form of implicit conversion application, where monomorphic types are implicitly converted to instances of some polymorphic type\footnote{This ``conversion'' may not be implemented in any explicit way at runtime, but does need to be handled by the expression resolver as an inexact match between argument and parameter types.}.
     478This form of implicit conversion is particularly common in functional languages; Haskell's type classes~\cite{typeclass} are a particularly well-studied variant of this inference.
     479However, type classes arguably do not allow name overloading, as (at least in the Haskell implmentation) identifiers belonging to type classes may not be overloaded in any other context than an implementation of that type class; this provides a single (possibly polymorphic) interpretation of any identifier, simplifing the expression resolution problem relative to \CFA.
     480\CC~\cite{ANSI98:C++} includes both name overloading and implicit conversions in its expression resolution specification, though unlike \CFA it does complete type-checking on a generated monomorphization of template functions, where \CFA simply checks a list of type constraints.
     481The upcoming Concepts standard~\cite{C++concepts} defines a system of type constraints similar in principle to \CFA's.
     482Cormack and Wright~\cite{Cormack90} present an algorithm which integrates overload resolution with a polymorphic type inference approach very similar to \CFA's.
     483However, their algorithm does not account for implicit conversions other than polymorphic type binding and their discussion of their overload resolution algorithm is not sufficiently detailed to classify it with the other argument-parameter matching approaches\footnote{Their overload resolution algorithm is possibly a variant of Ganzinger and Ripken~\cite{Ganzinger80} or Pennello~\etal~\cite{Pennello80}, modified to allow for polymorphic type binding.}.
    471484
    472485\subsubsection{On Parameters}
    473 Bilson does account for implicit conversions in his algorithm, but it is unclear the approach is optimal.
     486Bilson does account for implicit conversions in his algorithm, but it is unclear if the approach is optimal.
    474487His algorithm integrates checking for valid implicit conversions into the argument-parameter-matching step, essentially trading more expensive matching for a smaller number of argument interpretations.
    475488This approach may result in the same subexpression being checked for a type match with the same type multiple times, though again memoization may mitigate this cost, and this approach does not generate implicit conversions that are not useful to match the containing function.
     
    484497
    485498\subsection{Candidate Set Generation}
    486 Cormack, Baker and Bilson all generate the complete set of candidate argument interpretations before attempting to match the containing function call expression.
     499All the algorithms discussed to this point generate the complete set of candidate argument interpretations before attempting to match the containing function call expression.
    487500However, given that the top-level expression interpretation that is ultimately chosen is the minimal-cost valid interpretation, any consideration of non-minimal-cost interpretations is in some sense wasted work.
    488501Under the assumption that that programmers generally write function calls with relatively low-cost interpretations, a possible work-saving heuristic is to generate only the lowest-cost argument interpretations first, attempt to find a valid top-level interpretation using them, and only if that fails generate the next higher-cost argument interpretations.
    489502
    490503\subsubsection{Eager}
    491 Within the eager approach taken by Cormack, Baker and Bilson, there are still variants to explore.
     504Within the eager approach taken by the existing top-down and bottom-up algorithms, there are still variants to explore.
    492505Cormack and Baker do not account for implict conversions, and thus do not account for the possibility of multiple valid interpretations with distinct costs; Bilson, on the other hand, sorts the list of interpretations to aid in finding minimal-cost interpretations.
    493506Sorting the lists of argument or function call interpretations by cost at some point during resolution may provide useful opportunities to short-circuit expression evaluation when a minimal-cost interpretation is found, though it is unclear if this short-circuiting behaviour justifies the cost of the sort.
     
    559572
    560573This proposed project should provide valuable data on how to implement a performant compiler for modern programming languages such as \CFA with powerful static type-systems, specifically targeting the feature interaction between name overloading and implicit conversions.
    561 This work is not limited in applicability to \CFA, but may also be useful for supporting efficient compilation of the upcoming ``Concepts'' standard~\cite{C++concepts} for \CC template constraints, for instance.
     574This work is not limited in applicability to \CFA, but may also be useful for supporting efficient compilation of the upcoming Concepts standard~\cite{C++concepts} for \CC template constraints, for instance.
    562575
    563576\appendix
  • doc/bibliography/cfa.bib

    r38736854 r6603c1d  
    46854685}
    46864686
     4687@article{Ganzinger80,
     4688        contributer = {a3moss@uwaterloo.ca},
     4689        author = {Ganzinger, Harald and Ripken, Knut},
     4690        title = {Operator Identification in {ADA}: Formal Specification, Complexity, and Concrete Implementation},
     4691        journal = {SIGPLAN Notices},
     4692        issue_date = {February 1980},
     4693        volume = {15},
     4694        number = {2},
     4695        month = feb,
     4696        year = {1980},
     4697        issn = {0362-1340},
     4698        pages = {30--42},
     4699        numpages = {13},
     4700        url = {http://doi.acm.org/10.1145/947586.947589},
     4701        doi = {10.1145/947586.947589},
     4702        publisher = {ACM},
     4703        address = {New York, NY, USA}
     4704}
     4705
    46874706@article{Ford82,
    46884707    keywords    = {},
     
    58515870}
    58525871
     5872@article{Pennello80,
     5873        contributer = {a3moss@uwaterloo.ca},
     5874        author = {Pennello, Tom and DeRemer, Frank and Meyers, Richard},
     5875        title = {A Simplified Operator Identification Scheme for {Ada}},
     5876        journal = {SIGPLAN Notices},
     5877        issue_date = {July-August 1980},
     5878        volume = {15},
     5879        number = {7 and 8},
     5880        month = jul,
     5881        year = {1980},
     5882        issn = {0362-1340},
     5883        pages = {82--87},
     5884        numpages = {6},
     5885        url = {http://doi.acm.org/10.1145/947680.947688},
     5886        doi = {10.1145/947680.947688},
     5887        publisher = {ACM},
     5888        address = {New York, NY, USA},
     5889}
     5890
    58535891@inproceedings{Dice10,
    58545892    keywords    = {hardware, synchronization, transactional memory},
  • doc/user/user.tex

    r38736854 r6603c1d  
    1111%% Created On       : Wed Apr  6 14:53:29 2016
    1212%% Last Modified By : Peter A. Buhr
    13 %% Last Modified On : Tue Aug  2 17:39:02 2016
    14 %% Update Count     : 1286
     13%% Last Modified On : Sun Aug 14 08:23:06 2016
     14%% Update Count     : 1323
    1515%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    1616
     
    317317
    318318\item
    319 \Indexc{-no-include-std}\index{compilation option!-no-include-std@©-no-include-std©}
     319\Indexc{-no-include-stdhdr}\index{compilation option!-no-include-stdhdr@©-no-include-stdhdr©}
    320320Do not supply ©extern "C"© wrappers for \Celeven standard include files (see~\VRef{s:StandardHeaders}).
    321321\textbf{This option is \emph{not} the default.}
     
    807807
    808808
     809\section{Backquote Identifiers}
     810\label{s:BackquoteIdentifiers}
     811
     812\CFA accommodates keyword clashes by syntactic transformations using the \CFA backquote escape-mechanism:
     813\begin{lstlisting}
     814int `otype` = 3;                                // make keyword an identifier
     815double `choose` = 3.5;
     816\end{lstlisting}
     817Programs can be converted easily by enclosing keyword identifiers in backquotes, and the backquotes can be removed later when the identifier name is changed to an non-keyword name.
     818Clashes in C header files (see~\VRef{s:StandardHeaders}) can be handled automatically using the preprocessor, ©#include_next© and ©-I filename©:
     819\begin{lstlisting}
     820// include file uses the CFA keyword "otype".
     821#if ! defined( otype )                  // nesting ?
     822#define otype `otype`
     823#define __CFA_BFD_H__
     824#endif // ! otype
     825
     826#include_next <bfd.h>                   // must have internal check for multiple expansion
     827
     828#if defined( otype ) && defined( __CFA_BFD_H__ )        // reset only if set
     829#undef otype
     830#undef __CFA_BFD_H__
     831#endif // otype && __CFA_BFD_H__
     832\end{lstlisting}
     833
     834
    809835\section{Type Operators}
    810836
     
    10111037Alternatively, prototype definitions can be eliminated by using a two-pass compilation, and implicitly creating header files for exports.
    10121038The former is easy to do, while the latter is more complex.
    1013 Currently, \CFA does \emph{not} attempt to support named arguments.
     1039
     1040Furthermore, named arguments do not work well in a \CFA-style programming-languages because they potentially introduces a new criteria for type matching.
     1041For example, it is technically possible to disambiguate between these two overloaded definitions of ©f© based on named arguments at the call site:
     1042\begin{lstlisting}
     1043int f( int i, int j );
     1044int f( int x, double y );
     1045
     1046f( j : 3, i : 4 );                              §\C{// 1st f}§
     1047f( x : 7, y : 8.1 );                    §\C{// 2nd f}§
     1048f( 4, 5 );                                              §\C{// ambiguous call}§
     1049\end{lstlisting}
     1050However, named arguments compound routine resolution in conjunction with conversions:
     1051\begin{lstlisting}
     1052f( i : 3, 5.7 );                                §\C{// ambiguous call ?}§
     1053\end{lstlisting}
     1054Depending on the cost associated with named arguments, this call could be resolvable or ambiguous.
     1055Adding named argument into the routine resolution algorithm does not seem worth the complexity.
     1056Therefore, \CFA does \emph{not} attempt to support named arguments.
    10141057
    10151058\item[Default Arguments]
     
    10211064the allowable positional calls are:
    10221065\begin{lstlisting}
    1023 p();                            §\C{// rewrite $\Rightarrow$ p( 1, 2, 3 )}§
    1024 p( 4 );                         §\C{// rewrite $\Rightarrow$ p( 4, 2, 3 )}§
    1025 p( 4, 4 );                      §\C{// rewrite $\Rightarrow$ p( 4, 4, 3 )}§
    1026 p( 4, 4, 4 );           §\C{// rewrite $\Rightarrow$ p( 4, 4, 4 )}§
     1066p();                                                    §\C{// rewrite $\Rightarrow$ p( 1, 2, 3 )}§
     1067p( 4 );                                                 §\C{// rewrite $\Rightarrow$ p( 4, 2, 3 )}§
     1068p( 4, 4 );                                              §\C{// rewrite $\Rightarrow$ p( 4, 4, 3 )}§
     1069p( 4, 4, 4 );                                   §\C{// rewrite $\Rightarrow$ p( 4, 4, 4 )}§
    10271070// empty arguments
    1028 p(  , 4, 4 );           §\C{// rewrite $\Rightarrow$ p( 1, 4, 4 )}§
    1029 p( 4,  , 4 );           §\C{// rewrite $\Rightarrow$ p( 4, 2, 4 )}§
    1030 p( 4, 4,   );           §\C{// rewrite $\Rightarrow$ p( 4, 4, 3 )}§
    1031 p( 4,  ,   );           §\C{// rewrite $\Rightarrow$ p( 4, 2, 3 )}§
    1032 p(  , 4,   );           §\C{// rewrite $\Rightarrow$ p( 1, 4, 3 )}§
    1033 p(  ,  , 4 );           §\C{// rewrite $\Rightarrow$ p( 1, 2, 4 )}§
    1034 p(  ,  ,   );           §\C{// rewrite $\Rightarrow$ p( 1, 2, 3 )}§
     1071p(  , 4, 4 );                                   §\C{// rewrite $\Rightarrow$ p( 1, 4, 4 )}§
     1072p( 4,  , 4 );                                   §\C{// rewrite $\Rightarrow$ p( 4, 2, 4 )}§
     1073p( 4, 4,   );                                   §\C{// rewrite $\Rightarrow$ p( 4, 4, 3 )}§
     1074p( 4,  ,   );                                   §\C{// rewrite $\Rightarrow$ p( 4, 2, 3 )}§
     1075p(  , 4,   );                                   §\C{// rewrite $\Rightarrow$ p( 1, 4, 3 )}§
     1076p(  ,  , 4 );                                   §\C{// rewrite $\Rightarrow$ p( 1, 2, 4 )}§
     1077p(  ,  ,   );                                   §\C{// rewrite $\Rightarrow$ p( 1, 2, 3 )}§
    10351078\end{lstlisting}
    10361079Here the missing arguments are inserted from the default values in the parameter list.
     
    10671110The conflict occurs because both named and ellipse arguments must appear after positional arguments, giving two possibilities:
    10681111\begin{lstlisting}
    1069 p( /* positional */, . . ., /* named */ );
    1070 p( /* positional */, /* named */, . . . );
     1112p( /* positional */, ... , /* named */ );
     1113p( /* positional */, /* named */, ... );
    10711114\end{lstlisting}
    10721115While it is possible to implement both approaches, the first possibly is more complex than the second, \eg:
    10731116\begin{lstlisting}
    1074 p( int x, int y, int z, . . . );
    1075 p( 1, 4, 5, 6, z : 3, y : 2 ); §\C{// assume p( /* positional */, . . ., /* named */ );}§
    1076 p( 1, z : 3, y : 2, 4, 5, 6 ); §\C{// assume p( /* positional */, /* named */, . . . );}§
     1117p( int x, int y, int z, ... );
     1118p( 1, 4, 5, 6, z : 3, y : 2 ); §\C{// assume p( /* positional */, ... , /* named */ );}§
     1119p( 1, z : 3, y : 2, 4, 5, 6 ); §\C{// assume p( /* positional */, /* named */, ... );}§
    10771120\end{lstlisting}
    10781121In the first call, it is necessary for the programmer to conceptually rewrite the call, changing named arguments into positional, before knowing where the ellipse arguments begin.
     
    10821125The problem is exacerbated with default arguments, \eg:
    10831126\begin{lstlisting}
    1084 void p( int x, int y = 2, int z = 3. . . );
    1085 p( 1, 4, 5, 6, z : 3 );         §\C{// assume p( /* positional */, . . ., /* named */ );}§
    1086 p( 1, z : 3, 4, 5, 6 );         §\C{// assume p( /* positional */, /* named */, . . . );}§
     1127void p( int x, int y = 2, int z = 3... );
     1128p( 1, 4, 5, 6, z : 3 );         §\C{// assume p( /* positional */, ... , /* named */ );}§
     1129p( 1, z : 3, 4, 5, 6 );         §\C{// assume p( /* positional */, /* named */, ... );}§
    10871130\end{lstlisting}
    10881131The first call is an error because arguments 4 and 5 are actually positional not ellipse arguments;
     
    11291172\subsection{Type Nesting}
    11301173
    1131 \CFA allows \Index{type nesting}, and type qualification of the nested types (see \VRef[Figure]{f:TypeNestingQualification}), where as C hoists\index{type hoisting} (refactors) nested types into the enclosing scope and has no type qualification.
     1174\CFA allows \Index{type nesting}, and type qualification of the nested typres (see \VRef[Figure]{f:TypeNestingQualification}), where as C hoists\index{type hoisting} (refactors) nested types into the enclosing scope and has no type qualification.
    11321175\begin{figure}
     1176\centering
    11331177\begin{tabular}{@{}l@{\hspace{3em}}l|l@{}}
    11341178\multicolumn{1}{c@{\hspace{3em}}}{\textbf{C Type Nesting}}      & \multicolumn{1}{c}{\textbf{C Implicit Hoisting}}      & \multicolumn{1}{|c}{\textbf{\CFA}}    \\
     
    13971441Mass assignment has the following form:
    13981442\begin{lstlisting}
    1399 [ §\emph{lvalue}§, ..., §\emph{lvalue}§ ] = §\emph{expr}§;
     1443[ §\emph{lvalue}§, ... , §\emph{lvalue}§ ] = §\emph{expr}§;
    14001444\end{lstlisting}
    14011445\index{lvalue}
     
    14371481Multiple assignment has the following form:
    14381482\begin{lstlisting}
    1439 [ §\emph{lvalue}§, . . ., §\emph{lvalue}§ ] = [ §\emph{expr}§, . . ., §\emph{expr}§ ];
     1483[ §\emph{lvalue}§, ... , §\emph{lvalue}§ ] = [ §\emph{expr}§, ... , §\emph{expr}§ ];
    14401484\end{lstlisting}
    14411485\index{lvalue}
     
    18731917\begin{lstlisting}
    18741918switch ( i ) {
    1875   ®case 1, 3, 5®:
     1919  case ®1, 3, 5®:
    18761920        ...
    1877   ®case 2, 4, 6®:
     1921  case ®2, 4, 6®:
    18781922        ...
    18791923}
     
    19061950\begin{lstlisting}
    19071951switch ( i ) {
    1908   ®case 1~5:®
     1952  case ®1~5:®
    19091953        ...
    1910   ®case 10~15:®
     1954  case ®10~15:®
    19111955        ...
    19121956}
     
    19151959\begin{lstlisting}
    19161960switch ( i )
    1917   case 1 ... 5:
     1961  case ®1 ... 5®:
    19181962        ...
    1919   case 10 ... 15:
     1963  case ®10 ... 15®:
    19201964        ...
    19211965}
     
    43694413
    43704414
     4415\section{Incompatible}
     4416
     4417The following incompatibles exist between \CFA and C, and are similar to Annex C for \CC~\cite{ANSI14:C++}.
     4418
     4419\begin{enumerate}
     4420\item
     4421\begin{description}
     4422\item[Change:] add new keywords \\
     4423New keywords are added to \CFA (see~\VRef{s:NewKeywords}).
     4424\item[Rationale:] keywords added to implement new semantics of \CFA.
     4425\item[Effect on original feature:] change to semantics of well-defined feature. \\
     4426Any ISO C programs using these keywords as identifiers are invalid \CFA programs.
     4427\item[Difficulty of converting:] keyword clashes are accommodated by syntactic transformations using the \CFA backquote escape-mechanism (see~\VRef{s:BackquoteIdentifiers}):
     4428\item[How widely used:] clashes among new \CFA keywords and existing identifiers are rare.
     4429\end{description}
     4430
     4431\item
     4432\begin{description}
     4433\item[Change:] type of character literal ©int© to ©char© to allow more intuitive overloading:
     4434\begin{lstlisting}
     4435int rtn( int i );
     4436int rtn( char c );
     4437rtn( 'x' );                                             §\C{// programmer expects 2nd rtn to be called}§
     4438\end{lstlisting}
     4439\item[Rationale:] it is more intuitive for the call to ©rtn© to match the second version of definition of ©rtn© rather than the first.
     4440In particular, output of ©char© variable now print a character rather than the decimal ASCII value of the character.
     4441\begin{lstlisting}
     4442sout | 'x' | " " | (int)'x' | endl;
     4443x 120
     4444\end{lstlisting}
     4445Having to cast ©'x'© to ©char© is non-intuitive.
     4446\item[Effect on original feature:] change to semantics of well-defined feature that depend on:
     4447\begin{lstlisting}
     4448sizeof( 'x' ) == sizeof( int )
     4449\end{lstlisting}
     4450no long work the same in \CFA programs.
     4451\item[Difficulty of converting:] simple
     4452\item[How widely used:] programs that depend upon ©sizeof( 'x' )© are rare and can be changed to ©sizeof(char)©.
     4453\end{description}
     4454
     4455\item
     4456\begin{description}
     4457\item[Change:] make string literals ©const©:
     4458\begin{lstlisting}
     4459char * p = "abc";                               §\C{// valid in C, deprecated in \CFA}§
     4460char * q = expr ? "abc" : "de"; §\C{// valid in C, invalid in \CFA}§
     4461\end{lstlisting}
     4462The type of a string literal is changed from ©[] char© to ©const [] char©.
     4463Similarly, the type of a wide string literal is changed from ©[] wchar_t© to ©const [] wchar_t©.
     4464\item[Rationale:] This change is a safety issue:
     4465\begin{lstlisting}
     4466char * p = "abc";
     4467p[0] = 'w';                                             §\C{// segment fault or change constant literal}§
     4468\end{lstlisting}
     4469The same problem occurs when passing a string literal to a routine that changes its argument.
     4470\item[Effect on original feature:] change to semantics of well-defined feature.
     4471\item[Difficulty of converting:] simple syntactic transformation, because string literals can be converted to ©char *©.
     4472\item[How widely used:] programs that have a legitimate reason to treat string literals as pointers to potentially modifiable memory are rare.
     4473\end{description}
     4474
     4475\item
     4476\begin{description}
     4477\item[Change:] remove \newterm{tentative definitions}, which only occurs at file scope:
     4478\begin{lstlisting}
     4479int i;                                                  §\C{// forward definition}§
     4480int *j = ®&i®;                                  §\C{// forward reference, valid in C, invalid in \CFA}§
     4481int i = 0;                                              §\C{// definition}§
     4482\end{lstlisting}
     4483is valid in C, and invalid in \CFA because duplicate overloaded object definitions at the same scope level are disallowed.
     4484This change makes it impossible to define mutually referential file-local static objects, if initializers are restricted to the syntactic forms of C. For example,
     4485\begin{lstlisting}
     4486struct X { int i; struct X *next; };
     4487static struct X a;                              §\C{// forward definition}§
     4488static struct X b = { 0, ®&a® };        §\C{// forward reference, valid in C, invalid in \CFA}§
     4489static struct X a = { 1, &b };  §\C{// definition}§
     4490\end{lstlisting}
     4491\item[Rationale:] avoids having different initialization rules for builtin types and userdefined types.
     4492\item[Effect on original feature:] change to semantics of well-defined feature.
     4493\item[Difficulty of converting:] the initializer for one of a set of mutually-referential file-local static objects must invoke a routine call to achieve the initialization.
     4494\item[How widely used:] seldom
     4495\end{description}
     4496
     4497\item
     4498\begin{description}
     4499\item[Change:] have ©struct© introduce a scope for nested types:
     4500\begin{lstlisting}
     4501enum ®Colour® { R, G, B, Y, C, M };
     4502struct Person {
     4503        enum ®Colour® { R, G, B };      §\C{// nested type}§
     4504        struct Face {                           §\C{// nested type}§
     4505                ®Colour® Eyes, Hair;    §\C{// type defined outside (1 level)}§
     4506        };
     4507        ß.ß®Colour® shirt;                      §\C{// type defined outside (top level)}§
     4508        ®Colour® pants;                         §\C{// type defined same level}§
     4509        Face looks[10];                         §\C{// type defined same level}§
     4510};
     4511®Colour® c = R;                                 §\C{// type/enum defined same level}§
     4512Personß.ß®Colour® pc = Personß.ßR;      §\C{// type/enum defined inside}§
     4513Personß.ßFace pretty;                   §\C{// type defined inside}§
     4514\end{lstlisting}
     4515In C, the name of the nested types belongs to the same scope as the name of the outermost enclosing structure, i.e., the nested types are hoisted to the scope of the outer-most type, which is not useful and confusing.
     4516\CFA is C \emph{incompatible} on this issue, and provides semantics similar to \Index*[C++]{\CC}.
     4517Nested types are not hoisted and can be referenced using the field selection operator ``©.©'', unlike the \CC scope-resolution operator ``©::©''.
     4518\item[Rationale:] ©struct© scope is crucial to \CFA as an information structuring and hiding mechanism.
     4519\item[Effect on original feature:] change to semantics of well-defined feature.
     4520\item[Difficulty of converting:] Semantic transformation.
     4521\item[How widely used:] C programs rarely have nest types because they are equivalent to the hoisted version.
     4522\end{description}
     4523
     4524\item
     4525\begin{description}
     4526\item[Change:] In C++, the name of a nested class is local to its enclosing class.
     4527\item[Rationale:] C++ classes have member functions which require that classes establish scopes.
     4528\item[Difficulty of converting:] Semantic transformation. To make the struct type name visible in the scope of the enclosing struct, the struct tag could be declared in the scope of the enclosing struct, before the enclosing struct is defined. Example:
     4529\begin{lstlisting}
     4530struct Y;                                               §\C{// struct Y and struct X are at the same scope}§
     4531struct X {
     4532struct Y { /* ... */ } y;
     4533};
     4534\end{lstlisting}
     4535All the definitions of C struct types enclosed in other struct definitions and accessed outside the scope of the enclosing struct could be exported to the scope of the enclosing struct.
     4536Note: this is a consequence of the difference in scope rules, which is documented in 3.3.
     4537\item[How widely used:] Seldom.
     4538\end{description}
     4539
     4540\item
     4541\begin{description}
     4542\item[Change:] comma expression is disallowed as subscript
     4543\item[Rationale:] safety issue to prevent subscripting error for multidimensional arrays: ©x[i,j]© instead of ©x[i][j]©, and this syntactic form then taken by \CFA for new style arrays.
     4544\item[Effect on original feature:] change to semantics of well-defined feature.
     4545\item[Difficulty of converting:] semantic transformation of ©x[i,j]© to ©x[(i,j)]©
     4546\item[How widely used:] seldom.
     4547\end{description}
     4548\end{enumerate}
     4549
     4550
    43714551\section{New Keywords}
    43724552\label{s:NewKeywords}
    43734553
    43744554\begin{quote2}
    4375 \begin{tabular}{ll}
    4376 ©catch©                 & ©lvalue©              \\
    4377 ©catchResume©   &                               \\
    4378 ©choose©                & ©otype©               \\
    4379                                 &                               \\
    4380 ©disable©               & ©throw©               \\
    4381 ©dtype©                 & ©throwResume© \\
    4382                                 & ©trait©               \\
    4383 ©enable©                & ©try©                 \\
    4384                                 &                               \\
    4385 ©fallthrough©                                   \\
    4386 ©fallthru©                                              \\
    4387 ©finally©                                               \\
    4388 ©forall©                                                \\
    4389 ©ftype©                                                 \\
     4555\begin{tabular}{lll}
     4556©catch©                 & ©fallthrough© & ©otype©               \\
     4557©catchResume©   & ©fallthru©    & ©throw©               \\
     4558©choose©                & ©finally©             & ©throwResume© \\
     4559©disable©               & ©forall©              & ©trait©               \\
     4560©dtype©                 & ©ftype©               & ©try©                 \\
     4561©enable©                & ©lvalue©              &                               \\
    43904562\end{tabular}
    43914563\end{quote2}
     
    43954567\label{s:StandardHeaders}
    43964568
    4397 C prescribes the following standard header-files:
     4569C prescribes the following standard header-files~\cite[\S~7.1.2]{C11}:
    43984570\begin{quote2}
    43994571\begin{minipage}{\linewidth}
     
    44124584\end{minipage}
    44134585\end{quote2}
    4414 For the prescribed head-files, \CFA implicit wraps their includes in an ©extern "C"©;
     4586For the prescribed head-files, \CFA implicitly wraps their includes in an ©extern "C"©;
    44154587hence, names in these include files are not mangled\index{mangling!name} (see~\VRef{s:Interoperability}).
    44164588All other C header files must be explicitly wrapped in ©extern "C"© to prevent name mangling.
    4417 
    4418 
    4419 \section{Incompatible}
    4420 
    4421 The following incompatibles exist between \CFA and C, and are similar to Annex C for \CC~\cite{ANSI14:C++}.
    4422 
    4423 \begin{enumerate}
    4424 \item
    4425 \begin{description}
    4426 \item[Change:] add new keywords (see~\VRef{s:NewKeywords}) \\
    4427 New keywords are added to \CFA.
    4428 \item[Rationale:] keywords added to implement new semantics of \CFA.
    4429 \item[Effect on original feature:] change to semantics of well-defined feature. \\
    4430 Any ISO C programs using these keywords as identifiers are invalid \CFA programs.
    4431 \item[Difficulty of converting:] keyword clashes are accommodated by syntactic transformations using the \CFA backquote escape-mechanism:
    4432 \begin{lstlisting}
    4433 int `otype` = 3;                                // make keyword an identifier
    4434 double `choose` = 3.5;
    4435 \end{lstlisting}
    4436 Programs can be converted automatically by enclosing keyword identifiers in backquotes, and the backquotes can be remove later when the identifier name is changed.
    4437 Clashes in C system libraries (include files) can be handled automatically using preprocessor, ©#include_next© and ©-Ifilename©:
    4438 \begin{lstlisting}
    4439 // include file uses the CFA keyword "otype".
    4440 #if ! defined( otype )                  // nesting ?
    4441 #define otype `otype`
    4442 #define __CFA_BFD_H__
    4443 #endif // ! otype
    4444 
    4445 #include_next <bfd.h>                   // must have internal check for multiple expansion
    4446 
    4447 #if defined( otype ) && defined( __CFA_BFD_H__ )        // reset only if set
    4448 #undef otype
    4449 #undef __CFA_BFD_H__
    4450 #endif // otype && __CFA_BFD_H__
    4451 \end{lstlisting}
    4452 \item[How widely used:] clashes among new \CFA keywords and existing identifiers are rare.
    4453 \end{description}
    4454 
    4455 \item
    4456 \begin{description}
    4457 \item[Change:] type of character literal ©int© to ©char© to allow more intuitive overloading:
    4458 \begin{lstlisting}
    4459 int rtn( int i );
    4460 int rtn( char c );
    4461 rtn( 'x' );                                             // programmer expects 2nd rtn to be called
    4462 \end{lstlisting}
    4463 \item[Rationale:] it is more intuitive for the call to ©rtn© to match the second version of definition of ©rtn© rather than the first.
    4464 In particular, output of ©char© variable now print a character rather than the decimal ASCII value of the character.
    4465 \begin{lstlisting}
    4466 sout | 'x' | " " | (int)'x' | endl;
    4467 x 120
    4468 \end{lstlisting}
    4469 Having to cast ©'x'© to ©char© is non-intuitive.
    4470 \item[Effect on original feature:] change to semantics of well-defined feature that depend on:
    4471 \begin{lstlisting}
    4472 sizeof( 'x' ) == sizeof( int )
    4473 \end{lstlisting}
    4474 no long work the same in \CFA programs.
    4475 \item[Difficulty of converting:] simple
    4476 \item[How widely used:] programs that depend upon ©sizeof( 'x' )© are rare and can be changed to ©sizeof(char)©.
    4477 \end{description}
    4478 
    4479 \item
    4480 \begin{description}
    4481 \item[Change:] make string literals ©const©:
    4482 \begin{lstlisting}
    4483 char * p = "abc";                               // valid in C, deprecated in §\CFA§
    4484 char * q = expr ? "abc" : "de"; // valid in C, invalid in §\CFA§
    4485 \end{lstlisting}
    4486 The type of a string literal is changed from ©[] char© to ©const [] char©.
    4487 Similarly, the type of a wide string literal is changed from ©[] wchar_t© to ©const [] wchar_t©.
    4488 \item[Rationale:] This change is a safety issue:
    4489 \begin{lstlisting}
    4490 char * p = "abc";
    4491 p[0] = 'w';                                             // segment fault or change constant literal
    4492 \end{lstlisting}
    4493 The same problem occurs when passing a string literal to a routine that changes its argument.
    4494 \item[Effect on original feature:] change to semantics of well-defined feature.
    4495 \item[Difficulty of converting:] simple syntactic transformation, because string literals can be converted to ©char *©.
    4496 \item[How widely used:] programs that have a legitimate reason to treat string literals as pointers to potentially modifiable memory are rare.
    4497 \end{description}
    4498 
    4499 \item
    4500 \begin{description}
    4501 \item[Change:] remove \newterm{tentative definitions}, which only occurs at file scope:
    4502 \begin{lstlisting}
    4503 int i;                                                  // forward definition
    4504 int *j = ®&i®;                                  // forward reference, valid in C, invalid in §\CFA§
    4505 int i = 0;                                              // definition
    4506 \end{lstlisting}
    4507 is valid in C, and invalid in \CFA because duplicate overloaded object definitions at the same scope level are disallowed.
    4508 This change makes it impossible to define mutually referential file-local static objects, if initializers are restricted to the syntactic forms of C. For example,
    4509 \begin{lstlisting}
    4510 struct X { int i; struct X *next; };
    4511 static struct X a;                              // forward definition
    4512 static struct X b = { 0, ®&a® };        // forward reference, valid in C, invalid in §\CFA§
    4513 static struct X a = { 1, &b };  // definition
    4514 \end{lstlisting}
    4515 \item[Rationale:] avoids having different initialization rules for builtin types and userdefined types.
    4516 \item[Effect on original feature:] change to semantics of well-defined feature.
    4517 \item[Difficulty of converting:] the initializer for one of a set of mutually-referential file-local static objects must invoke a routine call to achieve the initialization.
    4518 \item[How widely used:] seldom
    4519 \end{description}
    4520 
    4521 \item
    4522 \begin{description}
    4523 \item[Change:] have ©struct© introduce a scope for nested types
    4524 In C, the name of the nested types belongs to the same scope as the name of the outermost enclosing
    4525 Example:
    4526 \begin{lstlisting}
    4527 enum ®Colour® { R, G, B, Y, C, M };
    4528 struct Person {
    4529         enum ®Colour® { R, G, B };      // nested type
    4530         struct Face {                           // nested type
    4531                 ®Colour® Eyes, Hair;            // type defined outside (1 level)
    4532         };
    4533         ß.ß®Colour® shirt;                              // type defined outside (top level)
    4534         ®Colour® pants;                         // type defined same level
    4535         Face looks[10];                         // type defined same level
    4536 };
    4537 ®Colour® c = R;                                 // type/enum defined same level
    4538 Personß.ß®Colour® pc = Personß.ßR;      // type/enum defined inside
    4539 Personß.ßFace pretty;                           // type defined inside
    4540 \end{lstlisting}
    4541 \item[Rationale:] ©struct© scope is crucial to \CFA as an information structuring and hiding mechanism.
    4542 \item[Effect on original feature:] change to semantics of well-defined feature.
    4543 \item[Difficulty of converting:] Semantic transformation.
    4544 \item[How widely used:] C programs rarely have nest types because they are equivalent to the hoisted version.
    4545 
    4546 \CFA is C \emph{incompatible} on this issue, and provides semantics similar to \Index*[C++]{\CC}.
    4547 Nested types are not hoisted and can be referenced using the field selection operator ``©.©'', unlike the \CC scope-resolution operator ``©::©''.
    4548 Given that nested types in C are equivalent to not using them, \ie they are essentially useless, it is unlikely there are any realistic usages that break because of this incompatibility.
    4549 \end{description}
    4550 
    4551 \item
    4552 \begin{description}
    4553 \item[Change:] In C++, the name of a nested class is local to its enclosing class.
    4554 \item[Rationale:] C++ classes have member functions which require that classes establish scopes.
    4555 \item[Difficulty of converting:] Semantic transformation. To make the struct type name visible in the scope of the enclosing struct, the struct tag could be declared in the scope of the enclosing struct, before the enclosing struct is defined. Example:
    4556 \begin{lstlisting}
    4557 struct Y; // struct Y and struct X are at the same scope
    4558 struct X {
    4559 struct Y { /* ... */ } y;
    4560 };
    4561 \end{lstlisting}
    4562 All the definitions of C struct types enclosed in other struct definitions and accessed outside the scope of the enclosing struct could be exported to the scope of the enclosing struct.
    4563 Note: this is a consequence of the difference in scope rules, which is documented in 3.3.
    4564 \item[How widely used:] Seldom.
    4565 \end{description}
    4566 
    4567 \item
    4568 \begin{description}
    4569 \item[Change:] comma expression is disallowed as subscript
    4570 \item[Rationale:] safety issue to prevent subscripting error for multidimensional arrays: ©x[i,j]© instead of ©x[i][j]©, and this syntactic form then taken by \CFA for new style arrays.
    4571 \item[Effect on original feature:] change to semantics of well-defined feature.
    4572 \item[Difficulty of converting:] semantic transformation of ©x[i,j]© to ©x[(i,j)]©
    4573 \item[How widely used:] seldom.
    4574 \end{description}
    4575 \end{enumerate}
    45764589
    45774590
     
    47494762\subsection{malloc}
    47504763
     4764\leavevmode
    47514765\begin{lstlisting}[aboveskip=0pt,belowskip=0pt]
    47524766forall( otype T ) T * malloc( void );§\indexc{malloc}§
     
    47654779forall( otype T ) T * memset( T * ptr );                                // remove when default value available
    47664780\end{lstlisting}
    4767 \
     4781
    47684782
    47694783\subsection{ato / strto}
    47704784
     4785\leavevmode
    47714786\begin{lstlisting}[aboveskip=0pt,belowskip=0pt]
    47724787int ato( const char * ptr );§\indexc{ato}§
     
    47964811long double _Complex strto( const char * sptr, char ** eptr );
    47974812\end{lstlisting}
    4798 \
    47994813
    48004814
    48014815\subsection{bsearch / qsort}
    48024816
     4817\leavevmode
    48034818\begin{lstlisting}[aboveskip=0pt,belowskip=0pt]
    48044819forall( otype T | { int ?<?( T, T ); } )
     
    48084823void qsort( const T * arr, size_t dimension );§\indexc{qsort}§
    48094824\end{lstlisting}
    4810 \
    48114825
    48124826
    48134827\subsection{abs}
    48144828
     4829\leavevmode
    48154830\begin{lstlisting}[aboveskip=0pt,belowskip=0pt]
    48164831char abs( char );§\indexc{abs}§
     
    48254840long double abs( long double _Complex );
    48264841\end{lstlisting}
    4827 \
    48284842
    48294843
    48304844\subsection{random}
    48314845
     4846\leavevmode
    48324847\begin{lstlisting}[aboveskip=0pt,belowskip=0pt]
    48334848void rand48seed( long int s );§\indexc{rand48seed}§
     
    48434858long double _Complex rand48();
    48444859\end{lstlisting}
    4845 \
    48464860
    48474861
    48484862\subsection{min / max / clamp / swap}
    48494863
     4864\leavevmode
    48504865\begin{lstlisting}[aboveskip=0pt,belowskip=0pt]
    48514866forall( otype T | { int ?<?( T, T ); } )
     
    48614876void swap( T * t1, T * t2 );§\indexc{swap}§
    48624877\end{lstlisting}
    4863 \
    48644878
    48654879
     
    48724886\subsection{General}
    48734887
     4888\leavevmode
    48744889\begin{lstlisting}[aboveskip=0pt,belowskip=0pt]
    48754890float fabs( float );§\indexc{fabs}§
     
    49174932long double nan( const char * );
    49184933\end{lstlisting}
    4919 \
    49204934
    49214935
    49224936\subsection{Exponential}
    49234937
     4938\leavevmode
    49244939\begin{lstlisting}[aboveskip=0pt,belowskip=0pt]
    49254940float exp( float );§\indexc{exp}§
     
    49744989long double logb( long double );
    49754990\end{lstlisting}
    4976 \
    49774991
    49784992
    49794993\subsection{Power}
    49804994
     4995\leavevmode
    49814996\begin{lstlisting}[aboveskip=0pt,belowskip=0pt]
    49824997float sqrt( float );§\indexc{sqrt}§
     
    50025017long double _Complex pow( long double _Complex, long double _Complex );
    50035018\end{lstlisting}
    5004 \
    50055019
    50065020
    50075021\subsection{Trigonometric}
    50085022
     5023\leavevmode
    50095024\begin{lstlisting}[aboveskip=0pt,belowskip=0pt]
    50105025float sin( float );§\indexc{sin}§
     
    50585073long double atan( long double, long double );
    50595074\end{lstlisting}
    5060 \
    50615075
    50625076
    50635077\subsection{Hyperbolic}
    50645078
     5079\leavevmode
    50655080\begin{lstlisting}[aboveskip=0pt,belowskip=0pt]
    50665081float sinh( float );§\indexc{sinh}§
     
    51065121long double _Complex atanh( long double _Complex );
    51075122\end{lstlisting}
    5108 \
    51095123
    51105124
    51115125\subsection{Error / Gamma}
    51125126
     5127\leavevmode
    51135128\begin{lstlisting}[aboveskip=0pt,belowskip=0pt]
    51145129float erf( float );§\indexc{erf}§
     
    51375152long double tgamma( long double );
    51385153\end{lstlisting}
    5139 \
    51405154
    51415155
    51425156\subsection{Nearest Integer}
    51435157
     5158\leavevmode
    51445159\begin{lstlisting}[aboveskip=0pt,belowskip=0pt]
    51455160float floor( float );§\indexc{floor}§
     
    51915206long long int llround( long double );
    51925207\end{lstlisting}
    5193 \
    51945208
    51955209
    51965210\subsection{Manipulation}
    51975211
     5212\leavevmode
    51985213\begin{lstlisting}[aboveskip=0pt,belowskip=0pt]
    51995214float copysign( float, float );§\indexc{copysign}§
     
    52325247long double scalbln( long double, long int );
    52335248\end{lstlisting}
    5234 \
    52355249
    52365250
  • src/Parser/DeclarationNode.cc

    r38736854 r6603c1d  
    1010// Created On       : Sat May 16 12:34:05 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Aug  9 08:39:20 2016
    13 // Update Count     : 169
     12// Last Modified On : Sat Aug 13 18:56:58 2016
     13// Update Count     : 171
    1414//
    1515
     
    470470
    471471                // there may be typedefs chained onto the type
    472                 if ( o->get_link() ) {
    473                         set_link( o->get_link()->clone() );
     472                if ( o->get_next() ) {
     473                        set_last( o->get_next()->clone() );
    474474                } // if
    475475        } // if
     
    757757DeclarationNode *DeclarationNode::appendList( DeclarationNode *node ) {
    758758        if ( node != 0 ) {
    759                 set_link( node );
     759                set_last( node );
    760760        } // if
    761761        return this;
     
    794794                        errors.append( e );
    795795                } // try
    796                 cur = dynamic_cast<DeclarationNode *>( cur->get_link() );
     796                cur = dynamic_cast<DeclarationNode *>( cur->get_next() );
    797797        } // while
    798798        if ( ! errors.isEmpty() ) {
     
    831831                        errors.append( e );
    832832                } // try
    833                 cur = dynamic_cast< DeclarationNode *>( cur->get_link() );
     833                cur = dynamic_cast< DeclarationNode *>( cur->get_next() );
    834834        } // while
    835835        if ( ! errors.isEmpty() ) {
     
    848848                        errors.append( e );
    849849                } // try
    850                 cur = dynamic_cast< DeclarationNode *>( cur->get_link() );
     850                cur = dynamic_cast< DeclarationNode *>( cur->get_next() );
    851851        } // while
    852852        if ( ! errors.isEmpty() ) {
  • src/Parser/ExpressionNode.cc

    r38736854 r6603c1d  
    1010// Created On       : Sat May 16 13:17:07 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Aug 10 11:07:38 2016
    13 // Update Count     : 486
     12// Last Modified On : Thu Aug 11 20:24:36 2016
     13// Update Count     : 487
    1414//
    1515
     
    309309
    310310//##############################################################################
    311  
    312 // ForCtlExprNode::ForCtlExprNode( ParseNode *init_, ExpressionNode *cond, ExpressionNode *incr ) throw ( SemanticError ) : condition( cond ), change( incr ) {
    313 //      if ( init_ == 0 )
    314 //              init = 0;
    315 //      else {
    316 //              DeclarationNode *decl;
    317 //              ExpressionNode *exp;
    318 
    319 //              if (( decl = dynamic_cast<DeclarationNode *>(init_) ) != 0)
    320 //                      init = new StatementNode( decl );
    321 //              else if (( exp = dynamic_cast<ExpressionNode *>( init_)) != 0)
    322 //                      init = new StatementNode( StatementNode::Exp, exp );
    323 //              else
    324 //                      throw SemanticError("Error in for control expression");
    325 //      }
    326 // }
    327 
    328 // ForCtlExprNode::ForCtlExprNode( const ForCtlExprNode &other )
    329 //      : ExpressionNode( other ), init( maybeClone( other.init ) ), condition( maybeClone( other.condition ) ), change( maybeClone( other.change ) ) {
    330 // }
    331 
    332 // ForCtlExprNode::~ForCtlExprNode() {
    333 //      delete init;
    334 //      delete condition;
    335 //      delete change;
    336 // }
    337 
    338 // Expression *ForCtlExprNode::build() const {
    339 //      // this shouldn't be used!
    340 //      assert( false );
    341 //      return 0;
    342 // }
    343 
    344 // void ForCtlExprNode::print( std::ostream &os, int indent ) const{
    345 //      os << string( indent,' ' ) << "For Control Expression -- :" << endl;
    346 
    347 //      os << string( indent + 2, ' ' ) << "initialization:" << endl;
    348 //      if ( init != 0 )
    349 //              init->printList( os, indent + 4 );
    350 
    351 //      os << string( indent + 2, ' ' ) << "condition: " << endl;
    352 //      if ( condition != 0 )
    353 //              condition->print( os, indent + 4 );
    354 //      os << string( indent + 2, ' ' ) << "increment: " << endl;
    355 //      if ( change != 0 )
    356 //              change->print( os, indent + 4 );
    357 // }
    358 
    359 // void ForCtlExprNode::printOneLine( std::ostream &, int indent ) const {
    360 //      assert( false );
    361 // }
    362 
    363 //##############################################################################
    364311
    365312Expression *build_typevalue( DeclarationNode *decl ) {
  • src/Parser/InitializerNode.cc

    r38736854 r6603c1d  
    1010// Created On       : Sat May 16 13:20:24 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Jul  4 15:37:15 2016
    13 // Update Count     : 15
     12// Last Modified On : Sat Aug 13 18:55:11 2016
     13// Update Count     : 18
    1414//
    1515
     
    2525        : expr( _expr ), aggregate( aggrp ), designator( des ), kids( 0 ), maybeConstructed( true ) {
    2626        if ( aggrp )
    27                 kids = dynamic_cast< InitializerNode *>( get_link() );
     27                kids = dynamic_cast< InitializerNode *>( get_next() );
    2828
    2929        if ( kids != 0 )
    30                 set_link( 0 );
     30                set_last( 0 );
    3131}
    3232
     
    3434        : expr( 0 ), aggregate( aggrp ), designator( des ), kids( 0 ), maybeConstructed( true ) {
    3535        if ( init != 0 )
    36                 set_link(init);
     36                set_last( init );
    3737
    3838        if ( aggrp )
    39                 kids = dynamic_cast< InitializerNode *>( get_link() );
     39                kids = dynamic_cast< InitializerNode *>( get_next() );
    4040
    4141        if ( kids != 0 )
     
    5858                        while ( curdes != 0) {
    5959                                curdes->printOneLine(os);
    60                                 curdes = (ExpressionNode *)(curdes->get_link());
     60                                curdes = (ExpressionNode *)(curdes->get_next());
    6161                                if ( curdes ) os << ", ";
    6262                        } // while
     
    7272
    7373        InitializerNode *moreInit;
    74         if  ( get_link() != 0 && ((moreInit = dynamic_cast< InitializerNode * >( get_link() ) ) != 0) )
     74        if  ( get_next() != 0 && ((moreInit = dynamic_cast< InitializerNode * >( get_next() ) ) != 0) )
    7575                moreInit->printOneLine( os );
    7676}
  • src/Parser/ParseNode.cc

    r38736854 r6603c1d  
    1010// Created On       : Sat May 16 13:26:29 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Aug  7 23:32:47 2016
    13 // Update Count     : 94
     12// Last Modified On : Sat Aug 13 18:55:35 2016
     13// Update Count     : 98
    1414//
    1515
     
    3131        ParseNode *current = this;
    3232
    33         while ( current->get_link() != 0 )
    34         current = current->get_link();
    35 
     33        while ( current->get_next() != 0 )
     34        current = current->get_next();
    3635        return current;
    3736}
    3837
    39 ParseNode *ParseNode::set_link( ParseNode *next_ ) {
     38ParseNode *ParseNode::set_last( ParseNode *next_ ) {
    4039        if ( next_ != 0 ) get_last()->next = next_;
    4140        return this;
     
    5453
    5554ParseNode &ParseNode::operator,( ParseNode &p ) {
    56         set_link( &p );
    57 
     55        set_last( &p );
    5856        return *this;
    5957}
  • src/Parser/ParseNode.h

    r38736854 r6603c1d  
    1010// Created On       : Sat May 16 13:28:16 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Aug 11 12:24:11 2016
    13 // Update Count     : 443
     12// Last Modified On : Sun Aug 14 16:29:20 2016
     13// Update Count     : 483
    1414//
    1515
     
    4545        virtual ~ParseNode();
    4646
    47         ParseNode *get_link() const { return next; }
     47        ParseNode *get_next() const { return next; }
     48        ParseNode *set_next( ParseNode *newlink ) { next = newlink; return this; }
    4849        ParseNode *get_last();
    49         ParseNode *set_link( ParseNode * );
    50         void set_next( ParseNode *newlink ) { next = newlink; }
     50        ParseNode *set_last( ParseNode * );
    5151
    5252        virtual ParseNode *clone() const { return 0; };
     
    9292        ExpressionNode *expr;
    9393        bool aggregate;
    94         ExpressionNode *designator; // may be list
     94        ExpressionNode *designator;                                                     // may be list
    9595        InitializerNode *kids;
    9696        bool maybeConstructed;
     
    336336
    337337        StatementNode();
    338         StatementNode( const std::string *name );
    339         StatementNode( Type t, ExpressionNode *control = 0, StatementNode *block = 0 );
    340         StatementNode( Type t, std::string *target );
    341338        StatementNode( DeclarationNode *decl );
    342 
    343339        ~StatementNode();
    344 
    345         static StatementNode *newCatchStmt( DeclarationNode *d = 0, StatementNode *s = 0, bool catchRestP = false );
    346 
    347         StatementNode *set_block( StatementNode *b ) { block = b; return this; }
    348         StatementNode *get_block() const { return block; }
    349 
    350         void set_control( ExpressionNode *c ) { control = c; }
    351         ExpressionNode *get_control() const { return control; }
    352340
    353341        StatementNode::Type get_type() const { return type; }
     
    357345
    358346        void addDeclaration( DeclarationNode *newDecl ) { decl = newDecl; }
    359         void setCatchRest( bool newVal ) { isCatchRest = newVal; }
    360 
    361         std::string get_target() const;
    362 
    363         // StatementNode *add_controlexp( ExpressionNode * );
    364         StatementNode *append_block( StatementNode * );
     347
    365348        virtual StatementNode *append_last_case( StatementNode * );
    366349
    367         void print( std::ostream &os, int indent = 0) const;
     350        virtual void print( std::ostream &os, int indent = 0) const {}
    368351        virtual StatementNode *clone() const;
    369352        virtual Statement *build() const;
    370   private:
     353  public:
    371354        static const char *StType[];
    372355        Type type;
    373         ExpressionNode *control;
    374         StatementNode *block;
    375356        std::list<std::string> labels;
    376         std::string *target;                            // target label for jump statements
    377357        DeclarationNode *decl;
    378         bool isCatchRest;
    379358}; // StatementNode
    380359
    381360class StatementNode2 : public StatementNode {
    382361  public:
    383         StatementNode2() {}
     362        StatementNode2() { stmt = nullptr; }
    384363        StatementNode2( Statement *stmt ) : stmt( stmt ) {}
     364        StatementNode2( DeclarationNode *decl );
    385365        virtual ~StatementNode2() {}
    386366
     
    392372                return this;
    393373        }
     374        virtual std::list<std::string> get_labels() const { assert( false ); return StatementNode::get_labels(); }
     375
    394376        virtual StatementNode *append_last_case( StatementNode * );
    395         virtual std::list<std::string> get_labels() const { assert( false ); return StatementNode::get_labels(); }
    396377
    397378        virtual void print( std::ostream &os, int indent = 0 ) {}
     
    401382}; // StatementNode
    402383
     384Statement *build_expr( ExpressionNode *ctl );
     385
    403386struct ForCtl {
    404387        ForCtl( ExpressionNode *expr, ExpressionNode *condition, ExpressionNode *change ) :
    405                 init( new StatementNode( StatementNode::Exp, expr ) ), condition( condition ), change( change ) {}
     388                init( new StatementNode2( build_expr( expr ) ) ), condition( condition ), change( change ) {}
    406389        ForCtl( DeclarationNode *decl, ExpressionNode *condition, ExpressionNode *change ) :
    407                 init( new StatementNode( decl ) ), condition( condition ), change( change ) {}
     390                init( new StatementNode2( decl ) ), condition( condition ), change( change ) {}
    408391
    409392        StatementNode *init;
     
    412395};
    413396
    414 Statement *build_expr( ExpressionNode *ctl );
    415397Statement *build_if( ExpressionNode *ctl, StatementNode *then_stmt, StatementNode *else_stmt );
    416398Statement *build_switch( ExpressionNode *ctl, StatementNode *stmt );
     
    423405Statement *build_return( ExpressionNode *ctl );
    424406Statement *build_throw( ExpressionNode *ctl );
     407Statement *build_try( StatementNode *try_stmt, StatementNode *catch_stmt, StatementNode *finally_stmt );
     408Statement *build_catch( DeclarationNode *decl, StatementNode *stmt, bool catchAny = false );
     409Statement *build_finally( StatementNode *stmt );
    425410
    426411//##############################################################################
     
    429414  public:
    430415        CompoundStmtNode();
    431         CompoundStmtNode( const std::string * );
    432416        CompoundStmtNode( StatementNode * );
    433417        ~CompoundStmtNode();
     
    445429class AsmStmtNode : public StatementNode {
    446430  public:
    447         AsmStmtNode( Type, bool voltile, ConstantExpr *instruction, ExpressionNode *output = 0, ExpressionNode *input = 0, ExpressionNode *clobber = 0, LabelNode *gotolabels = 0 );
     431        AsmStmtNode( bool voltile, ConstantExpr *instruction, ExpressionNode *output = 0, ExpressionNode *input = 0, ExpressionNode *clobber = 0, LabelNode *gotolabels = 0 );
    448432        ~AsmStmtNode();
    449433
    450         void print( std::ostream &os, int indent = 0 ) const;
     434        void print( std::ostream &os, int indent = 0 ) const {}
    451435        Statement *build() const;
    452436  private:
     
    477461                        errors.append( e );
    478462                } // try
    479                 cur = dynamic_cast< NodeType *>( cur->get_link() );
     463                cur = dynamic_cast< NodeType *>( cur->get_next() );
    480464        } // while
    481465        if ( ! errors.isEmpty() ) {
  • src/Parser/StatementNode.cc

    r38736854 r6603c1d  
    1010// Created On       : Sat May 16 14:59:41 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Aug 11 16:19:45 2016
    13 // Update Count     : 210
     12// Last Modified On : Sun Aug 14 13:10:54 2016
     13// Update Count     : 288
    1414//
    1515
     
    3434};
    3535
    36 StatementNode::StatementNode() : ParseNode(), control( 0 ), block( 0 ), labels( 0 ), target( 0 ), decl( 0 ), isCatchRest ( false ) {}
    37 
    38 StatementNode::StatementNode( const string *name ) : ParseNode( name ), control( 0 ), block( 0 ), labels( 0 ), target( 0 ), decl( 0 ), isCatchRest ( false ) {}
    39 
    40 StatementNode::StatementNode( DeclarationNode *decl ) : type( Decl ), control( 0 ), block( 0 ), labels( 0 ), target( 0 ), isCatchRest ( false ) {
     36StatementNode::StatementNode() : ParseNode(), labels( 0 ), decl( 0 ) {}
     37
     38StatementNode::StatementNode( DeclarationNode *decl ) : type( Decl ), labels( 0 ) {
     39        assert( false );
    4140        if ( decl ) {
    4241                if ( DeclarationNode *agg = decl->extractAggregate() ) {
     
    4645                        nextStmt->decl = decl;
    4746                        next = nextStmt;
    48                         if ( decl->get_link() ) {
    49                                 next->set_next( new StatementNode( dynamic_cast< DeclarationNode* >( decl->get_link() ) ) );
     47                        if ( decl->get_next() ) {
     48                                next->set_next( new StatementNode( dynamic_cast<DeclarationNode *>( decl->get_next() ) ) );
    5049                                decl->set_next( 0 );
    5150                        } // if
    5251                } else {
    53                         if ( decl->get_link() ) {
    54                                 next = new StatementNode( dynamic_cast< DeclarationNode* >( decl->get_link() ) );
     52                        if ( decl->get_next() ) {
     53                                next = new StatementNode( dynamic_cast<DeclarationNode *>( decl->get_next() ) );
    5554                                decl->set_next( 0 );
    5655                        } // if
     
    6059}
    6160
    62 StatementNode::StatementNode( Type t, ExpressionNode *ctrl_label, StatementNode *block ) : type( t ), control( ctrl_label ), block( block ), labels( 0 ), target( 0 ), decl( 0 ), isCatchRest ( false ) {
    63         this->control = ( t == Default ) ? 0 : control;
    64 }
    65 
    66 StatementNode::StatementNode( Type t, string *target ) : type( t ), control( 0 ), block( 0 ), labels( 0 ), target( target ), decl( 0 ), isCatchRest ( false ) {}
     61StatementNode2::StatementNode2( DeclarationNode *decl ) {
     62        if ( decl ) {
     63                DeclarationNode *agg = decl->extractAggregate();
     64                if ( agg ) {
     65                        StatementNode *nextStmt = new StatementNode;
     66                        nextStmt->type = Decl;
     67                        nextStmt->decl = decl;
     68                        next = nextStmt;
     69                        if ( decl->get_next() ) {
     70                                next->set_next( new StatementNode2( dynamic_cast<DeclarationNode *>(decl->get_next()) ) );
     71                                decl->set_next( 0 );
     72                        } // if
     73                } else {
     74                        if ( decl->get_next() ) {
     75                                next = new StatementNode2( dynamic_cast<DeclarationNode *>( decl->get_next() ) );
     76                                decl->set_next( 0 );
     77                        } // if
     78                        agg = decl;
     79                } // if
     80                stmt = new DeclStmt( noLabels, maybeBuild<Declaration>(agg) );
     81        } else {
     82                assert( false );
     83        } // if
     84}
    6785
    6886StatementNode::~StatementNode() {
    69         delete control;
    70         delete block;
    71         delete target;
    7287        delete decl;
    7388}
    7489
    75 StatementNode * StatementNode::newCatchStmt( DeclarationNode *d, StatementNode *s, bool catchRestP ) {
    76         StatementNode *ret = new StatementNode( StatementNode::Catch, 0, s );
    77         ret->addDeclaration( d );
    78         ret->setCatchRest( catchRestP );
    79 
    80         return ret;
    81 }
    82 
    83 std::string StatementNode::get_target() const{
    84         if ( target )
    85                 return *target;
    86 
    87         return string("");
    88 }
    89 
    9090StatementNode * StatementNode::clone() const {
    91         StatementNode *newnode = new StatementNode( type, maybeClone( control ), maybeClone( block ) );
    92         if ( target ) {
    93                 newnode->target = new string( *target );
    94         } else {
    95                 newnode->target = 0;
    96         } // if
    97         newnode->decl = maybeClone( decl );
    98         return newnode;
     91        assert( false );
     92        return 0;
    9993}
    10094
     
    107101}
    108102
    109 StatementNode *StatementNode::append_block( StatementNode *stmt ) {
    110         if ( stmt != 0 ) {
    111                 if ( block == 0 )
    112                         block = stmt;
    113                 else
    114                         block->set_link( stmt );
    115         } // if
    116         return this;
    117 }
    118 
    119103StatementNode *StatementNode::append_last_case( StatementNode *stmt ) {
    120104        assert( false );
    121         if ( stmt != 0 ) {
    122                 StatementNode *next = ( StatementNode *)get_link();
    123                 if ( next && ( next->get_type() == StatementNode::Case || next->get_type() == StatementNode::Default ) )
    124                         next->append_last_case( stmt );
    125                 else
    126                         if ( block == 0 )
    127                                 block = stmt;
    128                         else
    129                                 block->set_link( stmt );
    130         } // if
    131105        return this;
    132106}
     
    134108StatementNode *StatementNode2::append_last_case( StatementNode *stmt ) {
    135109        StatementNode *prev = this;
    136         for ( StatementNode * curr = prev; curr != nullptr; curr = (StatementNode *)curr->get_link() ) {
     110        // find end of list and maintain previous pointer
     111        for ( StatementNode * curr = prev; curr != nullptr; curr = (StatementNode *)curr->get_next() ) {
    137112                StatementNode2 *node = dynamic_cast<StatementNode2 *>(curr);
    138113                assert( node );
     
    140115                prev = curr;
    141116        } // for
     117        // conver from StatementNode list to Statement list
    142118        StatementNode2 *node = dynamic_cast<StatementNode2 *>(prev);
    143119        std::list<Statement *> stmts;
    144120        buildList( stmt, stmts );
    145         CaseStmt * caseStmt;
    146         caseStmt = dynamic_cast<CaseStmt *>(node->stmt);
     121        // splice any new Statements to end of currents Statements
     122        CaseStmt * caseStmt = dynamic_cast<CaseStmt *>(node->stmt);
    147123        caseStmt->get_statements().splice( caseStmt->get_statements().end(), stmts );
    148124        return this;
    149125}
    150126
    151 void StatementNode::print( std::ostream &os, int indent ) const {
    152         if ( ! labels.empty() ) {
    153                 std::list<std::string>::const_iterator i;
    154 
    155                 os << string( indent, ' ' );
    156                 for ( i = labels.begin(); i != labels.end(); i++ )
    157                         os << *i << ":";
    158                 os << endl;
    159         } // if
    160 
     127Statement *StatementNode::build() const {
    161128        switch ( type ) {
    162129          case Decl:
    163                 decl->print( os, indent );
    164                 break;
     130                return new DeclStmt( noLabels, maybeBuild< Declaration >( decl ) );
     131                assert( false );
    165132          case Exp:
    166                 if ( control ) {
    167                         os << string( indent, ' ' );
    168                         control->print( os, indent );
    169                         os << endl;
    170                 } else
    171                         os << string( indent, ' ' ) << "Null Statement" << endl;
    172                 break;
    173           default:
    174                 os << string( indent, ' ' ) << StatementNode::StType[type] << endl;
    175                 if ( type == Catch ) {
    176                         if ( decl ) {
    177                                 os << string( indent + ParseNode::indent_by, ' ' ) << "Declaration: " << endl;
    178                                 decl->print( os, indent + 2 * ParseNode::indent_by );
    179                         } else if ( isCatchRest ) {
    180                                 os << string( indent + ParseNode::indent_by, ' ' ) << "Catches the rest " << endl;
    181                         } else {
    182                                 ; // should never reach here
    183                         } // if
    184                 } // if
    185                 if ( control ) {
    186                         os << string( indent + ParseNode::indent_by, ' ' ) << "Control: " << endl;
    187                         control->printList( os, indent + 2 * ParseNode::indent_by );
    188                 } // if
    189                 if ( block ) {
    190                         os << string( indent + ParseNode::indent_by, ' ' ) << "Cases: " << endl;
    191                         block->printList( os, indent + 2 * ParseNode::indent_by );
    192                 } // if
    193                 if ( target ) {
    194                         os << string( indent + ParseNode::indent_by, ' ' ) << "Target: " << get_target() << endl;
    195                 } // if
    196                 break;
    197         } // switch
    198 }
    199 
    200 Statement *StatementNode::build() const {
    201         std::list<Statement *> branches;
    202         std::list<Expression *> exps;
    203         std::list<Label> labs;
    204 
    205         if ( ! labels.empty() ) {
    206                 std::back_insert_iterator< std::list<Label> > lab_it( labs );
    207                 copy( labels.begin(), labels.end(), lab_it );
    208         } // if
    209 
    210         // try {
    211         buildList<Statement, StatementNode>( get_block(), branches );
    212 
    213         switch ( type ) {
    214           case Decl:
    215                 return new DeclStmt( labs, maybeBuild< Declaration >( decl ) );
    216           case Exp:
    217                 {
    218                         Expression *e = maybeBuild< Expression >( get_control() );
    219 
    220                         if ( e )
    221                                 return new ExprStmt( labs, e );
    222                         else
    223                                 return new NullStmt( labs );
    224                 }
    225                 assert( false );
    226133          case If:
    227                 // {
    228                 //      Statement *thenb = 0, *elseb = 0;
    229                 //      assert( branches.size() >= 1 );
    230 
    231                 //      thenb = branches.front();
    232                 //      branches.pop_front();
    233                 //      if ( ! branches.empty() ) {
    234                 //              elseb = branches.front();
    235                 //              branches.pop_front();
    236                 //      } // if
    237                 //      return new IfStmt( labs, notZeroExpr( maybeBuild<Expression>(get_control()) ), thenb, elseb );
    238                 // }
    239                 assert( false );
    240134          case Switch:
    241                 // return new SwitchStmt( labs, maybeBuild<Expression>(get_control()), branches );
    242                 assert( false );
    243135          case Case:
    244                 //return new CaseStmt( labs, maybeBuild<Expression>(get_control() ), branches );
    245                 assert( false );
    246136          case Default:
    247                 //return new CaseStmt( labs, 0, branches, true );
    248                 assert( false );
    249137          case While:
    250                 // assert( branches.size() == 1 );
    251                 // return new WhileStmt( labs, notZeroExpr( maybeBuild<Expression>(get_control()) ), branches.front() );
    252                 assert( false );
    253138          case Do:
    254                 // assert( branches.size() == 1 );
    255                 // return new WhileStmt( labs, notZeroExpr( maybeBuild<Expression>(get_control()) ), branches.front(), true );
    256                 assert( false );
    257139          case For:
    258                 // {
    259                 //      assert( branches.size() == 1 );
    260 
    261                 //      ForCtlExprNode *ctl = dynamic_cast<ForCtlExprNode *>( get_control() );
    262                 //      assert( ctl != 0 );
    263 
    264                 //      std::list<Statement *> init;
    265                 //      if ( ctl->get_init() != 0 ) {
    266                 //              buildList( ctl->get_init(), init );
    267                 //      } // if
    268 
    269                 //      Expression *cond = 0;
    270                 //      if ( ctl->get_condition() != 0 )
    271                 //              cond = notZeroExpr( maybeBuild<Expression>(ctl->get_condition()) );
    272 
    273                 //      Expression *incr = 0;
    274                 //      if ( ctl->get_change() != 0 )
    275                 //              incr = maybeBuild<Expression>(ctl->get_change());
    276 
    277                 //      return new ForStmt( labs, init, cond, incr, branches.front() );
    278                 // }
    279                 assert( false );
    280140          case Goto:
    281                 // {
    282                 //      if ( get_target() == "" ) {                                     // computed goto
    283                 //              assert( get_control() != 0 );
    284                 //              return new BranchStmt( labs, maybeBuild<Expression>(get_control()), BranchStmt::Goto );
    285                 //      } // if
    286 
    287                 //      return new BranchStmt( labs, get_target(), BranchStmt::Goto );
    288                 // }
    289                 assert( false );
    290141          case Break:
    291                 // return new BranchStmt( labs, get_target(), BranchStmt::Break );
    292                 assert( false );
    293142          case Continue:
    294                 // return new BranchStmt( labs, get_target(), BranchStmt::Continue );
    295                 assert( false );
    296143          case Return:
    297144          case Throw :
    298                 // buildList( get_control(), exps );
    299                 // if ( exps.size() ==0 )
    300                 //      return new ReturnStmt( labs, 0, type == Throw );
    301                 // if ( exps.size() > 0 )
    302                 //      return new ReturnStmt( labs, exps.back(), type == Throw );
     145          case Try:
     146          case Catch:
     147          case Finally:
     148          case Asm:
     149          default:
    303150                assert( false );
    304           case Try:
    305                 {
    306                         assert( branches.size() >= 0 );
    307                         CompoundStmt *tryBlock = dynamic_cast<CompoundStmt *>( branches.front());
    308                         branches.pop_front();
    309                         FinallyStmt *finallyBlock = 0;
    310                         if ( ( finallyBlock = dynamic_cast<FinallyStmt *>( branches.back())) ) {
    311                                 branches.pop_back();
    312                         } // if
    313                         return new TryStmt( labs, tryBlock, branches, finallyBlock );
    314                 }
    315           case Catch:
    316                 {
    317                         assert( branches.size() == 1 );
    318 
    319                         return new CatchStmt( labs, maybeBuild< Declaration >( decl ), branches.front(), isCatchRest );
    320                 }
    321           case Finally:
    322                 {
    323                         assert( branches.size() == 1 );
    324                         CompoundStmt *block = dynamic_cast<CompoundStmt *>( branches.front() );
    325                         assert( block != 0 );
    326 
    327                         return new FinallyStmt( labs, block );
    328                 }
    329           case Asm:
    330                 assert( false );
    331           default:
    332                 // shouldn't be here
    333151                return 0;
    334152        } // switch
     
    422240}
    423241
     242Statement *build_try( StatementNode *try_stmt, StatementNode *catch_stmt, StatementNode *finally_stmt ) {
     243        std::list<Statement *> branches;
     244        buildList<Statement, StatementNode>( catch_stmt, branches );
     245        CompoundStmt *tryBlock = dynamic_cast<CompoundStmt *>(maybeBuild<Statement>(try_stmt));
     246        assert( tryBlock );
     247        FinallyStmt *finallyBlock = dynamic_cast<FinallyStmt *>(maybeBuild<Statement>(finally_stmt) );
     248        return new TryStmt( noLabels, tryBlock, branches, finallyBlock );
     249}
     250Statement *build_catch( DeclarationNode *decl, StatementNode *stmt, bool catchAny ) {
     251        std::list<Statement *> branches;
     252        buildList<Statement, StatementNode>( stmt, branches );
     253        assert( branches.size() == 1 );
     254        return new CatchStmt( noLabels, maybeBuild<Declaration>(decl), branches.front(), catchAny );
     255}
     256Statement *build_finally( StatementNode *stmt ) {
     257        std::list<Statement *> branches;
     258        buildList<Statement, StatementNode>( stmt, branches );
     259        assert( branches.size() == 1 );
     260        return new FinallyStmt( noLabels, dynamic_cast<CompoundStmt *>( branches.front() ) );
     261}
     262
    424263
    425264CompoundStmtNode::CompoundStmtNode() : first( 0 ), last( 0 ) {}
    426 
    427 CompoundStmtNode::CompoundStmtNode( const string *name_ ) : StatementNode( name_ ), first( 0 ), last( 0 ) {}
    428265
    429266CompoundStmtNode::CompoundStmtNode( StatementNode *stmt ) : first( stmt ) {
     
    441278void CompoundStmtNode::add_statement( StatementNode *stmt ) {
    442279        if ( stmt != 0 ) {
    443                 last->set_link( stmt );
    444                 last = ( StatementNode *)( stmt->get_link());
     280                last->set_last( stmt );
     281                last = ( StatementNode *)( stmt->get_next());
    445282        } // if
    446283}
     
    467304
    468305
    469 AsmStmtNode::AsmStmtNode( Type t, bool voltile, ConstantExpr *instruction, ExpressionNode *output, ExpressionNode *input, ExpressionNode *clobber, LabelNode *gotolabels ) :
    470         StatementNode( t ), voltile( voltile ), instruction( instruction ), output( output ), input( input ), clobber( clobber ) {
     306AsmStmtNode::AsmStmtNode( bool voltile, ConstantExpr *instruction, ExpressionNode *output, ExpressionNode *input, ExpressionNode *clobber, LabelNode *gotolabels ) :
     307        voltile( voltile ), instruction( instruction ), output( output ), input( input ), clobber( clobber ) {
     308        type = Asm;
    471309        if ( gotolabels ) {
    472310                this->gotolabels = gotolabels->get_labels();
     
    477315AsmStmtNode::~AsmStmtNode() {
    478316        delete output; delete input; delete clobber;
    479 }
    480 
    481 void AsmStmtNode::print( std::ostream &os, int indent ) const {
    482         StatementNode::print( os, indent );                                     // print statement labels
    483         os << string( indent + ParseNode::indent_by, ' ' ) << "volatile:" << voltile << endl;
    484         if ( instruction ) {
    485                 os << string( indent + ParseNode::indent_by, ' ' ) << "Instruction:" << endl;
    486 //              instruction->printList( os, indent + 2 * ParseNode::indent_by );
    487         } // if
    488         if ( output ) {
    489                 os << string( indent + ParseNode::indent_by, ' ' ) << "Output:" << endl;
    490                 output->printList( os, indent + 2 * ParseNode::indent_by );
    491         } // if
    492         if ( input ) {
    493                 os << string( indent + ParseNode::indent_by, ' ' ) << "Input:" << endl;
    494                 input->printList( os, indent + 2 * ParseNode::indent_by );
    495         } // if
    496         if ( clobber ) {
    497                 os << string( indent + ParseNode::indent_by, ' ' ) << "Clobber:" << endl;
    498 //              clobber->printList( os, indent + 2 * ParseNode::indent_by );
    499         } // if
    500         if ( ! gotolabels.empty() ) {
    501                 os << string( indent + ParseNode::indent_by, ' ' ) << "Goto Labels:" << endl;
    502                 os << string( indent + 2 * ParseNode::indent_by, ' ' );
    503                 for ( std::list<Label>::const_iterator i = gotolabels.begin();; ) {
    504                         os << *i;
    505                         i++;
    506                   if ( i == gotolabels.end() ) break;
    507                         os << ", ";
    508                 }
    509                 os << endl;
    510         } // if
    511317}
    512318
     
    528334}
    529335
     336// Statement *build_asm( bool voltile, ConstantExpr *instruction, ExpressionNode *output = 0, ExpressionNode *input = 0, ExpressionNode *clobber = 0, LabelNode *gotolabels = 0 ) {
     337//      std::list<Label> labs;
     338
     339//      if ( ! get_labels().empty() ) {
     340//              std::back_insert_iterator< std::list<Label> > lab_it( labs );
     341//              copy( get_labels().begin(), get_labels().end(), lab_it );
     342//      } // if
     343
     344//      std::list< Expression * > out, in;
     345//      std::list< ConstantExpr * > clob;
     346//      buildList( output, out );
     347//      buildList( input, in );
     348//      buildList( clobber, clob );
     349//      std::list< Label > gotolabs = gotolabels;
     350//      return new AsmStmt( labs, voltile, instruction, out, in, clob, gotolabs );
     351// }
     352
    530353// Local Variables: //
    531354// tab-width: 4 //
  • src/Parser/TypeData.cc

    r38736854 r6603c1d  
    1010// Created On       : Sat May 16 15:12:51 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Aug  7 07:51:48 2016
    13 // Update Count     : 58
     12// Last Modified On : Sat Aug 13 18:38:41 2016
     13// Update Count     : 59
    1414//
    1515
     
    495495                        decl = new FunctionDecl( name, sc, linkage, buildFunction(), 0, isInline, isNoreturn );
    496496                } // if
    497                 for ( DeclarationNode *cur = function->idList; cur != 0; cur = dynamic_cast< DeclarationNode* >( cur->get_link() ) ) {
     497                for ( DeclarationNode *cur = function->idList; cur != 0; cur = dynamic_cast< DeclarationNode* >( cur->get_next() ) ) {
    498498                        if ( cur->get_name() != "" ) {
    499499                                decl->get_oldIdents().insert( decl->get_oldIdents().end(), cur->get_name() );
     
    909909        buildList( enumeration->constants, ret->get_members() );
    910910        std::list< Declaration * >::iterator members = ret->get_members().begin();
    911         for ( const DeclarationNode *cur = enumeration->constants; cur != NULL; cur = dynamic_cast<DeclarationNode *>( cur->get_link() ), ++members ) {
     911        for ( const DeclarationNode *cur = enumeration->constants; cur != NULL; cur = dynamic_cast<DeclarationNode *>( cur->get_next() ), ++members ) {
    912912                if ( cur->get_enumeratorValue() != NULL ) {
    913913                        ObjectDecl *member = dynamic_cast<ObjectDecl *>(*members);
  • src/Parser/parser.cc

    r38736854 r6603c1d  
    10201020static const yytype_uint16 yyrline[] =
    10211021{
    1022        0,   299,   299,   305,   314,   315,   316,   320,   321,   322,
    1023      326,   327,   331,   332,   336,   337,   341,   342,   353,   355,
    1024      357,   359,   364,   365,   371,   375,   377,   378,   380,   381,
    1025      383,   385,   387,   396,   397,   403,   404,   408,   409,   413,
    1026      417,   419,   421,   423,   428,   431,   433,   435,   440,   453,
    1027      455,   457,   459,   461,   463,   465,   467,   469,   471,   473,
    1028      480,   481,   487,   488,   489,   490,   494,   495,   497,   502,
    1029      503,   505,   507,   512,   513,   515,   520,   521,   523,   528,
    1030      529,   531,   533,   535,   540,   541,   543,   548,   549,   554,
    1031      555,   560,   561,   566,   567,   572,   573,   578,   579,   582,
    1032      584,   589,   594,   595,   597,   603,   604,   608,   609,   610,
    1033      611,   612,   613,   614,   615,   616,   617,   618,   624,   626,
    1034      628,   630,   635,   636,   641,   642,   648,   649,   655,   656,
    1035      657,   658,   659,   660,   661,   662,   663,   673,   680,   682,
    1036      692,   693,   698,   700,   706,   708,   712,   713,   718,   723,
    1037      726,   728,   730,   740,   742,   753,   754,   756,   761,   763,
    1038      767,   768,   773,   774,   778,   783,   784,   788,   790,   796,
    1039      797,   801,   803,   805,   807,   813,   814,   818,   820,   825,
    1040      827,   829,   834,   836,   841,   843,   847,   850,   854,   857,
    1041      861,   863,   865,   867,   872,   874,   876,   885,   887,   889,
    1042      891,   893,   898,   900,   902,   904,   909,   922,   923,   928,
    1043      930,   935,   939,   941,   943,   945,   947,   953,   954,   960,
    1044      961,   965,   966,   971,   973,   979,   980,   982,   987,   989,
    1045      996,   998,  1002,  1003,  1008,  1010,  1014,  1015,  1019,  1021,
    1046     1025,  1026,  1030,  1031,  1035,  1036,  1051,  1052,  1053,  1054,
    1047     1055,  1059,  1064,  1071,  1081,  1086,  1091,  1099,  1104,  1109,
    1048     1114,  1119,  1127,  1149,  1154,  1161,  1163,  1170,  1175,  1180,
    1049     1191,  1196,  1201,  1206,  1211,  1220,  1225,  1233,  1234,  1235,
    1050     1236,  1242,  1247,  1255,  1256,  1257,  1258,  1262,  1263,  1264,
    1051     1265,  1270,  1271,  1280,  1281,  1286,  1287,  1292,  1294,  1296,
    1052     1298,  1300,  1303,  1302,  1314,  1315,  1317,  1327,  1328,  1333,
    1053     1337,  1339,  1341,  1343,  1345,  1347,  1349,  1351,  1356,  1358,
    1054     1360,  1362,  1364,  1366,  1368,  1370,  1372,  1374,  1376,  1378,
    1055     1380,  1386,  1387,  1389,  1391,  1393,  1398,  1399,  1405,  1406,
    1056     1408,  1410,  1415,  1417,  1419,  1421,  1426,  1427,  1429,  1431,
    1057     1436,  1437,  1439,  1444,  1445,  1447,  1449,  1454,  1456,  1458,
    1058     1463,  1464,  1468,  1470,  1476,  1475,  1479,  1481,  1486,  1488,
    1059     1494,  1495,  1500,  1501,  1503,  1504,  1513,  1514,  1516,  1518,
    1060     1523,  1525,  1531,  1532,  1534,  1537,  1540,  1545,  1546,  1551,
    1061     1556,  1560,  1562,  1568,  1567,  1574,  1576,  1582,  1583,  1591,
    1062     1592,  1596,  1597,  1598,  1600,  1602,  1609,  1610,  1612,  1614,
    1063     1619,  1620,  1626,  1627,  1631,  1632,  1637,  1638,  1639,  1641,
    1064     1649,  1650,  1652,  1655,  1657,  1661,  1662,  1663,  1665,  1667,
    1065     1671,  1676,  1684,  1685,  1694,  1696,  1701,  1702,  1703,  1707,
    1066     1708,  1709,  1713,  1714,  1715,  1719,  1720,  1721,  1726,  1727,
    1067     1728,  1729,  1735,  1736,  1738,  1743,  1744,  1749,  1750,  1751,
    1068     1752,  1753,  1768,  1769,  1774,  1775,  1781,  1783,  1786,  1788,
    1069     1790,  1813,  1814,  1816,  1818,  1823,  1824,  1826,  1831,  1836,
    1070     1837,  1843,  1842,  1846,  1850,  1852,  1854,  1860,  1861,  1866,
    1071     1871,  1873,  1878,  1880,  1881,  1883,  1888,  1890,  1892,  1897,
    1072     1899,  1904,  1909,  1917,  1923,  1922,  1936,  1937,  1942,  1943,
    1073     1947,  1952,  1957,  1965,  1970,  1981,  1982,  1993,  1994,  2000,
    1074     2001,  2005,  2006,  2007,  2010,  2009,  2020,  2029,  2035,  2041,
    1075     2050,  2056,  2062,  2068,  2074,  2082,  2088,  2096,  2102,  2111,
    1076     2112,  2113,  2117,  2121,  2123,  2128,  2129,  2133,  2134,  2139,
    1077     2145,  2146,  2149,  2151,  2152,  2156,  2157,  2158,  2159,  2193,
    1078     2195,  2196,  2198,  2203,  2208,  2213,  2215,  2217,  2222,  2224,
    1079     2226,  2228,  2233,  2235,  2244,  2246,  2247,  2252,  2254,  2256,
    1080     2261,  2263,  2265,  2270,  2272,  2274,  2283,  2284,  2285,  2289,
    1081     2291,  2293,  2298,  2300,  2302,  2307,  2309,  2311,  2326,  2328,
    1082     2329,  2331,  2336,  2337,  2342,  2344,  2346,  2351,  2353,  2355,
    1083     2357,  2362,  2364,  2366,  2376,  2378,  2379,  2381,  2386,  2388,
    1084     2390,  2395,  2397,  2399,  2401,  2406,  2408,  2410,  2441,  2443,
    1085     2444,  2446,  2451,  2456,  2464,  2466,  2468,  2473,  2475,  2480,
    1086     2482,  2496,  2497,  2499,  2504,  2506,  2508,  2510,  2512,  2517,
    1087     2518,  2520,  2522,  2527,  2529,  2531,  2537,  2539,  2541,  2545,
    1088     2547,  2549,  2551,  2565,  2566,  2568,  2573,  2575,  2577,  2579,
    1089     2581,  2586,  2587,  2589,  2591,  2596,  2598,  2600,  2606,  2607,
    1090     2609,  2618,  2621,  2623,  2626,  2628,  2630,  2643,  2644,  2646,
    1091     2651,  2653,  2655,  2657,  2659,  2664,  2665,  2667,  2669,  2674,
    1092     2676,  2684,  2685,  2686,  2691,  2692,  2696,  2698,  2700,  2702,
    1093     2704,  2706,  2713,  2715,  2717,  2719,  2721,  2723,  2725,  2727,
    1094     2729,  2731,  2736,  2738,  2740,  2745,  2771,  2772,  2774,  2778,
    1095     2779,  2783,  2785,  2787,  2789,  2791,  2793,  2800,  2802,  2804,
    1096     2806,  2808,  2810,  2815,  2820,  2822,  2824,  2842,  2844,  2849,
    1097     2850
     1022       0,   298,   298,   304,   313,   314,   315,   319,   320,   321,
     1023     325,   326,   330,   331,   335,   336,   340,   341,   352,   354,
     1024     356,   358,   363,   364,   370,   374,   376,   377,   379,   380,
     1025     382,   384,   386,   395,   396,   402,   403,   407,   408,   412,
     1026     416,   418,   420,   422,   427,   430,   432,   434,   439,   452,
     1027     454,   456,   458,   460,   462,   464,   466,   468,   470,   472,
     1028     479,   480,   486,   487,   488,   489,   493,   494,   496,   501,
     1029     502,   504,   506,   511,   512,   514,   519,   520,   522,   527,
     1030     528,   530,   532,   534,   539,   540,   542,   547,   548,   553,
     1031     554,   559,   560,   565,   566,   571,   572,   577,   578,   581,
     1032     583,   588,   593,   594,   596,   602,   603,   607,   608,   609,
     1033     610,   611,   612,   613,   614,   615,   616,   617,   623,   625,
     1034     627,   629,   634,   635,   640,   641,   647,   648,   654,   655,
     1035     656,   657,   658,   659,   660,   661,   662,   672,   679,   681,
     1036     691,   692,   697,   699,   705,   707,   711,   712,   717,   722,
     1037     725,   727,   729,   739,   741,   752,   753,   755,   759,   761,
     1038     765,   766,   771,   772,   776,   781,   782,   786,   788,   794,
     1039     795,   799,   801,   803,   805,   811,   812,   816,   818,   823,
     1040     825,   827,   832,   834,   839,   841,   845,   848,   852,   855,
     1041     859,   861,   863,   865,   870,   872,   874,   879,   881,   883,
     1042     885,   887,   892,   894,   896,   898,   903,   915,   916,   921,
     1043     923,   928,   932,   934,   936,   938,   940,   946,   947,   953,
     1044     954,   958,   959,   964,   966,   972,   973,   975,   980,   982,
     1045     989,   991,   995,   996,  1001,  1003,  1007,  1008,  1012,  1014,
     1046    1018,  1019,  1023,  1024,  1028,  1029,  1044,  1045,  1046,  1047,
     1047    1048,  1052,  1057,  1064,  1074,  1079,  1084,  1092,  1097,  1102,
     1048    1107,  1112,  1120,  1142,  1147,  1154,  1156,  1163,  1168,  1173,
     1049    1184,  1189,  1194,  1199,  1204,  1213,  1218,  1226,  1227,  1228,
     1050    1229,  1235,  1240,  1248,  1249,  1250,  1251,  1255,  1256,  1257,
     1051    1258,  1263,  1264,  1273,  1274,  1279,  1280,  1285,  1287,  1289,
     1052    1291,  1293,  1296,  1295,  1307,  1308,  1310,  1320,  1321,  1326,
     1053    1330,  1332,  1334,  1336,  1338,  1340,  1342,  1344,  1349,  1351,
     1054    1353,  1355,  1357,  1359,  1361,  1363,  1365,  1367,  1369,  1371,
     1055    1373,  1379,  1380,  1382,  1384,  1386,  1391,  1392,  1398,  1399,
     1056    1401,  1403,  1408,  1410,  1412,  1414,  1419,  1420,  1422,  1424,
     1057    1429,  1430,  1432,  1437,  1438,  1440,  1442,  1447,  1449,  1451,
     1058    1456,  1457,  1461,  1463,  1469,  1468,  1472,  1474,  1479,  1481,
     1059    1487,  1488,  1493,  1494,  1496,  1497,  1506,  1507,  1509,  1511,
     1060    1516,  1518,  1524,  1525,  1527,  1530,  1533,  1538,  1539,  1544,
     1061    1549,  1553,  1555,  1561,  1560,  1567,  1569,  1575,  1576,  1584,
     1062    1585,  1589,  1590,  1591,  1593,  1595,  1602,  1603,  1605,  1607,
     1063    1612,  1613,  1619,  1620,  1624,  1625,  1630,  1631,  1632,  1634,
     1064    1642,  1643,  1645,  1648,  1650,  1654,  1655,  1656,  1658,  1660,
     1065    1664,  1669,  1677,  1678,  1687,  1689,  1694,  1695,  1696,  1700,
     1066    1701,  1702,  1706,  1707,  1708,  1712,  1713,  1714,  1719,  1720,
     1067    1721,  1722,  1728,  1729,  1731,  1736,  1737,  1742,  1743,  1744,
     1068    1745,  1746,  1761,  1762,  1767,  1768,  1774,  1776,  1779,  1781,
     1069    1783,  1806,  1807,  1809,  1811,  1816,  1817,  1819,  1824,  1829,
     1070    1830,  1836,  1835,  1839,  1843,  1845,  1847,  1853,  1854,  1859,
     1071    1864,  1866,  1871,  1873,  1874,  1876,  1881,  1883,  1885,  1890,
     1072    1892,  1897,  1902,  1910,  1916,  1915,  1929,  1930,  1935,  1936,
     1073    1940,  1945,  1950,  1958,  1963,  1974,  1975,  1986,  1987,  1993,
     1074    1994,  1998,  1999,  2000,  2003,  2002,  2013,  2022,  2028,  2034,
     1075    2043,  2049,  2055,  2061,  2067,  2075,  2081,  2089,  2095,  2104,
     1076    2105,  2106,  2110,  2114,  2116,  2121,  2122,  2126,  2127,  2132,
     1077    2138,  2139,  2142,  2144,  2145,  2149,  2150,  2151,  2152,  2186,
     1078    2188,  2189,  2191,  2196,  2201,  2206,  2208,  2210,  2215,  2217,
     1079    2219,  2221,  2226,  2228,  2237,  2239,  2240,  2245,  2247,  2249,
     1080    2254,  2256,  2258,  2263,  2265,  2267,  2276,  2277,  2278,  2282,
     1081    2284,  2286,  2291,  2293,  2295,  2300,  2302,  2304,  2319,  2321,
     1082    2322,  2324,  2329,  2330,  2335,  2337,  2339,  2344,  2346,  2348,
     1083    2350,  2355,  2357,  2359,  2369,  2371,  2372,  2374,  2379,  2381,
     1084    2383,  2388,  2390,  2392,  2394,  2399,  2401,  2403,  2434,  2436,
     1085    2437,  2439,  2444,  2449,  2457,  2459,  2461,  2466,  2468,  2473,
     1086    2475,  2489,  2490,  2492,  2497,  2499,  2501,  2503,  2505,  2510,
     1087    2511,  2513,  2515,  2520,  2522,  2524,  2530,  2532,  2534,  2538,
     1088    2540,  2542,  2544,  2558,  2559,  2561,  2566,  2568,  2570,  2572,
     1089    2574,  2579,  2580,  2582,  2584,  2589,  2591,  2593,  2599,  2600,
     1090    2602,  2611,  2614,  2616,  2619,  2621,  2623,  2636,  2637,  2639,
     1091    2644,  2646,  2648,  2650,  2652,  2657,  2658,  2660,  2662,  2667,
     1092    2669,  2677,  2678,  2679,  2684,  2685,  2689,  2691,  2693,  2695,
     1093    2697,  2699,  2706,  2708,  2710,  2712,  2714,  2716,  2718,  2720,
     1094    2722,  2724,  2729,  2731,  2733,  2738,  2764,  2765,  2767,  2771,
     1095    2772,  2776,  2778,  2780,  2782,  2784,  2786,  2793,  2795,  2797,
     1096    2799,  2801,  2803,  2808,  2813,  2815,  2817,  2835,  2837,  2842,
     1097    2843
    10981098};
    10991099#endif
     
    49604960
    49614961/* Line 1806 of yacc.c  */
    4962 #line 299 "parser.yy"
     4962#line 298 "parser.yy"
    49634963    {
    49644964                        typedefTable.enterScope();
     
    49694969
    49704970/* Line 1806 of yacc.c  */
    4971 #line 305 "parser.yy"
     4971#line 304 "parser.yy"
    49724972    {
    49734973                        typedefTable.leaveScope();
     
    49784978
    49794979/* Line 1806 of yacc.c  */
     4980#line 313 "parser.yy"
     4981    { (yyval.en) = new ExpressionNode( build_constantInteger( *(yyvsp[(1) - (1)].tok) ) ); }
     4982    break;
     4983
     4984  case 5:
     4985
     4986/* Line 1806 of yacc.c  */
    49804987#line 314 "parser.yy"
    4981     { (yyval.en) = new ExpressionNode( build_constantInteger( *(yyvsp[(1) - (1)].tok) ) ); }
    4982     break;
    4983 
    4984   case 5:
     4988    { (yyval.en) = new ExpressionNode( build_constantFloat( *(yyvsp[(1) - (1)].tok) ) ); }
     4989    break;
     4990
     4991  case 6:
    49854992
    49864993/* Line 1806 of yacc.c  */
    49874994#line 315 "parser.yy"
    4988     { (yyval.en) = new ExpressionNode( build_constantFloat( *(yyvsp[(1) - (1)].tok) ) ); }
    4989     break;
    4990 
    4991   case 6:
    4992 
    4993 /* Line 1806 of yacc.c  */
    4994 #line 316 "parser.yy"
    49954995    { (yyval.en) = new ExpressionNode( build_constantChar( *(yyvsp[(1) - (1)].tok) ) ); }
    49964996    break;
     
    49994999
    50005000/* Line 1806 of yacc.c  */
    5001 #line 341 "parser.yy"
     5001#line 340 "parser.yy"
    50025002    { (yyval.constant) = build_constantStr( *(yyvsp[(1) - (1)].tok) ); }
    50035003    break;
     
    50065006
    50075007/* Line 1806 of yacc.c  */
    5008 #line 343 "parser.yy"
     5008#line 342 "parser.yy"
    50095009    {
    50105010                        appendStr( (yyvsp[(1) - (2)].constant)->get_constant()->get_value(), (yyvsp[(2) - (2)].tok) );
     
    50175017
    50185018/* Line 1806 of yacc.c  */
    5019 #line 354 "parser.yy"
     5019#line 353 "parser.yy"
    50205020    { (yyval.en) = new ExpressionNode( build_varref( (yyvsp[(1) - (1)].tok) ) ); }
    50215021    break;
     
    50245024
    50255025/* Line 1806 of yacc.c  */
    5026 #line 356 "parser.yy"
     5026#line 355 "parser.yy"
    50275027    { (yyval.en) = new ExpressionNode( build_varref( (yyvsp[(1) - (1)].tok) ) ); }
    50285028    break;
     
    50315031
    50325032/* Line 1806 of yacc.c  */
    5033 #line 358 "parser.yy"
     5033#line 357 "parser.yy"
    50345034    { (yyval.en) = (yyvsp[(2) - (3)].en); }
    50355035    break;
     
    50385038
    50395039/* Line 1806 of yacc.c  */
    5040 #line 360 "parser.yy"
     5040#line 359 "parser.yy"
    50415041    { (yyval.en) = new ExpressionNode( build_valexpr( (yyvsp[(2) - (3)].sn) ) ); }
    50425042    break;
     
    50455045
    50465046/* Line 1806 of yacc.c  */
    5047 #line 370 "parser.yy"
     5047#line 369 "parser.yy"
    50485048    { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::Index, (yyvsp[(1) - (6)].en), (yyvsp[(4) - (6)].en) ) ); }
    50495049    break;
     
    50525052
    50535053/* Line 1806 of yacc.c  */
    5054 #line 372 "parser.yy"
     5054#line 371 "parser.yy"
    50555055    { (yyval.en) = new ExpressionNode( build_func( (yyvsp[(1) - (4)].en), (yyvsp[(3) - (4)].en) ) ); }
    50565056    break;
     
    50595059
    50605060/* Line 1806 of yacc.c  */
    5061 #line 376 "parser.yy"
     5061#line 375 "parser.yy"
    50625062    { (yyval.en) = new ExpressionNode( build_fieldSel( (yyvsp[(1) - (3)].en), build_varref( (yyvsp[(3) - (3)].tok) ) ) ); }
    50635063    break;
     
    50665066
    50675067/* Line 1806 of yacc.c  */
    5068 #line 379 "parser.yy"
     5068#line 378 "parser.yy"
    50695069    { (yyval.en) = new ExpressionNode( build_pfieldSel( (yyvsp[(1) - (3)].en), build_varref( (yyvsp[(3) - (3)].tok) ) ) ); }
    50705070    break;
     
    50735073
    50745074/* Line 1806 of yacc.c  */
    5075 #line 382 "parser.yy"
     5075#line 381 "parser.yy"
    50765076    { (yyval.en) = new ExpressionNode( build_unary_ptr( OperKinds::IncrPost, (yyvsp[(1) - (2)].en) ) ); }
    50775077    break;
     
    50805080
    50815081/* Line 1806 of yacc.c  */
    5082 #line 384 "parser.yy"
     5082#line 383 "parser.yy"
    50835083    { (yyval.en) = new ExpressionNode( build_unary_ptr( OperKinds::DecrPost, (yyvsp[(1) - (2)].en) ) ); }
    50845084    break;
     
    50875087
    50885088/* Line 1806 of yacc.c  */
    5089 #line 386 "parser.yy"
     5089#line 385 "parser.yy"
    50905090    { (yyval.en) = new ExpressionNode( build_compoundLiteral( (yyvsp[(2) - (7)].decl), new InitializerNode( (yyvsp[(5) - (7)].in), true ) ) ); }
    50915091    break;
     
    50945094
    50955095/* Line 1806 of yacc.c  */
    5096 #line 388 "parser.yy"
     5096#line 387 "parser.yy"
    50975097    {
    50985098                        Token fn;
    50995099                        fn.str = new std::string( "?{}" ); // location undefined
    5100                         (yyval.en) = new ExpressionNode( build_func( new ExpressionNode( build_varref( fn ) ), (ExpressionNode *)( (yyvsp[(1) - (4)].en) )->set_link( (yyvsp[(3) - (4)].en) ) ) );
     5100                        (yyval.en) = new ExpressionNode( build_func( new ExpressionNode( build_varref( fn ) ), (ExpressionNode *)( (yyvsp[(1) - (4)].en) )->set_last( (yyvsp[(3) - (4)].en) ) ) );
    51015101                }
    51025102    break;
     
    51055105
    51065106/* Line 1806 of yacc.c  */
    5107 #line 398 "parser.yy"
    5108     { (yyval.en) = (ExpressionNode *)( (yyvsp[(1) - (3)].en)->set_link( (yyvsp[(3) - (3)].en) )); }
     5107#line 397 "parser.yy"
     5108    { (yyval.en) = (ExpressionNode *)( (yyvsp[(1) - (3)].en)->set_last( (yyvsp[(3) - (3)].en) )); }
    51095109    break;
    51105110
     
    51125112
    51135113/* Line 1806 of yacc.c  */
    5114 #line 403 "parser.yy"
     5114#line 402 "parser.yy"
    51155115    { (yyval.en) = 0; }
    51165116    break;
     
    51195119
    51205120/* Line 1806 of yacc.c  */
    5121 #line 409 "parser.yy"
    5122     { (yyval.en) = (ExpressionNode *)(yyvsp[(1) - (3)].en)->set_link( (yyvsp[(3) - (3)].en) ); }
     5121#line 408 "parser.yy"
     5122    { (yyval.en) = (ExpressionNode *)(yyvsp[(1) - (3)].en)->set_last( (yyvsp[(3) - (3)].en) ); }
    51235123    break;
    51245124
     
    51265126
    51275127/* Line 1806 of yacc.c  */
    5128 #line 414 "parser.yy"
     5128#line 413 "parser.yy"
    51295129    { (yyval.en) = new ExpressionNode( build_varref( (yyvsp[(1) - (1)].tok) ) ); }
    51305130    break;
     
    51335133
    51345134/* Line 1806 of yacc.c  */
    5135 #line 418 "parser.yy"
     5135#line 417 "parser.yy"
    51365136    { (yyval.en) = new ExpressionNode( build_fieldSel( (yyvsp[(3) - (3)].en), build_varref( (yyvsp[(1) - (3)].tok) ) ) ); }
    51375137    break;
     
    51405140
    51415141/* Line 1806 of yacc.c  */
    5142 #line 420 "parser.yy"
     5142#line 419 "parser.yy"
    51435143    { (yyval.en) = new ExpressionNode( build_fieldSel( (yyvsp[(5) - (7)].en), build_varref( (yyvsp[(1) - (7)].tok) ) ) ); }
    51445144    break;
     
    51475147
    51485148/* Line 1806 of yacc.c  */
    5149 #line 422 "parser.yy"
     5149#line 421 "parser.yy"
    51505150    { (yyval.en) = new ExpressionNode( build_pfieldSel( (yyvsp[(3) - (3)].en), build_varref( (yyvsp[(1) - (3)].tok) ) ) ); }
    51515151    break;
     
    51545154
    51555155/* Line 1806 of yacc.c  */
    5156 #line 424 "parser.yy"
     5156#line 423 "parser.yy"
    51575157    { (yyval.en) = new ExpressionNode( build_pfieldSel( (yyvsp[(5) - (7)].en), build_varref( (yyvsp[(1) - (7)].tok) ) ) ); }
    51585158    break;
     
    51615161
    51625162/* Line 1806 of yacc.c  */
    5163 #line 432 "parser.yy"
     5163#line 431 "parser.yy"
    51645164    { (yyval.en) = (yyvsp[(1) - (1)].en); }
    51655165    break;
     
    51685168
    51695169/* Line 1806 of yacc.c  */
    5170 #line 434 "parser.yy"
     5170#line 433 "parser.yy"
    51715171    { (yyval.en) = new ExpressionNode( (yyvsp[(1) - (1)].constant) ); }
    51725172    break;
     
    51755175
    51765176/* Line 1806 of yacc.c  */
    5177 #line 436 "parser.yy"
     5177#line 435 "parser.yy"
    51785178    { (yyval.en) = (yyvsp[(2) - (2)].en)->set_extension( true ); }
    51795179    break;
     
    51825182
    51835183/* Line 1806 of yacc.c  */
    5184 #line 441 "parser.yy"
     5184#line 440 "parser.yy"
    51855185    {
    51865186                        switch ( (yyvsp[(1) - (2)].op) ) {
     
    52005200
    52015201/* Line 1806 of yacc.c  */
    5202 #line 454 "parser.yy"
     5202#line 453 "parser.yy"
    52035203    { (yyval.en) = new ExpressionNode( build_unary_val( (yyvsp[(1) - (2)].op), (yyvsp[(2) - (2)].en) ) ); }
    52045204    break;
     
    52075207
    52085208/* Line 1806 of yacc.c  */
    5209 #line 456 "parser.yy"
     5209#line 455 "parser.yy"
    52105210    { (yyval.en) = new ExpressionNode( build_unary_ptr( OperKinds::Incr, (yyvsp[(2) - (2)].en) ) ); }
    52115211    break;
     
    52145214
    52155215/* Line 1806 of yacc.c  */
    5216 #line 458 "parser.yy"
     5216#line 457 "parser.yy"
    52175217    { (yyval.en) = new ExpressionNode( build_unary_ptr( OperKinds::Decr, (yyvsp[(2) - (2)].en) ) ); }
    52185218    break;
     
    52215221
    52225222/* Line 1806 of yacc.c  */
    5223 #line 460 "parser.yy"
     5223#line 459 "parser.yy"
    52245224    { (yyval.en) = new ExpressionNode( build_sizeOfexpr( (yyvsp[(2) - (2)].en) ) ); }
    52255225    break;
     
    52285228
    52295229/* Line 1806 of yacc.c  */
    5230 #line 462 "parser.yy"
     5230#line 461 "parser.yy"
    52315231    { (yyval.en) = new ExpressionNode( build_sizeOftype( (yyvsp[(3) - (4)].decl) ) ); }
    52325232    break;
     
    52355235
    52365236/* Line 1806 of yacc.c  */
    5237 #line 464 "parser.yy"
     5237#line 463 "parser.yy"
    52385238    { (yyval.en) = new ExpressionNode( build_alignOfexpr( (yyvsp[(2) - (2)].en) ) ); }
    52395239    break;
     
    52425242
    52435243/* Line 1806 of yacc.c  */
    5244 #line 466 "parser.yy"
     5244#line 465 "parser.yy"
    52455245    { (yyval.en) = new ExpressionNode( build_alignOftype( (yyvsp[(3) - (4)].decl) ) ); }
    52465246    break;
     
    52495249
    52505250/* Line 1806 of yacc.c  */
    5251 #line 468 "parser.yy"
     5251#line 467 "parser.yy"
    52525252    { (yyval.en) = new ExpressionNode( build_offsetOf( (yyvsp[(3) - (6)].decl), build_varref( (yyvsp[(5) - (6)].tok) ) ) ); }
    52535253    break;
     
    52565256
    52575257/* Line 1806 of yacc.c  */
    5258 #line 470 "parser.yy"
     5258#line 469 "parser.yy"
    52595259    { (yyval.en) = new ExpressionNode( build_attrexpr( build_varref( (yyvsp[(1) - (1)].tok) ), nullptr ) ); }
    52605260    break;
     
    52635263
    52645264/* Line 1806 of yacc.c  */
    5265 #line 472 "parser.yy"
     5265#line 471 "parser.yy"
    52665266    { (yyval.en) = new ExpressionNode( build_attrexpr( build_varref( (yyvsp[(1) - (4)].tok) ), (yyvsp[(3) - (4)].en) ) ); }
    52675267    break;
     
    52705270
    52715271/* Line 1806 of yacc.c  */
    5272 #line 474 "parser.yy"
     5272#line 473 "parser.yy"
    52735273    { (yyval.en) = new ExpressionNode( build_attrtype( build_varref( (yyvsp[(1) - (4)].tok) ), (yyvsp[(3) - (4)].decl) ) ); }
    52745274    break;
     
    52775277
    52785278/* Line 1806 of yacc.c  */
     5279#line 479 "parser.yy"
     5280    { (yyval.op) = OperKinds::PointTo; }
     5281    break;
     5282
     5283  case 61:
     5284
     5285/* Line 1806 of yacc.c  */
    52795286#line 480 "parser.yy"
    5280     { (yyval.op) = OperKinds::PointTo; }
    5281     break;
    5282 
    5283   case 61:
    5284 
    5285 /* Line 1806 of yacc.c  */
    5286 #line 481 "parser.yy"
    52875287    { (yyval.op) = OperKinds::AddressOf; }
    52885288    break;
     
    52915291
    52925292/* Line 1806 of yacc.c  */
     5293#line 486 "parser.yy"
     5294    { (yyval.op) = OperKinds::UnPlus; }
     5295    break;
     5296
     5297  case 63:
     5298
     5299/* Line 1806 of yacc.c  */
    52935300#line 487 "parser.yy"
    5294     { (yyval.op) = OperKinds::UnPlus; }
    5295     break;
    5296 
    5297   case 63:
     5301    { (yyval.op) = OperKinds::UnMinus; }
     5302    break;
     5303
     5304  case 64:
    52985305
    52995306/* Line 1806 of yacc.c  */
    53005307#line 488 "parser.yy"
    5301     { (yyval.op) = OperKinds::UnMinus; }
    5302     break;
    5303 
    5304   case 64:
     5308    { (yyval.op) = OperKinds::Neg; }
     5309    break;
     5310
     5311  case 65:
    53055312
    53065313/* Line 1806 of yacc.c  */
    53075314#line 489 "parser.yy"
    5308     { (yyval.op) = OperKinds::Neg; }
    5309     break;
    5310 
    5311   case 65:
    5312 
    5313 /* Line 1806 of yacc.c  */
    5314 #line 490 "parser.yy"
    53155315    { (yyval.op) = OperKinds::BitNeg; }
    53165316    break;
     
    53195319
    53205320/* Line 1806 of yacc.c  */
    5321 #line 496 "parser.yy"
     5321#line 495 "parser.yy"
    53225322    { (yyval.en) = new ExpressionNode( build_cast( (yyvsp[(2) - (4)].decl), (yyvsp[(4) - (4)].en) ) ); }
    53235323    break;
     
    53265326
    53275327/* Line 1806 of yacc.c  */
    5328 #line 498 "parser.yy"
     5328#line 497 "parser.yy"
    53295329    { (yyval.en) = new ExpressionNode( build_cast( (yyvsp[(2) - (4)].decl), (yyvsp[(4) - (4)].en) ) ); }
    53305330    break;
     
    53335333
    53345334/* Line 1806 of yacc.c  */
    5335 #line 504 "parser.yy"
     5335#line 503 "parser.yy"
    53365336    { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::Mul, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
    53375337    break;
     
    53405340
    53415341/* Line 1806 of yacc.c  */
    5342 #line 506 "parser.yy"
     5342#line 505 "parser.yy"
    53435343    { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::Div, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
    53445344    break;
     
    53475347
    53485348/* Line 1806 of yacc.c  */
    5349 #line 508 "parser.yy"
     5349#line 507 "parser.yy"
    53505350    { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::Mod, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
    53515351    break;
     
    53545354
    53555355/* Line 1806 of yacc.c  */
    5356 #line 514 "parser.yy"
     5356#line 513 "parser.yy"
    53575357    { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::Plus, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
    53585358    break;
     
    53615361
    53625362/* Line 1806 of yacc.c  */
    5363 #line 516 "parser.yy"
     5363#line 515 "parser.yy"
    53645364    { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::Minus, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
    53655365    break;
     
    53685368
    53695369/* Line 1806 of yacc.c  */
    5370 #line 522 "parser.yy"
     5370#line 521 "parser.yy"
    53715371    { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::LShift, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
    53725372    break;
     
    53755375
    53765376/* Line 1806 of yacc.c  */
    5377 #line 524 "parser.yy"
     5377#line 523 "parser.yy"
    53785378    { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::RShift, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
    53795379    break;
     
    53825382
    53835383/* Line 1806 of yacc.c  */
    5384 #line 530 "parser.yy"
     5384#line 529 "parser.yy"
    53855385    { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::LThan, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
    53865386    break;
     
    53895389
    53905390/* Line 1806 of yacc.c  */
    5391 #line 532 "parser.yy"
     5391#line 531 "parser.yy"
    53925392    { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::GThan, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
    53935393    break;
     
    53965396
    53975397/* Line 1806 of yacc.c  */
    5398 #line 534 "parser.yy"
     5398#line 533 "parser.yy"
    53995399    { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::LEThan, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
    54005400    break;
     
    54035403
    54045404/* Line 1806 of yacc.c  */
    5405 #line 536 "parser.yy"
     5405#line 535 "parser.yy"
    54065406    { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::GEThan, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
    54075407    break;
     
    54105410
    54115411/* Line 1806 of yacc.c  */
    5412 #line 542 "parser.yy"
     5412#line 541 "parser.yy"
    54135413    { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::Eq, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
    54145414    break;
     
    54175417
    54185418/* Line 1806 of yacc.c  */
    5419 #line 544 "parser.yy"
     5419#line 543 "parser.yy"
    54205420    { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::Neq, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
    54215421    break;
     
    54245424
    54255425/* Line 1806 of yacc.c  */
    5426 #line 550 "parser.yy"
     5426#line 549 "parser.yy"
    54275427    { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::BitAnd, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
    54285428    break;
     
    54315431
    54325432/* Line 1806 of yacc.c  */
    5433 #line 556 "parser.yy"
     5433#line 555 "parser.yy"
    54345434    { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::Xor, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
    54355435    break;
     
    54385438
    54395439/* Line 1806 of yacc.c  */
    5440 #line 562 "parser.yy"
     5440#line 561 "parser.yy"
    54415441    { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::BitOr, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
    54425442    break;
     
    54455445
    54465446/* Line 1806 of yacc.c  */
    5447 #line 568 "parser.yy"
     5447#line 567 "parser.yy"
    54485448    { (yyval.en) = new ExpressionNode( build_and_or( (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en), true ) ); }
    54495449    break;
     
    54525452
    54535453/* Line 1806 of yacc.c  */
    5454 #line 574 "parser.yy"
     5454#line 573 "parser.yy"
    54555455    { (yyval.en) = new ExpressionNode( build_and_or( (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en), false ) ); }
    54565456    break;
     
    54595459
    54605460/* Line 1806 of yacc.c  */
    5461 #line 580 "parser.yy"
     5461#line 579 "parser.yy"
    54625462    { (yyval.en) = new ExpressionNode( build_cond( (yyvsp[(1) - (5)].en), (yyvsp[(3) - (5)].en), (yyvsp[(5) - (5)].en) ) ); }
    54635463    break;
     
    54665466
    54675467/* Line 1806 of yacc.c  */
    5468 #line 583 "parser.yy"
     5468#line 582 "parser.yy"
    54695469    { (yyval.en) = new ExpressionNode( build_cond( (yyvsp[(1) - (4)].en), (yyvsp[(1) - (4)].en), (yyvsp[(4) - (4)].en) ) ); }
    54705470    break;
     
    54735473
    54745474/* Line 1806 of yacc.c  */
    5475 #line 585 "parser.yy"
     5475#line 584 "parser.yy"
    54765476    { (yyval.en) = new ExpressionNode( build_cond( (yyvsp[(1) - (5)].en), (yyvsp[(3) - (5)].en), (yyvsp[(5) - (5)].en) ) ); }
    54775477    break;
     
    54805480
    54815481/* Line 1806 of yacc.c  */
    5482 #line 596 "parser.yy"
     5482#line 595 "parser.yy"
    54835483    { (yyval.en) = new ExpressionNode( build_binary_ptr( (yyvsp[(2) - (3)].op), (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
    54845484    break;
     
    54875487
    54885488/* Line 1806 of yacc.c  */
    5489 #line 598 "parser.yy"
     5489#line 597 "parser.yy"
    54905490    { (yyval.en) = ( (yyvsp[(2) - (2)].en) == 0 ) ? (yyvsp[(1) - (2)].en) : new ExpressionNode( build_binary_ptr( OperKinds::Assign, (yyvsp[(1) - (2)].en), (yyvsp[(2) - (2)].en) ) ); }
    54915491    break;
     
    54945494
    54955495/* Line 1806 of yacc.c  */
    5496 #line 603 "parser.yy"
     5496#line 602 "parser.yy"
    54975497    { (yyval.en) = nullptr; }
    54985498    break;
     
    55015501
    55025502/* Line 1806 of yacc.c  */
     5503#line 607 "parser.yy"
     5504    { (yyval.op) = OperKinds::Assign; }
     5505    break;
     5506
     5507  case 108:
     5508
     5509/* Line 1806 of yacc.c  */
    55035510#line 608 "parser.yy"
    5504     { (yyval.op) = OperKinds::Assign; }
    5505     break;
    5506 
    5507   case 108:
     5511    { (yyval.op) = OperKinds::MulAssn; }
     5512    break;
     5513
     5514  case 109:
    55085515
    55095516/* Line 1806 of yacc.c  */
    55105517#line 609 "parser.yy"
    5511     { (yyval.op) = OperKinds::MulAssn; }
    5512     break;
    5513 
    5514   case 109:
     5518    { (yyval.op) = OperKinds::DivAssn; }
     5519    break;
     5520
     5521  case 110:
    55155522
    55165523/* Line 1806 of yacc.c  */
    55175524#line 610 "parser.yy"
    5518     { (yyval.op) = OperKinds::DivAssn; }
    5519     break;
    5520 
    5521   case 110:
     5525    { (yyval.op) = OperKinds::ModAssn; }
     5526    break;
     5527
     5528  case 111:
    55225529
    55235530/* Line 1806 of yacc.c  */
    55245531#line 611 "parser.yy"
    5525     { (yyval.op) = OperKinds::ModAssn; }
    5526     break;
    5527 
    5528   case 111:
     5532    { (yyval.op) = OperKinds::PlusAssn; }
     5533    break;
     5534
     5535  case 112:
    55295536
    55305537/* Line 1806 of yacc.c  */
    55315538#line 612 "parser.yy"
    5532     { (yyval.op) = OperKinds::PlusAssn; }
    5533     break;
    5534 
    5535   case 112:
     5539    { (yyval.op) = OperKinds::MinusAssn; }
     5540    break;
     5541
     5542  case 113:
    55365543
    55375544/* Line 1806 of yacc.c  */
    55385545#line 613 "parser.yy"
    5539     { (yyval.op) = OperKinds::MinusAssn; }
    5540     break;
    5541 
    5542   case 113:
     5546    { (yyval.op) = OperKinds::LSAssn; }
     5547    break;
     5548
     5549  case 114:
    55435550
    55445551/* Line 1806 of yacc.c  */
    55455552#line 614 "parser.yy"
    5546     { (yyval.op) = OperKinds::LSAssn; }
    5547     break;
    5548 
    5549   case 114:
     5553    { (yyval.op) = OperKinds::RSAssn; }
     5554    break;
     5555
     5556  case 115:
    55505557
    55515558/* Line 1806 of yacc.c  */
    55525559#line 615 "parser.yy"
    5553     { (yyval.op) = OperKinds::RSAssn; }
    5554     break;
    5555 
    5556   case 115:
     5560    { (yyval.op) = OperKinds::AndAssn; }
     5561    break;
     5562
     5563  case 116:
    55575564
    55585565/* Line 1806 of yacc.c  */
    55595566#line 616 "parser.yy"
    5560     { (yyval.op) = OperKinds::AndAssn; }
    5561     break;
    5562 
    5563   case 116:
     5567    { (yyval.op) = OperKinds::ERAssn; }
     5568    break;
     5569
     5570  case 117:
    55645571
    55655572/* Line 1806 of yacc.c  */
    55665573#line 617 "parser.yy"
    5567     { (yyval.op) = OperKinds::ERAssn; }
    5568     break;
    5569 
    5570   case 117:
    5571 
    5572 /* Line 1806 of yacc.c  */
    5573 #line 618 "parser.yy"
    55745574    { (yyval.op) = OperKinds::OrAssn; }
    55755575    break;
     
    55785578
    55795579/* Line 1806 of yacc.c  */
    5580 #line 625 "parser.yy"
     5580#line 624 "parser.yy"
    55815581    { (yyval.en) = new ExpressionNode( build_tuple() ); }
    55825582    break;
     
    55855585
    55865586/* Line 1806 of yacc.c  */
    5587 #line 627 "parser.yy"
     5587#line 626 "parser.yy"
    55885588    { (yyval.en) = new ExpressionNode( build_tuple( (yyvsp[(3) - (5)].en) ) ); }
    55895589    break;
     
    55925592
    55935593/* Line 1806 of yacc.c  */
    5594 #line 629 "parser.yy"
    5595     { (yyval.en) = new ExpressionNode( build_tuple( (ExpressionNode *)(new ExpressionNode( nullptr ) )->set_link( (yyvsp[(4) - (6)].en) ) ) ); }
     5594#line 628 "parser.yy"
     5595    { (yyval.en) = new ExpressionNode( build_tuple( (ExpressionNode *)(new ExpressionNode( nullptr ) )->set_last( (yyvsp[(4) - (6)].en) ) ) ); }
    55965596    break;
    55975597
     
    55995599
    56005600/* Line 1806 of yacc.c  */
    5601 #line 631 "parser.yy"
    5602     { (yyval.en) = new ExpressionNode( build_tuple( (ExpressionNode *)(yyvsp[(3) - (7)].en)->set_link( (yyvsp[(5) - (7)].en) ) ) ); }
     5601#line 630 "parser.yy"
     5602    { (yyval.en) = new ExpressionNode( build_tuple( (ExpressionNode *)(yyvsp[(3) - (7)].en)->set_last( (yyvsp[(5) - (7)].en) ) ) ); }
    56035603    break;
    56045604
     
    56065606
    56075607/* Line 1806 of yacc.c  */
    5608 #line 637 "parser.yy"
    5609     { (yyval.en) = (ExpressionNode *)(yyvsp[(1) - (3)].en)->set_link( (yyvsp[(3) - (3)].en) ); }
     5608#line 636 "parser.yy"
     5609    { (yyval.en) = (ExpressionNode *)(yyvsp[(1) - (3)].en)->set_last( (yyvsp[(3) - (3)].en) ); }
    56105610    break;
    56115611
     
    56135613
    56145614/* Line 1806 of yacc.c  */
    5615 #line 643 "parser.yy"
     5615#line 642 "parser.yy"
    56165616    { (yyval.en) = new ExpressionNode( build_comma( (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
    56175617    break;
     
    56205620
    56215621/* Line 1806 of yacc.c  */
    5622 #line 648 "parser.yy"
     5622#line 647 "parser.yy"
    56235623    { (yyval.en) = 0; }
    56245624    break;
     
    56275627
    56285628/* Line 1806 of yacc.c  */
    5629 #line 657 "parser.yy"
     5629#line 656 "parser.yy"
    56305630    { (yyval.sn) = (yyvsp[(1) - (1)].sn); }
    56315631    break;
     
    56345634
    56355635/* Line 1806 of yacc.c  */
    5636 #line 664 "parser.yy"
     5636#line 663 "parser.yy"
    56375637    {
    56385638                        Token fn;
    56395639                        fn.str = new std::string( "^?{}" ); // location undefined
    5640                         (yyval.sn) = new StatementNode2( build_expr( new ExpressionNode( build_func( new ExpressionNode( build_varref( fn ) ), (ExpressionNode *)( (yyvsp[(2) - (6)].en) )->set_link( (yyvsp[(4) - (6)].en) ) ) ) ) );
     5640                        (yyval.sn) = new StatementNode2( build_expr( new ExpressionNode( build_func( new ExpressionNode( build_varref( fn ) ), (ExpressionNode *)( (yyvsp[(2) - (6)].en) )->set_last( (yyvsp[(4) - (6)].en) ) ) ) ) );
    56415641                }
    56425642    break;
     
    56455645
    56465646/* Line 1806 of yacc.c  */
    5647 #line 674 "parser.yy"
     5647#line 673 "parser.yy"
    56485648    {
    56495649                        (yyval.sn) = (yyvsp[(4) - (4)].sn)->add_label( (yyvsp[(1) - (4)].tok) );
     
    56545654
    56555655/* Line 1806 of yacc.c  */
    5656 #line 681 "parser.yy"
     5656#line 680 "parser.yy"
    56575657    { (yyval.sn) = new CompoundStmtNode( (StatementNode *)0 ); }
    56585658    break;
     
    56615661
    56625662/* Line 1806 of yacc.c  */
    5663 #line 688 "parser.yy"
     5663#line 687 "parser.yy"
    56645664    { (yyval.sn) = new CompoundStmtNode( (yyvsp[(5) - (7)].sn) ); }
    56655665    break;
     
    56685668
    56695669/* Line 1806 of yacc.c  */
    5670 #line 694 "parser.yy"
    5671     { if ( (yyvsp[(1) - (3)].sn) != 0 ) { (yyvsp[(1) - (3)].sn)->set_link( (yyvsp[(3) - (3)].sn) ); (yyval.sn) = (yyvsp[(1) - (3)].sn); } }
     5670#line 693 "parser.yy"
     5671    { if ( (yyvsp[(1) - (3)].sn) != 0 ) { (yyvsp[(1) - (3)].sn)->set_last( (yyvsp[(3) - (3)].sn) ); (yyval.sn) = (yyvsp[(1) - (3)].sn); } }
    56725672    break;
    56735673
     
    56755675
    56765676/* Line 1806 of yacc.c  */
    5677 #line 699 "parser.yy"
    5678     { (yyval.sn) = new StatementNode( (yyvsp[(1) - (1)].decl) ); }
     5677#line 698 "parser.yy"
     5678    { (yyval.sn) = new StatementNode2( (yyvsp[(1) - (1)].decl) ); }
    56795679    break;
    56805680
     
    56825682
    56835683/* Line 1806 of yacc.c  */
    5684 #line 701 "parser.yy"
     5684#line 700 "parser.yy"
    56855685    {   // mark all fields in list
    5686                         for ( DeclarationNode *iter = (yyvsp[(2) - (2)].decl); iter != NULL; iter = (DeclarationNode *)iter->get_link() )
     5686                        for ( DeclarationNode *iter = (yyvsp[(2) - (2)].decl); iter != NULL; iter = (DeclarationNode *)iter->get_next() )
    56875687                                iter->set_extension( true );
    5688                         (yyval.sn) = new StatementNode( (yyvsp[(2) - (2)].decl) );
     5688                        (yyval.sn) = new StatementNode2( (yyvsp[(2) - (2)].decl) );
    56895689                }
    56905690    break;
     
    56935693
    56945694/* Line 1806 of yacc.c  */
    5695 #line 707 "parser.yy"
    5696     { (yyval.sn) = new StatementNode( (yyvsp[(1) - (1)].decl) ); }
     5695#line 706 "parser.yy"
     5696    { (yyval.sn) = new StatementNode2( (yyvsp[(1) - (1)].decl) ); }
    56975697    break;
    56985698
     
    57005700
    57015701/* Line 1806 of yacc.c  */
    5702 #line 714 "parser.yy"
    5703     { if ( (yyvsp[(1) - (2)].sn) != 0 ) { (yyvsp[(1) - (2)].sn)->set_link( (yyvsp[(2) - (2)].sn) ); (yyval.sn) = (yyvsp[(1) - (2)].sn); } }
     5702#line 713 "parser.yy"
     5703    { if ( (yyvsp[(1) - (2)].sn) != 0 ) { (yyvsp[(1) - (2)].sn)->set_last( (yyvsp[(2) - (2)].sn) ); (yyval.sn) = (yyvsp[(1) - (2)].sn); } }
    57045704    break;
    57055705
     
    57075707
    57085708/* Line 1806 of yacc.c  */
    5709 #line 719 "parser.yy"
     5709#line 718 "parser.yy"
    57105710    { (yyval.sn) = new StatementNode2( build_expr( (yyvsp[(1) - (2)].en) ) ); }
    57115711    break;
     
    57145714
    57155715/* Line 1806 of yacc.c  */
    5716 #line 725 "parser.yy"
     5716#line 724 "parser.yy"
    57175717    { (yyval.sn) = new StatementNode2( build_if( (yyvsp[(3) - (5)].en), (yyvsp[(5) - (5)].sn), nullptr ) ); }
    57185718    break;
     
    57215721
    57225722/* Line 1806 of yacc.c  */
    5723 #line 727 "parser.yy"
     5723#line 726 "parser.yy"
    57245724    { (yyval.sn) = new StatementNode2( build_if( (yyvsp[(3) - (7)].en), (yyvsp[(5) - (7)].sn), (yyvsp[(7) - (7)].sn) ) ); }
    57255725    break;
     
    57285728
    57295729/* Line 1806 of yacc.c  */
    5730 #line 729 "parser.yy"
     5730#line 728 "parser.yy"
    57315731    { (yyval.sn) = new StatementNode2( build_switch( (yyvsp[(3) - (5)].en), (yyvsp[(5) - (5)].sn) ) ); }
    57325732    break;
     
    57355735
    57365736/* Line 1806 of yacc.c  */
    5737 #line 731 "parser.yy"
     5737#line 730 "parser.yy"
    57385738    {
    57395739                        StatementNode *sw = new StatementNode2( build_switch( (yyvsp[(3) - (9)].en), (yyvsp[(8) - (9)].sn) ) );
     
    57435743                        // therefore, are removed from the grammar even though C allows it. The change also applies to choose
    57445744                        // statement.
    5745                         (yyval.sn) = (yyvsp[(7) - (9)].decl) != 0 ? new CompoundStmtNode( (StatementNode *)((new StatementNode( (yyvsp[(7) - (9)].decl) ))->set_link( sw )) ) : sw;
     5745                        (yyval.sn) = (yyvsp[(7) - (9)].decl) != 0 ? new CompoundStmtNode( (StatementNode *)((new StatementNode2( (yyvsp[(7) - (9)].decl) ))->set_last( sw )) ) : sw;
    57465746                }
    57475747    break;
     
    57505750
    57515751/* Line 1806 of yacc.c  */
    5752 #line 741 "parser.yy"
     5752#line 740 "parser.yy"
    57535753    { (yyval.sn) = new StatementNode2( build_switch( (yyvsp[(3) - (5)].en), (yyvsp[(5) - (5)].sn) ) ); }
    57545754    break;
     
    57575757
    57585758/* Line 1806 of yacc.c  */
    5759 #line 743 "parser.yy"
     5759#line 742 "parser.yy"
    57605760    {
    57615761                        StatementNode *sw = new StatementNode2( build_switch( (yyvsp[(3) - (9)].en), (yyvsp[(8) - (9)].sn) ) );
    5762                         (yyval.sn) = (yyvsp[(7) - (9)].decl) != 0 ? new CompoundStmtNode( (StatementNode *)((new StatementNode( (yyvsp[(7) - (9)].decl) ))->set_link( sw )) ) : sw;
     5762                        (yyval.sn) = (yyvsp[(7) - (9)].decl) != 0 ? new CompoundStmtNode( (StatementNode *)((new StatementNode2( (yyvsp[(7) - (9)].decl) ))->set_last( sw )) ) : sw;
    57635763                }
    57645764    break;
     
    57675767
    57685768/* Line 1806 of yacc.c  */
    5769 #line 753 "parser.yy"
     5769#line 752 "parser.yy"
    57705770    { (yyval.en) = (yyvsp[(1) - (1)].en); }
    57715771    break;
     
    57745774
    57755775/* Line 1806 of yacc.c  */
    5776 #line 755 "parser.yy"
     5776#line 754 "parser.yy"
    57775777    { (yyval.en) = new ExpressionNode( build_range( (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); }
    57785778    break;
     
    57815781
    57825782/* Line 1806 of yacc.c  */
     5783#line 759 "parser.yy"
     5784    { (yyval.sn) = new StatementNode2( build_case( (yyvsp[(1) - (1)].en) ) ); }
     5785    break;
     5786
     5787  case 159:
     5788
     5789/* Line 1806 of yacc.c  */
    57835790#line 761 "parser.yy"
    5784     { (yyval.sn) = new StatementNode2( build_case( (yyvsp[(1) - (1)].en) ) ); }
    5785     break;
    5786 
    5787   case 159:
    5788 
    5789 /* Line 1806 of yacc.c  */
    5790 #line 763 "parser.yy"
    5791     { (yyval.sn) = (StatementNode *)((yyvsp[(1) - (3)].sn)->set_link( new StatementNode2( build_case( (yyvsp[(3) - (3)].en) ) ) ) ); }
     5791    { (yyval.sn) = (StatementNode *)((yyvsp[(1) - (3)].sn)->set_last( new StatementNode2( build_case( (yyvsp[(3) - (3)].en) ) ) ) ); }
    57925792    break;
    57935793
     
    57955795
    57965796/* Line 1806 of yacc.c  */
    5797 #line 767 "parser.yy"
     5797#line 765 "parser.yy"
    57985798    { (yyval.sn) = (yyvsp[(2) - (3)].sn); }
    57995799    break;
     
    58025802
    58035803/* Line 1806 of yacc.c  */
    5804 #line 768 "parser.yy"
     5804#line 766 "parser.yy"
    58055805    { (yyval.sn) = new StatementNode2( build_default() ); }
    58065806    break;
     
    58095809
    58105810/* Line 1806 of yacc.c  */
    5811 #line 774 "parser.yy"
    5812     { (yyval.sn) = (StatementNode *)( (yyvsp[(1) - (2)].sn)->set_link( (yyvsp[(2) - (2)].sn) )); }
     5811#line 772 "parser.yy"
     5812    { (yyval.sn) = (StatementNode *)( (yyvsp[(1) - (2)].sn)->set_last( (yyvsp[(2) - (2)].sn) )); }
    58135813    break;
    58145814
     
    58165816
    58175817/* Line 1806 of yacc.c  */
    5818 #line 778 "parser.yy"
     5818#line 776 "parser.yy"
    58195819    { (yyval.sn) = (yyvsp[(1) - (2)].sn)->append_last_case( new CompoundStmtNode( (yyvsp[(2) - (2)].sn) ) ); }
    58205820    break;
     
    58235823
    58245824/* Line 1806 of yacc.c  */
    5825 #line 783 "parser.yy"
     5825#line 781 "parser.yy"
    58265826    { (yyval.sn) = 0; }
    58275827    break;
     
    58305830
    58315831/* Line 1806 of yacc.c  */
     5832#line 787 "parser.yy"
     5833    { (yyval.sn) = (yyvsp[(1) - (2)].sn)->append_last_case( new CompoundStmtNode( (yyvsp[(2) - (2)].sn) ) ); }
     5834    break;
     5835
     5836  case 168:
     5837
     5838/* Line 1806 of yacc.c  */
    58325839#line 789 "parser.yy"
    5833     { (yyval.sn) = (yyvsp[(1) - (2)].sn)->append_last_case( new CompoundStmtNode( (yyvsp[(2) - (2)].sn) ) ); }
    5834     break;
    5835 
    5836   case 168:
    5837 
    5838 /* Line 1806 of yacc.c  */
    5839 #line 791 "parser.yy"
    5840     { (yyval.sn) = (StatementNode *)( (yyvsp[(1) - (3)].sn)->set_link( (yyvsp[(2) - (3)].sn)->append_last_case( new CompoundStmtNode( (yyvsp[(3) - (3)].sn) ) ) ) ); }
     5840    { (yyval.sn) = (StatementNode *)( (yyvsp[(1) - (3)].sn)->set_last( (yyvsp[(2) - (3)].sn)->append_last_case( new CompoundStmtNode( (yyvsp[(3) - (3)].sn) ) ) ) ); }
    58415841    break;
    58425842
     
    58445844
    58455845/* Line 1806 of yacc.c  */
    5846 #line 796 "parser.yy"
     5846#line 794 "parser.yy"
    58475847    { (yyval.sn) = 0; }
    58485848    break;
     
    58515851
    58525852/* Line 1806 of yacc.c  */
     5853#line 800 "parser.yy"
     5854    { (yyval.sn) = (yyvsp[(1) - (2)].sn)->append_last_case( (yyvsp[(2) - (2)].sn) ); }
     5855    break;
     5856
     5857  case 172:
     5858
     5859/* Line 1806 of yacc.c  */
    58535860#line 802 "parser.yy"
    5854     { (yyval.sn) = (yyvsp[(1) - (2)].sn)->append_last_case( (yyvsp[(2) - (2)].sn) ); }
    5855     break;
    5856 
    5857   case 172:
     5861    { (yyval.sn) = (yyvsp[(1) - (3)].sn)->append_last_case( new CompoundStmtNode( (StatementNode *)mkList( (*(yyvsp[(2) - (3)].sn), *(yyvsp[(3) - (3)].sn) ) ) ) ); }
     5862    break;
     5863
     5864  case 173:
    58585865
    58595866/* Line 1806 of yacc.c  */
    58605867#line 804 "parser.yy"
    5861     { (yyval.sn) = (yyvsp[(1) - (3)].sn)->append_last_case( new CompoundStmtNode( (StatementNode *)mkList( (*(yyvsp[(2) - (3)].sn), *(yyvsp[(3) - (3)].sn) ) ) ) ); }
    5862     break;
    5863 
    5864   case 173:
     5868    { (yyval.sn) = (StatementNode *)( (yyvsp[(1) - (3)].sn)->set_last( (yyvsp[(2) - (3)].sn)->append_last_case( (yyvsp[(3) - (3)].sn) ))); }
     5869    break;
     5870
     5871  case 174:
    58655872
    58665873/* Line 1806 of yacc.c  */
    58675874#line 806 "parser.yy"
    5868     { (yyval.sn) = (StatementNode *)( (yyvsp[(1) - (3)].sn)->set_link( (yyvsp[(2) - (3)].sn)->append_last_case( (yyvsp[(3) - (3)].sn) ))); }
    5869     break;
    5870 
    5871   case 174:
    5872 
    5873 /* Line 1806 of yacc.c  */
    5874 #line 808 "parser.yy"
    5875     { (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) ) ) ) ) ) ); }
     5875    { (yyval.sn) = (StatementNode *)( (yyvsp[(1) - (4)].sn)->set_last( (yyvsp[(2) - (4)].sn)->append_last_case( new CompoundStmtNode( (StatementNode *)mkList( (*(yyvsp[(3) - (4)].sn), *(yyvsp[(4) - (4)].sn) ) ) ) ) ) ); }
    58765876    break;
    58775877
     
    58795879
    58805880/* Line 1806 of yacc.c  */
    5881 #line 813 "parser.yy"
     5881#line 811 "parser.yy"
    58825882    { (yyval.sn) = new StatementNode2( build_branch( "", BranchStmt::Break ) ); }
    58835883    break;
    58845884
    58855885  case 177:
     5886
     5887/* Line 1806 of yacc.c  */
     5888#line 817 "parser.yy"
     5889    { (yyval.sn) = 0; }
     5890    break;
     5891
     5892  case 178:
    58865893
    58875894/* Line 1806 of yacc.c  */
     
    58905897    break;
    58915898
    5892   case 178:
    5893 
    5894 /* Line 1806 of yacc.c  */
    5895 #line 821 "parser.yy"
    5896     { (yyval.sn) = 0; }
    5897     break;
    5898 
    58995899  case 179:
    59005900
    59015901/* Line 1806 of yacc.c  */
     5902#line 824 "parser.yy"
     5903    { (yyval.sn) = new StatementNode2( build_while( (yyvsp[(3) - (5)].en), (yyvsp[(5) - (5)].sn) ) ); }
     5904    break;
     5905
     5906  case 180:
     5907
     5908/* Line 1806 of yacc.c  */
    59025909#line 826 "parser.yy"
    5903     { (yyval.sn) = new StatementNode2( build_while( (yyvsp[(3) - (5)].en), (yyvsp[(5) - (5)].sn) ) ); }
    5904     break;
    5905 
    5906   case 180:
     5910    { (yyval.sn) = new StatementNode2( build_while( (yyvsp[(5) - (7)].en), (yyvsp[(2) - (7)].sn) ) ); }
     5911    break;
     5912
     5913  case 181:
    59075914
    59085915/* Line 1806 of yacc.c  */
    59095916#line 828 "parser.yy"
    5910     { (yyval.sn) = new StatementNode2( build_while( (yyvsp[(5) - (7)].en), (yyvsp[(2) - (7)].sn) ) ); }
    5911     break;
    5912 
    5913   case 181:
    5914 
    5915 /* Line 1806 of yacc.c  */
    5916 #line 830 "parser.yy"
    59175917    { (yyval.sn) = new StatementNode2( build_for( (yyvsp[(4) - (6)].fctl), (yyvsp[(6) - (6)].sn) ) ); }
    59185918    break;
     
    59215921
    59225922/* Line 1806 of yacc.c  */
     5923#line 833 "parser.yy"
     5924    { (yyval.fctl) = new ForCtl( (yyvsp[(1) - (6)].en), (yyvsp[(4) - (6)].en), (yyvsp[(6) - (6)].en) ); }
     5925    break;
     5926
     5927  case 183:
     5928
     5929/* Line 1806 of yacc.c  */
    59235930#line 835 "parser.yy"
    5924     { (yyval.fctl) = new ForCtl( (yyvsp[(1) - (6)].en), (yyvsp[(4) - (6)].en), (yyvsp[(6) - (6)].en) ); }
    5925     break;
    5926 
    5927   case 183:
    5928 
    5929 /* Line 1806 of yacc.c  */
    5930 #line 837 "parser.yy"
    59315931    { (yyval.fctl) = new ForCtl( (yyvsp[(1) - (4)].decl), (yyvsp[(2) - (4)].en), (yyvsp[(4) - (4)].en) ); }
    59325932    break;
     
    59355935
    59365936/* Line 1806 of yacc.c  */
    5937 #line 842 "parser.yy"
     5937#line 840 "parser.yy"
    59385938    { (yyval.sn) = new StatementNode2( build_branch( *(yyvsp[(2) - (3)].tok), BranchStmt::Goto ) ); }
    59395939    break;
     
    59425942
    59435943/* Line 1806 of yacc.c  */
    5944 #line 846 "parser.yy"
     5944#line 844 "parser.yy"
    59455945    { (yyval.sn) = new StatementNode2( build_computedgoto( (yyvsp[(3) - (4)].en) ) ); }
    59465946    break;
     
    59495949
    59505950/* Line 1806 of yacc.c  */
    5951 #line 849 "parser.yy"
     5951#line 847 "parser.yy"
    59525952    { (yyval.sn) = new StatementNode2( build_branch( "", BranchStmt::Continue ) ); }
    59535953    break;
     
    59565956
    59575957/* Line 1806 of yacc.c  */
    5958 #line 853 "parser.yy"
     5958#line 851 "parser.yy"
    59595959    { (yyval.sn) = new StatementNode2( build_branch( *(yyvsp[(2) - (3)].tok), BranchStmt::Continue ) ); delete (yyvsp[(2) - (3)].tok); }
    59605960    break;
     
    59635963
    59645964/* Line 1806 of yacc.c  */
    5965 #line 856 "parser.yy"
     5965#line 854 "parser.yy"
    59665966    { (yyval.sn) = new StatementNode2( build_branch( "", BranchStmt::Break ) ); }
    59675967    break;
     
    59705970
    59715971/* Line 1806 of yacc.c  */
     5972#line 858 "parser.yy"
     5973    { (yyval.sn) = new StatementNode2( build_branch( *(yyvsp[(2) - (3)].tok), BranchStmt::Break ) ); delete (yyvsp[(2) - (3)].tok); }
     5974    break;
     5975
     5976  case 190:
     5977
     5978/* Line 1806 of yacc.c  */
    59725979#line 860 "parser.yy"
    5973     { (yyval.sn) = new StatementNode2( build_branch( *(yyvsp[(2) - (3)].tok), BranchStmt::Break ) ); delete (yyvsp[(2) - (3)].tok); }
    5974     break;
    5975 
    5976   case 190:
     5980    { (yyval.sn) = new StatementNode2( build_return( (yyvsp[(2) - (3)].en) ) ); }
     5981    break;
     5982
     5983  case 191:
    59775984
    59785985/* Line 1806 of yacc.c  */
    59795986#line 862 "parser.yy"
    5980     { (yyval.sn) = new StatementNode2( build_return( (yyvsp[(2) - (3)].en) ) ); }
    5981     break;
    5982 
    5983   case 191:
     5987    { (yyval.sn) = new StatementNode2( build_throw( (yyvsp[(2) - (3)].en) ) ); }
     5988    break;
     5989
     5990  case 192:
    59845991
    59855992/* Line 1806 of yacc.c  */
     
    59885995    break;
    59895996
    5990   case 192:
     5997  case 193:
    59915998
    59925999/* Line 1806 of yacc.c  */
    59936000#line 866 "parser.yy"
    5994     { (yyval.sn) = new StatementNode2( build_throw( (yyvsp[(2) - (3)].en) ) ); }
    5995     break;
    5996 
    5997   case 193:
    5998 
    5999 /* Line 1806 of yacc.c  */
    6000 #line 868 "parser.yy"
    60016001    { (yyval.sn) = new StatementNode2( build_throw( (yyvsp[(2) - (5)].en) ) ); }
    60026002    break;
     
    60056005
    60066006/* Line 1806 of yacc.c  */
     6007#line 871 "parser.yy"
     6008    { (yyval.sn) = new StatementNode2( build_try( (yyvsp[(2) - (3)].sn), (yyvsp[(3) - (3)].sn), 0 ) ); }
     6009    break;
     6010
     6011  case 195:
     6012
     6013/* Line 1806 of yacc.c  */
    60076014#line 873 "parser.yy"
    6008     { (yyval.sn) = new StatementNode( StatementNode::Try, 0,(StatementNode *)(mkList((*(yyvsp[(2) - (3)].sn),*(yyvsp[(3) - (3)].pn) )))); }
    6009     break;
    6010 
    6011   case 195:
     6015    { (yyval.sn) = new StatementNode2( build_try( (yyvsp[(2) - (3)].sn), 0, (yyvsp[(3) - (3)].sn) ) ); }
     6016    break;
     6017
     6018  case 196:
    60126019
    60136020/* Line 1806 of yacc.c  */
    60146021#line 875 "parser.yy"
    6015     { (yyval.sn) = new StatementNode( StatementNode::Try, 0,(StatementNode *)(mkList((*(yyvsp[(2) - (3)].sn),*(yyvsp[(3) - (3)].pn) )))); }
    6016     break;
    6017 
    6018   case 196:
    6019 
    6020 /* Line 1806 of yacc.c  */
    6021 #line 877 "parser.yy"
     6022    { (yyval.sn) = new StatementNode2( build_try( (yyvsp[(2) - (4)].sn), (yyvsp[(3) - (4)].sn), (yyvsp[(4) - (4)].sn) ) ); }
     6023    break;
     6024
     6025  case 198:
     6026
     6027/* Line 1806 of yacc.c  */
     6028#line 882 "parser.yy"
     6029    { (yyval.sn) = new StatementNode2( build_catch( 0, (yyvsp[(5) - (5)].sn), true ) ); }
     6030    break;
     6031
     6032  case 199:
     6033
     6034/* Line 1806 of yacc.c  */
     6035#line 884 "parser.yy"
     6036    { (yyval.sn) = (StatementNode *)(yyvsp[(1) - (6)].sn)->set_last( new StatementNode2( build_catch( 0, (yyvsp[(6) - (6)].sn), true ) ) ); }
     6037    break;
     6038
     6039  case 200:
     6040
     6041/* Line 1806 of yacc.c  */
     6042#line 886 "parser.yy"
     6043    { (yyval.sn) = new StatementNode2( build_catch( 0, (yyvsp[(5) - (5)].sn), true ) ); }
     6044    break;
     6045
     6046  case 201:
     6047
     6048/* Line 1806 of yacc.c  */
     6049#line 888 "parser.yy"
     6050    { (yyval.sn) = (StatementNode *)(yyvsp[(1) - (6)].sn)->set_last( new StatementNode2( build_catch( 0, (yyvsp[(6) - (6)].sn), true ) ) ); }
     6051    break;
     6052
     6053  case 202:
     6054
     6055/* Line 1806 of yacc.c  */
     6056#line 893 "parser.yy"
     6057    { (yyval.sn) = new StatementNode2( build_catch( (yyvsp[(5) - (9)].decl), (yyvsp[(8) - (9)].sn) ) ); }
     6058    break;
     6059
     6060  case 203:
     6061
     6062/* Line 1806 of yacc.c  */
     6063#line 895 "parser.yy"
     6064    { (yyval.sn) = (StatementNode *)(yyvsp[(1) - (10)].sn)->set_last( new StatementNode2( build_catch( (yyvsp[(6) - (10)].decl), (yyvsp[(9) - (10)].sn) ) ) ); }
     6065    break;
     6066
     6067  case 204:
     6068
     6069/* Line 1806 of yacc.c  */
     6070#line 897 "parser.yy"
     6071    { (yyval.sn) = new StatementNode2( build_catch( (yyvsp[(5) - (9)].decl), (yyvsp[(8) - (9)].sn) ) ); }
     6072    break;
     6073
     6074  case 205:
     6075
     6076/* Line 1806 of yacc.c  */
     6077#line 899 "parser.yy"
     6078    { (yyval.sn) = (StatementNode *)(yyvsp[(1) - (10)].sn)->set_last( new StatementNode2( build_catch( (yyvsp[(6) - (10)].decl), (yyvsp[(9) - (10)].sn) ) ) ); }
     6079    break;
     6080
     6081  case 206:
     6082
     6083/* Line 1806 of yacc.c  */
     6084#line 904 "parser.yy"
    60226085    {
    6023                         (yyvsp[(3) - (4)].pn)->set_link( (yyvsp[(4) - (4)].pn) );
    6024                         (yyval.sn) = new StatementNode( StatementNode::Try, 0,(StatementNode *)(mkList((*(yyvsp[(2) - (4)].sn),*(yyvsp[(3) - (4)].pn) ))));
     6086                        (yyval.sn) = new StatementNode2( build_finally( (yyvsp[(2) - (2)].sn) ) );
    60256087                }
    60266088    break;
    60276089
    6028   case 198:
    6029 
    6030 /* Line 1806 of yacc.c  */
    6031 #line 888 "parser.yy"
    6032     { (yyval.pn) = StatementNode::newCatchStmt( 0, (yyvsp[(5) - (5)].sn), true ); }
    6033     break;
    6034 
    6035   case 199:
    6036 
    6037 /* Line 1806 of yacc.c  */
    6038 #line 890 "parser.yy"
    6039     { (yyval.pn) = (yyvsp[(1) - (6)].pn)->set_link( StatementNode::newCatchStmt( 0, (yyvsp[(6) - (6)].sn), true ) ); }
    6040     break;
    6041 
    6042   case 200:
    6043 
    6044 /* Line 1806 of yacc.c  */
    6045 #line 892 "parser.yy"
    6046     { (yyval.pn) = StatementNode::newCatchStmt( 0, (yyvsp[(5) - (5)].sn), true ); }
    6047     break;
    6048 
    6049   case 201:
    6050 
    6051 /* Line 1806 of yacc.c  */
    6052 #line 894 "parser.yy"
    6053     { (yyval.pn) = (yyvsp[(1) - (6)].pn)->set_link( StatementNode::newCatchStmt( 0, (yyvsp[(6) - (6)].sn), true ) ); }
    6054     break;
    6055 
    6056   case 202:
    6057 
    6058 /* Line 1806 of yacc.c  */
    6059 #line 899 "parser.yy"
    6060     { (yyval.pn) = StatementNode::newCatchStmt( (yyvsp[(5) - (9)].decl), (yyvsp[(8) - (9)].sn) ); }
    6061     break;
    6062 
    6063   case 203:
    6064 
    6065 /* Line 1806 of yacc.c  */
    6066 #line 901 "parser.yy"
    6067     { (yyval.pn) = (yyvsp[(1) - (10)].pn)->set_link( StatementNode::newCatchStmt( (yyvsp[(6) - (10)].decl), (yyvsp[(9) - (10)].sn) ) ); }
    6068     break;
    6069 
    6070   case 204:
    6071 
    6072 /* Line 1806 of yacc.c  */
    6073 #line 903 "parser.yy"
    6074     { (yyval.pn) = StatementNode::newCatchStmt( (yyvsp[(5) - (9)].decl), (yyvsp[(8) - (9)].sn) ); }
    6075     break;
    6076 
    6077   case 205:
    6078 
    6079 /* Line 1806 of yacc.c  */
    6080 #line 905 "parser.yy"
    6081     { (yyval.pn) = (yyvsp[(1) - (10)].pn)->set_link( StatementNode::newCatchStmt( (yyvsp[(6) - (10)].decl), (yyvsp[(9) - (10)].sn) ) ); }
    6082     break;
    6083 
    6084   case 206:
    6085 
    6086 /* Line 1806 of yacc.c  */
    6087 #line 910 "parser.yy"
    6088     {
    6089                         (yyval.pn) = new StatementNode( StatementNode::Finally, 0, (yyvsp[(2) - (2)].sn) );
    6090                         std::cout << "Just created a finally node" << std::endl;
    6091                 }
    6092     break;
    6093 
    60946090  case 208:
    60956091
    60966092/* Line 1806 of yacc.c  */
    6097 #line 924 "parser.yy"
     6093#line 917 "parser.yy"
    60986094    {
    60996095                        typedefTable.addToEnclosingScope( TypedefTable::ID );
     
    61056101
    61066102/* Line 1806 of yacc.c  */
    6107 #line 929 "parser.yy"
     6103#line 922 "parser.yy"
    61086104    { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addType( (yyvsp[(1) - (2)].decl) ); }
    61096105    break;
     
    61126108
    61136109/* Line 1806 of yacc.c  */
    6114 #line 931 "parser.yy"
     6110#line 924 "parser.yy"
    61156111    {
    61166112                        typedefTable.addToEnclosingScope( TypedefTable::ID );
     
    61226118
    61236119/* Line 1806 of yacc.c  */
    6124 #line 940 "parser.yy"
    6125     { (yyval.sn) = new AsmStmtNode( StatementNode::Asm, (yyvsp[(2) - (6)].flag), (yyvsp[(4) - (6)].constant), 0 ); }
     6120#line 933 "parser.yy"
     6121    { (yyval.sn) = new AsmStmtNode( (yyvsp[(2) - (6)].flag), (yyvsp[(4) - (6)].constant), 0 ); }
    61266122    break;
    61276123
     
    61296125
    61306126/* Line 1806 of yacc.c  */
    6131 #line 942 "parser.yy"
    6132     { (yyval.sn) = new AsmStmtNode( StatementNode::Asm, (yyvsp[(2) - (8)].flag), (yyvsp[(4) - (8)].constant), (yyvsp[(6) - (8)].en) ); }
     6127#line 935 "parser.yy"
     6128    { (yyval.sn) = new AsmStmtNode( (yyvsp[(2) - (8)].flag), (yyvsp[(4) - (8)].constant), (yyvsp[(6) - (8)].en) ); }
    61336129    break;
    61346130
     
    61366132
    61376133/* Line 1806 of yacc.c  */
    6138 #line 944 "parser.yy"
    6139     { (yyval.sn) = new AsmStmtNode( StatementNode::Asm, (yyvsp[(2) - (10)].flag), (yyvsp[(4) - (10)].constant), (yyvsp[(6) - (10)].en), (yyvsp[(8) - (10)].en) ); }
     6134#line 937 "parser.yy"
     6135    { (yyval.sn) = new AsmStmtNode( (yyvsp[(2) - (10)].flag), (yyvsp[(4) - (10)].constant), (yyvsp[(6) - (10)].en), (yyvsp[(8) - (10)].en) ); }
    61406136    break;
    61416137
     
    61436139
    61446140/* Line 1806 of yacc.c  */
     6141#line 939 "parser.yy"
     6142    { (yyval.sn) = new AsmStmtNode( (yyvsp[(2) - (12)].flag), (yyvsp[(4) - (12)].constant), (yyvsp[(6) - (12)].en), (yyvsp[(8) - (12)].en), (yyvsp[(10) - (12)].en) ); }
     6143    break;
     6144
     6145  case 216:
     6146
     6147/* Line 1806 of yacc.c  */
     6148#line 941 "parser.yy"
     6149    { (yyval.sn) = new AsmStmtNode( (yyvsp[(2) - (14)].flag), (yyvsp[(5) - (14)].constant), 0, (yyvsp[(8) - (14)].en), (yyvsp[(10) - (14)].en), (yyvsp[(12) - (14)].label) ); }
     6150    break;
     6151
     6152  case 217:
     6153
     6154/* Line 1806 of yacc.c  */
    61456155#line 946 "parser.yy"
    6146     { (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)].en) ); }
    6147     break;
    6148 
    6149   case 216:
     6156    { (yyval.flag) = false; }
     6157    break;
     6158
     6159  case 218:
    61506160
    61516161/* Line 1806 of yacc.c  */
    61526162#line 948 "parser.yy"
    6153     { (yyval.sn) = new AsmStmtNode( StatementNode::Asm, (yyvsp[(2) - (14)].flag), (yyvsp[(5) - (14)].constant), 0, (yyvsp[(8) - (14)].en), (yyvsp[(10) - (14)].en), (yyvsp[(12) - (14)].label) ); }
    6154     break;
    6155 
    6156   case 217:
     6163    { (yyval.flag) = true; }
     6164    break;
     6165
     6166  case 219:
    61576167
    61586168/* Line 1806 of yacc.c  */
    61596169#line 953 "parser.yy"
    6160     { (yyval.flag) = false; }
    6161     break;
    6162 
    6163   case 218:
    6164 
    6165 /* Line 1806 of yacc.c  */
    6166 #line 955 "parser.yy"
    6167     { (yyval.flag) = true; }
    6168     break;
    6169 
    6170   case 219:
     6170    { (yyval.en) = 0; }
     6171    break;
     6172
     6173  case 222:
    61716174
    61726175/* Line 1806 of yacc.c  */
    61736176#line 960 "parser.yy"
     6177    { (yyval.en) = (ExpressionNode *)(yyvsp[(1) - (3)].en)->set_last( (yyvsp[(3) - (3)].en) ); }
     6178    break;
     6179
     6180  case 223:
     6181
     6182/* Line 1806 of yacc.c  */
     6183#line 965 "parser.yy"
     6184    { (yyval.en) = new ExpressionNode( build_asm( 0, (yyvsp[(1) - (4)].constant), (yyvsp[(3) - (4)].en) ) ); }
     6185    break;
     6186
     6187  case 224:
     6188
     6189/* Line 1806 of yacc.c  */
     6190#line 967 "parser.yy"
     6191    { (yyval.en) = new ExpressionNode( build_asm( (yyvsp[(2) - (7)].en), (yyvsp[(4) - (7)].constant), (yyvsp[(6) - (7)].en) ) ); }
     6192    break;
     6193
     6194  case 225:
     6195
     6196/* Line 1806 of yacc.c  */
     6197#line 972 "parser.yy"
    61746198    { (yyval.en) = 0; }
    61756199    break;
    61766200
    6177   case 222:
    6178 
    6179 /* Line 1806 of yacc.c  */
    6180 #line 967 "parser.yy"
    6181     { (yyval.en) = (ExpressionNode *)(yyvsp[(1) - (3)].en)->set_link( (yyvsp[(3) - (3)].en) ); }
    6182     break;
    6183 
    6184   case 223:
    6185 
    6186 /* Line 1806 of yacc.c  */
    6187 #line 972 "parser.yy"
    6188     { (yyval.en) = new ExpressionNode( build_asm( 0, (yyvsp[(1) - (4)].constant), (yyvsp[(3) - (4)].en) ) ); }
    6189     break;
    6190 
    6191   case 224:
     6201  case 226:
    61926202
    61936203/* Line 1806 of yacc.c  */
    61946204#line 974 "parser.yy"
    6195     { (yyval.en) = new ExpressionNode( build_asm( (yyvsp[(2) - (7)].en), (yyvsp[(4) - (7)].constant), (yyvsp[(6) - (7)].en) ) ); }
    6196     break;
    6197 
    6198   case 225:
    6199 
    6200 /* Line 1806 of yacc.c  */
    6201 #line 979 "parser.yy"
    6202     { (yyval.en) = 0; }
    6203     break;
    6204 
    6205   case 226:
     6205    { (yyval.en) = new ExpressionNode( (yyvsp[(1) - (1)].constant) ); }
     6206    break;
     6207
     6208  case 227:
     6209
     6210/* Line 1806 of yacc.c  */
     6211#line 976 "parser.yy"
     6212    { (yyval.en) = (ExpressionNode *)(yyvsp[(1) - (3)].en)->set_last( new ExpressionNode( (yyvsp[(3) - (3)].constant) ) ); }
     6213    break;
     6214
     6215  case 228:
    62066216
    62076217/* Line 1806 of yacc.c  */
    62086218#line 981 "parser.yy"
    6209     { (yyval.en) = new ExpressionNode( (yyvsp[(1) - (1)].constant) ); }
    6210     break;
    6211 
    6212   case 227:
     6219    { (yyval.label) = new LabelNode(); (yyval.label)->append_label( (yyvsp[(1) - (1)].tok) ); }
     6220    break;
     6221
     6222  case 229:
    62136223
    62146224/* Line 1806 of yacc.c  */
    62156225#line 983 "parser.yy"
    6216     { (yyval.en) = (ExpressionNode *)(yyvsp[(1) - (3)].en)->set_link( new ExpressionNode( (yyvsp[(3) - (3)].constant) ) ); }
    6217     break;
    6218 
    6219   case 228:
    6220 
    6221 /* Line 1806 of yacc.c  */
    6222 #line 988 "parser.yy"
    6223     { (yyval.label) = new LabelNode(); (yyval.label)->append_label( (yyvsp[(1) - (1)].tok) ); }
    6224     break;
    6225 
    6226   case 229:
     6226    { (yyval.label) = (yyvsp[(1) - (3)].label); (yyvsp[(1) - (3)].label)->append_label( (yyvsp[(3) - (3)].tok) ); }
     6227    break;
     6228
     6229  case 230:
    62276230
    62286231/* Line 1806 of yacc.c  */
    62296232#line 990 "parser.yy"
    6230     { (yyval.label) = (yyvsp[(1) - (3)].label); (yyvsp[(1) - (3)].label)->append_label( (yyvsp[(3) - (3)].tok) ); }
    6231     break;
    6232 
    6233   case 230:
     6233    { (yyval.decl) = 0; }
     6234    break;
     6235
     6236  case 233:
    62346237
    62356238/* Line 1806 of yacc.c  */
    62366239#line 997 "parser.yy"
     6240    { (yyval.decl) = (yyvsp[(1) - (3)].decl)->appendList( (yyvsp[(3) - (3)].decl) ); }
     6241    break;
     6242
     6243  case 234:
     6244
     6245/* Line 1806 of yacc.c  */
     6246#line 1002 "parser.yy"
    62376247    { (yyval.decl) = 0; }
    62386248    break;
    62396249
    6240   case 233:
    6241 
    6242 /* Line 1806 of yacc.c  */
    6243 #line 1004 "parser.yy"
     6250  case 237:
     6251
     6252/* Line 1806 of yacc.c  */
     6253#line 1009 "parser.yy"
    62446254    { (yyval.decl) = (yyvsp[(1) - (3)].decl)->appendList( (yyvsp[(3) - (3)].decl) ); }
    62456255    break;
    62466256
    6247   case 234:
    6248 
    6249 /* Line 1806 of yacc.c  */
    6250 #line 1009 "parser.yy"
    6251     { (yyval.decl) = 0; }
    6252     break;
    6253 
    6254   case 237:
    6255 
    6256 /* Line 1806 of yacc.c  */
    6257 #line 1016 "parser.yy"
    6258     { (yyval.decl) = (yyvsp[(1) - (3)].decl)->appendList( (yyvsp[(3) - (3)].decl) ); }
    6259     break;
    6260 
    62616257  case 242:
    62626258
    62636259/* Line 1806 of yacc.c  */
    6264 #line 1030 "parser.yy"
     6260#line 1023 "parser.yy"
    62656261    {}
    62666262    break;
     
    62696265
    62706266/* Line 1806 of yacc.c  */
    6271 #line 1031 "parser.yy"
     6267#line 1024 "parser.yy"
    62726268    {}
    62736269    break;
     
    62766272
    62776273/* Line 1806 of yacc.c  */
    6278 #line 1060 "parser.yy"
     6274#line 1053 "parser.yy"
    62796275    {
    62806276                        typedefTable.addToEnclosingScope( TypedefTable::ID );
     
    62866282
    62876283/* Line 1806 of yacc.c  */
    6288 #line 1067 "parser.yy"
     6284#line 1060 "parser.yy"
    62896285    {
    62906286                        typedefTable.addToEnclosingScope( TypedefTable::ID );
     
    62966292
    62976293/* Line 1806 of yacc.c  */
    6298 #line 1072 "parser.yy"
     6294#line 1065 "parser.yy"
    62996295    {
    63006296                        typedefTable.addToEnclosingScope( *(yyvsp[(5) - (6)].tok), TypedefTable::ID );
     
    63066302
    63076303/* Line 1806 of yacc.c  */
    6308 #line 1082 "parser.yy"
     6304#line 1075 "parser.yy"
    63096305    {
    63106306                        typedefTable.setNextIdentifier( *(yyvsp[(2) - (3)].tok) );
     
    63166312
    63176313/* Line 1806 of yacc.c  */
    6318 #line 1087 "parser.yy"
     6314#line 1080 "parser.yy"
    63196315    {
    63206316                        typedefTable.setNextIdentifier( *(yyvsp[(2) - (3)].tok) );
     
    63266322
    63276323/* Line 1806 of yacc.c  */
    6328 #line 1092 "parser.yy"
     6324#line 1085 "parser.yy"
    63296325    {
    63306326                        typedefTable.setNextIdentifier( *(yyvsp[(3) - (4)].tok) );
     
    63366332
    63376333/* Line 1806 of yacc.c  */
    6338 #line 1100 "parser.yy"
     6334#line 1093 "parser.yy"
    63396335    {
    63406336                        typedefTable.addToEnclosingScope( TypedefTable::ID );
     
    63466342
    63476343/* Line 1806 of yacc.c  */
    6348 #line 1105 "parser.yy"
     6344#line 1098 "parser.yy"
    63496345    {
    63506346                        typedefTable.addToEnclosingScope( TypedefTable::ID );
     
    63566352
    63576353/* Line 1806 of yacc.c  */
    6358 #line 1110 "parser.yy"
     6354#line 1103 "parser.yy"
    63596355    {
    63606356                        typedefTable.addToEnclosingScope( TypedefTable::ID );
     
    63666362
    63676363/* Line 1806 of yacc.c  */
    6368 #line 1115 "parser.yy"
     6364#line 1108 "parser.yy"
    63696365    {
    63706366                        typedefTable.addToEnclosingScope( TypedefTable::ID );
     
    63766372
    63776373/* Line 1806 of yacc.c  */
    6378 #line 1120 "parser.yy"
     6374#line 1113 "parser.yy"
    63796375    {
    63806376                        typedefTable.addToEnclosingScope( *(yyvsp[(5) - (5)].tok), TypedefTable::ID );
     
    63866382
    63876383/* Line 1806 of yacc.c  */
    6388 #line 1128 "parser.yy"
     6384#line 1121 "parser.yy"
    63896385    {
    63906386                        (yyval.decl) = DeclarationNode::newFunction( (yyvsp[(3) - (8)].tok), DeclarationNode::newTuple( 0 ), (yyvsp[(6) - (8)].decl), 0, true );
     
    63956391
    63966392/* Line 1806 of yacc.c  */
    6397 #line 1151 "parser.yy"
     6393#line 1144 "parser.yy"
    63986394    {
    63996395                        (yyval.decl) = DeclarationNode::newFunction( (yyvsp[(2) - (7)].tok), (yyvsp[(1) - (7)].decl), (yyvsp[(5) - (7)].decl), 0, true );
     
    64046400
    64056401/* Line 1806 of yacc.c  */
    6406 #line 1155 "parser.yy"
     6402#line 1148 "parser.yy"
    64076403    {
    64086404                        (yyval.decl) = DeclarationNode::newFunction( (yyvsp[(2) - (7)].tok), (yyvsp[(1) - (7)].decl), (yyvsp[(5) - (7)].decl), 0, true );
     
    64136409
    64146410/* Line 1806 of yacc.c  */
    6415 #line 1162 "parser.yy"
     6411#line 1155 "parser.yy"
    64166412    { (yyval.decl) = DeclarationNode::newTuple( (yyvsp[(3) - (5)].decl) ); }
    64176413    break;
     
    64206416
    64216417/* Line 1806 of yacc.c  */
    6422 #line 1166 "parser.yy"
     6418#line 1159 "parser.yy"
    64236419    { (yyval.decl) = DeclarationNode::newTuple( (yyvsp[(3) - (9)].decl)->appendList( (yyvsp[(7) - (9)].decl) ) ); }
    64246420    break;
     
    64276423
    64286424/* Line 1806 of yacc.c  */
    6429 #line 1171 "parser.yy"
     6425#line 1164 "parser.yy"
    64306426    {
    64316427                        typedefTable.addToEnclosingScope( TypedefTable::TD );
     
    64376433
    64386434/* Line 1806 of yacc.c  */
    6439 #line 1176 "parser.yy"
     6435#line 1169 "parser.yy"
    64406436    {
    64416437                        typedefTable.addToEnclosingScope( TypedefTable::TD );
     
    64476443
    64486444/* Line 1806 of yacc.c  */
    6449 #line 1181 "parser.yy"
     6445#line 1174 "parser.yy"
    64506446    {
    64516447                        typedefTable.addToEnclosingScope( *(yyvsp[(5) - (5)].tok), TypedefTable::TD );
     
    64576453
    64586454/* Line 1806 of yacc.c  */
    6459 #line 1192 "parser.yy"
     6455#line 1185 "parser.yy"
    64606456    {
    64616457                        typedefTable.addToEnclosingScope( TypedefTable::TD );
     
    64676463
    64686464/* Line 1806 of yacc.c  */
    6469 #line 1197 "parser.yy"
     6465#line 1190 "parser.yy"
    64706466    {
    64716467                        typedefTable.addToEnclosingScope( TypedefTable::TD );
     
    64776473
    64786474/* Line 1806 of yacc.c  */
    6479 #line 1202 "parser.yy"
     6475#line 1195 "parser.yy"
    64806476    {
    64816477                        typedefTable.addToEnclosingScope( TypedefTable::TD );
     
    64876483
    64886484/* Line 1806 of yacc.c  */
    6489 #line 1207 "parser.yy"
     6485#line 1200 "parser.yy"
    64906486    {
    64916487                        typedefTable.addToEnclosingScope( TypedefTable::TD );
     
    64976493
    64986494/* Line 1806 of yacc.c  */
    6499 #line 1212 "parser.yy"
     6495#line 1205 "parser.yy"
    65006496    {
    65016497                        typedefTable.addToEnclosingScope( TypedefTable::TD );
     
    65076503
    65086504/* Line 1806 of yacc.c  */
    6509 #line 1221 "parser.yy"
     6505#line 1214 "parser.yy"
    65106506    {
    65116507                        typedefTable.addToEnclosingScope( *(yyvsp[(2) - (4)].tok), TypedefTable::TD );
     
    65176513
    65186514/* Line 1806 of yacc.c  */
    6519 #line 1226 "parser.yy"
     6515#line 1219 "parser.yy"
    65206516    {
    65216517                        typedefTable.addToEnclosingScope( *(yyvsp[(5) - (7)].tok), TypedefTable::TD );
     
    65276523
    65286524/* Line 1806 of yacc.c  */
    6529 #line 1243 "parser.yy"
     6525#line 1236 "parser.yy"
    65306526    {
    65316527                        typedefTable.addToEnclosingScope( TypedefTable::ID );
     
    65376533
    65386534/* Line 1806 of yacc.c  */
    6539 #line 1248 "parser.yy"
     6535#line 1241 "parser.yy"
    65406536    {
    65416537                        typedefTable.addToEnclosingScope( TypedefTable::ID );
     
    65476543
    65486544/* Line 1806 of yacc.c  */
    6549 #line 1270 "parser.yy"
     6545#line 1263 "parser.yy"
    65506546    { (yyval.decl) = 0; }
    65516547    break;
     
    65546550
    65556551/* Line 1806 of yacc.c  */
    6556 #line 1282 "parser.yy"
     6552#line 1275 "parser.yy"
    65576553    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
    65586554    break;
     
    65616557
    65626558/* Line 1806 of yacc.c  */
    6563 #line 1293 "parser.yy"
     6559#line 1286 "parser.yy"
    65646560    { (yyval.decl) = DeclarationNode::newQualifier( DeclarationNode::Const ); }
    65656561    break;
     
    65686564
    65696565/* Line 1806 of yacc.c  */
    6570 #line 1295 "parser.yy"
     6566#line 1288 "parser.yy"
    65716567    { (yyval.decl) = DeclarationNode::newQualifier( DeclarationNode::Restrict ); }
    65726568    break;
     
    65756571
    65766572/* Line 1806 of yacc.c  */
    6577 #line 1297 "parser.yy"
     6573#line 1290 "parser.yy"
    65786574    { (yyval.decl) = DeclarationNode::newQualifier( DeclarationNode::Volatile ); }
    65796575    break;
     
    65826578
    65836579/* Line 1806 of yacc.c  */
    6584 #line 1299 "parser.yy"
     6580#line 1292 "parser.yy"
    65856581    { (yyval.decl) = DeclarationNode::newQualifier( DeclarationNode::Lvalue ); }
    65866582    break;
     
    65896585
    65906586/* Line 1806 of yacc.c  */
    6591 #line 1301 "parser.yy"
     6587#line 1294 "parser.yy"
    65926588    { (yyval.decl) = DeclarationNode::newQualifier( DeclarationNode::Atomic ); }
    65936589    break;
     
    65966592
    65976593/* Line 1806 of yacc.c  */
    6598 #line 1303 "parser.yy"
     6594#line 1296 "parser.yy"
    65996595    {
    66006596                        typedefTable.enterScope();
     
    66056601
    66066602/* Line 1806 of yacc.c  */
    6607 #line 1307 "parser.yy"
     6603#line 1300 "parser.yy"
    66086604    {
    66096605                        typedefTable.leaveScope();
     
    66156611
    66166612/* Line 1806 of yacc.c  */
    6617 #line 1316 "parser.yy"
     6613#line 1309 "parser.yy"
    66186614    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
    66196615    break;
     
    66226618
    66236619/* Line 1806 of yacc.c  */
    6624 #line 1318 "parser.yy"
     6620#line 1311 "parser.yy"
    66256621    { (yyval.decl) = (yyvsp[(1) - (3)].decl)->addQualifiers( (yyvsp[(2) - (3)].decl) )->addQualifiers( (yyvsp[(3) - (3)].decl) ); }
    66266622    break;
     
    66296625
    66306626/* Line 1806 of yacc.c  */
    6631 #line 1329 "parser.yy"
     6627#line 1322 "parser.yy"
    66326628    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
    66336629    break;
     
    66366632
    66376633/* Line 1806 of yacc.c  */
    6638 #line 1338 "parser.yy"
     6634#line 1331 "parser.yy"
    66396635    { (yyval.decl) = DeclarationNode::newStorageClass( DeclarationNode::Extern ); }
    66406636    break;
     
    66436639
    66446640/* Line 1806 of yacc.c  */
    6645 #line 1340 "parser.yy"
     6641#line 1333 "parser.yy"
    66466642    { (yyval.decl) = DeclarationNode::newStorageClass( DeclarationNode::Static ); }
    66476643    break;
     
    66506646
    66516647/* Line 1806 of yacc.c  */
    6652 #line 1342 "parser.yy"
     6648#line 1335 "parser.yy"
    66536649    { (yyval.decl) = DeclarationNode::newStorageClass( DeclarationNode::Auto ); }
    66546650    break;
     
    66576653
    66586654/* Line 1806 of yacc.c  */
    6659 #line 1344 "parser.yy"
     6655#line 1337 "parser.yy"
    66606656    { (yyval.decl) = DeclarationNode::newStorageClass( DeclarationNode::Register ); }
    66616657    break;
     
    66646660
    66656661/* Line 1806 of yacc.c  */
    6666 #line 1346 "parser.yy"
     6662#line 1339 "parser.yy"
    66676663    { (yyval.decl) = DeclarationNode::newStorageClass( DeclarationNode::Inline ); }
    66686664    break;
     
    66716667
    66726668/* Line 1806 of yacc.c  */
    6673 #line 1348 "parser.yy"
     6669#line 1341 "parser.yy"
    66746670    { (yyval.decl) = DeclarationNode::newStorageClass( DeclarationNode::Fortran ); }
    66756671    break;
     
    66786674
    66796675/* Line 1806 of yacc.c  */
     6676#line 1343 "parser.yy"
     6677    { (yyval.decl) = DeclarationNode::newStorageClass( DeclarationNode::Noreturn ); }
     6678    break;
     6679
     6680  case 317:
     6681
     6682/* Line 1806 of yacc.c  */
     6683#line 1345 "parser.yy"
     6684    { (yyval.decl) = DeclarationNode::newStorageClass( DeclarationNode::Threadlocal ); }
     6685    break;
     6686
     6687  case 318:
     6688
     6689/* Line 1806 of yacc.c  */
    66806690#line 1350 "parser.yy"
    6681     { (yyval.decl) = DeclarationNode::newStorageClass( DeclarationNode::Noreturn ); }
    6682     break;
    6683 
    6684   case 317:
     6691    { (yyval.decl) = DeclarationNode::newBasicType( DeclarationNode::Char ); }
     6692    break;
     6693
     6694  case 319:
    66856695
    66866696/* Line 1806 of yacc.c  */
    66876697#line 1352 "parser.yy"
    6688     { (yyval.decl) = DeclarationNode::newStorageClass( DeclarationNode::Threadlocal ); }
    6689     break;
    6690 
    6691   case 318:
    6692 
    6693 /* Line 1806 of yacc.c  */
    6694 #line 1357 "parser.yy"
    6695     { (yyval.decl) = DeclarationNode::newBasicType( DeclarationNode::Char ); }
    6696     break;
    6697 
    6698   case 319:
    6699 
    6700 /* Line 1806 of yacc.c  */
    6701 #line 1359 "parser.yy"
    67026698    { (yyval.decl) = DeclarationNode::newBasicType( DeclarationNode::Double ); }
    67036699    break;
     
    67066702
    67076703/* Line 1806 of yacc.c  */
    6708 #line 1361 "parser.yy"
     6704#line 1354 "parser.yy"
    67096705    { (yyval.decl) = DeclarationNode::newBasicType( DeclarationNode::Float ); }
    67106706    break;
     
    67136709
    67146710/* Line 1806 of yacc.c  */
    6715 #line 1363 "parser.yy"
     6711#line 1356 "parser.yy"
    67166712    { (yyval.decl) = DeclarationNode::newBasicType( DeclarationNode::Int ); }
    67176713    break;
     
    67206716
    67216717/* Line 1806 of yacc.c  */
    6722 #line 1365 "parser.yy"
     6718#line 1358 "parser.yy"
    67236719    { (yyval.decl) = DeclarationNode::newModifier( DeclarationNode::Long ); }
    67246720    break;
     
    67276723
    67286724/* Line 1806 of yacc.c  */
    6729 #line 1367 "parser.yy"
     6725#line 1360 "parser.yy"
    67306726    { (yyval.decl) = DeclarationNode::newModifier( DeclarationNode::Short ); }
    67316727    break;
     
    67346730
    67356731/* Line 1806 of yacc.c  */
    6736 #line 1369 "parser.yy"
     6732#line 1362 "parser.yy"
    67376733    { (yyval.decl) = DeclarationNode::newModifier( DeclarationNode::Signed ); }
    67386734    break;
     
    67416737
    67426738/* Line 1806 of yacc.c  */
    6743 #line 1371 "parser.yy"
     6739#line 1364 "parser.yy"
    67446740    { (yyval.decl) = DeclarationNode::newModifier( DeclarationNode::Unsigned ); }
    67456741    break;
     
    67486744
    67496745/* Line 1806 of yacc.c  */
    6750 #line 1373 "parser.yy"
     6746#line 1366 "parser.yy"
    67516747    { (yyval.decl) = DeclarationNode::newBasicType( DeclarationNode::Void ); }
    67526748    break;
     
    67556751
    67566752/* Line 1806 of yacc.c  */
    6757 #line 1375 "parser.yy"
     6753#line 1368 "parser.yy"
    67586754    { (yyval.decl) = DeclarationNode::newBasicType( DeclarationNode::Bool ); }
    67596755    break;
     
    67626758
    67636759/* Line 1806 of yacc.c  */
    6764 #line 1377 "parser.yy"
     6760#line 1370 "parser.yy"
    67656761    { (yyval.decl) = DeclarationNode::newBasicType( DeclarationNode::Complex ); }
    67666762    break;
     
    67696765
    67706766/* Line 1806 of yacc.c  */
    6771 #line 1379 "parser.yy"
     6767#line 1372 "parser.yy"
    67726768    { (yyval.decl) = DeclarationNode::newBasicType( DeclarationNode::Imaginary ); }
    67736769    break;
     
    67766772
    67776773/* Line 1806 of yacc.c  */
     6774#line 1374 "parser.yy"
     6775    { (yyval.decl) = DeclarationNode::newBuiltinType( DeclarationNode::Valist ); }
     6776    break;
     6777
     6778  case 332:
     6779
     6780/* Line 1806 of yacc.c  */
    67786781#line 1381 "parser.yy"
    6779     { (yyval.decl) = DeclarationNode::newBuiltinType( DeclarationNode::Valist ); }
    6780     break;
    6781 
    6782   case 332:
    6783 
    6784 /* Line 1806 of yacc.c  */
    6785 #line 1388 "parser.yy"
    67866782    { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); }
    67876783    break;
     
    67906786
    67916787/* Line 1806 of yacc.c  */
    6792 #line 1390 "parser.yy"
     6788#line 1383 "parser.yy"
    67936789    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
    67946790    break;
     
    67976793
    67986794/* Line 1806 of yacc.c  */
    6799 #line 1392 "parser.yy"
     6795#line 1385 "parser.yy"
    68006796    { (yyval.decl) = (yyvsp[(1) - (3)].decl)->addQualifiers( (yyvsp[(2) - (3)].decl) )->addQualifiers( (yyvsp[(3) - (3)].decl) ); }
    68016797    break;
     
    68046800
    68056801/* Line 1806 of yacc.c  */
    6806 #line 1394 "parser.yy"
     6802#line 1387 "parser.yy"
    68076803    { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addQualifiers( (yyvsp[(2) - (3)].decl) )->addType( (yyvsp[(1) - (3)].decl) ); }
    68086804    break;
     
    68116807
    68126808/* Line 1806 of yacc.c  */
     6809#line 1393 "parser.yy"
     6810    { (yyval.decl) = (yyvsp[(2) - (3)].decl)->addQualifiers( (yyvsp[(1) - (3)].decl) )->addQualifiers( (yyvsp[(3) - (3)].decl) ); }
     6811    break;
     6812
     6813  case 339:
     6814
     6815/* Line 1806 of yacc.c  */
    68136816#line 1400 "parser.yy"
    6814     { (yyval.decl) = (yyvsp[(2) - (3)].decl)->addQualifiers( (yyvsp[(1) - (3)].decl) )->addQualifiers( (yyvsp[(3) - (3)].decl) ); }
    6815     break;
    6816 
    6817   case 339:
    6818 
    6819 /* Line 1806 of yacc.c  */
    6820 #line 1407 "parser.yy"
    68216817    { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); }
    68226818    break;
     
    68256821
    68266822/* Line 1806 of yacc.c  */
     6823#line 1402 "parser.yy"
     6824    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
     6825    break;
     6826
     6827  case 341:
     6828
     6829/* Line 1806 of yacc.c  */
     6830#line 1404 "parser.yy"
     6831    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addType( (yyvsp[(2) - (2)].decl) ); }
     6832    break;
     6833
     6834  case 342:
     6835
     6836/* Line 1806 of yacc.c  */
    68276837#line 1409 "parser.yy"
     6838    { (yyval.decl) = (yyvsp[(3) - (4)].decl); }
     6839    break;
     6840
     6841  case 343:
     6842
     6843/* Line 1806 of yacc.c  */
     6844#line 1411 "parser.yy"
     6845    { (yyval.decl) = DeclarationNode::newTypeof( (yyvsp[(3) - (4)].en) ); }
     6846    break;
     6847
     6848  case 344:
     6849
     6850/* Line 1806 of yacc.c  */
     6851#line 1413 "parser.yy"
     6852    { (yyval.decl) = DeclarationNode::newAttr( (yyvsp[(1) - (4)].tok), (yyvsp[(3) - (4)].decl) ); }
     6853    break;
     6854
     6855  case 345:
     6856
     6857/* Line 1806 of yacc.c  */
     6858#line 1415 "parser.yy"
     6859    { (yyval.decl) = DeclarationNode::newAttr( (yyvsp[(1) - (4)].tok), (yyvsp[(3) - (4)].en) ); }
     6860    break;
     6861
     6862  case 347:
     6863
     6864/* Line 1806 of yacc.c  */
     6865#line 1421 "parser.yy"
     6866    { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); }
     6867    break;
     6868
     6869  case 348:
     6870
     6871/* Line 1806 of yacc.c  */
     6872#line 1423 "parser.yy"
    68286873    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
    68296874    break;
    68306875
    6831   case 341:
    6832 
    6833 /* Line 1806 of yacc.c  */
    6834 #line 1411 "parser.yy"
    6835     { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addType( (yyvsp[(2) - (2)].decl) ); }
    6836     break;
    6837 
    6838   case 342:
    6839 
    6840 /* Line 1806 of yacc.c  */
    6841 #line 1416 "parser.yy"
    6842     { (yyval.decl) = (yyvsp[(3) - (4)].decl); }
    6843     break;
    6844 
    6845   case 343:
    6846 
    6847 /* Line 1806 of yacc.c  */
    6848 #line 1418 "parser.yy"
    6849     { (yyval.decl) = DeclarationNode::newTypeof( (yyvsp[(3) - (4)].en) ); }
    6850     break;
    6851 
    6852   case 344:
    6853 
    6854 /* Line 1806 of yacc.c  */
    6855 #line 1420 "parser.yy"
    6856     { (yyval.decl) = DeclarationNode::newAttr( (yyvsp[(1) - (4)].tok), (yyvsp[(3) - (4)].decl) ); }
    6857     break;
    6858 
    6859   case 345:
    6860 
    6861 /* Line 1806 of yacc.c  */
    6862 #line 1422 "parser.yy"
    6863     { (yyval.decl) = DeclarationNode::newAttr( (yyvsp[(1) - (4)].tok), (yyvsp[(3) - (4)].en) ); }
    6864     break;
    6865 
    6866   case 347:
    6867 
    6868 /* Line 1806 of yacc.c  */
    6869 #line 1428 "parser.yy"
     6876  case 349:
     6877
     6878/* Line 1806 of yacc.c  */
     6879#line 1425 "parser.yy"
     6880    { (yyval.decl) = (yyvsp[(1) - (3)].decl)->addQualifiers( (yyvsp[(2) - (3)].decl) )->addQualifiers( (yyvsp[(3) - (3)].decl) ); }
     6881    break;
     6882
     6883  case 351:
     6884
     6885/* Line 1806 of yacc.c  */
     6886#line 1431 "parser.yy"
    68706887    { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); }
    68716888    break;
    68726889
    6873   case 348:
    6874 
    6875 /* Line 1806 of yacc.c  */
    6876 #line 1430 "parser.yy"
     6890  case 352:
     6891
     6892/* Line 1806 of yacc.c  */
     6893#line 1433 "parser.yy"
    68776894    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
    68786895    break;
    68796896
    6880   case 349:
    6881 
    6882 /* Line 1806 of yacc.c  */
    6883 #line 1432 "parser.yy"
     6897  case 354:
     6898
     6899/* Line 1806 of yacc.c  */
     6900#line 1439 "parser.yy"
     6901    { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); }
     6902    break;
     6903
     6904  case 355:
     6905
     6906/* Line 1806 of yacc.c  */
     6907#line 1441 "parser.yy"
     6908    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
     6909    break;
     6910
     6911  case 356:
     6912
     6913/* Line 1806 of yacc.c  */
     6914#line 1443 "parser.yy"
    68846915    { (yyval.decl) = (yyvsp[(1) - (3)].decl)->addQualifiers( (yyvsp[(2) - (3)].decl) )->addQualifiers( (yyvsp[(3) - (3)].decl) ); }
    68856916    break;
    68866917
    6887   case 351:
    6888 
    6889 /* Line 1806 of yacc.c  */
    6890 #line 1438 "parser.yy"
    6891     { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); }
    6892     break;
    6893 
    6894   case 352:
    6895 
    6896 /* Line 1806 of yacc.c  */
    6897 #line 1440 "parser.yy"
     6918  case 357:
     6919
     6920/* Line 1806 of yacc.c  */
     6921#line 1448 "parser.yy"
     6922    { (yyval.decl) = DeclarationNode::newFromTypedef( (yyvsp[(1) - (1)].tok) ); }
     6923    break;
     6924
     6925  case 358:
     6926
     6927/* Line 1806 of yacc.c  */
     6928#line 1450 "parser.yy"
     6929    { (yyval.decl) = DeclarationNode::newFromTypedef( (yyvsp[(2) - (2)].tok) )->addQualifiers( (yyvsp[(1) - (2)].decl) ); }
     6930    break;
     6931
     6932  case 359:
     6933
     6934/* Line 1806 of yacc.c  */
     6935#line 1452 "parser.yy"
    68986936    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
    68996937    break;
    69006938
    6901   case 354:
    6902 
    6903 /* Line 1806 of yacc.c  */
    6904 #line 1446 "parser.yy"
    6905     { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); }
    6906     break;
    6907 
    6908   case 355:
    6909 
    6910 /* Line 1806 of yacc.c  */
    6911 #line 1448 "parser.yy"
    6912     { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
    6913     break;
    6914 
    6915   case 356:
    6916 
    6917 /* Line 1806 of yacc.c  */
    6918 #line 1450 "parser.yy"
    6919     { (yyval.decl) = (yyvsp[(1) - (3)].decl)->addQualifiers( (yyvsp[(2) - (3)].decl) )->addQualifiers( (yyvsp[(3) - (3)].decl) ); }
    6920     break;
    6921 
    6922   case 357:
    6923 
    6924 /* Line 1806 of yacc.c  */
    6925 #line 1455 "parser.yy"
    6926     { (yyval.decl) = DeclarationNode::newFromTypedef( (yyvsp[(1) - (1)].tok) ); }
    6927     break;
    6928 
    6929   case 358:
    6930 
    6931 /* Line 1806 of yacc.c  */
    6932 #line 1457 "parser.yy"
    6933     { (yyval.decl) = DeclarationNode::newFromTypedef( (yyvsp[(2) - (2)].tok) )->addQualifiers( (yyvsp[(1) - (2)].decl) ); }
    6934     break;
    6935 
    6936   case 359:
    6937 
    6938 /* Line 1806 of yacc.c  */
    6939 #line 1459 "parser.yy"
    6940     { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
    6941     break;
    6942 
    69436939  case 362:
    69446940
    69456941/* Line 1806 of yacc.c  */
    6946 #line 1469 "parser.yy"
     6942#line 1462 "parser.yy"
    69476943    { (yyval.decl) = DeclarationNode::newAggregate( (yyvsp[(1) - (4)].aggKey), 0, 0, (yyvsp[(3) - (4)].decl), true ); }
    69486944    break;
     
    69516947
    69526948/* Line 1806 of yacc.c  */
    6953 #line 1471 "parser.yy"
     6949#line 1464 "parser.yy"
    69546950    {
    69556951                        typedefTable.makeTypedef( *(yyvsp[(2) - (2)].tok) );
     
    69616957
    69626958/* Line 1806 of yacc.c  */
    6963 #line 1476 "parser.yy"
     6959#line 1469 "parser.yy"
    69646960    { typedefTable.makeTypedef( *(yyvsp[(2) - (2)].tok) ); }
    69656961    break;
     
    69686964
    69696965/* Line 1806 of yacc.c  */
    6970 #line 1478 "parser.yy"
     6966#line 1471 "parser.yy"
    69716967    { (yyval.decl) = DeclarationNode::newAggregate( (yyvsp[(1) - (6)].aggKey), (yyvsp[(2) - (6)].tok), 0, (yyvsp[(5) - (6)].decl), true ); }
    69726968    break;
     
    69756971
    69766972/* Line 1806 of yacc.c  */
     6973#line 1473 "parser.yy"
     6974    { (yyval.decl) = DeclarationNode::newAggregate( (yyvsp[(1) - (7)].aggKey), 0, (yyvsp[(3) - (7)].en), (yyvsp[(6) - (7)].decl), false ); }
     6975    break;
     6976
     6977  case 367:
     6978
     6979/* Line 1806 of yacc.c  */
     6980#line 1475 "parser.yy"
     6981    { (yyval.decl) = (yyvsp[(2) - (2)].decl); }
     6982    break;
     6983
     6984  case 368:
     6985
     6986/* Line 1806 of yacc.c  */
    69776987#line 1480 "parser.yy"
    6978     { (yyval.decl) = DeclarationNode::newAggregate( (yyvsp[(1) - (7)].aggKey), 0, (yyvsp[(3) - (7)].en), (yyvsp[(6) - (7)].decl), false ); }
    6979     break;
    6980 
    6981   case 367:
     6988    { (yyval.aggKey) = DeclarationNode::Struct; }
     6989    break;
     6990
     6991  case 369:
    69826992
    69836993/* Line 1806 of yacc.c  */
    69846994#line 1482 "parser.yy"
    6985     { (yyval.decl) = (yyvsp[(2) - (2)].decl); }
    6986     break;
    6987 
    6988   case 368:
     6995    { (yyval.aggKey) = DeclarationNode::Union; }
     6996    break;
     6997
     6998  case 370:
    69896999
    69907000/* Line 1806 of yacc.c  */
    69917001#line 1487 "parser.yy"
    6992     { (yyval.aggKey) = DeclarationNode::Struct; }
    6993     break;
    6994 
    6995   case 369:
     7002    { (yyval.decl) = 0; }
     7003    break;
     7004
     7005  case 371:
    69967006
    69977007/* Line 1806 of yacc.c  */
    69987008#line 1489 "parser.yy"
    6999     { (yyval.aggKey) = DeclarationNode::Union; }
    7000     break;
    7001 
    7002   case 370:
    7003 
    7004 /* Line 1806 of yacc.c  */
    7005 #line 1494 "parser.yy"
    7006     { (yyval.decl) = 0; }
    7007     break;
    7008 
    7009   case 371:
    7010 
    7011 /* Line 1806 of yacc.c  */
    7012 #line 1496 "parser.yy"
    70137009    { (yyval.decl) = (yyvsp[(1) - (2)].decl) != 0 ? (yyvsp[(1) - (2)].decl)->appendList( (yyvsp[(2) - (2)].decl) ) : (yyvsp[(2) - (2)].decl); }
    70147010    break;
     
    70177013
    70187014/* Line 1806 of yacc.c  */
    7019 #line 1502 "parser.yy"
     7015#line 1495 "parser.yy"
    70207016    { (yyval.decl) = (yyvsp[(2) - (3)].decl)->set_extension( true ); }
    70217017    break;
     
    70247020
    70257021/* Line 1806 of yacc.c  */
    7026 #line 1505 "parser.yy"
     7022#line 1498 "parser.yy"
    70277023    {   // mark all fields in list
    7028                         for ( DeclarationNode *iter = (yyvsp[(2) - (3)].decl); iter != NULL; iter = (DeclarationNode *)iter->get_link() )
     7024                        for ( DeclarationNode *iter = (yyvsp[(2) - (3)].decl); iter != NULL; iter = (DeclarationNode *)iter->get_next() )
    70297025                                iter->set_extension( true );
    70307026                        (yyval.decl) = (yyvsp[(2) - (3)].decl);
     
    70357031
    70367032/* Line 1806 of yacc.c  */
    7037 #line 1515 "parser.yy"
     7033#line 1508 "parser.yy"
    70387034    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addName( (yyvsp[(2) - (2)].tok) ); }
    70397035    break;
     
    70427038
    70437039/* Line 1806 of yacc.c  */
     7040#line 1510 "parser.yy"
     7041    { (yyval.decl) = (yyvsp[(1) - (3)].decl)->appendList( (yyvsp[(1) - (3)].decl)->cloneType( (yyvsp[(3) - (3)].tok) ) ); }
     7042    break;
     7043
     7044  case 379:
     7045
     7046/* Line 1806 of yacc.c  */
     7047#line 1512 "parser.yy"
     7048    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->appendList( (yyvsp[(1) - (2)].decl)->cloneType( 0 ) ); }
     7049    break;
     7050
     7051  case 380:
     7052
     7053/* Line 1806 of yacc.c  */
    70447054#line 1517 "parser.yy"
    7045     { (yyval.decl) = (yyvsp[(1) - (3)].decl)->appendList( (yyvsp[(1) - (3)].decl)->cloneType( (yyvsp[(3) - (3)].tok) ) ); }
    7046     break;
    7047 
    7048   case 379:
     7055    { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addType( (yyvsp[(1) - (2)].decl) ); }
     7056    break;
     7057
     7058  case 381:
    70497059
    70507060/* Line 1806 of yacc.c  */
    70517061#line 1519 "parser.yy"
    7052     { (yyval.decl) = (yyvsp[(1) - (2)].decl)->appendList( (yyvsp[(1) - (2)].decl)->cloneType( 0 ) ); }
    7053     break;
    7054 
    7055   case 380:
     7062    { (yyval.decl) = (yyvsp[(1) - (4)].decl)->appendList( (yyvsp[(1) - (4)].decl)->cloneBaseType( (yyvsp[(4) - (4)].decl) ) ); }
     7063    break;
     7064
     7065  case 382:
    70567066
    70577067/* Line 1806 of yacc.c  */
    70587068#line 1524 "parser.yy"
    7059     { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addType( (yyvsp[(1) - (2)].decl) ); }
    7060     break;
    7061 
    7062   case 381:
     7069    { (yyval.decl) = DeclarationNode::newName( 0 ); /* XXX */ }
     7070    break;
     7071
     7072  case 383:
    70637073
    70647074/* Line 1806 of yacc.c  */
    70657075#line 1526 "parser.yy"
    7066     { (yyval.decl) = (yyvsp[(1) - (4)].decl)->appendList( (yyvsp[(1) - (4)].decl)->cloneBaseType( (yyvsp[(4) - (4)].decl) ) ); }
    7067     break;
    7068 
    7069   case 382:
    7070 
    7071 /* Line 1806 of yacc.c  */
    7072 #line 1531 "parser.yy"
    7073     { (yyval.decl) = DeclarationNode::newName( 0 ); /* XXX */ }
    7074     break;
    7075 
    7076   case 383:
    7077 
    7078 /* Line 1806 of yacc.c  */
    7079 #line 1533 "parser.yy"
    70807076    { (yyval.decl) = DeclarationNode::newBitfield( (yyvsp[(1) - (1)].en) ); }
    70817077    break;
     
    70847080
    70857081/* Line 1806 of yacc.c  */
    7086 #line 1536 "parser.yy"
     7082#line 1529 "parser.yy"
    70877083    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addBitfield( (yyvsp[(2) - (2)].en) ); }
    70887084    break;
     
    70917087
    70927088/* Line 1806 of yacc.c  */
    7093 #line 1539 "parser.yy"
     7089#line 1532 "parser.yy"
    70947090    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addBitfield( (yyvsp[(2) - (2)].en) ); }
    70957091    break;
     
    70987094
    70997095/* Line 1806 of yacc.c  */
     7096#line 1538 "parser.yy"
     7097    { (yyval.en) = 0; }
     7098    break;
     7099
     7100  case 388:
     7101
     7102/* Line 1806 of yacc.c  */
     7103#line 1540 "parser.yy"
     7104    { (yyval.en) = (yyvsp[(1) - (1)].en); }
     7105    break;
     7106
     7107  case 389:
     7108
     7109/* Line 1806 of yacc.c  */
    71007110#line 1545 "parser.yy"
    7101     { (yyval.en) = 0; }
    7102     break;
    7103 
    7104   case 388:
    7105 
    7106 /* Line 1806 of yacc.c  */
    7107 #line 1547 "parser.yy"
    7108     { (yyval.en) = (yyvsp[(1) - (1)].en); }
    7109     break;
    7110 
    7111   case 389:
    7112 
    7113 /* Line 1806 of yacc.c  */
    7114 #line 1552 "parser.yy"
    71157111    { (yyval.en) = (yyvsp[(2) - (2)].en); }
    71167112    break;
     
    71197115
    71207116/* Line 1806 of yacc.c  */
    7121 #line 1561 "parser.yy"
     7117#line 1554 "parser.yy"
    71227118    { (yyval.decl) = DeclarationNode::newEnum( 0, (yyvsp[(3) - (5)].decl) ); }
    71237119    break;
     
    71267122
    71277123/* Line 1806 of yacc.c  */
    7128 #line 1563 "parser.yy"
     7124#line 1556 "parser.yy"
    71297125    {
    71307126                        typedefTable.makeTypedef( *(yyvsp[(2) - (2)].tok) );
     
    71367132
    71377133/* Line 1806 of yacc.c  */
     7134#line 1561 "parser.yy"
     7135    { typedefTable.makeTypedef( *(yyvsp[(2) - (2)].tok) ); }
     7136    break;
     7137
     7138  case 394:
     7139
     7140/* Line 1806 of yacc.c  */
     7141#line 1563 "parser.yy"
     7142    { (yyval.decl) = DeclarationNode::newEnum( (yyvsp[(2) - (7)].tok), (yyvsp[(5) - (7)].decl) ); }
     7143    break;
     7144
     7145  case 395:
     7146
     7147/* Line 1806 of yacc.c  */
    71387148#line 1568 "parser.yy"
    7139     { typedefTable.makeTypedef( *(yyvsp[(2) - (2)].tok) ); }
    7140     break;
    7141 
    7142   case 394:
     7149    { (yyval.decl) = DeclarationNode::newEnumConstant( (yyvsp[(1) - (2)].tok), (yyvsp[(2) - (2)].en) ); }
     7150    break;
     7151
     7152  case 396:
    71437153
    71447154/* Line 1806 of yacc.c  */
    71457155#line 1570 "parser.yy"
    7146     { (yyval.decl) = DeclarationNode::newEnum( (yyvsp[(2) - (7)].tok), (yyvsp[(5) - (7)].decl) ); }
    7147     break;
    7148 
    7149   case 395:
     7156    { (yyval.decl) = (yyvsp[(1) - (4)].decl)->appendList( DeclarationNode::newEnumConstant( (yyvsp[(3) - (4)].tok), (yyvsp[(4) - (4)].en) ) ); }
     7157    break;
     7158
     7159  case 397:
    71507160
    71517161/* Line 1806 of yacc.c  */
    71527162#line 1575 "parser.yy"
    7153     { (yyval.decl) = DeclarationNode::newEnumConstant( (yyvsp[(1) - (2)].tok), (yyvsp[(2) - (2)].en) ); }
    7154     break;
    7155 
    7156   case 396:
     7163    { (yyval.en) = 0; }
     7164    break;
     7165
     7166  case 398:
    71577167
    71587168/* Line 1806 of yacc.c  */
    71597169#line 1577 "parser.yy"
    7160     { (yyval.decl) = (yyvsp[(1) - (4)].decl)->appendList( DeclarationNode::newEnumConstant( (yyvsp[(3) - (4)].tok), (yyvsp[(4) - (4)].en) ) ); }
    7161     break;
    7162 
    7163   case 397:
    7164 
    7165 /* Line 1806 of yacc.c  */
    7166 #line 1582 "parser.yy"
    7167     { (yyval.en) = 0; }
    7168     break;
    7169 
    7170   case 398:
     7170    { (yyval.en) = (yyvsp[(2) - (2)].en); }
     7171    break;
     7172
     7173  case 399:
    71717174
    71727175/* Line 1806 of yacc.c  */
    71737176#line 1584 "parser.yy"
    7174     { (yyval.en) = (yyvsp[(2) - (2)].en); }
    7175     break;
    7176 
    7177   case 399:
    7178 
    7179 /* Line 1806 of yacc.c  */
    7180 #line 1591 "parser.yy"
    71817177    { (yyval.decl) = 0; }
    71827178    break;
     
    71857181
    71867182/* Line 1806 of yacc.c  */
    7187 #line 1599 "parser.yy"
     7183#line 1592 "parser.yy"
    71887184    { (yyval.decl) = (yyvsp[(1) - (5)].decl)->appendList( (yyvsp[(5) - (5)].decl) ); }
    71897185    break;
     
    71927188
    71937189/* Line 1806 of yacc.c  */
    7194 #line 1601 "parser.yy"
     7190#line 1594 "parser.yy"
    71957191    { (yyval.decl) = (yyvsp[(1) - (5)].decl)->addVarArgs(); }
    71967192    break;
     
    71997195
    72007196/* Line 1806 of yacc.c  */
    7201 #line 1603 "parser.yy"
     7197#line 1596 "parser.yy"
    72027198    { (yyval.decl) = (yyvsp[(1) - (5)].decl)->addVarArgs(); }
    72037199    break;
     
    72067202
    72077203/* Line 1806 of yacc.c  */
    7208 #line 1611 "parser.yy"
     7204#line 1604 "parser.yy"
    72097205    { (yyval.decl) = (yyvsp[(1) - (5)].decl)->appendList( (yyvsp[(5) - (5)].decl) ); }
    72107206    break;
     
    72137209
    72147210/* Line 1806 of yacc.c  */
    7215 #line 1613 "parser.yy"
     7211#line 1606 "parser.yy"
    72167212    { (yyval.decl) = (yyvsp[(1) - (5)].decl)->appendList( (yyvsp[(5) - (5)].decl) ); }
    72177213    break;
     
    72207216
    72217217/* Line 1806 of yacc.c  */
    7222 #line 1615 "parser.yy"
     7218#line 1608 "parser.yy"
    72237219    { (yyval.decl) = (yyvsp[(1) - (9)].decl)->appendList( (yyvsp[(5) - (9)].decl) )->appendList( (yyvsp[(9) - (9)].decl) ); }
    72247220    break;
     
    72277223
    72287224/* Line 1806 of yacc.c  */
    7229 #line 1621 "parser.yy"
     7225#line 1614 "parser.yy"
    72307226    { (yyval.decl) = (yyvsp[(1) - (5)].decl)->appendList( (yyvsp[(5) - (5)].decl) ); }
    72317227    break;
     
    72347230
    72357231/* Line 1806 of yacc.c  */
     7232#line 1619 "parser.yy"
     7233    { (yyval.decl) = 0; }
     7234    break;
     7235
     7236  case 415:
     7237
     7238/* Line 1806 of yacc.c  */
    72367239#line 1626 "parser.yy"
    7237     { (yyval.decl) = 0; }
    7238     break;
    7239 
    7240   case 415:
     7240    { (yyval.decl) = (yyvsp[(1) - (5)].decl)->addVarArgs(); }
     7241    break;
     7242
     7243  case 418:
    72417244
    72427245/* Line 1806 of yacc.c  */
    72437246#line 1633 "parser.yy"
    7244     { (yyval.decl) = (yyvsp[(1) - (5)].decl)->addVarArgs(); }
    7245     break;
    7246 
    7247   case 418:
    7248 
    7249 /* Line 1806 of yacc.c  */
    7250 #line 1640 "parser.yy"
    72517247    { (yyval.decl) = (yyvsp[(1) - (5)].decl)->appendList( (yyvsp[(5) - (5)].decl) ); }
    72527248    break;
     
    72557251
    72567252/* Line 1806 of yacc.c  */
    7257 #line 1642 "parser.yy"
     7253#line 1635 "parser.yy"
    72587254    { (yyval.decl) = (yyvsp[(1) - (5)].decl)->appendList( (yyvsp[(5) - (5)].decl) ); }
    72597255    break;
     
    72627258
    72637259/* Line 1806 of yacc.c  */
    7264 #line 1651 "parser.yy"
     7260#line 1644 "parser.yy"
    72657261    { (yyval.decl) = (yyvsp[(1) - (3)].decl)->addName( (yyvsp[(2) - (3)].tok) ); }
    72667262    break;
     
    72697265
    72707266/* Line 1806 of yacc.c  */
    7271 #line 1654 "parser.yy"
     7267#line 1647 "parser.yy"
    72727268    { (yyval.decl) = (yyvsp[(1) - (3)].decl)->addName( (yyvsp[(2) - (3)].tok) ); }
    72737269    break;
     
    72767272
    72777273/* Line 1806 of yacc.c  */
    7278 #line 1656 "parser.yy"
     7274#line 1649 "parser.yy"
    72797275    { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addName( (yyvsp[(3) - (4)].tok) )->addQualifiers( (yyvsp[(1) - (4)].decl) ); }
    72807276    break;
     
    72837279
    72847280/* Line 1806 of yacc.c  */
    7285 #line 1666 "parser.yy"
     7281#line 1659 "parser.yy"
    72867282    { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); }
    72877283    break;
     
    72907286
    72917287/* Line 1806 of yacc.c  */
    7292 #line 1672 "parser.yy"
     7288#line 1665 "parser.yy"
    72937289    {
    72947290                        typedefTable.addToEnclosingScope( TypedefTable::ID );
     
    73007296
    73017297/* Line 1806 of yacc.c  */
    7302 #line 1677 "parser.yy"
     7298#line 1670 "parser.yy"
    73037299    {
    73047300                        typedefTable.addToEnclosingScope( TypedefTable::ID );
     
    73107306
    73117307/* Line 1806 of yacc.c  */
    7312 #line 1686 "parser.yy"
     7308#line 1679 "parser.yy"
    73137309    { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addType( (yyvsp[(1) - (2)].decl) ); }
    73147310    break;
     
    73177313
    73187314/* Line 1806 of yacc.c  */
    7319 #line 1695 "parser.yy"
     7315#line 1688 "parser.yy"
    73207316    { (yyval.decl) = DeclarationNode::newName( (yyvsp[(1) - (1)].tok) ); }
    73217317    break;
     
    73247320
    73257321/* Line 1806 of yacc.c  */
    7326 #line 1697 "parser.yy"
     7322#line 1690 "parser.yy"
    73277323    { (yyval.decl) = (yyvsp[(1) - (3)].decl)->appendList( DeclarationNode::newName( (yyvsp[(3) - (3)].tok) ) ); }
    73287324    break;
     
    73317327
    73327328/* Line 1806 of yacc.c  */
    7333 #line 1722 "parser.yy"
     7329#line 1715 "parser.yy"
    73347330    { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addType( (yyvsp[(1) - (2)].decl) ); }
    73357331    break;
     
    73387334
    73397335/* Line 1806 of yacc.c  */
     7336#line 1723 "parser.yy"
     7337    { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addType( (yyvsp[(1) - (2)].decl) ); }
     7338    break;
     7339
     7340  case 452:
     7341
     7342/* Line 1806 of yacc.c  */
     7343#line 1728 "parser.yy"
     7344    { (yyval.in) = 0; }
     7345    break;
     7346
     7347  case 453:
     7348
     7349/* Line 1806 of yacc.c  */
    73407350#line 1730 "parser.yy"
    7341     { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addType( (yyvsp[(1) - (2)].decl) ); }
    7342     break;
    7343 
    7344   case 452:
    7345 
    7346 /* Line 1806 of yacc.c  */
    7347 #line 1735 "parser.yy"
     7351    { (yyval.in) = (yyvsp[(2) - (2)].in); }
     7352    break;
     7353
     7354  case 454:
     7355
     7356/* Line 1806 of yacc.c  */
     7357#line 1732 "parser.yy"
     7358    { (yyval.in) = (yyvsp[(2) - (2)].in)->set_maybeConstructed( false ); }
     7359    break;
     7360
     7361  case 455:
     7362
     7363/* Line 1806 of yacc.c  */
     7364#line 1736 "parser.yy"
     7365    { (yyval.in) = new InitializerNode( (yyvsp[(1) - (1)].en) ); }
     7366    break;
     7367
     7368  case 456:
     7369
     7370/* Line 1806 of yacc.c  */
     7371#line 1737 "parser.yy"
     7372    { (yyval.in) = new InitializerNode( (yyvsp[(2) - (4)].in), true ); }
     7373    break;
     7374
     7375  case 457:
     7376
     7377/* Line 1806 of yacc.c  */
     7378#line 1742 "parser.yy"
    73487379    { (yyval.in) = 0; }
    73497380    break;
    73507381
    7351   case 453:
    7352 
    7353 /* Line 1806 of yacc.c  */
    7354 #line 1737 "parser.yy"
    7355     { (yyval.in) = (yyvsp[(2) - (2)].in); }
    7356     break;
    7357 
    7358   case 454:
    7359 
    7360 /* Line 1806 of yacc.c  */
    7361 #line 1739 "parser.yy"
    7362     { (yyval.in) = (yyvsp[(2) - (2)].in)->set_maybeConstructed( false ); }
    7363     break;
    7364 
    7365   case 455:
    7366 
    7367 /* Line 1806 of yacc.c  */
    7368 #line 1743 "parser.yy"
    7369     { (yyval.in) = new InitializerNode( (yyvsp[(1) - (1)].en) ); }
    7370     break;
    7371 
    7372   case 456:
     7382  case 459:
    73737383
    73747384/* Line 1806 of yacc.c  */
    73757385#line 1744 "parser.yy"
    7376     { (yyval.in) = new InitializerNode( (yyvsp[(2) - (4)].in), true ); }
    7377     break;
    7378 
    7379   case 457:
    7380 
    7381 /* Line 1806 of yacc.c  */
    7382 #line 1749 "parser.yy"
    7383     { (yyval.in) = 0; }
    7384     break;
    7385 
    7386   case 459:
    7387 
    7388 /* Line 1806 of yacc.c  */
    7389 #line 1751 "parser.yy"
    73907386    { (yyval.in) = (yyvsp[(2) - (2)].in)->set_designators( (yyvsp[(1) - (2)].en) ); }
    73917387    break;
     
    73947390
    73957391/* Line 1806 of yacc.c  */
    7396 #line 1752 "parser.yy"
    7397     { (yyval.in) = (InitializerNode *)( (yyvsp[(1) - (3)].in)->set_link( (yyvsp[(3) - (3)].in) ) ); }
     7392#line 1745 "parser.yy"
     7393    { (yyval.in) = (InitializerNode *)( (yyvsp[(1) - (3)].in)->set_last( (yyvsp[(3) - (3)].in) ) ); }
    73987394    break;
    73997395
     
    74017397
    74027398/* Line 1806 of yacc.c  */
    7403 #line 1754 "parser.yy"
    7404     { (yyval.in) = (InitializerNode *)( (yyvsp[(1) - (4)].in)->set_link( (yyvsp[(4) - (4)].in)->set_designators( (yyvsp[(3) - (4)].en) ) ) ); }
     7399#line 1747 "parser.yy"
     7400    { (yyval.in) = (InitializerNode *)( (yyvsp[(1) - (4)].in)->set_last( (yyvsp[(4) - (4)].in)->set_designators( (yyvsp[(3) - (4)].en) ) ) ); }
    74057401    break;
    74067402
     
    74087404
    74097405/* Line 1806 of yacc.c  */
    7410 #line 1770 "parser.yy"
     7406#line 1763 "parser.yy"
    74117407    { (yyval.en) = new ExpressionNode( build_varref( (yyvsp[(1) - (2)].tok) ) ); }
    74127408    break;
     
    74157411
    74167412/* Line 1806 of yacc.c  */
    7417 #line 1776 "parser.yy"
    7418     { (yyval.en) = (ExpressionNode *)( (yyvsp[(1) - (2)].en)->set_link( (yyvsp[(2) - (2)].en) ) ); }
     7413#line 1769 "parser.yy"
     7414    { (yyval.en) = (ExpressionNode *)( (yyvsp[(1) - (2)].en)->set_last( (yyvsp[(2) - (2)].en) ) ); }
    74197415    break;
    74207416
     
    74227418
    74237419/* Line 1806 of yacc.c  */
     7420#line 1775 "parser.yy"
     7421    { (yyval.en) = new ExpressionNode( build_varref( (yyvsp[(2) - (2)].tok) ) ); }
     7422    break;
     7423
     7424  case 467:
     7425
     7426/* Line 1806 of yacc.c  */
     7427#line 1778 "parser.yy"
     7428    { (yyval.en) = (yyvsp[(3) - (5)].en); }
     7429    break;
     7430
     7431  case 468:
     7432
     7433/* Line 1806 of yacc.c  */
     7434#line 1780 "parser.yy"
     7435    { (yyval.en) = (yyvsp[(3) - (5)].en); }
     7436    break;
     7437
     7438  case 469:
     7439
     7440/* Line 1806 of yacc.c  */
    74247441#line 1782 "parser.yy"
    7425     { (yyval.en) = new ExpressionNode( build_varref( (yyvsp[(2) - (2)].tok) ) ); }
    7426     break;
    7427 
    7428   case 467:
    7429 
    7430 /* Line 1806 of yacc.c  */
    7431 #line 1785 "parser.yy"
    7432     { (yyval.en) = (yyvsp[(3) - (5)].en); }
    7433     break;
    7434 
    7435   case 468:
    7436 
    7437 /* Line 1806 of yacc.c  */
    7438 #line 1787 "parser.yy"
    7439     { (yyval.en) = (yyvsp[(3) - (5)].en); }
    7440     break;
    7441 
    7442   case 469:
    7443 
    7444 /* Line 1806 of yacc.c  */
    7445 #line 1789 "parser.yy"
    74467442    { (yyval.en) = new ExpressionNode( build_range( (yyvsp[(3) - (7)].en), (yyvsp[(5) - (7)].en) ) ); }
    74477443    break;
     
    74507446
    74517447/* Line 1806 of yacc.c  */
    7452 #line 1791 "parser.yy"
     7448#line 1784 "parser.yy"
    74537449    { (yyval.en) = (yyvsp[(4) - (6)].en); }
    74547450    break;
     
    74577453
    74587454/* Line 1806 of yacc.c  */
    7459 #line 1815 "parser.yy"
     7455#line 1808 "parser.yy"
    74607456    { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); }
    74617457    break;
     
    74647460
    74657461/* Line 1806 of yacc.c  */
    7466 #line 1817 "parser.yy"
     7462#line 1810 "parser.yy"
    74677463    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
    74687464    break;
     
    74717467
    74727468/* Line 1806 of yacc.c  */
    7473 #line 1819 "parser.yy"
     7469#line 1812 "parser.yy"
    74747470    { (yyval.decl) = (yyvsp[(1) - (3)].decl)->addQualifiers( (yyvsp[(2) - (3)].decl) )->addQualifiers( (yyvsp[(3) - (3)].decl) ); }
    74757471    break;
     
    74787474
    74797475/* Line 1806 of yacc.c  */
     7476#line 1818 "parser.yy"
     7477    { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); }
     7478    break;
     7479
     7480  case 477:
     7481
     7482/* Line 1806 of yacc.c  */
     7483#line 1820 "parser.yy"
     7484    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
     7485    break;
     7486
     7487  case 478:
     7488
     7489/* Line 1806 of yacc.c  */
    74807490#line 1825 "parser.yy"
    7481     { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); }
    7482     break;
    7483 
    7484   case 477:
    7485 
    7486 /* Line 1806 of yacc.c  */
    7487 #line 1827 "parser.yy"
    7488     { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); }
    7489     break;
    7490 
    7491   case 478:
    7492 
    7493 /* Line 1806 of yacc.c  */
    7494 #line 1832 "parser.yy"
    74957491    { (yyval.decl) = DeclarationNode::newFromTypeGen( (yyvsp[(1) - (4)].tok), (yyvsp[(3) - (4)].en) ); }
    74967492    break;
     
    74997495
    75007496/* Line 1806 of yacc.c  */
     7497#line 1831 "parser.yy"
     7498    { (yyval.decl) = (yyvsp[(1) - (4)].decl)->appendList( (yyvsp[(3) - (4)].decl) ); }
     7499    break;
     7500
     7501  case 481:
     7502
     7503/* Line 1806 of yacc.c  */
     7504#line 1836 "parser.yy"
     7505    { typedefTable.addToEnclosingScope( *(yyvsp[(2) - (2)].tok), TypedefTable::TD ); }
     7506    break;
     7507
     7508  case 482:
     7509
     7510/* Line 1806 of yacc.c  */
    75017511#line 1838 "parser.yy"
    7502     { (yyval.decl) = (yyvsp[(1) - (4)].decl)->appendList( (yyvsp[(3) - (4)].decl) ); }
    7503     break;
    7504 
    7505   case 481:
    7506 
    7507 /* Line 1806 of yacc.c  */
    7508 #line 1843 "parser.yy"
    7509     { typedefTable.addToEnclosingScope( *(yyvsp[(2) - (2)].tok), TypedefTable::TD ); }
    7510     break;
    7511 
    7512   case 482:
    7513 
    7514 /* Line 1806 of yacc.c  */
    7515 #line 1845 "parser.yy"
    75167512    { (yyval.decl) = DeclarationNode::newTypeParam( (yyvsp[(1) - (4)].tclass), (yyvsp[(2) - (4)].tok) )->addAssertions( (yyvsp[(4) - (4)].decl) ); }
    75177513    break;
     
    75207516
    75217517/* Line 1806 of yacc.c  */
    7522 #line 1851 "parser.yy"
     7518#line 1844 "parser.yy"
    75237519    { (yyval.tclass) = DeclarationNode::Type; }
    75247520    break;
     
    75277523
    75287524/* Line 1806 of yacc.c  */
     7525#line 1846 "parser.yy"
     7526    { (yyval.tclass) = DeclarationNode::Ftype; }
     7527    break;
     7528
     7529  case 486:
     7530
     7531/* Line 1806 of yacc.c  */
     7532#line 1848 "parser.yy"
     7533    { (yyval.tclass) = DeclarationNode::Dtype; }
     7534    break;
     7535
     7536  case 487:
     7537
     7538/* Line 1806 of yacc.c  */
    75297539#line 1853 "parser.yy"
    7530     { (yyval.tclass) = DeclarationNode::Ftype; }
    7531     break;
    7532 
    7533   case 486:
     7540    { (yyval.decl) = 0; }
     7541    break;
     7542
     7543  case 488:
    75347544
    75357545/* Line 1806 of yacc.c  */
    75367546#line 1855 "parser.yy"
    7537     { (yyval.tclass) = DeclarationNode::Dtype; }
    7538     break;
    7539 
    7540   case 487:
     7547    { (yyval.decl) = (yyvsp[(1) - (2)].decl) != 0 ? (yyvsp[(1) - (2)].decl)->appendList( (yyvsp[(2) - (2)].decl) ) : (yyvsp[(2) - (2)].decl); }
     7548    break;
     7549
     7550  case 489:
    75417551
    75427552/* Line 1806 of yacc.c  */
    75437553#line 1860 "parser.yy"
    7544     { (yyval.decl) = 0; }
    7545     break;
    7546 
    7547   case 488:
    7548 
    7549 /* Line 1806 of yacc.c  */
    7550 #line 1862 "parser.yy"
    7551     { (yyval.decl) = (yyvsp[(1) - (2)].decl) != 0 ? (yyvsp[(1) - (2)].decl)->appendList( (yyvsp[(2) - (2)].decl) ) : (yyvsp[(2) - (2)].decl); }
    7552     break;
    7553 
    7554   case 489:
    7555 
    7556 /* Line 1806 of yacc.c  */
    7557 #line 1867 "parser.yy"
    75587554    {
    75597555                        typedefTable.openTrait( *(yyvsp[(2) - (5)].tok) );
     
    75657561
    75667562/* Line 1806 of yacc.c  */
     7563#line 1865 "parser.yy"
     7564    { (yyval.decl) = (yyvsp[(4) - (5)].decl); }
     7565    break;
     7566
     7567  case 491:
     7568
     7569/* Line 1806 of yacc.c  */
     7570#line 1867 "parser.yy"
     7571    { (yyval.decl) = 0; }
     7572    break;
     7573
     7574  case 492:
     7575
     7576/* Line 1806 of yacc.c  */
    75677577#line 1872 "parser.yy"
    7568     { (yyval.decl) = (yyvsp[(4) - (5)].decl); }
    7569     break;
    7570 
    7571   case 491:
    7572 
    7573 /* Line 1806 of yacc.c  */
    7574 #line 1874 "parser.yy"
    7575     { (yyval.decl) = 0; }
    7576     break;
    7577 
    7578   case 492:
    7579 
    7580 /* Line 1806 of yacc.c  */
    7581 #line 1879 "parser.yy"
    75827578    { (yyval.en) = new ExpressionNode( build_typevalue( (yyvsp[(1) - (1)].decl) ) ); }
    75837579    break;
     
    75867582
    75877583/* Line 1806 of yacc.c  */
     7584#line 1875 "parser.yy"
     7585    { (yyval.en) = (ExpressionNode *)( (yyvsp[(1) - (3)].en)->set_last( new ExpressionNode( build_typevalue( (yyvsp[(3) - (3)].decl) ) ) ) ); }
     7586    break;
     7587
     7588  case 495:
     7589
     7590/* Line 1806 of yacc.c  */
     7591#line 1877 "parser.yy"
     7592    { (yyval.en) = (ExpressionNode *)( (yyvsp[(1) - (3)].en)->set_last( (yyvsp[(3) - (3)].en) )); }
     7593    break;
     7594
     7595  case 496:
     7596
     7597/* Line 1806 of yacc.c  */
    75887598#line 1882 "parser.yy"
    7589     { (yyval.en) = (ExpressionNode *)( (yyvsp[(1) - (3)].en)->set_link( new ExpressionNode( build_typevalue( (yyvsp[(3) - (3)].decl) ) ) ) ); }
    7590     break;
    7591 
    7592   case 495:
     7599    { (yyval.decl) = (yyvsp[(2) - (2)].decl); }
     7600    break;
     7601
     7602  case 497:
    75937603
    75947604/* Line 1806 of yacc.c  */
    75957605#line 1884 "parser.yy"
    7596     { (yyval.en) = (ExpressionNode *)( (yyvsp[(1) - (3)].en)->set_link( (yyvsp[(3) - (3)].en) )); }
    7597     break;
    7598 
    7599   case 496:
    7600 
    7601 /* Line 1806 of yacc.c  */
    7602 #line 1889 "parser.yy"
    7603     { (yyval.decl) = (yyvsp[(2) - (2)].decl); }
    7604     break;
    7605 
    7606   case 497:
     7606    { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addQualifiers( (yyvsp[(1) - (3)].decl) ); }
     7607    break;
     7608
     7609  case 498:
     7610
     7611/* Line 1806 of yacc.c  */
     7612#line 1886 "parser.yy"
     7613    { (yyval.decl) = (yyvsp[(1) - (3)].decl)->appendList( (yyvsp[(3) - (3)].decl)->copyStorageClasses( (yyvsp[(1) - (3)].decl) ) ); }
     7614    break;
     7615
     7616  case 499:
    76077617
    76087618/* Line 1806 of yacc.c  */
    76097619#line 1891 "parser.yy"
    7610     { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addQualifiers( (yyvsp[(1) - (3)].decl) ); }
    7611     break;
    7612 
    7613   case 498:
     7620    { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addAssertions( (yyvsp[(2) - (2)].decl) ); }
     7621    break;
     7622
     7623  case 500:
    76147624
    76157625/* Line 1806 of yacc.c  */
    76167626#line 1893 "parser.yy"
    7617     { (yyval.decl) = (yyvsp[(1) - (3)].decl)->appendList( (yyvsp[(3) - (3)].decl)->copyStorageClasses( (yyvsp[(1) - (3)].decl) ) ); }
    7618     break;
    7619 
    7620   case 499:
     7627    { (yyval.decl) = (yyvsp[(1) - (4)].decl)->addAssertions( (yyvsp[(2) - (4)].decl) )->addType( (yyvsp[(4) - (4)].decl) ); }
     7628    break;
     7629
     7630  case 501:
    76217631
    76227632/* Line 1806 of yacc.c  */
    76237633#line 1898 "parser.yy"
    7624     { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addAssertions( (yyvsp[(2) - (2)].decl) ); }
    7625     break;
    7626 
    7627   case 500:
    7628 
    7629 /* Line 1806 of yacc.c  */
    7630 #line 1900 "parser.yy"
    7631     { (yyval.decl) = (yyvsp[(1) - (4)].decl)->addAssertions( (yyvsp[(2) - (4)].decl) )->addType( (yyvsp[(4) - (4)].decl) ); }
    7632     break;
    7633 
    7634   case 501:
    7635 
    7636 /* Line 1806 of yacc.c  */
    7637 #line 1905 "parser.yy"
    76387634    {
    76397635                        typedefTable.addToEnclosingScope( *(yyvsp[(1) - (1)].tok), TypedefTable::TD );
     
    76457641
    76467642/* Line 1806 of yacc.c  */
    7647 #line 1910 "parser.yy"
     7643#line 1903 "parser.yy"
    76487644    {
    76497645                        typedefTable.addToEnclosingScope( *(yyvsp[(1) - (6)].tok), TypedefTable::TG );
     
    76557651
    76567652/* Line 1806 of yacc.c  */
    7657 #line 1918 "parser.yy"
     7653#line 1911 "parser.yy"
    76587654    {
    76597655                        typedefTable.addToEnclosingScope( *(yyvsp[(2) - (9)].tok), TypedefTable::ID );
     
    76657661
    76667662/* Line 1806 of yacc.c  */
    7667 #line 1923 "parser.yy"
     7663#line 1916 "parser.yy"
    76687664    {
    76697665                        typedefTable.enterTrait( *(yyvsp[(2) - (8)].tok) );
     
    76757671
    76767672/* Line 1806 of yacc.c  */
    7677 #line 1928 "parser.yy"
     7673#line 1921 "parser.yy"
    76787674    {
    76797675                        typedefTable.leaveTrait();
     
    76867682
    76877683/* Line 1806 of yacc.c  */
    7688 #line 1938 "parser.yy"
     7684#line 1931 "parser.yy"
    76897685    { (yyval.decl) = (yyvsp[(1) - (3)].decl)->appendList( (yyvsp[(3) - (3)].decl) ); }
    76907686    break;
     
    76937689
    76947690/* Line 1806 of yacc.c  */
    7695 #line 1948 "parser.yy"
     7691#line 1941 "parser.yy"
    76967692    {
    76977693                        typedefTable.addToEnclosingScope2( TypedefTable::ID );
     
    77037699
    77047700/* Line 1806 of yacc.c  */
    7705 #line 1953 "parser.yy"
     7701#line 1946 "parser.yy"
    77067702    {
    77077703                        typedefTable.addToEnclosingScope2( TypedefTable::ID );
     
    77137709
    77147710/* Line 1806 of yacc.c  */
    7715 #line 1958 "parser.yy"
     7711#line 1951 "parser.yy"
    77167712    {
    77177713                        typedefTable.addToEnclosingScope2( *(yyvsp[(5) - (5)].tok), TypedefTable::ID );
     
    77237719
    77247720/* Line 1806 of yacc.c  */
    7725 #line 1966 "parser.yy"
     7721#line 1959 "parser.yy"
    77267722    {
    77277723                        typedefTable.addToEnclosingScope2( TypedefTable::ID );
     
    77337729
    77347730/* Line 1806 of yacc.c  */
    7735 #line 1971 "parser.yy"
     7731#line 1964 "parser.yy"
    77367732    {
    77377733                        typedefTable.addToEnclosingScope2( TypedefTable::ID );
     
    77437739
    77447740/* Line 1806 of yacc.c  */
    7745 #line 1981 "parser.yy"
     7741#line 1974 "parser.yy"
    77467742    {}
    77477743    break;
     
    77507746
    77517747/* Line 1806 of yacc.c  */
    7752 #line 1983 "parser.yy"
     7748#line 1976 "parser.yy"
    77537749    {
    77547750                        if ( theTree ) {
     
    77637759
    77647760/* Line 1806 of yacc.c  */
    7765 #line 1995 "parser.yy"
     7761#line 1988 "parser.yy"
    77667762    { (yyval.decl) = ( (yyvsp[(1) - (3)].decl) != NULL ) ? (yyvsp[(1) - (3)].decl)->appendList( (yyvsp[(3) - (3)].decl) ) : (yyvsp[(3) - (3)].decl); }
    77677763    break;
     
    77707766
    77717767/* Line 1806 of yacc.c  */
    7772 #line 2000 "parser.yy"
     7768#line 1993 "parser.yy"
    77737769    { (yyval.decl) = 0; }
    77747770    break;
     
    77777773
    77787774/* Line 1806 of yacc.c  */
    7779 #line 2008 "parser.yy"
     7775#line 2001 "parser.yy"
    77807776    {}
    77817777    break;
     
    77847780
    77857781/* Line 1806 of yacc.c  */
    7786 #line 2010 "parser.yy"
     7782#line 2003 "parser.yy"
    77877783    {
    77887784                        linkageStack.push( linkage );
     
    77947790
    77957791/* Line 1806 of yacc.c  */
    7796 #line 2015 "parser.yy"
     7792#line 2008 "parser.yy"
    77977793    {