Changeset 6603c1d
- Timestamp:
- Aug 15, 2016, 10:18:22 AM (7 years ago)
- 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. - Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/LaTeXmacros/common.tex
r38736854 r6603c1d 11 11 %% Created On : Sat Apr 9 10:06:17 2016 12 12 %% Last Modified By : Peter A. Buhr 13 %% Last Modified On : Tue Aug 2 17:02:02201614 %% Update Count : 2 2813 %% Last Modified On : Sun Aug 14 08:27:29 2016 14 %% Update Count : 231 15 15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 16 … … 153 153 {\abbrevFont{etc}.\xspace}% 154 154 }% 155 \newcommand{\etal}{% 156 \@ifnextchar{.}{\abbrevFont{et~al}}% 157 {\abbrevFont{et al}.\xspace}% 158 }% 155 159 \makeatother 156 160 … … 251 255 literate={-}{\raisebox{-0.15ex}{\texttt{-}}}1 {^}{\raisebox{0.6ex}{$\scriptscriptstyle\land\,$}}1 252 256 {~}{\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, 254 258 }% 255 259 -
doc/aaron_comp_II/comp_II.tex
r38736854 r6603c1d 413 413 \subsection{Argument-Parameter Matching} 414 414 The 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. 415 For 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. 415 416 All 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: 416 417 \begin{figure}[h] … … 422 423 423 424 double *f(int*, int*); // $f_d$ 424 char *f(char*, char*); // $f_c$425 char *f(char*, int*); // $f_c$ 425 426 426 427 f( f( p, p ), p ); … … 463 464 Deciding 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. 464 465 466 Ganzinger 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. 467 Persch~\etal~\cite{PW:overload} developed a similar two-pass approach where the bottom-up pass is followed by the top-down pass. 468 These 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 465 470 \subsubsection{Common Subexpression Caching} 466 471 With 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©. 467 472 468 473 \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. 474 With 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. 475 Integrating implicit conversion handling into the presented argument-parameter matching algorithms thus provides some choice of implementation approach. 476 477 Inference 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.}. 478 This 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. 479 However, 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. 481 The upcoming Concepts standard~\cite{C++concepts} defines a system of type constraints similar in principle to \CFA's. 482 Cormack and Wright~\cite{Cormack90} present an algorithm which integrates overload resolution with a polymorphic type inference approach very similar to \CFA's. 483 However, 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.}. 471 484 472 485 \subsubsection{On Parameters} 473 Bilson does account for implicit conversions in his algorithm, but it is unclear the approach is optimal.486 Bilson does account for implicit conversions in his algorithm, but it is unclear if the approach is optimal. 474 487 His 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. 475 488 This 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. … … 484 497 485 498 \subsection{Candidate Set Generation} 486 Cormack, Baker and Bilson allgenerate the complete set of candidate argument interpretations before attempting to match the containing function call expression.499 All the algorithms discussed to this point generate the complete set of candidate argument interpretations before attempting to match the containing function call expression. 487 500 However, 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. 488 501 Under 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. 489 502 490 503 \subsubsection{Eager} 491 Within the eager approach taken by Cormack, Baker and Bilson, there are still variants to explore.504 Within the eager approach taken by the existing top-down and bottom-up algorithms, there are still variants to explore. 492 505 Cormack 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. 493 506 Sorting 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. … … 559 572 560 573 This 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.574 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. 562 575 563 576 \appendix -
doc/bibliography/cfa.bib
r38736854 r6603c1d 4685 4685 } 4686 4686 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 4687 4706 @article{Ford82, 4688 4707 keywords = {}, … … 5851 5870 } 5852 5871 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 5853 5891 @inproceedings{Dice10, 5854 5892 keywords = {hardware, synchronization, transactional memory}, -
doc/user/user.tex
r38736854 r6603c1d 11 11 %% Created On : Wed Apr 6 14:53:29 2016 12 12 %% Last Modified By : Peter A. Buhr 13 %% Last Modified On : Tue Aug 2 17:39:02201614 %% Update Count : 1 28613 %% Last Modified On : Sun Aug 14 08:23:06 2016 14 %% Update Count : 1323 15 15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 16 … … 317 317 318 318 \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©} 320 320 Do not supply ©extern "C"© wrappers for \Celeven standard include files (see~\VRef{s:StandardHeaders}). 321 321 \textbf{This option is \emph{not} the default.} … … 807 807 808 808 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} 814 int `otype` = 3; // make keyword an identifier 815 double `choose` = 3.5; 816 \end{lstlisting} 817 Programs 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. 818 Clashes 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 809 835 \section{Type Operators} 810 836 … … 1011 1037 Alternatively, prototype definitions can be eliminated by using a two-pass compilation, and implicitly creating header files for exports. 1012 1038 The former is easy to do, while the latter is more complex. 1013 Currently, \CFA does \emph{not} attempt to support named arguments. 1039 1040 Furthermore, named arguments do not work well in a \CFA-style programming-languages because they potentially introduces a new criteria for type matching. 1041 For 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} 1043 int f( int i, int j ); 1044 int f( int x, double y ); 1045 1046 f( j : 3, i : 4 ); §\C{// 1st f}§ 1047 f( x : 7, y : 8.1 ); §\C{// 2nd f}§ 1048 f( 4, 5 ); §\C{// ambiguous call}§ 1049 \end{lstlisting} 1050 However, named arguments compound routine resolution in conjunction with conversions: 1051 \begin{lstlisting} 1052 f( i : 3, 5.7 ); §\C{// ambiguous call ?}§ 1053 \end{lstlisting} 1054 Depending on the cost associated with named arguments, this call could be resolvable or ambiguous. 1055 Adding named argument into the routine resolution algorithm does not seem worth the complexity. 1056 Therefore, \CFA does \emph{not} attempt to support named arguments. 1014 1057 1015 1058 \item[Default Arguments] … … 1021 1064 the allowable positional calls are: 1022 1065 \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 )}§1066 p(); §\C{// rewrite $\Rightarrow$ p( 1, 2, 3 )}§ 1067 p( 4 ); §\C{// rewrite $\Rightarrow$ p( 4, 2, 3 )}§ 1068 p( 4, 4 ); §\C{// rewrite $\Rightarrow$ p( 4, 4, 3 )}§ 1069 p( 4, 4, 4 ); §\C{// rewrite $\Rightarrow$ p( 4, 4, 4 )}§ 1027 1070 // 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 )}§1071 p( , 4, 4 ); §\C{// rewrite $\Rightarrow$ p( 1, 4, 4 )}§ 1072 p( 4, , 4 ); §\C{// rewrite $\Rightarrow$ p( 4, 2, 4 )}§ 1073 p( 4, 4, ); §\C{// rewrite $\Rightarrow$ p( 4, 4, 3 )}§ 1074 p( 4, , ); §\C{// rewrite $\Rightarrow$ p( 4, 2, 3 )}§ 1075 p( , 4, ); §\C{// rewrite $\Rightarrow$ p( 1, 4, 3 )}§ 1076 p( , , 4 ); §\C{// rewrite $\Rightarrow$ p( 1, 2, 4 )}§ 1077 p( , , ); §\C{// rewrite $\Rightarrow$ p( 1, 2, 3 )}§ 1035 1078 \end{lstlisting} 1036 1079 Here the missing arguments are inserted from the default values in the parameter list. … … 1067 1110 The conflict occurs because both named and ellipse arguments must appear after positional arguments, giving two possibilities: 1068 1111 \begin{lstlisting} 1069 p( /* positional */, . . ., /* named */ );1070 p( /* positional */, /* named */, . .. );1112 p( /* positional */, ... , /* named */ ); 1113 p( /* positional */, /* named */, ... ); 1071 1114 \end{lstlisting} 1072 1115 While it is possible to implement both approaches, the first possibly is more complex than the second, \eg: 1073 1116 \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 */, . .. );}§1117 p( int x, int y, int z, ... ); 1118 p( 1, 4, 5, 6, z : 3, y : 2 ); §\C{// assume p( /* positional */, ... , /* named */ );}§ 1119 p( 1, z : 3, y : 2, 4, 5, 6 ); §\C{// assume p( /* positional */, /* named */, ... );}§ 1077 1120 \end{lstlisting} 1078 1121 In 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. … … 1082 1125 The problem is exacerbated with default arguments, \eg: 1083 1126 \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 */, . .. );}§1127 void p( int x, int y = 2, int z = 3... ); 1128 p( 1, 4, 5, 6, z : 3 ); §\C{// assume p( /* positional */, ... , /* named */ );}§ 1129 p( 1, z : 3, 4, 5, 6 ); §\C{// assume p( /* positional */, /* named */, ... );}§ 1087 1130 \end{lstlisting} 1088 1131 The first call is an error because arguments 4 and 5 are actually positional not ellipse arguments; … … 1129 1172 \subsection{Type Nesting} 1130 1173 1131 \CFA allows \Index{type nesting}, and type qualification of the nested typ es (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. 1132 1175 \begin{figure} 1176 \centering 1133 1177 \begin{tabular}{@{}l@{\hspace{3em}}l|l@{}} 1134 1178 \multicolumn{1}{c@{\hspace{3em}}}{\textbf{C Type Nesting}} & \multicolumn{1}{c}{\textbf{C Implicit Hoisting}} & \multicolumn{1}{|c}{\textbf{\CFA}} \\ … … 1397 1441 Mass assignment has the following form: 1398 1442 \begin{lstlisting} 1399 [ §\emph{lvalue}§, ... , §\emph{lvalue}§ ] = §\emph{expr}§;1443 [ §\emph{lvalue}§, ... , §\emph{lvalue}§ ] = §\emph{expr}§; 1400 1444 \end{lstlisting} 1401 1445 \index{lvalue} … … 1437 1481 Multiple assignment has the following form: 1438 1482 \begin{lstlisting} 1439 [ §\emph{lvalue}§, . . ., §\emph{lvalue}§ ] = [ §\emph{expr}§, . . ., §\emph{expr}§ ];1483 [ §\emph{lvalue}§, ... , §\emph{lvalue}§ ] = [ §\emph{expr}§, ... , §\emph{expr}§ ]; 1440 1484 \end{lstlisting} 1441 1485 \index{lvalue} … … 1873 1917 \begin{lstlisting} 1874 1918 switch ( i ) { 1875 ®case1, 3, 5®:1919 case ®1, 3, 5®: 1876 1920 ... 1877 ®case2, 4, 6®:1921 case ®2, 4, 6®: 1878 1922 ... 1879 1923 } … … 1906 1950 \begin{lstlisting} 1907 1951 switch ( i ) { 1908 ®case1~5:®1952 case ®1~5:® 1909 1953 ... 1910 ®case10~15:®1954 case ®10~15:® 1911 1955 ... 1912 1956 } … … 1915 1959 \begin{lstlisting} 1916 1960 switch ( i ) 1917 case 1 ... 5:1961 case ®1 ... 5®: 1918 1962 ... 1919 case 10 ... 15:1963 case ®10 ... 15®: 1920 1964 ... 1921 1965 } … … 4369 4413 4370 4414 4415 \section{Incompatible} 4416 4417 The 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 \\ 4423 New 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. \\ 4426 Any 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} 4435 int rtn( int i ); 4436 int rtn( char c ); 4437 rtn( '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. 4440 In particular, output of ©char© variable now print a character rather than the decimal ASCII value of the character. 4441 \begin{lstlisting} 4442 sout | 'x' | " " | (int)'x' | endl; 4443 x 120 4444 \end{lstlisting} 4445 Having 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} 4448 sizeof( 'x' ) == sizeof( int ) 4449 \end{lstlisting} 4450 no 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} 4459 char * p = "abc"; §\C{// valid in C, deprecated in \CFA}§ 4460 char * q = expr ? "abc" : "de"; §\C{// valid in C, invalid in \CFA}§ 4461 \end{lstlisting} 4462 The type of a string literal is changed from ©[] char© to ©const [] char©. 4463 Similarly, 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} 4466 char * p = "abc"; 4467 p[0] = 'w'; §\C{// segment fault or change constant literal}§ 4468 \end{lstlisting} 4469 The 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} 4479 int i; §\C{// forward definition}§ 4480 int *j = ®&i®; §\C{// forward reference, valid in C, invalid in \CFA}§ 4481 int i = 0; §\C{// definition}§ 4482 \end{lstlisting} 4483 is valid in C, and invalid in \CFA because duplicate overloaded object definitions at the same scope level are disallowed. 4484 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, 4485 \begin{lstlisting} 4486 struct X { int i; struct X *next; }; 4487 static struct X a; §\C{// forward definition}§ 4488 static struct X b = { 0, ®&a® }; §\C{// forward reference, valid in C, invalid in \CFA}§ 4489 static 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} 4501 enum ®Colour® { R, G, B, Y, C, M }; 4502 struct 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}§ 4512 Personß.ß®Colour® pc = Personß.ßR; §\C{// type/enum defined inside}§ 4513 Personß.ßFace pretty; §\C{// type defined inside}§ 4514 \end{lstlisting} 4515 In 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}. 4517 Nested 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} 4530 struct Y; §\C{// struct Y and struct X are at the same scope}§ 4531 struct X { 4532 struct Y { /* ... */ } y; 4533 }; 4534 \end{lstlisting} 4535 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. 4536 Note: 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 4371 4551 \section{New Keywords} 4372 4552 \label{s:NewKeywords} 4373 4553 4374 4554 \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© & \\ 4390 4562 \end{tabular} 4391 4563 \end{quote2} … … 4395 4567 \label{s:StandardHeaders} 4396 4568 4397 C prescribes the following standard header-files :4569 C prescribes the following standard header-files~\cite[\S~7.1.2]{C11}: 4398 4570 \begin{quote2} 4399 4571 \begin{minipage}{\linewidth} … … 4412 4584 \end{minipage} 4413 4585 \end{quote2} 4414 For the prescribed head-files, \CFA implicit wraps their includes in an ©extern "C"©;4586 For the prescribed head-files, \CFA implicitly wraps their includes in an ©extern "C"©; 4415 4587 hence, names in these include files are not mangled\index{mangling!name} (see~\VRef{s:Interoperability}). 4416 4588 All 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 \item4425 \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 identifier4434 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 // ! otype4444 4445 #include_next <bfd.h> // must have internal check for multiple expansion4446 4447 #if defined( otype ) && defined( __CFA_BFD_H__ ) // reset only if set4448 #undef otype4449 #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 \item4456 \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 called4462 \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 1204468 \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:] simple4476 \item[How widely used:] programs that depend upon ©sizeof( 'x' )© are rare and can be changed to ©sizeof(char)©.4477 \end{description}4478 4479 \item4480 \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 literal4492 \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 \item4500 \begin{description}4501 \item[Change:] remove \newterm{tentative definitions}, which only occurs at file scope:4502 \begin{lstlisting}4503 int i; // forward definition4504 int *j = ®&i®; // forward reference, valid in C, invalid in §\CFA§4505 int i = 0; // definition4506 \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 definition4512 static struct X b = { 0, ®&a® }; // forward reference, valid in C, invalid in §\CFA§4513 static struct X a = { 1, &b }; // definition4514 \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:] seldom4519 \end{description}4520 4521 \item4522 \begin{description}4523 \item[Change:] have ©struct© introduce a scope for nested types4524 In C, the name of the nested types belongs to the same scope as the name of the outermost enclosing4525 Example:4526 \begin{lstlisting}4527 enum ®Colour® { R, G, B, Y, C, M };4528 struct Person {4529 enum ®Colour® { R, G, B }; // nested type4530 struct Face { // nested type4531 ®Colour® Eyes, Hair; // type defined outside (1 level)4532 };4533 ß.ß®Colour® shirt; // type defined outside (top level)4534 ®Colour® pants; // type defined same level4535 Face looks[10]; // type defined same level4536 };4537 ®Colour® c = R; // type/enum defined same level4538 Personß.ß®Colour® pc = Personß.ßR; // type/enum defined inside4539 Personß.ßFace pretty; // type defined inside4540 \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 \item4552 \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 scope4558 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 \item4568 \begin{description}4569 \item[Change:] comma expression is disallowed as subscript4570 \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}4576 4589 4577 4590 … … 4749 4762 \subsection{malloc} 4750 4763 4764 \leavevmode 4751 4765 \begin{lstlisting}[aboveskip=0pt,belowskip=0pt] 4752 4766 forall( otype T ) T * malloc( void );§\indexc{malloc}§ … … 4765 4779 forall( otype T ) T * memset( T * ptr ); // remove when default value available 4766 4780 \end{lstlisting} 4767 \ 4781 4768 4782 4769 4783 \subsection{ato / strto} 4770 4784 4785 \leavevmode 4771 4786 \begin{lstlisting}[aboveskip=0pt,belowskip=0pt] 4772 4787 int ato( const char * ptr );§\indexc{ato}§ … … 4796 4811 long double _Complex strto( const char * sptr, char ** eptr ); 4797 4812 \end{lstlisting} 4798 \4799 4813 4800 4814 4801 4815 \subsection{bsearch / qsort} 4802 4816 4817 \leavevmode 4803 4818 \begin{lstlisting}[aboveskip=0pt,belowskip=0pt] 4804 4819 forall( otype T | { int ?<?( T, T ); } ) … … 4808 4823 void qsort( const T * arr, size_t dimension );§\indexc{qsort}§ 4809 4824 \end{lstlisting} 4810 \4811 4825 4812 4826 4813 4827 \subsection{abs} 4814 4828 4829 \leavevmode 4815 4830 \begin{lstlisting}[aboveskip=0pt,belowskip=0pt] 4816 4831 char abs( char );§\indexc{abs}§ … … 4825 4840 long double abs( long double _Complex ); 4826 4841 \end{lstlisting} 4827 \4828 4842 4829 4843 4830 4844 \subsection{random} 4831 4845 4846 \leavevmode 4832 4847 \begin{lstlisting}[aboveskip=0pt,belowskip=0pt] 4833 4848 void rand48seed( long int s );§\indexc{rand48seed}§ … … 4843 4858 long double _Complex rand48(); 4844 4859 \end{lstlisting} 4845 \4846 4860 4847 4861 4848 4862 \subsection{min / max / clamp / swap} 4849 4863 4864 \leavevmode 4850 4865 \begin{lstlisting}[aboveskip=0pt,belowskip=0pt] 4851 4866 forall( otype T | { int ?<?( T, T ); } ) … … 4861 4876 void swap( T * t1, T * t2 );§\indexc{swap}§ 4862 4877 \end{lstlisting} 4863 \4864 4878 4865 4879 … … 4872 4886 \subsection{General} 4873 4887 4888 \leavevmode 4874 4889 \begin{lstlisting}[aboveskip=0pt,belowskip=0pt] 4875 4890 float fabs( float );§\indexc{fabs}§ … … 4917 4932 long double nan( const char * ); 4918 4933 \end{lstlisting} 4919 \4920 4934 4921 4935 4922 4936 \subsection{Exponential} 4923 4937 4938 \leavevmode 4924 4939 \begin{lstlisting}[aboveskip=0pt,belowskip=0pt] 4925 4940 float exp( float );§\indexc{exp}§ … … 4974 4989 long double logb( long double ); 4975 4990 \end{lstlisting} 4976 \4977 4991 4978 4992 4979 4993 \subsection{Power} 4980 4994 4995 \leavevmode 4981 4996 \begin{lstlisting}[aboveskip=0pt,belowskip=0pt] 4982 4997 float sqrt( float );§\indexc{sqrt}§ … … 5002 5017 long double _Complex pow( long double _Complex, long double _Complex ); 5003 5018 \end{lstlisting} 5004 \5005 5019 5006 5020 5007 5021 \subsection{Trigonometric} 5008 5022 5023 \leavevmode 5009 5024 \begin{lstlisting}[aboveskip=0pt,belowskip=0pt] 5010 5025 float sin( float );§\indexc{sin}§ … … 5058 5073 long double atan( long double, long double ); 5059 5074 \end{lstlisting} 5060 \5061 5075 5062 5076 5063 5077 \subsection{Hyperbolic} 5064 5078 5079 \leavevmode 5065 5080 \begin{lstlisting}[aboveskip=0pt,belowskip=0pt] 5066 5081 float sinh( float );§\indexc{sinh}§ … … 5106 5121 long double _Complex atanh( long double _Complex ); 5107 5122 \end{lstlisting} 5108 \5109 5123 5110 5124 5111 5125 \subsection{Error / Gamma} 5112 5126 5127 \leavevmode 5113 5128 \begin{lstlisting}[aboveskip=0pt,belowskip=0pt] 5114 5129 float erf( float );§\indexc{erf}§ … … 5137 5152 long double tgamma( long double ); 5138 5153 \end{lstlisting} 5139 \5140 5154 5141 5155 5142 5156 \subsection{Nearest Integer} 5143 5157 5158 \leavevmode 5144 5159 \begin{lstlisting}[aboveskip=0pt,belowskip=0pt] 5145 5160 float floor( float );§\indexc{floor}§ … … 5191 5206 long long int llround( long double ); 5192 5207 \end{lstlisting} 5193 \5194 5208 5195 5209 5196 5210 \subsection{Manipulation} 5197 5211 5212 \leavevmode 5198 5213 \begin{lstlisting}[aboveskip=0pt,belowskip=0pt] 5199 5214 float copysign( float, float );§\indexc{copysign}§ … … 5232 5247 long double scalbln( long double, long int ); 5233 5248 \end{lstlisting} 5234 \5235 5249 5236 5250 -
src/Parser/DeclarationNode.cc
r38736854 r6603c1d 10 10 // Created On : Sat May 16 12:34:05 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Aug 9 08:39:20201613 // Update Count : 1 6912 // Last Modified On : Sat Aug 13 18:56:58 2016 13 // Update Count : 171 14 14 // 15 15 … … 470 470 471 471 // there may be typedefs chained onto the type 472 if ( o->get_ link() ) {473 set_l ink( o->get_link()->clone() );472 if ( o->get_next() ) { 473 set_last( o->get_next()->clone() ); 474 474 } // if 475 475 } // if … … 757 757 DeclarationNode *DeclarationNode::appendList( DeclarationNode *node ) { 758 758 if ( node != 0 ) { 759 set_l ink( node );759 set_last( node ); 760 760 } // if 761 761 return this; … … 794 794 errors.append( e ); 795 795 } // try 796 cur = dynamic_cast<DeclarationNode *>( cur->get_ link() );796 cur = dynamic_cast<DeclarationNode *>( cur->get_next() ); 797 797 } // while 798 798 if ( ! errors.isEmpty() ) { … … 831 831 errors.append( e ); 832 832 } // try 833 cur = dynamic_cast< DeclarationNode *>( cur->get_ link() );833 cur = dynamic_cast< DeclarationNode *>( cur->get_next() ); 834 834 } // while 835 835 if ( ! errors.isEmpty() ) { … … 848 848 errors.append( e ); 849 849 } // try 850 cur = dynamic_cast< DeclarationNode *>( cur->get_ link() );850 cur = dynamic_cast< DeclarationNode *>( cur->get_next() ); 851 851 } // while 852 852 if ( ! errors.isEmpty() ) { -
src/Parser/ExpressionNode.cc
r38736854 r6603c1d 10 10 // Created On : Sat May 16 13:17:07 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Aug 10 11:07:38201613 // Update Count : 48 612 // Last Modified On : Thu Aug 11 20:24:36 2016 13 // Update Count : 487 14 14 // 15 15 … … 309 309 310 310 //############################################################################## 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 // else324 // 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 //##############################################################################364 311 365 312 Expression *build_typevalue( DeclarationNode *decl ) { -
src/Parser/InitializerNode.cc
r38736854 r6603c1d 10 10 // Created On : Sat May 16 13:20:24 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Jul 4 15:37:15201613 // Update Count : 1 512 // Last Modified On : Sat Aug 13 18:55:11 2016 13 // Update Count : 18 14 14 // 15 15 … … 25 25 : expr( _expr ), aggregate( aggrp ), designator( des ), kids( 0 ), maybeConstructed( true ) { 26 26 if ( aggrp ) 27 kids = dynamic_cast< InitializerNode *>( get_ link() );27 kids = dynamic_cast< InitializerNode *>( get_next() ); 28 28 29 29 if ( kids != 0 ) 30 set_l ink( 0 );30 set_last( 0 ); 31 31 } 32 32 … … 34 34 : expr( 0 ), aggregate( aggrp ), designator( des ), kids( 0 ), maybeConstructed( true ) { 35 35 if ( init != 0 ) 36 set_l ink(init);36 set_last( init ); 37 37 38 38 if ( aggrp ) 39 kids = dynamic_cast< InitializerNode *>( get_ link() );39 kids = dynamic_cast< InitializerNode *>( get_next() ); 40 40 41 41 if ( kids != 0 ) … … 58 58 while ( curdes != 0) { 59 59 curdes->printOneLine(os); 60 curdes = (ExpressionNode *)(curdes->get_ link());60 curdes = (ExpressionNode *)(curdes->get_next()); 61 61 if ( curdes ) os << ", "; 62 62 } // while … … 72 72 73 73 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) ) 75 75 moreInit->printOneLine( os ); 76 76 } -
src/Parser/ParseNode.cc
r38736854 r6603c1d 10 10 // Created On : Sat May 16 13:26:29 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : S un Aug 7 23:32:47201613 // Update Count : 9 412 // Last Modified On : Sat Aug 13 18:55:35 2016 13 // Update Count : 98 14 14 // 15 15 … … 31 31 ParseNode *current = this; 32 32 33 while ( current->get_link() != 0 ) 34 current = current->get_link(); 35 33 while ( current->get_next() != 0 ) 34 current = current->get_next(); 36 35 return current; 37 36 } 38 37 39 ParseNode *ParseNode::set_l ink( ParseNode *next_ ) {38 ParseNode *ParseNode::set_last( ParseNode *next_ ) { 40 39 if ( next_ != 0 ) get_last()->next = next_; 41 40 return this; … … 54 53 55 54 ParseNode &ParseNode::operator,( ParseNode &p ) { 56 set_link( &p ); 57 55 set_last( &p ); 58 56 return *this; 59 57 } -
src/Parser/ParseNode.h
r38736854 r6603c1d 10 10 // Created On : Sat May 16 13:28:16 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Aug 11 12:24:11201613 // Update Count : 4 4312 // Last Modified On : Sun Aug 14 16:29:20 2016 13 // Update Count : 483 14 14 // 15 15 … … 45 45 virtual ~ParseNode(); 46 46 47 ParseNode *get_link() const { return next; } 47 ParseNode *get_next() const { return next; } 48 ParseNode *set_next( ParseNode *newlink ) { next = newlink; return this; } 48 49 ParseNode *get_last(); 49 ParseNode *set_link( ParseNode * ); 50 void set_next( ParseNode *newlink ) { next = newlink; } 50 ParseNode *set_last( ParseNode * ); 51 51 52 52 virtual ParseNode *clone() const { return 0; }; … … 92 92 ExpressionNode *expr; 93 93 bool aggregate; 94 ExpressionNode *designator; 94 ExpressionNode *designator; // may be list 95 95 InitializerNode *kids; 96 96 bool maybeConstructed; … … 336 336 337 337 StatementNode(); 338 StatementNode( const std::string *name );339 StatementNode( Type t, ExpressionNode *control = 0, StatementNode *block = 0 );340 StatementNode( Type t, std::string *target );341 338 StatementNode( DeclarationNode *decl ); 342 343 339 ~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; }352 340 353 341 StatementNode::Type get_type() const { return type; } … … 357 345 358 346 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 365 348 virtual StatementNode *append_last_case( StatementNode * ); 366 349 367 v oid print( std::ostream &os, int indent = 0) const;350 virtual void print( std::ostream &os, int indent = 0) const {} 368 351 virtual StatementNode *clone() const; 369 352 virtual Statement *build() const; 370 p rivate:353 public: 371 354 static const char *StType[]; 372 355 Type type; 373 ExpressionNode *control;374 StatementNode *block;375 356 std::list<std::string> labels; 376 std::string *target; // target label for jump statements377 357 DeclarationNode *decl; 378 bool isCatchRest;379 358 }; // StatementNode 380 359 381 360 class StatementNode2 : public StatementNode { 382 361 public: 383 StatementNode2() { }362 StatementNode2() { stmt = nullptr; } 384 363 StatementNode2( Statement *stmt ) : stmt( stmt ) {} 364 StatementNode2( DeclarationNode *decl ); 385 365 virtual ~StatementNode2() {} 386 366 … … 392 372 return this; 393 373 } 374 virtual std::list<std::string> get_labels() const { assert( false ); return StatementNode::get_labels(); } 375 394 376 virtual StatementNode *append_last_case( StatementNode * ); 395 virtual std::list<std::string> get_labels() const { assert( false ); return StatementNode::get_labels(); }396 377 397 378 virtual void print( std::ostream &os, int indent = 0 ) {} … … 401 382 }; // StatementNode 402 383 384 Statement *build_expr( ExpressionNode *ctl ); 385 403 386 struct ForCtl { 404 387 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 ) {} 406 389 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 ) {} 408 391 409 392 StatementNode *init; … … 412 395 }; 413 396 414 Statement *build_expr( ExpressionNode *ctl );415 397 Statement *build_if( ExpressionNode *ctl, StatementNode *then_stmt, StatementNode *else_stmt ); 416 398 Statement *build_switch( ExpressionNode *ctl, StatementNode *stmt ); … … 423 405 Statement *build_return( ExpressionNode *ctl ); 424 406 Statement *build_throw( ExpressionNode *ctl ); 407 Statement *build_try( StatementNode *try_stmt, StatementNode *catch_stmt, StatementNode *finally_stmt ); 408 Statement *build_catch( DeclarationNode *decl, StatementNode *stmt, bool catchAny = false ); 409 Statement *build_finally( StatementNode *stmt ); 425 410 426 411 //############################################################################## … … 429 414 public: 430 415 CompoundStmtNode(); 431 CompoundStmtNode( const std::string * );432 416 CompoundStmtNode( StatementNode * ); 433 417 ~CompoundStmtNode(); … … 445 429 class AsmStmtNode : public StatementNode { 446 430 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 ); 448 432 ~AsmStmtNode(); 449 433 450 void print( std::ostream &os, int indent = 0 ) const ;434 void print( std::ostream &os, int indent = 0 ) const {} 451 435 Statement *build() const; 452 436 private: … … 477 461 errors.append( e ); 478 462 } // try 479 cur = dynamic_cast< NodeType *>( cur->get_ link() );463 cur = dynamic_cast< NodeType *>( cur->get_next() ); 480 464 } // while 481 465 if ( ! errors.isEmpty() ) { -
src/Parser/StatementNode.cc
r38736854 r6603c1d 10 10 // Created On : Sat May 16 14:59:41 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Aug 11 16:19:45201613 // Update Count : 2 1012 // Last Modified On : Sun Aug 14 13:10:54 2016 13 // Update Count : 288 14 14 // 15 15 … … 34 34 }; 35 35 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 ) { 36 StatementNode::StatementNode() : ParseNode(), labels( 0 ), decl( 0 ) {} 37 38 StatementNode::StatementNode( DeclarationNode *decl ) : type( Decl ), labels( 0 ) { 39 assert( false ); 41 40 if ( decl ) { 42 41 if ( DeclarationNode *agg = decl->extractAggregate() ) { … … 46 45 nextStmt->decl = decl; 47 46 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() ) ) ); 50 49 decl->set_next( 0 ); 51 50 } // if 52 51 } 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() ) ); 55 54 decl->set_next( 0 ); 56 55 } // if … … 60 59 } 61 60 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 ) {} 61 StatementNode2::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 } 67 85 68 86 StatementNode::~StatementNode() { 69 delete control;70 delete block;71 delete target;72 87 delete decl; 73 88 } 74 89 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 90 90 StatementNode * 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; 99 93 } 100 94 … … 107 101 } 108 102 109 StatementNode *StatementNode::append_block( StatementNode *stmt ) {110 if ( stmt != 0 ) {111 if ( block == 0 )112 block = stmt;113 else114 block->set_link( stmt );115 } // if116 return this;117 }118 119 103 StatementNode *StatementNode::append_last_case( StatementNode *stmt ) { 120 104 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 else126 if ( block == 0 )127 block = stmt;128 else129 block->set_link( stmt );130 } // if131 105 return this; 132 106 } … … 134 108 StatementNode *StatementNode2::append_last_case( StatementNode *stmt ) { 135 109 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() ) { 137 112 StatementNode2 *node = dynamic_cast<StatementNode2 *>(curr); 138 113 assert( node ); … … 140 115 prev = curr; 141 116 } // for 117 // conver from StatementNode list to Statement list 142 118 StatementNode2 *node = dynamic_cast<StatementNode2 *>(prev); 143 119 std::list<Statement *> stmts; 144 120 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); 147 123 caseStmt->get_statements().splice( caseStmt->get_statements().end(), stmts ); 148 124 return this; 149 125 } 150 126 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 127 Statement *StatementNode::build() const { 161 128 switch ( type ) { 162 129 case Decl: 163 decl->print( os, indent);164 break;130 return new DeclStmt( noLabels, maybeBuild< Declaration >( decl ) ); 131 assert( false ); 165 132 case Exp: 166 if ( control ) {167 os << string( indent, ' ' );168 control->print( os, indent );169 os << endl;170 } else171 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 here183 } // if184 } // if185 if ( control ) {186 os << string( indent + ParseNode::indent_by, ' ' ) << "Control: " << endl;187 control->printList( os, indent + 2 * ParseNode::indent_by );188 } // if189 if ( block ) {190 os << string( indent + ParseNode::indent_by, ' ' ) << "Cases: " << endl;191 block->printList( os, indent + 2 * ParseNode::indent_by );192 } // if193 if ( target ) {194 os << string( indent + ParseNode::indent_by, ' ' ) << "Target: " << get_target() << endl;195 } // if196 break;197 } // switch198 }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 } // if209 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 else223 return new NullStmt( labs );224 }225 assert( false );226 133 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 // } // if237 // return new IfStmt( labs, notZeroExpr( maybeBuild<Expression>(get_control()) ), thenb, elseb );238 // }239 assert( false );240 134 case Switch: 241 // return new SwitchStmt( labs, maybeBuild<Expression>(get_control()), branches );242 assert( false );243 135 case Case: 244 //return new CaseStmt( labs, maybeBuild<Expression>(get_control() ), branches );245 assert( false );246 136 case Default: 247 //return new CaseStmt( labs, 0, branches, true );248 assert( false );249 137 case While: 250 // assert( branches.size() == 1 );251 // return new WhileStmt( labs, notZeroExpr( maybeBuild<Expression>(get_control()) ), branches.front() );252 assert( false );253 138 case Do: 254 // assert( branches.size() == 1 );255 // return new WhileStmt( labs, notZeroExpr( maybeBuild<Expression>(get_control()) ), branches.front(), true );256 assert( false );257 139 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 // } // if268 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 );280 140 case Goto: 281 // {282 // if ( get_target() == "" ) { // computed goto283 // assert( get_control() != 0 );284 // return new BranchStmt( labs, maybeBuild<Expression>(get_control()), BranchStmt::Goto );285 // } // if286 287 // return new BranchStmt( labs, get_target(), BranchStmt::Goto );288 // }289 assert( false );290 141 case Break: 291 // return new BranchStmt( labs, get_target(), BranchStmt::Break );292 assert( false );293 142 case Continue: 294 // return new BranchStmt( labs, get_target(), BranchStmt::Continue );295 assert( false );296 143 case Return: 297 144 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: 303 150 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 } // if313 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 here333 151 return 0; 334 152 } // switch … … 422 240 } 423 241 242 Statement *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 } 250 Statement *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 } 256 Statement *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 424 263 425 264 CompoundStmtNode::CompoundStmtNode() : first( 0 ), last( 0 ) {} 426 427 CompoundStmtNode::CompoundStmtNode( const string *name_ ) : StatementNode( name_ ), first( 0 ), last( 0 ) {}428 265 429 266 CompoundStmtNode::CompoundStmtNode( StatementNode *stmt ) : first( stmt ) { … … 441 278 void CompoundStmtNode::add_statement( StatementNode *stmt ) { 442 279 if ( stmt != 0 ) { 443 last->set_l ink( stmt );444 last = ( StatementNode *)( stmt->get_ link());280 last->set_last( stmt ); 281 last = ( StatementNode *)( stmt->get_next()); 445 282 } // if 446 283 } … … 467 304 468 305 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 ) { 306 AsmStmtNode::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; 471 309 if ( gotolabels ) { 472 310 this->gotolabels = gotolabels->get_labels(); … … 477 315 AsmStmtNode::~AsmStmtNode() { 478 316 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 labels483 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 } // if488 if ( output ) {489 os << string( indent + ParseNode::indent_by, ' ' ) << "Output:" << endl;490 output->printList( os, indent + 2 * ParseNode::indent_by );491 } // if492 if ( input ) {493 os << string( indent + ParseNode::indent_by, ' ' ) << "Input:" << endl;494 input->printList( os, indent + 2 * ParseNode::indent_by );495 } // if496 if ( clobber ) {497 os << string( indent + ParseNode::indent_by, ' ' ) << "Clobber:" << endl;498 // clobber->printList( os, indent + 2 * ParseNode::indent_by );499 } // if500 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 } // if511 317 } 512 318 … … 528 334 } 529 335 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 530 353 // Local Variables: // 531 354 // tab-width: 4 // -
src/Parser/TypeData.cc
r38736854 r6603c1d 10 10 // Created On : Sat May 16 15:12:51 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : S un Aug 7 07:51:48201613 // Update Count : 5 812 // Last Modified On : Sat Aug 13 18:38:41 2016 13 // Update Count : 59 14 14 // 15 15 … … 495 495 decl = new FunctionDecl( name, sc, linkage, buildFunction(), 0, isInline, isNoreturn ); 496 496 } // 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() ) ) { 498 498 if ( cur->get_name() != "" ) { 499 499 decl->get_oldIdents().insert( decl->get_oldIdents().end(), cur->get_name() ); … … 909 909 buildList( enumeration->constants, ret->get_members() ); 910 910 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 ) { 912 912 if ( cur->get_enumeratorValue() != NULL ) { 913 913 ObjectDecl *member = dynamic_cast<ObjectDecl *>(*members); -
src/Parser/parser.cc
r38736854 r6603c1d 1020 1020 static const yytype_uint16 yyrline[] = 1021 1021 { 1022 0, 29 9, 299, 305, 314, 315, 316, 320, 321, 322,1023 32 6, 327, 331, 332, 336, 337, 341, 342, 353, 355,1024 35 7, 359, 364, 365, 371, 375, 377, 378, 380, 381,1025 38 3, 385, 387, 396, 397, 403, 404, 408, 409, 413,1026 41 7, 419, 421, 423, 428, 431, 433, 435, 440, 453,1027 45 5, 457, 459, 461, 463, 465, 467, 469, 471, 473,1028 4 80, 481, 487, 488, 489, 490, 494, 495, 497, 502,1029 50 3, 505, 507, 512, 513, 515, 520, 521, 523, 528,1030 52 9, 531, 533, 535, 540, 541, 543, 548, 549, 554,1031 55 5, 560, 561, 566, 567, 572, 573, 578, 579, 582,1032 58 4, 589, 594, 595, 597, 603, 604, 608, 609, 610,1033 61 1, 612, 613, 614, 615, 616, 617, 618, 624, 626,1034 62 8, 630, 635, 636, 641, 642, 648, 649, 655, 656,1035 65 7, 658, 659, 660, 661, 662, 663, 673, 680, 682,1036 69 2, 693, 698, 700, 706, 708, 712, 713, 718, 723,1037 72 6, 728, 730, 740, 742, 753, 754, 756, 761, 763,1038 76 7, 768, 773, 774, 778, 783, 784, 788, 790, 796,1039 79 7, 801, 803, 805, 807, 813, 814, 818, 820, 825,1040 82 7, 829, 834, 836, 841, 843, 847, 850, 854, 857,1041 8 61, 863, 865, 867, 872, 874, 876, 885, 887, 889,1042 8 91, 893, 898, 900, 902, 904, 909, 922, 923, 928,1043 9 30, 935, 939, 941, 943, 945, 947, 953, 954, 960,1044 9 61, 965, 966, 971, 973, 979, 980, 982, 987, 989,1045 9 96, 998, 1002, 1003, 1008, 1010, 1014, 1015, 1019, 1021,1046 10 25, 1026, 1030, 1031, 1035, 1036, 1051, 1052, 1053, 1054,1047 10 55, 1059, 1064, 1071, 1081, 1086, 1091, 1099, 1104, 1109,1048 11 14, 1119, 1127, 1149, 1154, 1161, 1163, 1170, 1175, 1180,1049 11 91, 1196, 1201, 1206, 1211, 1220, 1225, 1233, 1234, 1235,1050 12 36, 1242, 1247, 1255, 1256, 1257, 1258, 1262, 1263, 1264,1051 12 65, 1270, 1271, 1280, 1281, 1286, 1287, 1292, 1294, 1296,1052 129 8, 1300, 1303, 1302, 1314, 1315, 1317, 1327, 1328, 1333,1053 133 7, 1339, 1341, 1343, 1345, 1347, 1349, 1351, 1356, 1358,1054 13 60, 1362, 1364, 1366, 1368, 1370, 1372, 1374, 1376, 1378,1055 13 80, 1386, 1387, 1389, 1391, 1393, 1398, 1399, 1405, 1406,1056 140 8, 1410, 1415, 1417, 1419, 1421, 1426, 1427, 1429, 1431,1057 14 36, 1437, 1439, 1444, 1445, 1447, 1449, 1454, 1456, 1458,1058 14 63, 1464, 1468, 1470, 1476, 1475, 1479, 1481, 1486, 1488,1059 14 94, 1495, 1500, 1501, 1503, 1504, 1513, 1514, 1516, 1518,1060 15 23, 1525, 1531, 1532, 1534, 1537, 1540, 1545, 1546, 1551,1061 15 56, 1560, 1562, 1568, 1567, 1574, 1576, 1582, 1583, 1591,1062 15 92, 1596, 1597, 1598, 1600, 1602, 1609, 1610, 1612, 1614,1063 161 9, 1620, 1626, 1627, 1631, 1632, 1637, 1638, 1639, 1641,1064 164 9, 1650, 1652, 1655, 1657, 1661, 1662, 1663, 1665, 1667,1065 16 71, 1676, 1684, 1685, 1694, 1696, 1701, 1702, 1703, 1707,1066 170 8, 1709, 1713, 1714, 1715, 1719, 1720, 1721, 1726, 1727,1067 172 8, 1729, 1735, 1736, 1738, 1743, 1744, 1749, 1750, 1751,1068 17 52, 1753, 1768, 1769, 1774, 1775, 1781, 1783, 1786, 1788,1069 17 90, 1813, 1814, 1816, 1818, 1823, 1824, 1826, 1831, 1836,1070 183 7, 1843, 1842, 1846, 1850, 1852, 1854, 1860, 1861, 1866,1071 18 71, 1873, 1878, 1880, 1881, 1883, 1888, 1890, 1892, 1897,1072 189 9, 1904, 1909, 1917, 1923, 1922, 1936, 1937, 1942, 1943,1073 194 7, 1952, 1957, 1965, 1970, 1981, 1982, 1993, 1994, 2000,1074 2001, 2005, 2006, 2007, 2010, 2009, 2020, 2029, 2035, 2041,1075 20 50, 2056, 2062, 2068, 2074, 2082, 2088, 2096, 2102, 2111,1076 21 12, 2113, 2117, 2121, 2123, 2128, 2129, 2133, 2134, 2139,1077 21 45, 2146, 2149, 2151, 2152, 2156, 2157, 2158, 2159, 2193,1078 21 95, 2196, 2198, 2203, 2208, 2213, 2215, 2217, 2222, 2224,1079 22 26, 2228, 2233, 2235, 2244, 2246, 2247, 2252, 2254, 2256,1080 22 61, 2263, 2265, 2270, 2272, 2274, 2283, 2284, 2285, 2289,1081 22 91, 2293, 2298, 2300, 2302, 2307, 2309, 2311, 2326, 2328,1082 232 9, 2331, 2336, 2337, 2342, 2344, 2346, 2351, 2353, 2355,1083 235 7, 2362, 2364, 2366, 2376, 2378, 2379, 2381, 2386, 2388,1084 23 90, 2395, 2397, 2399, 2401, 2406, 2408, 2410, 2441, 2443,1085 24 44, 2446, 2451, 2456, 2464, 2466, 2468, 2473, 2475, 2480,1086 24 82, 2496, 2497, 2499, 2504, 2506, 2508, 2510, 2512, 2517,1087 251 8, 2520, 2522, 2527, 2529, 2531, 2537, 2539, 2541, 2545,1088 254 7, 2549, 2551, 2565, 2566, 2568, 2573, 2575, 2577, 2579,1089 25 81, 2586, 2587, 2589, 2591, 2596, 2598, 2600, 2606, 2607,1090 260 9, 2618, 2621, 2623, 2626, 2628, 2630, 2643, 2644, 2646,1091 26 51, 2653, 2655, 2657, 2659, 2664, 2665, 2667, 2669, 2674,1092 26 76, 2684, 2685, 2686, 2691, 2692, 2696, 2698, 2700, 2702,1093 2 704, 2706, 2713, 2715, 2717, 2719, 2721, 2723, 2725, 2727,1094 272 9, 2731, 2736, 2738, 2740, 2745, 2771, 2772, 2774, 2778,1095 277 9, 2783, 2785, 2787, 2789, 2791, 2793, 2800, 2802, 2804,1096 2 806, 2808, 2810, 2815, 2820, 2822, 2824, 2842, 2844, 2849,1097 28 501022 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 1098 1098 }; 1099 1099 #endif … … 4960 4960 4961 4961 /* Line 1806 of yacc.c */ 4962 #line 29 9"parser.yy"4962 #line 298 "parser.yy" 4963 4963 { 4964 4964 typedefTable.enterScope(); … … 4969 4969 4970 4970 /* Line 1806 of yacc.c */ 4971 #line 30 5"parser.yy"4971 #line 304 "parser.yy" 4972 4972 { 4973 4973 typedefTable.leaveScope(); … … 4978 4978 4979 4979 /* 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 */ 4980 4987 #line 314 "parser.yy" 4981 { (yyval.en) = new ExpressionNode( build_constant Integer( *(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: 4985 4992 4986 4993 /* Line 1806 of yacc.c */ 4987 4994 #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"4995 4995 { (yyval.en) = new ExpressionNode( build_constantChar( *(yyvsp[(1) - (1)].tok) ) ); } 4996 4996 break; … … 4999 4999 5000 5000 /* Line 1806 of yacc.c */ 5001 #line 34 1"parser.yy"5001 #line 340 "parser.yy" 5002 5002 { (yyval.constant) = build_constantStr( *(yyvsp[(1) - (1)].tok) ); } 5003 5003 break; … … 5006 5006 5007 5007 /* Line 1806 of yacc.c */ 5008 #line 34 3"parser.yy"5008 #line 342 "parser.yy" 5009 5009 { 5010 5010 appendStr( (yyvsp[(1) - (2)].constant)->get_constant()->get_value(), (yyvsp[(2) - (2)].tok) ); … … 5017 5017 5018 5018 /* Line 1806 of yacc.c */ 5019 #line 35 4"parser.yy"5019 #line 353 "parser.yy" 5020 5020 { (yyval.en) = new ExpressionNode( build_varref( (yyvsp[(1) - (1)].tok) ) ); } 5021 5021 break; … … 5024 5024 5025 5025 /* Line 1806 of yacc.c */ 5026 #line 35 6"parser.yy"5026 #line 355 "parser.yy" 5027 5027 { (yyval.en) = new ExpressionNode( build_varref( (yyvsp[(1) - (1)].tok) ) ); } 5028 5028 break; … … 5031 5031 5032 5032 /* Line 1806 of yacc.c */ 5033 #line 35 8"parser.yy"5033 #line 357 "parser.yy" 5034 5034 { (yyval.en) = (yyvsp[(2) - (3)].en); } 5035 5035 break; … … 5038 5038 5039 5039 /* Line 1806 of yacc.c */ 5040 #line 3 60"parser.yy"5040 #line 359 "parser.yy" 5041 5041 { (yyval.en) = new ExpressionNode( build_valexpr( (yyvsp[(2) - (3)].sn) ) ); } 5042 5042 break; … … 5045 5045 5046 5046 /* Line 1806 of yacc.c */ 5047 #line 3 70"parser.yy"5047 #line 369 "parser.yy" 5048 5048 { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::Index, (yyvsp[(1) - (6)].en), (yyvsp[(4) - (6)].en) ) ); } 5049 5049 break; … … 5052 5052 5053 5053 /* Line 1806 of yacc.c */ 5054 #line 37 2"parser.yy"5054 #line 371 "parser.yy" 5055 5055 { (yyval.en) = new ExpressionNode( build_func( (yyvsp[(1) - (4)].en), (yyvsp[(3) - (4)].en) ) ); } 5056 5056 break; … … 5059 5059 5060 5060 /* Line 1806 of yacc.c */ 5061 #line 37 6"parser.yy"5061 #line 375 "parser.yy" 5062 5062 { (yyval.en) = new ExpressionNode( build_fieldSel( (yyvsp[(1) - (3)].en), build_varref( (yyvsp[(3) - (3)].tok) ) ) ); } 5063 5063 break; … … 5066 5066 5067 5067 /* Line 1806 of yacc.c */ 5068 #line 37 9"parser.yy"5068 #line 378 "parser.yy" 5069 5069 { (yyval.en) = new ExpressionNode( build_pfieldSel( (yyvsp[(1) - (3)].en), build_varref( (yyvsp[(3) - (3)].tok) ) ) ); } 5070 5070 break; … … 5073 5073 5074 5074 /* Line 1806 of yacc.c */ 5075 #line 38 2"parser.yy"5075 #line 381 "parser.yy" 5076 5076 { (yyval.en) = new ExpressionNode( build_unary_ptr( OperKinds::IncrPost, (yyvsp[(1) - (2)].en) ) ); } 5077 5077 break; … … 5080 5080 5081 5081 /* Line 1806 of yacc.c */ 5082 #line 38 4"parser.yy"5082 #line 383 "parser.yy" 5083 5083 { (yyval.en) = new ExpressionNode( build_unary_ptr( OperKinds::DecrPost, (yyvsp[(1) - (2)].en) ) ); } 5084 5084 break; … … 5087 5087 5088 5088 /* Line 1806 of yacc.c */ 5089 #line 38 6"parser.yy"5089 #line 385 "parser.yy" 5090 5090 { (yyval.en) = new ExpressionNode( build_compoundLiteral( (yyvsp[(2) - (7)].decl), new InitializerNode( (yyvsp[(5) - (7)].in), true ) ) ); } 5091 5091 break; … … 5094 5094 5095 5095 /* Line 1806 of yacc.c */ 5096 #line 38 8"parser.yy"5096 #line 387 "parser.yy" 5097 5097 { 5098 5098 Token fn; 5099 5099 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_l ink( (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) ) ) ); 5101 5101 } 5102 5102 break; … … 5105 5105 5106 5106 /* Line 1806 of yacc.c */ 5107 #line 39 8"parser.yy"5108 { (yyval.en) = (ExpressionNode *)( (yyvsp[(1) - (3)].en)->set_l ink( (yyvsp[(3) - (3)].en) )); }5107 #line 397 "parser.yy" 5108 { (yyval.en) = (ExpressionNode *)( (yyvsp[(1) - (3)].en)->set_last( (yyvsp[(3) - (3)].en) )); } 5109 5109 break; 5110 5110 … … 5112 5112 5113 5113 /* Line 1806 of yacc.c */ 5114 #line 40 3"parser.yy"5114 #line 402 "parser.yy" 5115 5115 { (yyval.en) = 0; } 5116 5116 break; … … 5119 5119 5120 5120 /* Line 1806 of yacc.c */ 5121 #line 40 9"parser.yy"5122 { (yyval.en) = (ExpressionNode *)(yyvsp[(1) - (3)].en)->set_l ink( (yyvsp[(3) - (3)].en) ); }5121 #line 408 "parser.yy" 5122 { (yyval.en) = (ExpressionNode *)(yyvsp[(1) - (3)].en)->set_last( (yyvsp[(3) - (3)].en) ); } 5123 5123 break; 5124 5124 … … 5126 5126 5127 5127 /* Line 1806 of yacc.c */ 5128 #line 41 4"parser.yy"5128 #line 413 "parser.yy" 5129 5129 { (yyval.en) = new ExpressionNode( build_varref( (yyvsp[(1) - (1)].tok) ) ); } 5130 5130 break; … … 5133 5133 5134 5134 /* Line 1806 of yacc.c */ 5135 #line 41 8"parser.yy"5135 #line 417 "parser.yy" 5136 5136 { (yyval.en) = new ExpressionNode( build_fieldSel( (yyvsp[(3) - (3)].en), build_varref( (yyvsp[(1) - (3)].tok) ) ) ); } 5137 5137 break; … … 5140 5140 5141 5141 /* Line 1806 of yacc.c */ 5142 #line 4 20"parser.yy"5142 #line 419 "parser.yy" 5143 5143 { (yyval.en) = new ExpressionNode( build_fieldSel( (yyvsp[(5) - (7)].en), build_varref( (yyvsp[(1) - (7)].tok) ) ) ); } 5144 5144 break; … … 5147 5147 5148 5148 /* Line 1806 of yacc.c */ 5149 #line 42 2"parser.yy"5149 #line 421 "parser.yy" 5150 5150 { (yyval.en) = new ExpressionNode( build_pfieldSel( (yyvsp[(3) - (3)].en), build_varref( (yyvsp[(1) - (3)].tok) ) ) ); } 5151 5151 break; … … 5154 5154 5155 5155 /* Line 1806 of yacc.c */ 5156 #line 42 4"parser.yy"5156 #line 423 "parser.yy" 5157 5157 { (yyval.en) = new ExpressionNode( build_pfieldSel( (yyvsp[(5) - (7)].en), build_varref( (yyvsp[(1) - (7)].tok) ) ) ); } 5158 5158 break; … … 5161 5161 5162 5162 /* Line 1806 of yacc.c */ 5163 #line 43 2"parser.yy"5163 #line 431 "parser.yy" 5164 5164 { (yyval.en) = (yyvsp[(1) - (1)].en); } 5165 5165 break; … … 5168 5168 5169 5169 /* Line 1806 of yacc.c */ 5170 #line 43 4"parser.yy"5170 #line 433 "parser.yy" 5171 5171 { (yyval.en) = new ExpressionNode( (yyvsp[(1) - (1)].constant) ); } 5172 5172 break; … … 5175 5175 5176 5176 /* Line 1806 of yacc.c */ 5177 #line 43 6"parser.yy"5177 #line 435 "parser.yy" 5178 5178 { (yyval.en) = (yyvsp[(2) - (2)].en)->set_extension( true ); } 5179 5179 break; … … 5182 5182 5183 5183 /* Line 1806 of yacc.c */ 5184 #line 44 1"parser.yy"5184 #line 440 "parser.yy" 5185 5185 { 5186 5186 switch ( (yyvsp[(1) - (2)].op) ) { … … 5200 5200 5201 5201 /* Line 1806 of yacc.c */ 5202 #line 45 4"parser.yy"5202 #line 453 "parser.yy" 5203 5203 { (yyval.en) = new ExpressionNode( build_unary_val( (yyvsp[(1) - (2)].op), (yyvsp[(2) - (2)].en) ) ); } 5204 5204 break; … … 5207 5207 5208 5208 /* Line 1806 of yacc.c */ 5209 #line 45 6"parser.yy"5209 #line 455 "parser.yy" 5210 5210 { (yyval.en) = new ExpressionNode( build_unary_ptr( OperKinds::Incr, (yyvsp[(2) - (2)].en) ) ); } 5211 5211 break; … … 5214 5214 5215 5215 /* Line 1806 of yacc.c */ 5216 #line 45 8"parser.yy"5216 #line 457 "parser.yy" 5217 5217 { (yyval.en) = new ExpressionNode( build_unary_ptr( OperKinds::Decr, (yyvsp[(2) - (2)].en) ) ); } 5218 5218 break; … … 5221 5221 5222 5222 /* Line 1806 of yacc.c */ 5223 #line 4 60"parser.yy"5223 #line 459 "parser.yy" 5224 5224 { (yyval.en) = new ExpressionNode( build_sizeOfexpr( (yyvsp[(2) - (2)].en) ) ); } 5225 5225 break; … … 5228 5228 5229 5229 /* Line 1806 of yacc.c */ 5230 #line 46 2"parser.yy"5230 #line 461 "parser.yy" 5231 5231 { (yyval.en) = new ExpressionNode( build_sizeOftype( (yyvsp[(3) - (4)].decl) ) ); } 5232 5232 break; … … 5235 5235 5236 5236 /* Line 1806 of yacc.c */ 5237 #line 46 4"parser.yy"5237 #line 463 "parser.yy" 5238 5238 { (yyval.en) = new ExpressionNode( build_alignOfexpr( (yyvsp[(2) - (2)].en) ) ); } 5239 5239 break; … … 5242 5242 5243 5243 /* Line 1806 of yacc.c */ 5244 #line 46 6"parser.yy"5244 #line 465 "parser.yy" 5245 5245 { (yyval.en) = new ExpressionNode( build_alignOftype( (yyvsp[(3) - (4)].decl) ) ); } 5246 5246 break; … … 5249 5249 5250 5250 /* Line 1806 of yacc.c */ 5251 #line 46 8"parser.yy"5251 #line 467 "parser.yy" 5252 5252 { (yyval.en) = new ExpressionNode( build_offsetOf( (yyvsp[(3) - (6)].decl), build_varref( (yyvsp[(5) - (6)].tok) ) ) ); } 5253 5253 break; … … 5256 5256 5257 5257 /* Line 1806 of yacc.c */ 5258 #line 4 70"parser.yy"5258 #line 469 "parser.yy" 5259 5259 { (yyval.en) = new ExpressionNode( build_attrexpr( build_varref( (yyvsp[(1) - (1)].tok) ), nullptr ) ); } 5260 5260 break; … … 5263 5263 5264 5264 /* Line 1806 of yacc.c */ 5265 #line 47 2"parser.yy"5265 #line 471 "parser.yy" 5266 5266 { (yyval.en) = new ExpressionNode( build_attrexpr( build_varref( (yyvsp[(1) - (4)].tok) ), (yyvsp[(3) - (4)].en) ) ); } 5267 5267 break; … … 5270 5270 5271 5271 /* Line 1806 of yacc.c */ 5272 #line 47 4"parser.yy"5272 #line 473 "parser.yy" 5273 5273 { (yyval.en) = new ExpressionNode( build_attrtype( build_varref( (yyvsp[(1) - (4)].tok) ), (yyvsp[(3) - (4)].decl) ) ); } 5274 5274 break; … … 5277 5277 5278 5278 /* 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 */ 5279 5286 #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"5287 5287 { (yyval.op) = OperKinds::AddressOf; } 5288 5288 break; … … 5291 5291 5292 5292 /* 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 */ 5293 5300 #line 487 "parser.yy" 5294 { (yyval.op) = OperKinds::Un Plus; }5295 break; 5296 5297 case 6 3:5301 { (yyval.op) = OperKinds::UnMinus; } 5302 break; 5303 5304 case 64: 5298 5305 5299 5306 /* Line 1806 of yacc.c */ 5300 5307 #line 488 "parser.yy" 5301 { (yyval.op) = OperKinds:: UnMinus; }5302 break; 5303 5304 case 6 4:5308 { (yyval.op) = OperKinds::Neg; } 5309 break; 5310 5311 case 65: 5305 5312 5306 5313 /* Line 1806 of yacc.c */ 5307 5314 #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"5315 5315 { (yyval.op) = OperKinds::BitNeg; } 5316 5316 break; … … 5319 5319 5320 5320 /* Line 1806 of yacc.c */ 5321 #line 49 6"parser.yy"5321 #line 495 "parser.yy" 5322 5322 { (yyval.en) = new ExpressionNode( build_cast( (yyvsp[(2) - (4)].decl), (yyvsp[(4) - (4)].en) ) ); } 5323 5323 break; … … 5326 5326 5327 5327 /* Line 1806 of yacc.c */ 5328 #line 49 8"parser.yy"5328 #line 497 "parser.yy" 5329 5329 { (yyval.en) = new ExpressionNode( build_cast( (yyvsp[(2) - (4)].decl), (yyvsp[(4) - (4)].en) ) ); } 5330 5330 break; … … 5333 5333 5334 5334 /* Line 1806 of yacc.c */ 5335 #line 50 4"parser.yy"5335 #line 503 "parser.yy" 5336 5336 { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::Mul, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); } 5337 5337 break; … … 5340 5340 5341 5341 /* Line 1806 of yacc.c */ 5342 #line 50 6"parser.yy"5342 #line 505 "parser.yy" 5343 5343 { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::Div, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); } 5344 5344 break; … … 5347 5347 5348 5348 /* Line 1806 of yacc.c */ 5349 #line 50 8"parser.yy"5349 #line 507 "parser.yy" 5350 5350 { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::Mod, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); } 5351 5351 break; … … 5354 5354 5355 5355 /* Line 1806 of yacc.c */ 5356 #line 51 4"parser.yy"5356 #line 513 "parser.yy" 5357 5357 { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::Plus, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); } 5358 5358 break; … … 5361 5361 5362 5362 /* Line 1806 of yacc.c */ 5363 #line 51 6"parser.yy"5363 #line 515 "parser.yy" 5364 5364 { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::Minus, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); } 5365 5365 break; … … 5368 5368 5369 5369 /* Line 1806 of yacc.c */ 5370 #line 52 2"parser.yy"5370 #line 521 "parser.yy" 5371 5371 { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::LShift, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); } 5372 5372 break; … … 5375 5375 5376 5376 /* Line 1806 of yacc.c */ 5377 #line 52 4"parser.yy"5377 #line 523 "parser.yy" 5378 5378 { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::RShift, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); } 5379 5379 break; … … 5382 5382 5383 5383 /* Line 1806 of yacc.c */ 5384 #line 5 30"parser.yy"5384 #line 529 "parser.yy" 5385 5385 { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::LThan, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); } 5386 5386 break; … … 5389 5389 5390 5390 /* Line 1806 of yacc.c */ 5391 #line 53 2"parser.yy"5391 #line 531 "parser.yy" 5392 5392 { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::GThan, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); } 5393 5393 break; … … 5396 5396 5397 5397 /* Line 1806 of yacc.c */ 5398 #line 53 4"parser.yy"5398 #line 533 "parser.yy" 5399 5399 { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::LEThan, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); } 5400 5400 break; … … 5403 5403 5404 5404 /* Line 1806 of yacc.c */ 5405 #line 53 6"parser.yy"5405 #line 535 "parser.yy" 5406 5406 { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::GEThan, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); } 5407 5407 break; … … 5410 5410 5411 5411 /* Line 1806 of yacc.c */ 5412 #line 54 2"parser.yy"5412 #line 541 "parser.yy" 5413 5413 { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::Eq, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); } 5414 5414 break; … … 5417 5417 5418 5418 /* Line 1806 of yacc.c */ 5419 #line 54 4"parser.yy"5419 #line 543 "parser.yy" 5420 5420 { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::Neq, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); } 5421 5421 break; … … 5424 5424 5425 5425 /* Line 1806 of yacc.c */ 5426 #line 5 50"parser.yy"5426 #line 549 "parser.yy" 5427 5427 { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::BitAnd, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); } 5428 5428 break; … … 5431 5431 5432 5432 /* Line 1806 of yacc.c */ 5433 #line 55 6"parser.yy"5433 #line 555 "parser.yy" 5434 5434 { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::Xor, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); } 5435 5435 break; … … 5438 5438 5439 5439 /* Line 1806 of yacc.c */ 5440 #line 56 2"parser.yy"5440 #line 561 "parser.yy" 5441 5441 { (yyval.en) = new ExpressionNode( build_binary_val( OperKinds::BitOr, (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); } 5442 5442 break; … … 5445 5445 5446 5446 /* Line 1806 of yacc.c */ 5447 #line 56 8"parser.yy"5447 #line 567 "parser.yy" 5448 5448 { (yyval.en) = new ExpressionNode( build_and_or( (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en), true ) ); } 5449 5449 break; … … 5452 5452 5453 5453 /* Line 1806 of yacc.c */ 5454 #line 57 4"parser.yy"5454 #line 573 "parser.yy" 5455 5455 { (yyval.en) = new ExpressionNode( build_and_or( (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en), false ) ); } 5456 5456 break; … … 5459 5459 5460 5460 /* Line 1806 of yacc.c */ 5461 #line 5 80"parser.yy"5461 #line 579 "parser.yy" 5462 5462 { (yyval.en) = new ExpressionNode( build_cond( (yyvsp[(1) - (5)].en), (yyvsp[(3) - (5)].en), (yyvsp[(5) - (5)].en) ) ); } 5463 5463 break; … … 5466 5466 5467 5467 /* Line 1806 of yacc.c */ 5468 #line 58 3"parser.yy"5468 #line 582 "parser.yy" 5469 5469 { (yyval.en) = new ExpressionNode( build_cond( (yyvsp[(1) - (4)].en), (yyvsp[(1) - (4)].en), (yyvsp[(4) - (4)].en) ) ); } 5470 5470 break; … … 5473 5473 5474 5474 /* Line 1806 of yacc.c */ 5475 #line 58 5"parser.yy"5475 #line 584 "parser.yy" 5476 5476 { (yyval.en) = new ExpressionNode( build_cond( (yyvsp[(1) - (5)].en), (yyvsp[(3) - (5)].en), (yyvsp[(5) - (5)].en) ) ); } 5477 5477 break; … … 5480 5480 5481 5481 /* Line 1806 of yacc.c */ 5482 #line 59 6"parser.yy"5482 #line 595 "parser.yy" 5483 5483 { (yyval.en) = new ExpressionNode( build_binary_ptr( (yyvsp[(2) - (3)].op), (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); } 5484 5484 break; … … 5487 5487 5488 5488 /* Line 1806 of yacc.c */ 5489 #line 59 8"parser.yy"5489 #line 597 "parser.yy" 5490 5490 { (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) ) ); } 5491 5491 break; … … 5494 5494 5495 5495 /* Line 1806 of yacc.c */ 5496 #line 60 3"parser.yy"5496 #line 602 "parser.yy" 5497 5497 { (yyval.en) = nullptr; } 5498 5498 break; … … 5501 5501 5502 5502 /* 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 */ 5503 5510 #line 608 "parser.yy" 5504 { (yyval.op) = OperKinds:: Assign; }5505 break; 5506 5507 case 10 8:5511 { (yyval.op) = OperKinds::MulAssn; } 5512 break; 5513 5514 case 109: 5508 5515 5509 5516 /* Line 1806 of yacc.c */ 5510 5517 #line 609 "parser.yy" 5511 { (yyval.op) = OperKinds:: MulAssn; }5512 break; 5513 5514 case 1 09:5518 { (yyval.op) = OperKinds::DivAssn; } 5519 break; 5520 5521 case 110: 5515 5522 5516 5523 /* Line 1806 of yacc.c */ 5517 5524 #line 610 "parser.yy" 5518 { (yyval.op) = OperKinds:: DivAssn; }5519 break; 5520 5521 case 11 0:5525 { (yyval.op) = OperKinds::ModAssn; } 5526 break; 5527 5528 case 111: 5522 5529 5523 5530 /* Line 1806 of yacc.c */ 5524 5531 #line 611 "parser.yy" 5525 { (yyval.op) = OperKinds:: ModAssn; }5526 break; 5527 5528 case 11 1:5532 { (yyval.op) = OperKinds::PlusAssn; } 5533 break; 5534 5535 case 112: 5529 5536 5530 5537 /* Line 1806 of yacc.c */ 5531 5538 #line 612 "parser.yy" 5532 { (yyval.op) = OperKinds:: PlusAssn; }5533 break; 5534 5535 case 11 2:5539 { (yyval.op) = OperKinds::MinusAssn; } 5540 break; 5541 5542 case 113: 5536 5543 5537 5544 /* Line 1806 of yacc.c */ 5538 5545 #line 613 "parser.yy" 5539 { (yyval.op) = OperKinds:: MinusAssn; }5540 break; 5541 5542 case 11 3:5546 { (yyval.op) = OperKinds::LSAssn; } 5547 break; 5548 5549 case 114: 5543 5550 5544 5551 /* Line 1806 of yacc.c */ 5545 5552 #line 614 "parser.yy" 5546 { (yyval.op) = OperKinds:: LSAssn; }5547 break; 5548 5549 case 11 4:5553 { (yyval.op) = OperKinds::RSAssn; } 5554 break; 5555 5556 case 115: 5550 5557 5551 5558 /* Line 1806 of yacc.c */ 5552 5559 #line 615 "parser.yy" 5553 { (yyval.op) = OperKinds:: RSAssn; }5554 break; 5555 5556 case 11 5:5560 { (yyval.op) = OperKinds::AndAssn; } 5561 break; 5562 5563 case 116: 5557 5564 5558 5565 /* Line 1806 of yacc.c */ 5559 5566 #line 616 "parser.yy" 5560 { (yyval.op) = OperKinds:: AndAssn; }5561 break; 5562 5563 case 11 6:5567 { (yyval.op) = OperKinds::ERAssn; } 5568 break; 5569 5570 case 117: 5564 5571 5565 5572 /* Line 1806 of yacc.c */ 5566 5573 #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"5574 5574 { (yyval.op) = OperKinds::OrAssn; } 5575 5575 break; … … 5578 5578 5579 5579 /* Line 1806 of yacc.c */ 5580 #line 62 5"parser.yy"5580 #line 624 "parser.yy" 5581 5581 { (yyval.en) = new ExpressionNode( build_tuple() ); } 5582 5582 break; … … 5585 5585 5586 5586 /* Line 1806 of yacc.c */ 5587 #line 62 7"parser.yy"5587 #line 626 "parser.yy" 5588 5588 { (yyval.en) = new ExpressionNode( build_tuple( (yyvsp[(3) - (5)].en) ) ); } 5589 5589 break; … … 5592 5592 5593 5593 /* Line 1806 of yacc.c */ 5594 #line 62 9"parser.yy"5595 { (yyval.en) = new ExpressionNode( build_tuple( (ExpressionNode *)(new ExpressionNode( nullptr ) )->set_l ink( (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) ) ) ); } 5596 5596 break; 5597 5597 … … 5599 5599 5600 5600 /* Line 1806 of yacc.c */ 5601 #line 63 1"parser.yy"5602 { (yyval.en) = new ExpressionNode( build_tuple( (ExpressionNode *)(yyvsp[(3) - (7)].en)->set_l ink( (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) ) ) ); } 5603 5603 break; 5604 5604 … … 5606 5606 5607 5607 /* Line 1806 of yacc.c */ 5608 #line 63 7"parser.yy"5609 { (yyval.en) = (ExpressionNode *)(yyvsp[(1) - (3)].en)->set_l ink( (yyvsp[(3) - (3)].en) ); }5608 #line 636 "parser.yy" 5609 { (yyval.en) = (ExpressionNode *)(yyvsp[(1) - (3)].en)->set_last( (yyvsp[(3) - (3)].en) ); } 5610 5610 break; 5611 5611 … … 5613 5613 5614 5614 /* Line 1806 of yacc.c */ 5615 #line 64 3"parser.yy"5615 #line 642 "parser.yy" 5616 5616 { (yyval.en) = new ExpressionNode( build_comma( (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); } 5617 5617 break; … … 5620 5620 5621 5621 /* Line 1806 of yacc.c */ 5622 #line 64 8"parser.yy"5622 #line 647 "parser.yy" 5623 5623 { (yyval.en) = 0; } 5624 5624 break; … … 5627 5627 5628 5628 /* Line 1806 of yacc.c */ 5629 #line 65 7"parser.yy"5629 #line 656 "parser.yy" 5630 5630 { (yyval.sn) = (yyvsp[(1) - (1)].sn); } 5631 5631 break; … … 5634 5634 5635 5635 /* Line 1806 of yacc.c */ 5636 #line 66 4"parser.yy"5636 #line 663 "parser.yy" 5637 5637 { 5638 5638 Token fn; 5639 5639 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_l ink( (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) ) ) ) ) ); 5641 5641 } 5642 5642 break; … … 5645 5645 5646 5646 /* Line 1806 of yacc.c */ 5647 #line 67 4"parser.yy"5647 #line 673 "parser.yy" 5648 5648 { 5649 5649 (yyval.sn) = (yyvsp[(4) - (4)].sn)->add_label( (yyvsp[(1) - (4)].tok) ); … … 5654 5654 5655 5655 /* Line 1806 of yacc.c */ 5656 #line 68 1"parser.yy"5656 #line 680 "parser.yy" 5657 5657 { (yyval.sn) = new CompoundStmtNode( (StatementNode *)0 ); } 5658 5658 break; … … 5661 5661 5662 5662 /* Line 1806 of yacc.c */ 5663 #line 68 8"parser.yy"5663 #line 687 "parser.yy" 5664 5664 { (yyval.sn) = new CompoundStmtNode( (yyvsp[(5) - (7)].sn) ); } 5665 5665 break; … … 5668 5668 5669 5669 /* Line 1806 of yacc.c */ 5670 #line 69 4"parser.yy"5671 { if ( (yyvsp[(1) - (3)].sn) != 0 ) { (yyvsp[(1) - (3)].sn)->set_l ink( (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); } } 5672 5672 break; 5673 5673 … … 5675 5675 5676 5676 /* Line 1806 of yacc.c */ 5677 #line 69 9"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) ); } 5679 5679 break; 5680 5680 … … 5682 5682 5683 5683 /* Line 1806 of yacc.c */ 5684 #line 70 1"parser.yy"5684 #line 700 "parser.yy" 5685 5685 { // 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() ) 5687 5687 iter->set_extension( true ); 5688 (yyval.sn) = new StatementNode ( (yyvsp[(2) - (2)].decl) );5688 (yyval.sn) = new StatementNode2( (yyvsp[(2) - (2)].decl) ); 5689 5689 } 5690 5690 break; … … 5693 5693 5694 5694 /* Line 1806 of yacc.c */ 5695 #line 70 7"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) ); } 5697 5697 break; 5698 5698 … … 5700 5700 5701 5701 /* Line 1806 of yacc.c */ 5702 #line 71 4"parser.yy"5703 { if ( (yyvsp[(1) - (2)].sn) != 0 ) { (yyvsp[(1) - (2)].sn)->set_l ink( (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); } } 5704 5704 break; 5705 5705 … … 5707 5707 5708 5708 /* Line 1806 of yacc.c */ 5709 #line 71 9"parser.yy"5709 #line 718 "parser.yy" 5710 5710 { (yyval.sn) = new StatementNode2( build_expr( (yyvsp[(1) - (2)].en) ) ); } 5711 5711 break; … … 5714 5714 5715 5715 /* Line 1806 of yacc.c */ 5716 #line 72 5"parser.yy"5716 #line 724 "parser.yy" 5717 5717 { (yyval.sn) = new StatementNode2( build_if( (yyvsp[(3) - (5)].en), (yyvsp[(5) - (5)].sn), nullptr ) ); } 5718 5718 break; … … 5721 5721 5722 5722 /* Line 1806 of yacc.c */ 5723 #line 72 7"parser.yy"5723 #line 726 "parser.yy" 5724 5724 { (yyval.sn) = new StatementNode2( build_if( (yyvsp[(3) - (7)].en), (yyvsp[(5) - (7)].sn), (yyvsp[(7) - (7)].sn) ) ); } 5725 5725 break; … … 5728 5728 5729 5729 /* Line 1806 of yacc.c */ 5730 #line 72 9"parser.yy"5730 #line 728 "parser.yy" 5731 5731 { (yyval.sn) = new StatementNode2( build_switch( (yyvsp[(3) - (5)].en), (yyvsp[(5) - (5)].sn) ) ); } 5732 5732 break; … … 5735 5735 5736 5736 /* Line 1806 of yacc.c */ 5737 #line 73 1"parser.yy"5737 #line 730 "parser.yy" 5738 5738 { 5739 5739 StatementNode *sw = new StatementNode2( build_switch( (yyvsp[(3) - (9)].en), (yyvsp[(8) - (9)].sn) ) ); … … 5743 5743 // therefore, are removed from the grammar even though C allows it. The change also applies to choose 5744 5744 // 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; 5746 5746 } 5747 5747 break; … … 5750 5750 5751 5751 /* Line 1806 of yacc.c */ 5752 #line 74 1"parser.yy"5752 #line 740 "parser.yy" 5753 5753 { (yyval.sn) = new StatementNode2( build_switch( (yyvsp[(3) - (5)].en), (yyvsp[(5) - (5)].sn) ) ); } 5754 5754 break; … … 5757 5757 5758 5758 /* Line 1806 of yacc.c */ 5759 #line 74 3"parser.yy"5759 #line 742 "parser.yy" 5760 5760 { 5761 5761 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; 5763 5763 } 5764 5764 break; … … 5767 5767 5768 5768 /* Line 1806 of yacc.c */ 5769 #line 75 3"parser.yy"5769 #line 752 "parser.yy" 5770 5770 { (yyval.en) = (yyvsp[(1) - (1)].en); } 5771 5771 break; … … 5774 5774 5775 5775 /* Line 1806 of yacc.c */ 5776 #line 75 5"parser.yy"5776 #line 754 "parser.yy" 5777 5777 { (yyval.en) = new ExpressionNode( build_range( (yyvsp[(1) - (3)].en), (yyvsp[(3) - (3)].en) ) ); } 5778 5778 break; … … 5781 5781 5782 5782 /* 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 */ 5783 5790 #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) ) ) ) ); } 5792 5792 break; 5793 5793 … … 5795 5795 5796 5796 /* Line 1806 of yacc.c */ 5797 #line 76 7"parser.yy"5797 #line 765 "parser.yy" 5798 5798 { (yyval.sn) = (yyvsp[(2) - (3)].sn); } 5799 5799 break; … … 5802 5802 5803 5803 /* Line 1806 of yacc.c */ 5804 #line 76 8"parser.yy"5804 #line 766 "parser.yy" 5805 5805 { (yyval.sn) = new StatementNode2( build_default() ); } 5806 5806 break; … … 5809 5809 5810 5810 /* Line 1806 of yacc.c */ 5811 #line 77 4"parser.yy"5812 { (yyval.sn) = (StatementNode *)( (yyvsp[(1) - (2)].sn)->set_l ink( (yyvsp[(2) - (2)].sn) )); }5811 #line 772 "parser.yy" 5812 { (yyval.sn) = (StatementNode *)( (yyvsp[(1) - (2)].sn)->set_last( (yyvsp[(2) - (2)].sn) )); } 5813 5813 break; 5814 5814 … … 5816 5816 5817 5817 /* Line 1806 of yacc.c */ 5818 #line 77 8"parser.yy"5818 #line 776 "parser.yy" 5819 5819 { (yyval.sn) = (yyvsp[(1) - (2)].sn)->append_last_case( new CompoundStmtNode( (yyvsp[(2) - (2)].sn) ) ); } 5820 5820 break; … … 5823 5823 5824 5824 /* Line 1806 of yacc.c */ 5825 #line 78 3"parser.yy"5825 #line 781 "parser.yy" 5826 5826 { (yyval.sn) = 0; } 5827 5827 break; … … 5830 5830 5831 5831 /* 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 */ 5832 5839 #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) ) ) ) ); } 5841 5841 break; 5842 5842 … … 5844 5844 5845 5845 /* Line 1806 of yacc.c */ 5846 #line 79 6"parser.yy"5846 #line 794 "parser.yy" 5847 5847 { (yyval.sn) = 0; } 5848 5848 break; … … 5851 5851 5852 5852 /* 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 */ 5853 5860 #line 802 "parser.yy" 5854 { (yyval.sn) = (yyvsp[(1) - ( 2)].sn)->append_last_case( (yyvsp[(2) - (2)].sn) ); }5855 break; 5856 5857 case 17 2: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: 5858 5865 5859 5866 /* Line 1806 of yacc.c */ 5860 5867 #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 17 3: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: 5865 5872 5866 5873 /* Line 1806 of yacc.c */ 5867 5874 #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) ) ) ) ) ) ); } 5876 5876 break; 5877 5877 … … 5879 5879 5880 5880 /* Line 1806 of yacc.c */ 5881 #line 81 3"parser.yy"5881 #line 811 "parser.yy" 5882 5882 { (yyval.sn) = new StatementNode2( build_branch( "", BranchStmt::Break ) ); } 5883 5883 break; 5884 5884 5885 5885 case 177: 5886 5887 /* Line 1806 of yacc.c */ 5888 #line 817 "parser.yy" 5889 { (yyval.sn) = 0; } 5890 break; 5891 5892 case 178: 5886 5893 5887 5894 /* Line 1806 of yacc.c */ … … 5890 5897 break; 5891 5898 5892 case 178:5893 5894 /* Line 1806 of yacc.c */5895 #line 821 "parser.yy"5896 { (yyval.sn) = 0; }5897 break;5898 5899 5899 case 179: 5900 5900 5901 5901 /* 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 */ 5902 5909 #line 826 "parser.yy" 5903 { (yyval.sn) = new StatementNode2( build_while( (yyvsp[( 3) - (5)].en), (yyvsp[(5) - (5)].sn) ) ); }5904 break; 5905 5906 case 18 0:5910 { (yyval.sn) = new StatementNode2( build_while( (yyvsp[(5) - (7)].en), (yyvsp[(2) - (7)].sn) ) ); } 5911 break; 5912 5913 case 181: 5907 5914 5908 5915 /* Line 1806 of yacc.c */ 5909 5916 #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"5917 5917 { (yyval.sn) = new StatementNode2( build_for( (yyvsp[(4) - (6)].fctl), (yyvsp[(6) - (6)].sn) ) ); } 5918 5918 break; … … 5921 5921 5922 5922 /* 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 */ 5923 5930 #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"5931 5931 { (yyval.fctl) = new ForCtl( (yyvsp[(1) - (4)].decl), (yyvsp[(2) - (4)].en), (yyvsp[(4) - (4)].en) ); } 5932 5932 break; … … 5935 5935 5936 5936 /* Line 1806 of yacc.c */ 5937 #line 84 2"parser.yy"5937 #line 840 "parser.yy" 5938 5938 { (yyval.sn) = new StatementNode2( build_branch( *(yyvsp[(2) - (3)].tok), BranchStmt::Goto ) ); } 5939 5939 break; … … 5942 5942 5943 5943 /* Line 1806 of yacc.c */ 5944 #line 84 6"parser.yy"5944 #line 844 "parser.yy" 5945 5945 { (yyval.sn) = new StatementNode2( build_computedgoto( (yyvsp[(3) - (4)].en) ) ); } 5946 5946 break; … … 5949 5949 5950 5950 /* Line 1806 of yacc.c */ 5951 #line 84 9"parser.yy"5951 #line 847 "parser.yy" 5952 5952 { (yyval.sn) = new StatementNode2( build_branch( "", BranchStmt::Continue ) ); } 5953 5953 break; … … 5956 5956 5957 5957 /* Line 1806 of yacc.c */ 5958 #line 85 3"parser.yy"5958 #line 851 "parser.yy" 5959 5959 { (yyval.sn) = new StatementNode2( build_branch( *(yyvsp[(2) - (3)].tok), BranchStmt::Continue ) ); delete (yyvsp[(2) - (3)].tok); } 5960 5960 break; … … 5963 5963 5964 5964 /* Line 1806 of yacc.c */ 5965 #line 85 6"parser.yy"5965 #line 854 "parser.yy" 5966 5966 { (yyval.sn) = new StatementNode2( build_branch( "", BranchStmt::Break ) ); } 5967 5967 break; … … 5970 5970 5971 5971 /* 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 */ 5972 5979 #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 19 0:5980 { (yyval.sn) = new StatementNode2( build_return( (yyvsp[(2) - (3)].en) ) ); } 5981 break; 5982 5983 case 191: 5977 5984 5978 5985 /* Line 1806 of yacc.c */ 5979 5986 #line 862 "parser.yy" 5980 { (yyval.sn) = new StatementNode2( build_ return( (yyvsp[(2) - (3)].en) ) ); }5981 break; 5982 5983 case 19 1:5987 { (yyval.sn) = new StatementNode2( build_throw( (yyvsp[(2) - (3)].en) ) ); } 5988 break; 5989 5990 case 192: 5984 5991 5985 5992 /* Line 1806 of yacc.c */ … … 5988 5995 break; 5989 5996 5990 case 19 2:5997 case 193: 5991 5998 5992 5999 /* Line 1806 of yacc.c */ 5993 6000 #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"6001 6001 { (yyval.sn) = new StatementNode2( build_throw( (yyvsp[(2) - (5)].en) ) ); } 6002 6002 break; … … 6005 6005 6006 6006 /* 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 */ 6007 6014 #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 19 5:6015 { (yyval.sn) = new StatementNode2( build_try( (yyvsp[(2) - (3)].sn), 0, (yyvsp[(3) - (3)].sn) ) ); } 6016 break; 6017 6018 case 196: 6012 6019 6013 6020 /* Line 1806 of yacc.c */ 6014 6021 #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" 6022 6085 { 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) ) ); 6025 6087 } 6026 6088 break; 6027 6089 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 6094 6090 case 208: 6095 6091 6096 6092 /* Line 1806 of yacc.c */ 6097 #line 9 24"parser.yy"6093 #line 917 "parser.yy" 6098 6094 { 6099 6095 typedefTable.addToEnclosingScope( TypedefTable::ID ); … … 6105 6101 6106 6102 /* Line 1806 of yacc.c */ 6107 #line 92 9"parser.yy"6103 #line 922 "parser.yy" 6108 6104 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addType( (yyvsp[(1) - (2)].decl) ); } 6109 6105 break; … … 6112 6108 6113 6109 /* Line 1806 of yacc.c */ 6114 #line 9 31"parser.yy"6110 #line 924 "parser.yy" 6115 6111 { 6116 6112 typedefTable.addToEnclosingScope( TypedefTable::ID ); … … 6122 6118 6123 6119 /* Line 1806 of yacc.c */ 6124 #line 9 40"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 ); } 6126 6122 break; 6127 6123 … … 6129 6125 6130 6126 /* Line 1806 of yacc.c */ 6131 #line 9 42"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) ); } 6133 6129 break; 6134 6130 … … 6136 6132 6137 6133 /* Line 1806 of yacc.c */ 6138 #line 9 44"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) ); } 6140 6136 break; 6141 6137 … … 6143 6139 6144 6140 /* 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 */ 6145 6155 #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 21 6:6156 { (yyval.flag) = false; } 6157 break; 6158 6159 case 218: 6150 6160 6151 6161 /* Line 1806 of yacc.c */ 6152 6162 #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 21 7:6163 { (yyval.flag) = true; } 6164 break; 6165 6166 case 219: 6157 6167 6158 6168 /* Line 1806 of yacc.c */ 6159 6169 #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: 6171 6174 6172 6175 /* Line 1806 of yacc.c */ 6173 6176 #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" 6174 6198 { (yyval.en) = 0; } 6175 6199 break; 6176 6200 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: 6192 6202 6193 6203 /* Line 1806 of yacc.c */ 6194 6204 #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 22 5:6199 6200 /* Line 1806 of yacc.c */ 6201 #line 97 9"parser.yy"6202 { (yyval.en) = 0; }6203 break; 6204 6205 case 22 6: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: 6206 6216 6207 6217 /* Line 1806 of yacc.c */ 6208 6218 #line 981 "parser.yy" 6209 { (yyval. en) = new ExpressionNode( (yyvsp[(1) - (1)].constant) ); }6210 break; 6211 6212 case 22 7:6219 { (yyval.label) = new LabelNode(); (yyval.label)->append_label( (yyvsp[(1) - (1)].tok) ); } 6220 break; 6221 6222 case 229: 6213 6223 6214 6224 /* Line 1806 of yacc.c */ 6215 6225 #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: 6227 6230 6228 6231 /* Line 1806 of yacc.c */ 6229 6232 #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 23 0:6233 { (yyval.decl) = 0; } 6234 break; 6235 6236 case 233: 6234 6237 6235 6238 /* Line 1806 of yacc.c */ 6236 6239 #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" 6237 6247 { (yyval.decl) = 0; } 6238 6248 break; 6239 6249 6240 case 23 3:6241 6242 /* Line 1806 of yacc.c */ 6243 #line 100 4"parser.yy"6250 case 237: 6251 6252 /* Line 1806 of yacc.c */ 6253 #line 1009 "parser.yy" 6244 6254 { (yyval.decl) = (yyvsp[(1) - (3)].decl)->appendList( (yyvsp[(3) - (3)].decl) ); } 6245 6255 break; 6246 6256 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 6261 6257 case 242: 6262 6258 6263 6259 /* Line 1806 of yacc.c */ 6264 #line 10 30"parser.yy"6260 #line 1023 "parser.yy" 6265 6261 {} 6266 6262 break; … … 6269 6265 6270 6266 /* Line 1806 of yacc.c */ 6271 #line 10 31"parser.yy"6267 #line 1024 "parser.yy" 6272 6268 {} 6273 6269 break; … … 6276 6272 6277 6273 /* Line 1806 of yacc.c */ 6278 #line 10 60"parser.yy"6274 #line 1053 "parser.yy" 6279 6275 { 6280 6276 typedefTable.addToEnclosingScope( TypedefTable::ID ); … … 6286 6282 6287 6283 /* Line 1806 of yacc.c */ 6288 #line 106 7"parser.yy"6284 #line 1060 "parser.yy" 6289 6285 { 6290 6286 typedefTable.addToEnclosingScope( TypedefTable::ID ); … … 6296 6292 6297 6293 /* Line 1806 of yacc.c */ 6298 #line 10 72"parser.yy"6294 #line 1065 "parser.yy" 6299 6295 { 6300 6296 typedefTable.addToEnclosingScope( *(yyvsp[(5) - (6)].tok), TypedefTable::ID ); … … 6306 6302 6307 6303 /* Line 1806 of yacc.c */ 6308 #line 10 82"parser.yy"6304 #line 1075 "parser.yy" 6309 6305 { 6310 6306 typedefTable.setNextIdentifier( *(yyvsp[(2) - (3)].tok) ); … … 6316 6312 6317 6313 /* Line 1806 of yacc.c */ 6318 #line 108 7"parser.yy"6314 #line 1080 "parser.yy" 6319 6315 { 6320 6316 typedefTable.setNextIdentifier( *(yyvsp[(2) - (3)].tok) ); … … 6326 6322 6327 6323 /* Line 1806 of yacc.c */ 6328 #line 10 92"parser.yy"6324 #line 1085 "parser.yy" 6329 6325 { 6330 6326 typedefTable.setNextIdentifier( *(yyvsp[(3) - (4)].tok) ); … … 6336 6332 6337 6333 /* Line 1806 of yacc.c */ 6338 #line 1 100"parser.yy"6334 #line 1093 "parser.yy" 6339 6335 { 6340 6336 typedefTable.addToEnclosingScope( TypedefTable::ID ); … … 6346 6342 6347 6343 /* Line 1806 of yacc.c */ 6348 #line 1 105"parser.yy"6344 #line 1098 "parser.yy" 6349 6345 { 6350 6346 typedefTable.addToEnclosingScope( TypedefTable::ID ); … … 6356 6352 6357 6353 /* Line 1806 of yacc.c */ 6358 #line 11 10"parser.yy"6354 #line 1103 "parser.yy" 6359 6355 { 6360 6356 typedefTable.addToEnclosingScope( TypedefTable::ID ); … … 6366 6362 6367 6363 /* Line 1806 of yacc.c */ 6368 #line 11 15"parser.yy"6364 #line 1108 "parser.yy" 6369 6365 { 6370 6366 typedefTable.addToEnclosingScope( TypedefTable::ID ); … … 6376 6372 6377 6373 /* Line 1806 of yacc.c */ 6378 #line 11 20"parser.yy"6374 #line 1113 "parser.yy" 6379 6375 { 6380 6376 typedefTable.addToEnclosingScope( *(yyvsp[(5) - (5)].tok), TypedefTable::ID ); … … 6386 6382 6387 6383 /* Line 1806 of yacc.c */ 6388 #line 112 8"parser.yy"6384 #line 1121 "parser.yy" 6389 6385 { 6390 6386 (yyval.decl) = DeclarationNode::newFunction( (yyvsp[(3) - (8)].tok), DeclarationNode::newTuple( 0 ), (yyvsp[(6) - (8)].decl), 0, true ); … … 6395 6391 6396 6392 /* Line 1806 of yacc.c */ 6397 #line 11 51"parser.yy"6393 #line 1144 "parser.yy" 6398 6394 { 6399 6395 (yyval.decl) = DeclarationNode::newFunction( (yyvsp[(2) - (7)].tok), (yyvsp[(1) - (7)].decl), (yyvsp[(5) - (7)].decl), 0, true ); … … 6404 6400 6405 6401 /* Line 1806 of yacc.c */ 6406 #line 11 55"parser.yy"6402 #line 1148 "parser.yy" 6407 6403 { 6408 6404 (yyval.decl) = DeclarationNode::newFunction( (yyvsp[(2) - (7)].tok), (yyvsp[(1) - (7)].decl), (yyvsp[(5) - (7)].decl), 0, true ); … … 6413 6409 6414 6410 /* Line 1806 of yacc.c */ 6415 #line 11 62"parser.yy"6411 #line 1155 "parser.yy" 6416 6412 { (yyval.decl) = DeclarationNode::newTuple( (yyvsp[(3) - (5)].decl) ); } 6417 6413 break; … … 6420 6416 6421 6417 /* Line 1806 of yacc.c */ 6422 #line 11 66"parser.yy"6418 #line 1159 "parser.yy" 6423 6419 { (yyval.decl) = DeclarationNode::newTuple( (yyvsp[(3) - (9)].decl)->appendList( (yyvsp[(7) - (9)].decl) ) ); } 6424 6420 break; … … 6427 6423 6428 6424 /* Line 1806 of yacc.c */ 6429 #line 11 71"parser.yy"6425 #line 1164 "parser.yy" 6430 6426 { 6431 6427 typedefTable.addToEnclosingScope( TypedefTable::TD ); … … 6437 6433 6438 6434 /* Line 1806 of yacc.c */ 6439 #line 11 76"parser.yy"6435 #line 1169 "parser.yy" 6440 6436 { 6441 6437 typedefTable.addToEnclosingScope( TypedefTable::TD ); … … 6447 6443 6448 6444 /* Line 1806 of yacc.c */ 6449 #line 11 81"parser.yy"6445 #line 1174 "parser.yy" 6450 6446 { 6451 6447 typedefTable.addToEnclosingScope( *(yyvsp[(5) - (5)].tok), TypedefTable::TD ); … … 6457 6453 6458 6454 /* Line 1806 of yacc.c */ 6459 #line 11 92"parser.yy"6455 #line 1185 "parser.yy" 6460 6456 { 6461 6457 typedefTable.addToEnclosingScope( TypedefTable::TD ); … … 6467 6463 6468 6464 /* Line 1806 of yacc.c */ 6469 #line 119 7"parser.yy"6465 #line 1190 "parser.yy" 6470 6466 { 6471 6467 typedefTable.addToEnclosingScope( TypedefTable::TD ); … … 6477 6473 6478 6474 /* Line 1806 of yacc.c */ 6479 #line 1 202"parser.yy"6475 #line 1195 "parser.yy" 6480 6476 { 6481 6477 typedefTable.addToEnclosingScope( TypedefTable::TD ); … … 6487 6483 6488 6484 /* Line 1806 of yacc.c */ 6489 #line 120 7"parser.yy"6485 #line 1200 "parser.yy" 6490 6486 { 6491 6487 typedefTable.addToEnclosingScope( TypedefTable::TD ); … … 6497 6493 6498 6494 /* Line 1806 of yacc.c */ 6499 #line 12 12"parser.yy"6495 #line 1205 "parser.yy" 6500 6496 { 6501 6497 typedefTable.addToEnclosingScope( TypedefTable::TD ); … … 6507 6503 6508 6504 /* Line 1806 of yacc.c */ 6509 #line 12 21"parser.yy"6505 #line 1214 "parser.yy" 6510 6506 { 6511 6507 typedefTable.addToEnclosingScope( *(yyvsp[(2) - (4)].tok), TypedefTable::TD ); … … 6517 6513 6518 6514 /* Line 1806 of yacc.c */ 6519 #line 12 26"parser.yy"6515 #line 1219 "parser.yy" 6520 6516 { 6521 6517 typedefTable.addToEnclosingScope( *(yyvsp[(5) - (7)].tok), TypedefTable::TD ); … … 6527 6523 6528 6524 /* Line 1806 of yacc.c */ 6529 #line 12 43"parser.yy"6525 #line 1236 "parser.yy" 6530 6526 { 6531 6527 typedefTable.addToEnclosingScope( TypedefTable::ID ); … … 6537 6533 6538 6534 /* Line 1806 of yacc.c */ 6539 #line 124 8"parser.yy"6535 #line 1241 "parser.yy" 6540 6536 { 6541 6537 typedefTable.addToEnclosingScope( TypedefTable::ID ); … … 6547 6543 6548 6544 /* Line 1806 of yacc.c */ 6549 #line 12 70"parser.yy"6545 #line 1263 "parser.yy" 6550 6546 { (yyval.decl) = 0; } 6551 6547 break; … … 6554 6550 6555 6551 /* Line 1806 of yacc.c */ 6556 #line 12 82"parser.yy"6552 #line 1275 "parser.yy" 6557 6553 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 6558 6554 break; … … 6561 6557 6562 6558 /* Line 1806 of yacc.c */ 6563 #line 12 93"parser.yy"6559 #line 1286 "parser.yy" 6564 6560 { (yyval.decl) = DeclarationNode::newQualifier( DeclarationNode::Const ); } 6565 6561 break; … … 6568 6564 6569 6565 /* Line 1806 of yacc.c */ 6570 #line 12 95"parser.yy"6566 #line 1288 "parser.yy" 6571 6567 { (yyval.decl) = DeclarationNode::newQualifier( DeclarationNode::Restrict ); } 6572 6568 break; … … 6575 6571 6576 6572 /* Line 1806 of yacc.c */ 6577 #line 129 7"parser.yy"6573 #line 1290 "parser.yy" 6578 6574 { (yyval.decl) = DeclarationNode::newQualifier( DeclarationNode::Volatile ); } 6579 6575 break; … … 6582 6578 6583 6579 /* Line 1806 of yacc.c */ 6584 #line 129 9"parser.yy"6580 #line 1292 "parser.yy" 6585 6581 { (yyval.decl) = DeclarationNode::newQualifier( DeclarationNode::Lvalue ); } 6586 6582 break; … … 6589 6585 6590 6586 /* Line 1806 of yacc.c */ 6591 #line 1 301"parser.yy"6587 #line 1294 "parser.yy" 6592 6588 { (yyval.decl) = DeclarationNode::newQualifier( DeclarationNode::Atomic ); } 6593 6589 break; … … 6596 6592 6597 6593 /* Line 1806 of yacc.c */ 6598 #line 1 303"parser.yy"6594 #line 1296 "parser.yy" 6599 6595 { 6600 6596 typedefTable.enterScope(); … … 6605 6601 6606 6602 /* Line 1806 of yacc.c */ 6607 #line 130 7"parser.yy"6603 #line 1300 "parser.yy" 6608 6604 { 6609 6605 typedefTable.leaveScope(); … … 6615 6611 6616 6612 /* Line 1806 of yacc.c */ 6617 #line 13 16"parser.yy"6613 #line 1309 "parser.yy" 6618 6614 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 6619 6615 break; … … 6622 6618 6623 6619 /* Line 1806 of yacc.c */ 6624 #line 131 8"parser.yy"6620 #line 1311 "parser.yy" 6625 6621 { (yyval.decl) = (yyvsp[(1) - (3)].decl)->addQualifiers( (yyvsp[(2) - (3)].decl) )->addQualifiers( (yyvsp[(3) - (3)].decl) ); } 6626 6622 break; … … 6629 6625 6630 6626 /* Line 1806 of yacc.c */ 6631 #line 132 9"parser.yy"6627 #line 1322 "parser.yy" 6632 6628 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 6633 6629 break; … … 6636 6632 6637 6633 /* Line 1806 of yacc.c */ 6638 #line 133 8"parser.yy"6634 #line 1331 "parser.yy" 6639 6635 { (yyval.decl) = DeclarationNode::newStorageClass( DeclarationNode::Extern ); } 6640 6636 break; … … 6643 6639 6644 6640 /* Line 1806 of yacc.c */ 6645 #line 13 40"parser.yy"6641 #line 1333 "parser.yy" 6646 6642 { (yyval.decl) = DeclarationNode::newStorageClass( DeclarationNode::Static ); } 6647 6643 break; … … 6650 6646 6651 6647 /* Line 1806 of yacc.c */ 6652 #line 13 42"parser.yy"6648 #line 1335 "parser.yy" 6653 6649 { (yyval.decl) = DeclarationNode::newStorageClass( DeclarationNode::Auto ); } 6654 6650 break; … … 6657 6653 6658 6654 /* Line 1806 of yacc.c */ 6659 #line 13 44"parser.yy"6655 #line 1337 "parser.yy" 6660 6656 { (yyval.decl) = DeclarationNode::newStorageClass( DeclarationNode::Register ); } 6661 6657 break; … … 6664 6660 6665 6661 /* Line 1806 of yacc.c */ 6666 #line 13 46"parser.yy"6662 #line 1339 "parser.yy" 6667 6663 { (yyval.decl) = DeclarationNode::newStorageClass( DeclarationNode::Inline ); } 6668 6664 break; … … 6671 6667 6672 6668 /* Line 1806 of yacc.c */ 6673 #line 134 8"parser.yy"6669 #line 1341 "parser.yy" 6674 6670 { (yyval.decl) = DeclarationNode::newStorageClass( DeclarationNode::Fortran ); } 6675 6671 break; … … 6678 6674 6679 6675 /* 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 */ 6680 6690 #line 1350 "parser.yy" 6681 { (yyval.decl) = DeclarationNode::new StorageClass( DeclarationNode::Noreturn); }6682 break; 6683 6684 case 31 7:6691 { (yyval.decl) = DeclarationNode::newBasicType( DeclarationNode::Char ); } 6692 break; 6693 6694 case 319: 6685 6695 6686 6696 /* Line 1806 of yacc.c */ 6687 6697 #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"6702 6698 { (yyval.decl) = DeclarationNode::newBasicType( DeclarationNode::Double ); } 6703 6699 break; … … 6706 6702 6707 6703 /* Line 1806 of yacc.c */ 6708 #line 13 61"parser.yy"6704 #line 1354 "parser.yy" 6709 6705 { (yyval.decl) = DeclarationNode::newBasicType( DeclarationNode::Float ); } 6710 6706 break; … … 6713 6709 6714 6710 /* Line 1806 of yacc.c */ 6715 #line 13 63"parser.yy"6711 #line 1356 "parser.yy" 6716 6712 { (yyval.decl) = DeclarationNode::newBasicType( DeclarationNode::Int ); } 6717 6713 break; … … 6720 6716 6721 6717 /* Line 1806 of yacc.c */ 6722 #line 13 65"parser.yy"6718 #line 1358 "parser.yy" 6723 6719 { (yyval.decl) = DeclarationNode::newModifier( DeclarationNode::Long ); } 6724 6720 break; … … 6727 6723 6728 6724 /* Line 1806 of yacc.c */ 6729 #line 136 7"parser.yy"6725 #line 1360 "parser.yy" 6730 6726 { (yyval.decl) = DeclarationNode::newModifier( DeclarationNode::Short ); } 6731 6727 break; … … 6734 6730 6735 6731 /* Line 1806 of yacc.c */ 6736 #line 136 9"parser.yy"6732 #line 1362 "parser.yy" 6737 6733 { (yyval.decl) = DeclarationNode::newModifier( DeclarationNode::Signed ); } 6738 6734 break; … … 6741 6737 6742 6738 /* Line 1806 of yacc.c */ 6743 #line 13 71"parser.yy"6739 #line 1364 "parser.yy" 6744 6740 { (yyval.decl) = DeclarationNode::newModifier( DeclarationNode::Unsigned ); } 6745 6741 break; … … 6748 6744 6749 6745 /* Line 1806 of yacc.c */ 6750 #line 13 73"parser.yy"6746 #line 1366 "parser.yy" 6751 6747 { (yyval.decl) = DeclarationNode::newBasicType( DeclarationNode::Void ); } 6752 6748 break; … … 6755 6751 6756 6752 /* Line 1806 of yacc.c */ 6757 #line 13 75"parser.yy"6753 #line 1368 "parser.yy" 6758 6754 { (yyval.decl) = DeclarationNode::newBasicType( DeclarationNode::Bool ); } 6759 6755 break; … … 6762 6758 6763 6759 /* Line 1806 of yacc.c */ 6764 #line 137 7"parser.yy"6760 #line 1370 "parser.yy" 6765 6761 { (yyval.decl) = DeclarationNode::newBasicType( DeclarationNode::Complex ); } 6766 6762 break; … … 6769 6765 6770 6766 /* Line 1806 of yacc.c */ 6771 #line 137 9"parser.yy"6767 #line 1372 "parser.yy" 6772 6768 { (yyval.decl) = DeclarationNode::newBasicType( DeclarationNode::Imaginary ); } 6773 6769 break; … … 6776 6772 6777 6773 /* 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 */ 6778 6781 #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"6786 6782 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); } 6787 6783 break; … … 6790 6786 6791 6787 /* Line 1806 of yacc.c */ 6792 #line 13 90"parser.yy"6788 #line 1383 "parser.yy" 6793 6789 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 6794 6790 break; … … 6797 6793 6798 6794 /* Line 1806 of yacc.c */ 6799 #line 13 92"parser.yy"6795 #line 1385 "parser.yy" 6800 6796 { (yyval.decl) = (yyvsp[(1) - (3)].decl)->addQualifiers( (yyvsp[(2) - (3)].decl) )->addQualifiers( (yyvsp[(3) - (3)].decl) ); } 6801 6797 break; … … 6804 6800 6805 6801 /* Line 1806 of yacc.c */ 6806 #line 13 94"parser.yy"6802 #line 1387 "parser.yy" 6807 6803 { (yyval.decl) = (yyvsp[(3) - (3)].decl)->addQualifiers( (yyvsp[(2) - (3)].decl) )->addType( (yyvsp[(1) - (3)].decl) ); } 6808 6804 break; … … 6811 6807 6812 6808 /* 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 */ 6813 6816 #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"6821 6817 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); } 6822 6818 break; … … 6825 6821 6826 6822 /* 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 */ 6827 6837 #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" 6828 6873 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 6829 6874 break; 6830 6875 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" 6870 6887 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); } 6871 6888 break; 6872 6889 6873 case 3 48:6874 6875 /* Line 1806 of yacc.c */ 6876 #line 143 0"parser.yy"6890 case 352: 6891 6892 /* Line 1806 of yacc.c */ 6893 #line 1433 "parser.yy" 6877 6894 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 6878 6895 break; 6879 6896 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" 6884 6915 { (yyval.decl) = (yyvsp[(1) - (3)].decl)->addQualifiers( (yyvsp[(2) - (3)].decl) )->addQualifiers( (yyvsp[(3) - (3)].decl) ); } 6885 6916 break; 6886 6917 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" 6898 6936 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 6899 6937 break; 6900 6938 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 6943 6939 case 362: 6944 6940 6945 6941 /* Line 1806 of yacc.c */ 6946 #line 146 9"parser.yy"6942 #line 1462 "parser.yy" 6947 6943 { (yyval.decl) = DeclarationNode::newAggregate( (yyvsp[(1) - (4)].aggKey), 0, 0, (yyvsp[(3) - (4)].decl), true ); } 6948 6944 break; … … 6951 6947 6952 6948 /* Line 1806 of yacc.c */ 6953 #line 14 71"parser.yy"6949 #line 1464 "parser.yy" 6954 6950 { 6955 6951 typedefTable.makeTypedef( *(yyvsp[(2) - (2)].tok) ); … … 6961 6957 6962 6958 /* Line 1806 of yacc.c */ 6963 #line 14 76"parser.yy"6959 #line 1469 "parser.yy" 6964 6960 { typedefTable.makeTypedef( *(yyvsp[(2) - (2)].tok) ); } 6965 6961 break; … … 6968 6964 6969 6965 /* Line 1806 of yacc.c */ 6970 #line 147 8"parser.yy"6966 #line 1471 "parser.yy" 6971 6967 { (yyval.decl) = DeclarationNode::newAggregate( (yyvsp[(1) - (6)].aggKey), (yyvsp[(2) - (6)].tok), 0, (yyvsp[(5) - (6)].decl), true ); } 6972 6968 break; … … 6975 6971 6976 6972 /* 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 */ 6977 6987 #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 36 7:6988 { (yyval.aggKey) = DeclarationNode::Struct; } 6989 break; 6990 6991 case 369: 6982 6992 6983 6993 /* Line 1806 of yacc.c */ 6984 6994 #line 1482 "parser.yy" 6985 { (yyval. decl) = (yyvsp[(2) - (2)].decl); }6986 break; 6987 6988 case 3 68:6995 { (yyval.aggKey) = DeclarationNode::Union; } 6996 break; 6997 6998 case 370: 6989 6999 6990 7000 /* Line 1806 of yacc.c */ 6991 7001 #line 1487 "parser.yy" 6992 { (yyval. aggKey) = DeclarationNode::Struct; }6993 break; 6994 6995 case 3 69:7002 { (yyval.decl) = 0; } 7003 break; 7004 7005 case 371: 6996 7006 6997 7007 /* Line 1806 of yacc.c */ 6998 7008 #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"7013 7009 { (yyval.decl) = (yyvsp[(1) - (2)].decl) != 0 ? (yyvsp[(1) - (2)].decl)->appendList( (yyvsp[(2) - (2)].decl) ) : (yyvsp[(2) - (2)].decl); } 7014 7010 break; … … 7017 7013 7018 7014 /* Line 1806 of yacc.c */ 7019 #line 1 502"parser.yy"7015 #line 1495 "parser.yy" 7020 7016 { (yyval.decl) = (yyvsp[(2) - (3)].decl)->set_extension( true ); } 7021 7017 break; … … 7024 7020 7025 7021 /* Line 1806 of yacc.c */ 7026 #line 1 505"parser.yy"7022 #line 1498 "parser.yy" 7027 7023 { // 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() ) 7029 7025 iter->set_extension( true ); 7030 7026 (yyval.decl) = (yyvsp[(2) - (3)].decl); … … 7035 7031 7036 7032 /* Line 1806 of yacc.c */ 7037 #line 15 15"parser.yy"7033 #line 1508 "parser.yy" 7038 7034 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addName( (yyvsp[(2) - (2)].tok) ); } 7039 7035 break; … … 7042 7038 7043 7039 /* 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 */ 7044 7054 #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 3 79:7055 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addType( (yyvsp[(1) - (2)].decl) ); } 7056 break; 7057 7058 case 381: 7049 7059 7050 7060 /* Line 1806 of yacc.c */ 7051 7061 #line 1519 "parser.yy" 7052 { (yyval.decl) = (yyvsp[(1) - ( 2)].decl)->appendList( (yyvsp[(1) - (2)].decl)->cloneType( 0) ); }7053 break; 7054 7055 case 38 0:7062 { (yyval.decl) = (yyvsp[(1) - (4)].decl)->appendList( (yyvsp[(1) - (4)].decl)->cloneBaseType( (yyvsp[(4) - (4)].decl) ) ); } 7063 break; 7064 7065 case 382: 7056 7066 7057 7067 /* Line 1806 of yacc.c */ 7058 7068 #line 1524 "parser.yy" 7059 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addType( (yyvsp[(1) - (2)].decl) );}7060 break; 7061 7062 case 38 1:7069 { (yyval.decl) = DeclarationNode::newName( 0 ); /* XXX */ } 7070 break; 7071 7072 case 383: 7063 7073 7064 7074 /* Line 1806 of yacc.c */ 7065 7075 #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"7080 7076 { (yyval.decl) = DeclarationNode::newBitfield( (yyvsp[(1) - (1)].en) ); } 7081 7077 break; … … 7084 7080 7085 7081 /* Line 1806 of yacc.c */ 7086 #line 15 36"parser.yy"7082 #line 1529 "parser.yy" 7087 7083 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addBitfield( (yyvsp[(2) - (2)].en) ); } 7088 7084 break; … … 7091 7087 7092 7088 /* Line 1806 of yacc.c */ 7093 #line 153 9"parser.yy"7089 #line 1532 "parser.yy" 7094 7090 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addBitfield( (yyvsp[(2) - (2)].en) ); } 7095 7091 break; … … 7098 7094 7099 7095 /* 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 */ 7100 7110 #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"7115 7111 { (yyval.en) = (yyvsp[(2) - (2)].en); } 7116 7112 break; … … 7119 7115 7120 7116 /* Line 1806 of yacc.c */ 7121 #line 15 61"parser.yy"7117 #line 1554 "parser.yy" 7122 7118 { (yyval.decl) = DeclarationNode::newEnum( 0, (yyvsp[(3) - (5)].decl) ); } 7123 7119 break; … … 7126 7122 7127 7123 /* Line 1806 of yacc.c */ 7128 #line 15 63"parser.yy"7124 #line 1556 "parser.yy" 7129 7125 { 7130 7126 typedefTable.makeTypedef( *(yyvsp[(2) - (2)].tok) ); … … 7136 7132 7137 7133 /* 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 */ 7138 7148 #line 1568 "parser.yy" 7139 { typedefTable.makeTypedef( *(yyvsp[(2) - (2)].tok) ); }7140 break; 7141 7142 case 39 4:7149 { (yyval.decl) = DeclarationNode::newEnumConstant( (yyvsp[(1) - (2)].tok), (yyvsp[(2) - (2)].en) ); } 7150 break; 7151 7152 case 396: 7143 7153 7144 7154 /* Line 1806 of yacc.c */ 7145 7155 #line 1570 "parser.yy" 7146 { (yyval.decl) = DeclarationNode::newEnum( (yyvsp[(2) - (7)].tok), (yyvsp[(5) - (7)].decl) ); }7147 break; 7148 7149 case 39 5:7156 { (yyval.decl) = (yyvsp[(1) - (4)].decl)->appendList( DeclarationNode::newEnumConstant( (yyvsp[(3) - (4)].tok), (yyvsp[(4) - (4)].en) ) ); } 7157 break; 7158 7159 case 397: 7150 7160 7151 7161 /* Line 1806 of yacc.c */ 7152 7162 #line 1575 "parser.yy" 7153 { (yyval. decl) = DeclarationNode::newEnumConstant( (yyvsp[(1) - (2)].tok), (yyvsp[(2) - (2)].en) ); }7154 break; 7155 7156 case 39 6:7163 { (yyval.en) = 0; } 7164 break; 7165 7166 case 398: 7157 7167 7158 7168 /* Line 1806 of yacc.c */ 7159 7169 #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: 7171 7174 7172 7175 /* Line 1806 of yacc.c */ 7173 7176 #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"7181 7177 { (yyval.decl) = 0; } 7182 7178 break; … … 7185 7181 7186 7182 /* Line 1806 of yacc.c */ 7187 #line 159 9"parser.yy"7183 #line 1592 "parser.yy" 7188 7184 { (yyval.decl) = (yyvsp[(1) - (5)].decl)->appendList( (yyvsp[(5) - (5)].decl) ); } 7189 7185 break; … … 7192 7188 7193 7189 /* Line 1806 of yacc.c */ 7194 #line 1 601"parser.yy"7190 #line 1594 "parser.yy" 7195 7191 { (yyval.decl) = (yyvsp[(1) - (5)].decl)->addVarArgs(); } 7196 7192 break; … … 7199 7195 7200 7196 /* Line 1806 of yacc.c */ 7201 #line 1 603"parser.yy"7197 #line 1596 "parser.yy" 7202 7198 { (yyval.decl) = (yyvsp[(1) - (5)].decl)->addVarArgs(); } 7203 7199 break; … … 7206 7202 7207 7203 /* Line 1806 of yacc.c */ 7208 #line 16 11"parser.yy"7204 #line 1604 "parser.yy" 7209 7205 { (yyval.decl) = (yyvsp[(1) - (5)].decl)->appendList( (yyvsp[(5) - (5)].decl) ); } 7210 7206 break; … … 7213 7209 7214 7210 /* Line 1806 of yacc.c */ 7215 #line 16 13"parser.yy"7211 #line 1606 "parser.yy" 7216 7212 { (yyval.decl) = (yyvsp[(1) - (5)].decl)->appendList( (yyvsp[(5) - (5)].decl) ); } 7217 7213 break; … … 7220 7216 7221 7217 /* Line 1806 of yacc.c */ 7222 #line 16 15"parser.yy"7218 #line 1608 "parser.yy" 7223 7219 { (yyval.decl) = (yyvsp[(1) - (9)].decl)->appendList( (yyvsp[(5) - (9)].decl) )->appendList( (yyvsp[(9) - (9)].decl) ); } 7224 7220 break; … … 7227 7223 7228 7224 /* Line 1806 of yacc.c */ 7229 #line 16 21"parser.yy"7225 #line 1614 "parser.yy" 7230 7226 { (yyval.decl) = (yyvsp[(1) - (5)].decl)->appendList( (yyvsp[(5) - (5)].decl) ); } 7231 7227 break; … … 7234 7230 7235 7231 /* 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 */ 7236 7239 #line 1626 "parser.yy" 7237 { (yyval.decl) = 0; }7238 break; 7239 7240 case 41 5:7240 { (yyval.decl) = (yyvsp[(1) - (5)].decl)->addVarArgs(); } 7241 break; 7242 7243 case 418: 7241 7244 7242 7245 /* Line 1806 of yacc.c */ 7243 7246 #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"7251 7247 { (yyval.decl) = (yyvsp[(1) - (5)].decl)->appendList( (yyvsp[(5) - (5)].decl) ); } 7252 7248 break; … … 7255 7251 7256 7252 /* Line 1806 of yacc.c */ 7257 #line 16 42"parser.yy"7253 #line 1635 "parser.yy" 7258 7254 { (yyval.decl) = (yyvsp[(1) - (5)].decl)->appendList( (yyvsp[(5) - (5)].decl) ); } 7259 7255 break; … … 7262 7258 7263 7259 /* Line 1806 of yacc.c */ 7264 #line 16 51"parser.yy"7260 #line 1644 "parser.yy" 7265 7261 { (yyval.decl) = (yyvsp[(1) - (3)].decl)->addName( (yyvsp[(2) - (3)].tok) ); } 7266 7262 break; … … 7269 7265 7270 7266 /* Line 1806 of yacc.c */ 7271 #line 16 54"parser.yy"7267 #line 1647 "parser.yy" 7272 7268 { (yyval.decl) = (yyvsp[(1) - (3)].decl)->addName( (yyvsp[(2) - (3)].tok) ); } 7273 7269 break; … … 7276 7272 7277 7273 /* Line 1806 of yacc.c */ 7278 #line 16 56"parser.yy"7274 #line 1649 "parser.yy" 7279 7275 { (yyval.decl) = (yyvsp[(2) - (4)].decl)->addName( (yyvsp[(3) - (4)].tok) )->addQualifiers( (yyvsp[(1) - (4)].decl) ); } 7280 7276 break; … … 7283 7279 7284 7280 /* Line 1806 of yacc.c */ 7285 #line 16 66"parser.yy"7281 #line 1659 "parser.yy" 7286 7282 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); } 7287 7283 break; … … 7290 7286 7291 7287 /* Line 1806 of yacc.c */ 7292 #line 16 72"parser.yy"7288 #line 1665 "parser.yy" 7293 7289 { 7294 7290 typedefTable.addToEnclosingScope( TypedefTable::ID ); … … 7300 7296 7301 7297 /* Line 1806 of yacc.c */ 7302 #line 167 7"parser.yy"7298 #line 1670 "parser.yy" 7303 7299 { 7304 7300 typedefTable.addToEnclosingScope( TypedefTable::ID ); … … 7310 7306 7311 7307 /* Line 1806 of yacc.c */ 7312 #line 16 86"parser.yy"7308 #line 1679 "parser.yy" 7313 7309 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addType( (yyvsp[(1) - (2)].decl) ); } 7314 7310 break; … … 7317 7313 7318 7314 /* Line 1806 of yacc.c */ 7319 #line 16 95"parser.yy"7315 #line 1688 "parser.yy" 7320 7316 { (yyval.decl) = DeclarationNode::newName( (yyvsp[(1) - (1)].tok) ); } 7321 7317 break; … … 7324 7320 7325 7321 /* Line 1806 of yacc.c */ 7326 #line 169 7"parser.yy"7322 #line 1690 "parser.yy" 7327 7323 { (yyval.decl) = (yyvsp[(1) - (3)].decl)->appendList( DeclarationNode::newName( (yyvsp[(3) - (3)].tok) ) ); } 7328 7324 break; … … 7331 7327 7332 7328 /* Line 1806 of yacc.c */ 7333 #line 17 22"parser.yy"7329 #line 1715 "parser.yy" 7334 7330 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addType( (yyvsp[(1) - (2)].decl) ); } 7335 7331 break; … … 7338 7334 7339 7335 /* 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 */ 7340 7350 #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" 7348 7379 { (yyval.in) = 0; } 7349 7380 break; 7350 7381 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: 7373 7383 7374 7384 /* Line 1806 of yacc.c */ 7375 7385 #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"7390 7386 { (yyval.in) = (yyvsp[(2) - (2)].in)->set_designators( (yyvsp[(1) - (2)].en) ); } 7391 7387 break; … … 7394 7390 7395 7391 /* Line 1806 of yacc.c */ 7396 #line 17 52"parser.yy"7397 { (yyval.in) = (InitializerNode *)( (yyvsp[(1) - (3)].in)->set_l ink( (yyvsp[(3) - (3)].in) ) ); }7392 #line 1745 "parser.yy" 7393 { (yyval.in) = (InitializerNode *)( (yyvsp[(1) - (3)].in)->set_last( (yyvsp[(3) - (3)].in) ) ); } 7398 7394 break; 7399 7395 … … 7401 7397 7402 7398 /* Line 1806 of yacc.c */ 7403 #line 17 54"parser.yy"7404 { (yyval.in) = (InitializerNode *)( (yyvsp[(1) - (4)].in)->set_l ink( (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) ) ) ); } 7405 7401 break; 7406 7402 … … 7408 7404 7409 7405 /* Line 1806 of yacc.c */ 7410 #line 17 70"parser.yy"7406 #line 1763 "parser.yy" 7411 7407 { (yyval.en) = new ExpressionNode( build_varref( (yyvsp[(1) - (2)].tok) ) ); } 7412 7408 break; … … 7415 7411 7416 7412 /* Line 1806 of yacc.c */ 7417 #line 17 76"parser.yy"7418 { (yyval.en) = (ExpressionNode *)( (yyvsp[(1) - (2)].en)->set_l ink( (yyvsp[(2) - (2)].en) ) ); }7413 #line 1769 "parser.yy" 7414 { (yyval.en) = (ExpressionNode *)( (yyvsp[(1) - (2)].en)->set_last( (yyvsp[(2) - (2)].en) ) ); } 7419 7415 break; 7420 7416 … … 7422 7418 7423 7419 /* 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 */ 7424 7441 #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"7446 7442 { (yyval.en) = new ExpressionNode( build_range( (yyvsp[(3) - (7)].en), (yyvsp[(5) - (7)].en) ) ); } 7447 7443 break; … … 7450 7446 7451 7447 /* Line 1806 of yacc.c */ 7452 #line 17 91"parser.yy"7448 #line 1784 "parser.yy" 7453 7449 { (yyval.en) = (yyvsp[(4) - (6)].en); } 7454 7450 break; … … 7457 7453 7458 7454 /* Line 1806 of yacc.c */ 7459 #line 18 15"parser.yy"7455 #line 1808 "parser.yy" 7460 7456 { (yyval.decl) = (yyvsp[(2) - (2)].decl)->addQualifiers( (yyvsp[(1) - (2)].decl) ); } 7461 7457 break; … … 7464 7460 7465 7461 /* Line 1806 of yacc.c */ 7466 #line 181 7"parser.yy"7462 #line 1810 "parser.yy" 7467 7463 { (yyval.decl) = (yyvsp[(1) - (2)].decl)->addQualifiers( (yyvsp[(2) - (2)].decl) ); } 7468 7464 break; … … 7471 7467 7472 7468 /* Line 1806 of yacc.c */ 7473 #line 181 9"parser.yy"7469 #line 1812 "parser.yy" 7474 7470 { (yyval.decl) = (yyvsp[(1) - (3)].decl)->addQualifiers( (yyvsp[(2) - (3)].decl) )->addQualifiers( (yyvsp[(3) - (3)].decl) ); } 7475 7471 break; … … 7478 7474 7479 7475 /* 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 */ 7480 7490 #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"7495 7491 { (yyval.decl) = DeclarationNode::newFromTypeGen( (yyvsp[(1) - (4)].tok), (yyvsp[(3) - (4)].en) ); } 7496 7492 break; … … 7499 7495 7500 7496 /* 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 */ 7501 7511 #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"7516 7512 { (yyval.decl) = DeclarationNode::newTypeParam( (yyvsp[(1) - (4)].tclass), (yyvsp[(2) - (4)].tok) )->addAssertions( (yyvsp[(4) - (4)].decl) ); } 7517 7513 break; … … 7520 7516 7521 7517 /* Line 1806 of yacc.c */ 7522 #line 18 51"parser.yy"7518 #line 1844 "parser.yy" 7523 7519 { (yyval.tclass) = DeclarationNode::Type; } 7524 7520 break; … … 7527 7523 7528 7524 /* 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 */ 7529 7539 #line 1853 "parser.yy" 7530 { (yyval. tclass) = DeclarationNode::Ftype; }7531 break; 7532 7533 case 48 6:7540 { (yyval.decl) = 0; } 7541 break; 7542 7543 case 488: 7534 7544 7535 7545 /* Line 1806 of yacc.c */ 7536 7546 #line 1855 "parser.yy" 7537 { (yyval. tclass) = DeclarationNode::Dtype; }7538 break; 7539 7540 case 48 7: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: 7541 7551 7542 7552 /* Line 1806 of yacc.c */ 7543 7553 #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"7558 7554 { 7559 7555 typedefTable.openTrait( *(yyvsp[(2) - (5)].tok) ); … … 7565 7561 7566 7562 /* 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 */ 7567 7577 #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"7582 7578 { (yyval.en) = new ExpressionNode( build_typevalue( (yyvsp[(1) - (1)].decl) ) ); } 7583 7579 break; … … 7586 7582 7587 7583 /* 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 */ 7588 7598 #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 49 5:7599 { (yyval.decl) = (yyvsp[(2) - (2)].decl); } 7600 break; 7601 7602 case 497: 7593 7603 7594 7604 /* Line 1806 of yacc.c */ 7595 7605 #line 1884 "parser.yy" 7596 { (yyval. en) = (ExpressionNode *)( (yyvsp[(1) - (3)].en)->set_link( (yyvsp[(3) - (3)].en) )); }7597 break; 7598 7599 case 49 6:7600 7601 /* Line 1806 of yacc.c */ 7602 #line 188 9"parser.yy"7603 { (yyval.decl) = (yyvsp[( 2) - (2)].decl); }7604 break; 7605 7606 case 49 7: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: 7607 7617 7608 7618 /* Line 1806 of yacc.c */ 7609 7619 #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: 7614 7624 7615 7625 /* Line 1806 of yacc.c */ 7616 7626 #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: 7621 7631 7622 7632 /* Line 1806 of yacc.c */ 7623 7633 #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"7638 7634 { 7639 7635 typedefTable.addToEnclosingScope( *(yyvsp[(1) - (1)].tok), TypedefTable::TD ); … … 7645 7641 7646 7642 /* Line 1806 of yacc.c */ 7647 #line 19 10"parser.yy"7643 #line 1903 "parser.yy" 7648 7644 { 7649 7645 typedefTable.addToEnclosingScope( *(yyvsp[(1) - (6)].tok), TypedefTable::TG ); … … 7655 7651 7656 7652 /* Line 1806 of yacc.c */ 7657 #line 191 8"parser.yy"7653 #line 1911 "parser.yy" 7658 7654 { 7659 7655 typedefTable.addToEnclosingScope( *(yyvsp[(2) - (9)].tok), TypedefTable::ID ); … … 7665 7661 7666 7662 /* Line 1806 of yacc.c */ 7667 #line 19 23"parser.yy"7663 #line 1916 "parser.yy" 7668 7664 { 7669 7665 typedefTable.enterTrait( *(yyvsp[(2) - (8)].tok) ); … … 7675 7671 7676 7672 /* Line 1806 of yacc.c */ 7677 #line 192 8"parser.yy"7673 #line 1921 "parser.yy" 7678 7674 { 7679 7675 typedefTable.leaveTrait(); … … 7686 7682 7687 7683 /* Line 1806 of yacc.c */ 7688 #line 193 8"parser.yy"7684 #line 1931 "parser.yy" 7689 7685 { (yyval.decl) = (yyvsp[(1) - (3)].decl)->appendList( (yyvsp[(3) - (3)].decl) ); } 7690 7686 break; … … 7693 7689 7694 7690 /* Line 1806 of yacc.c */ 7695 #line 194 8"parser.yy"7691 #line 1941 "parser.yy" 7696 7692 { 7697 7693 typedefTable.addToEnclosingScope2( TypedefTable::ID ); … … 7703 7699 7704 7700 /* Line 1806 of yacc.c */ 7705 #line 19 53"parser.yy"7701 #line 1946 "parser.yy" 7706 7702 { 7707 7703 typedefTable.addToEnclosingScope2( TypedefTable::ID ); … … 7713 7709 7714 7710 /* Line 1806 of yacc.c */ 7715 #line 195 8"parser.yy"7711 #line 1951 "parser.yy" 7716 7712 { 7717 7713 typedefTable.addToEnclosingScope2( *(yyvsp[(5) - (5)].tok), TypedefTable::ID ); … … 7723 7719 7724 7720 /* Line 1806 of yacc.c */ 7725 #line 19 66"parser.yy"7721 #line 1959 "parser.yy" 7726 7722 { 7727 7723 typedefTable.addToEnclosingScope2( TypedefTable::ID ); … … 7733 7729 7734 7730 /* Line 1806 of yacc.c */ 7735 #line 19 71"parser.yy"7731 #line 1964 "parser.yy" 7736 7732 { 7737 7733 typedefTable.addToEnclosingScope2( TypedefTable::ID ); … … 7743 7739 7744 7740 /* Line 1806 of yacc.c */ 7745 #line 19 81"parser.yy"7741 #line 1974 "parser.yy" 7746 7742 {} 7747 7743 break; … … 7750 7746 7751 7747 /* Line 1806 of yacc.c */ 7752 #line 19 83"parser.yy"7748 #line 1976 "parser.yy" 7753 7749 { 7754 7750 if ( theTree ) { … … 7763 7759 7764 7760 /* Line 1806 of yacc.c */ 7765 #line 19 95"parser.yy"7761 #line 1988 "parser.yy" 7766 7762 { (yyval.decl) = ( (yyvsp[(1) - (3)].decl) != NULL ) ? (yyvsp[(1) - (3)].decl)->appendList( (yyvsp[(3) - (3)].decl) ) : (yyvsp[(3) - (3)].decl); } 7767 7763 break; … … 7770 7766 7771 7767 /* Line 1806 of yacc.c */ 7772 #line 2000"parser.yy"7768 #line 1993 "parser.yy" 7773 7769 { (yyval.decl) = 0; } 7774 7770 break; … … 7777 7773 7778 7774 /* Line 1806 of yacc.c */ 7779 #line 200 8"parser.yy"7775 #line 2001 "parser.yy" 7780 7776 {} 7781 7777 break; … … 7784 7780 7785 7781 /* Line 1806 of yacc.c */ 7786 #line 20 10"parser.yy"7782 #line 2003 "parser.yy" 7787 7783 { 7788 7784 linkageStack.push( linkage ); … … 7794 7790 7795 7791 /* Line 1806 of yacc.c */ 7796 #line 20 15"parser.yy"7792 #line 2008 "parser.yy" 7797 7793 {