Changes in / [e85a8631:04cdd9b]


Ignore:
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • doc/aaron_comp_II/comp_II.tex

    re85a8631 r04cdd9b  
    9191\CFA\footnote{Pronounced ``C-for-all'', and written \CFA or \CFL.} is an evolutionary modernization of the C programming language currently being designed and built at the University of Waterloo by a team led by Peter Buhr.
    9292\CFA both fixes existing design problems and adds multiple new features to C, including name overloading, user-defined operators, parametric-polymorphic routines, and type constructors and destructors, among others.
    93 The new features make \CFA more powerful and expressive than C, but impose a compile-time cost, particularly in the expression resolver, which must evaluate the typing rules of a significantly more complex type-system.
     93The new features make \CFA significantly more powerful and expressive than C, but impose a significant compile-time cost, particularly in the expression resolver, which must evaluate the typing rules of a much more complex type-system.
    9494
    9595The primary goal of this research project is to develop a sufficiently performant expression resolution algorithm, experimentally validate its performance, and integrate it into CFA, the \CFA reference compiler.
     
    104104
    105105It is important to note that \CFA is not an object-oriented language.
    106 \CFA does have a system of (possibly implicit) type conversions derived from C's type conversions; while these conversions may be thought of as something like an inheritance hierarchy, the underlying semantics are significantly different and such an analogy is loose at best.
     106\CFA does have a system of (possibly implicit) type conversions derived from C's type conversions; while these conversions may be thought of as something like an inheritance hierarchy the underlying semantics are significantly different and such an analogy is loose at best.
    107107Particularly, \CFA has no concept of ``subclass'', and thus no need to integrate an inheritance-based form of polymorphism with its parametric and overloading-based polymorphism.
    108108The graph structure of the \CFA type conversions is also markedly different than an inheritance graph; it has neither a top nor a bottom type, and does not satisfy the lattice properties typical of inheritance graphs.
     
    120120\end{lstlisting}
    121121The ©identity© function above can be applied to any complete object type (or ``©otype©'').
    122 The type variable ©T© is transformed into a set of additional implicit parameters to ©identity©, which encode sufficient information about ©T© to create and return a variable of that type.
     122The type variable ©T© is transformed into a set of additional implicit parameters to ©identity© which encode sufficient information about ©T© to create and return a variable of that type.
    123123The current \CFA implementation passes the size and alignment of the type represented by an ©otype© parameter, as well as an assignment operator, constructor, copy constructor and destructor.
    124124Here, the runtime cost of polymorphism is spread over each polymorphic call, due to passing more arguments to polymorphic functions; preliminary experiments have shown this overhead to be similar to \CC virtual function calls.
    125125Determining if packaging all polymorphic arguments to a function into a virtual function table would reduce the runtime overhead of polymorphic calls is an open research question.
    126126
    127 Since bare polymorphic types do not provide a great range of available operations, \CFA provides a \emph{type assertion} mechanism to provide further information about a type:
     127Since bare polymorphic types do not provide a great range of available operations, \CFA also provides a \emph{type assertion} mechanism to provide further information about a type:
    128128\begin{lstlisting}
    129129forall(otype T ®| { T twice(T); }®)
     
    137137\end{lstlisting}
    138138These type assertions may be either variable or function declarations that depend on a polymorphic type variable.
    139 ©four_times© can only be called with an argument for which there exists a function named ©twice© that can take that argument and return another value of the same type; a pointer to the appropriate ©twice© function is passed as an additional implicit parameter to the call of ©four_times©.
     139©four_times© can only be called with an argument for which there exists a function named ©twice© that can take that argument and return another value of the same type; a pointer to the appropriate ©twice© function is passed as an additional implicit parameter to the call to ©four_times©.
    140140
    141141Monomorphic specializations of polymorphic functions can themselves be used to satisfy type assertions.
     
    148148The compiler accomplishes this by creating a wrapper function calling ©twice // (2)© with ©S© bound to ©double©, then providing this wrapper function to ©four_times©\footnote{©twice // (2)© could also have had a type parameter named ©T©; \CFA specifies renaming of the type parameters, which would avoid the name conflict with the type variable ©T© of ©four_times©.}.
    149149
    150 Finding appropriate functions to satisfy type assertions is essentially a recursive case of expression resolution, as it takes a name (that of the type assertion) and attempts to match it to a suitable declaration \emph{in the current scope}.
     150Finding appropriate functions to satisfy type assertions is essentially a recursive case of expression resolution, as it takes a name (that of the type assertion) and attempts to match it to a suitable declaration in the current scope.
    151151If a polymorphic function can be used to satisfy one of its own type assertions, this recursion may not terminate, as it is possible that function is examined as a candidate for its own type assertion unboundedly repeatedly.
    152152To avoid infinite loops, the current CFA compiler imposes a fixed limit on the possible depth of recursion, similar to that employed by most \CC compilers for template expansion; this restriction means that there are some semantically well-typed expressions that cannot be resolved by CFA.
     
    170170forall(otype M | has_magnitude(M))
    171171M max_magnitude( M a, M b ) {
    172     return abs(a) < abs(b) ? b : a;
     172    M aa = abs(a), ab = abs(b);
     173    return aa < ab ? b : a;
    173174}
    174175\end{lstlisting}
    175176
    176177Semantically, traits are simply a named lists of type assertions, but they may be used for many of the same purposes that interfaces in Java or abstract base classes in \CC are used for.
    177 Unlike Java interfaces or \CC base classes, \CFA types do not explicitly state any inheritance relationship to traits they satisfy; this can be considered a form of structural inheritance, similar to implementation of an interface in Go, as opposed to the nominal inheritance model of Java and \CC.
     178Unlike Java interfaces or \CC base classes, \CFA types do not explicitly state any inheritance relationship to traits they satisfy; this can be considered a form of structural inheritance, similar to interface implementation in Go, as opposed to the nominal inheritance model of Java and \CC.
    178179Nominal inheritance can be simulated with traits using marker variables or functions:
    179180\begin{lstlisting}
     
    189190\end{lstlisting}
    190191
    191 Traits, however, are significantly more powerful than nominal-inheritance interfaces; firstly, due to the scoping rules of the declarations that satisfy a trait's type assertions, a type may not satisfy a trait everywhere that the type is declared, as with ©char© and the ©nominal© trait above.
    192 Secondly, traits may be used to declare a relationship among multiple types, a property that may be difficult or impossible to represent in nominal-inheritance type systems:
     192Traits, however, are significantly more powerful than nominal-inheritance interfaces; firstly, due to the scoping rules of the declarations which satisfy a trait's type assertions, a type may not satisfy a trait everywhere that the type is declared, as with ©char© and the ©nominal© trait above.
     193Secondly, traits may be used to declare a relationship between multiple types, a property which may be difficult or impossible to represent in nominal-inheritance type systems:
    193194\begin{lstlisting}
    194195trait pointer_like(®otype Ptr, otype El®) {
     
    201202};
    202203
    203 typedef list *list_iterator;
     204typedef list* list_iterator;
    204205
    205206lvalue int *?( list_iterator it ) {
     
    208209\end{lstlisting}
    209210
    210 In the example above, ©(list_iterator, int)© satisfies ©pointer_like© by the user-defined dereference function, and ©(list_iterator, list)© also satisfies ©pointer_like© by the built-in dereference operator for pointers.
    211 Given a declaration ©list_iterator it©, ©*it© can be either an ©int© or a ©list©, with the meaning disambiguated by context (\eg ©int x = *it;© interprets ©*it© as an ©int©, while ©(*it).value = 42;© interprets ©*it© as a ©list©).
     211In the example above, ©(list_iterator, int)© satisfies ©pointer_like© by the given function, and ©(list_iterator, list)© also satisfies ©pointer_like© by the built-in pointer dereference operator.
    212212While a nominal-inheritance system with associated types could model one of those two relationships by making ©El© an associated type of ©Ptr© in the ©pointer_like© implementation, few such systems could model both relationships simultaneously.
    213213
    214 The flexibility of \CFA's implicit trait-satisfaction mechanism provides programmers with a great deal of power, but also blocks some optimization approaches for expression resolution.
    215 The ability of types to begin to or cease to satisfy traits when declarations go into or out of scope makes caching of trait satisfaction judgements difficult, and the ability of traits to take multiple type parameters can lead to a combinatorial explosion of work in any attempt to pre-compute trait satisfaction relationships.
     214The flexibility of \CFA's implicit trait satisfaction mechanism provides programmers with a great deal of power, but also blocks some optimization approaches for expression resolution.
     215The ability of types to begin to or cease to satisfy traits when declarations go into or out of scope makes caching of trait satisfaction judgements difficult, and the ability of traits to take multiple type parameters could lead to a combinatorial explosion of work in any attempt to pre-compute trait satisfaction relationships.
    216216On the other hand, the addition of a nominal inheritance mechanism to \CFA's type system or replacement of \CFA's trait satisfaction system with a more object-oriented inheritance model and investigation of possible expression resolution optimizations for such a system may be an interesting avenue of further research.
    217217
    218218\subsection{Name Overloading}
    219219In C, no more than one variable or function in the same scope may share the same name\footnote{Technically, C has multiple separated namespaces, one holding ©struct©, ©union©, and ©enum© tags, one holding labels, one holding typedef names, variable, function, and enumerator identifiers, and one for each ©struct© or ©union© type holding the field names.}, and variable or function declarations in inner scopes with the same name as a declaration in an outer scope hide the outer declaration.
    220 This restriction makes finding the proper declaration to match to a variable expression or function application a simple matter of symbol-table lookup, which can be easily and efficiently implemented.
     220This makes finding the proper declaration to match to a variable expression or function application a simple matter of symbol table lookup, which can be easily and efficiently implemented.
    221221\CFA, on the other hand, allows overloading of variable and function names, so long as the overloaded declarations do not have the same type, avoiding the multiplication of variable and function names for different types common in the C standard library, as in the following example:
    222222\begin{lstlisting}
     
    229229double max = DBL_MAX;  // (4)
    230230
    231 max(7, -max);   // uses (1) and (3), by matching int type of the constant 7
    232 max(max, 3.14); // uses (2) and (4), by matching double type of the constant 3.14
     231max(7, -max);   // uses (1) and (3), by matching int type of 7
     232max(max, 3.14); // uses (2) and (4), by matching double type of 3.14
    233233
    234234max(max, -max);  // ERROR: ambiguous
    235 int m = max(max, -max); // uses (1) once and (3) twice, by matching return type
     235int m = max(max, -max); // uses (1) and (3) twice, by return type
    236236\end{lstlisting}
    237237
     
    239239
    240240\subsection{Implicit Conversions}
    241 In addition to the multiple interpretations of an expression produced by name overloading, \CFA must support all of the implicit conversions present in C for backward compatibility, producing further candidate interpretations for expressions.
    242 C does not have a inheritance hierarchy of types, but the C standard's rules for the ``usual arithmetic conversions'' define which of the built-in types are implicitly convertable to which other types, and the relative cost of any pair of such conversions from a single source type.
    243 \CFA adds to the usual arithmetic conversions rules defining the cost of binding a polymorphic type variable in a function call; such bindings are cheaper than any \emph{unsafe} (narrowing) conversion, \eg ©int© to ©char©, but more expensive than any \emph{safe} (widening) conversion, \eg ©int© to ©double©.
    244 
    245 The expression resolution problem, then, is to find the unique minimal-cost interpretation of each expression in the program, where all identifiers must be matched to a declaration, and implicit conversions or polymorphic bindings of the result of an expression may increase the cost of the expression.
     241In addition to the multiple interpretations of an expression produced by name overloading, \CFA also supports all of the implicit conversions present in C, producing further candidate interpretations for expressions.
     242C does not have a traditionally-defined inheritance hierarchy of types, but the C standard's rules for the ``usual arithmetic conversions'' define which of the built-in types are implicitly convertable to which other types, and the relative cost of any pair of such conversions from a single source type.
     243\CFA adds to the usual arithmetic conversions rules for determining the cost of binding a polymorphic type variable in a function call; such bindings are cheaper than any \emph{unsafe} (narrowing) conversion, \eg ©int© to ©char©, but more expensive than any \emph{safe} (widening) conversion, \eg ©int© to ©double©.
     244
     245The expression resolution problem, then, is to find the unique minimal-cost interpretation of each expression in the program, where all identifiers must be matched to a declaration and implicit conversions or polymorphic bindings of the result of an expression may increase the cost of the expression.
    246246Note that which subexpression interpretation is minimal-cost may require contextual information to disambiguate.
    247 For instance, in the example in the previous subsection, ©max(max, -max)© cannot be unambiguously resolved, but ©int m = max(max, -max)© has a single minimal-cost resolution.
    248 While the interpretation ©int m = (int)max((double)max, -(double)max)© is also a valid interpretation, it is not minimal-cost due to the unsafe cast from the ©double© result of ©max© to ©int© (the two ©double© casts function as type ascriptions selecting ©double max© rather than casts from ©int max© to ©double©, and as such are zero-cost).
     247For instance, in the example in the previous subsection, ©max(max, -max)© cannot be unambiguously resolved, but ©int m = max(max, -max);© has a single minimal-cost resolution.
     248©int m = (int)max((double)max, -(double)max)© is also be a valid interpretation, but is not minimal-cost due to the unsafe cast from the ©double© result of ©max© to ©int© (the two ©double© casts function as type ascriptions selecting ©double max© rather than casts from ©int max© to ©double©, and as such are zero-cost).
    249249
    250250\subsubsection{User-generated Implicit Conversions}
     
    252252Such a conversion system should be simple for programmers to utilize, and fit naturally with the existing design of implicit conversions in C; ideally it would also be sufficiently powerful to encode C's usual arithmetic conversions itself, so that \CFA only has one set of rules for conversions.
    253253
    254 Ditchfield~\cite{Ditchfield:conversions} laid out a framework for using polymorphic-conversion-constructor functions to create a directed acyclic graph (DAG) of conversions.
     254Ditchfield~\cite{Ditchfield:conversions} has laid out a framework for using polymorphic-conversion-constructor functions to create a directed acyclic graph (DAG) of conversions.
    255255A monomorphic variant of these functions can be used to mark a conversion arc in the DAG as only usable as the final step in a conversion.
    256 With these two types of conversion arcs, separate DAGs can be created for the safe and the unsafe conversions, and conversion cost can be represented the length of the shortest path through the DAG from one type to another.
     256With these two types of conversion arcs, separate DAGs can be created for the safe and the unsafe conversions, and conversion cost can be represented as path length through the DAG.
    257257\begin{figure}[h]
    258258\centering
    259259\includegraphics{conversion_dag}
    260 \caption{A portion of the implicit conversion DAG for built-in types.}\label{fig:conv_dag}
     260\caption{A portion of the implicit conversion DAG for built-in types.}
    261261\end{figure}
    262 As can be seen in Figure~\ref{fig:conv_dag}, there are either safe or unsafe paths between each of the arithmetic types listed; the ``final'' arcs are important both to avoid creating cycles in the signed-unsigned conversions, and to disambiguate potential diamond conversions (\eg, if the ©int© to ©unsigned int© conversion was not marked final there would be two length-two paths from ©int© to ©unsigned long©, making it impossible to choose which one; however, since the ©unsigned int© to ©unsigned long© arc can not be traversed after the final ©int© to ©unsigned int© arc, there is a single unambiguous conversion path from ©int© to ©unsigned long©).
     262As can be seen in the example DAG above, there are either safe or unsafe paths between each of the arithmetic types listed; the ``final'' arcs are important both to avoid creating cycles in the signed-unsigned conversions, and to disambiguate potential diamond conversions (\eg, if the ©int© to ©unsigned int© conversion was not marked final there would be two length-two paths from ©int© to ©unsigned long©, and it would be impossible to choose which one; however, since the ©unsigned int© to ©unsigned long© arc can not be traversed after the final ©int© to ©unsigned int© arc, there is a single unambiguous conversion path from ©int© to ©unsigned long©).
    263263
    264264Open research questions on this topic include:
    265265\begin{itemize}
    266266\item Can a conversion graph be generated that represents each allowable conversion in C with a unique minimal-length path such that the path lengths accurately represent the relative costs of the conversions?
    267 \item Can such a graph representation be usefully augmented to include user-defined types as well as built-in types?
    268 \item Can the graph be efficiently represented and used in the expression resolver?
     267\item Can such a graph representation can be usefully augmented to include user-defined types as well as built-in types?
     268\item Can the graph can be efficiently represented and used in the expression resolver?
    269269\end{itemize}
    270270
    271271\subsection{Constructors and Destructors}
    272272Rob Shluntz, a current member of the \CFA research team, has added constructors and destructors to \CFA.
    273 Each type has an overridable default-generated zero-argument constructor, copy constructor, assignment operator, and destructor.
    274 For ©struct© types these functions each call their equivalents on each field of the ©struct©.
    275 This feature affects expression resolution because an ©otype© type variable ©T© implicitly adds four type assertions, one for each of these four functions, so assertion resolution is pervasive in \CFA polymorphic functions, even those without any explicit type assertions.
     273Each type has an overridable default-generated zero-argument constructor, copy constructor, assignment operator, and destructor; for ©struct© types these functions each call their equivalents on each field of the ©struct©.
     274This affects expression resolution because an ©otype© type variable ©T© implicitly adds four type assertions, one for each of these four functions, so assertion resolution is pervasive in \CFA polymorphic functions, even those without any explicit type assertions.
    276275The following example shows the implicitly-generated code in green:
    277276\begin{lstlisting}
     
    281280};
    282281
    283 ¢void ?{}(kv *this) {  // default constructor
    284     ?{}(&(this->key));  // call recursively on members
    285     ?{}(&(this->value));
    286 }
    287 void ?{}(kv *this, kv that) {  // copy constructor
    288     ?{}(&(this->key), that.key);
    289     ?{}(&(this->value), that.value);
    290 }
    291 kv ?=?(kv *this, kv that) {  // assignment operator
    292     ?=?(&(this->key), that.key);
    293     ?=?(&(this->value), that.value);
     282¢void ?{}(kv *this) {
     283    ?{}(&this->key);
     284    ?{}(&this->value);
     285}
     286void ?{}(kv *this, kv that) {
     287    ?{}(&this->key, that.key);
     288    ?{}(&this->value, that.value);
     289}
     290kv ?=?(kv *this, kv that) {
     291    ?=?(&this->key, that.key);
     292    ?=?(&this->value, that.value);
    294293    return *this;
    295294}
    296 void ^?{}(kv *this) {  // destructor
    297     ^?{}(&(this->key));
    298     ^?{}(&(this->value));
     295void ^?{}(kv *this) {
     296    ^?{}(&this->key);
     297    ^?{}(&this->value);
    299298
    300299
     
    336335\begin{itemize}
    337336\item Since there is an implicit conversion from ©void*© to any pointer type, the highlighted expression can be interpreted as either a ©void*©, matching ©f // (1)©, or a ©box(S)*© for some type ©S©, matching ©f // (2)©.
    338 \item To determine the cost of the ©box(S)© interpretation, a type must be found for ©S© that satisfies the ©otype© implicit type assertions (assignment operator, default and copy constructors, and destructor); one option is ©box(S2)© for some type ©S2©.
     337\item To determine the cost of the ©box(S)© interpretation, a type must be found for ©S© which satisfies the ©otype© implicit type assertions (assignment operator, default and copy constructors, and destructor); one option is ©box(S2)© for some type ©S2©.
    339338\item The assignment operator, default and copy constructors, and destructor of ©box(T)© are also polymorphic functions, each of which require the type parameter ©T© to have an assignment operator, default and copy constructors, and destructor. When choosing an interpretation for ©S2©, one option is ©box(S3)©, for some type ©S3©.
    340339\item The previous step repeats until stopped, with four times as much work performed at each step.
    341340\end{itemize}
    342 This problem can occur in any resolution context where a polymorphic function can satisfy its own type assertions is required for a possible interpretation of an expression with no constraints on its type, and is thus not limited to combinations of generic types with ©void*© conversions.
    343 However, constructors for generic types often satisfy their own assertions and a polymorphic conversion such as the ©void*© conversion to a polymorphic variable is a common way to create an expression with no constraints on its type.
     341This problem can occur in any resolution context where a polymorphic function that can satisfy its own type assertions is required for a possible interpretation of an expression with no constraints on its type, and is thus not limited to combinations of generic types with ©void*© conversions, though constructors for generic types often satisfy their own assertions and a polymorphic conversion such as the ©void*© conversion to a polymorphic variable can create an expression with no constraints on its type.
    344342As discussed above, the \CFA expression resolver must handle this possible infinite recursion somehow, and it occurs fairly naturally in code like the above that uses generic types.
    345343
     
    347345\CFA adds \emph{tuple types} to C, a syntactic facility for referring to lists of values anonymously or with a single identifier.
    348346An identifier may name a tuple, and a function may return one.
    349 Particularly relevantly for resolution, a tuple may be implicitly \emph{destructured} into a list of values, as in the call to ©swap©:
    350 \begin{lstlisting}
    351 [char, char] x = [ '!', '?' ];  // (1)
    352 int x = 42;  // (2)
    353 
    354 forall(otype T) [T, T] swap( T a, T b ) { return [b, a]; }  // (3)
     347Particularly relevantly for resolution, a tuple may be implicitly \emph{destructured} into a list of values, as in the call to ©swap© below:
     348\begin{lstlisting}
     349[char, char] x = [ '!', '?' ];
     350int x = 42;
     351
     352forall(otype T) [T, T] swap( T a, T b ) { return [b, a]; }
    355353
    356354x = swap( x ); // destructure [char, char] x into two elements of parameter list
    357355// cannot use int x for parameter, not enough arguments to swap
    358 
    359 void swap( int, char, char ); // (4)
    360 
    361 swap( x, x ); // resolved as (4) on (2) and (1)
    362 // (3) on (2) and (2) is close, but the polymorphic binding makes it not minimal-cost
    363 \end{lstlisting}
    364 Tuple destructuring means that the mapping from the position of a subexpression in the argument list to the position of a paramter in the function declaration is not straightforward, as some arguments may be expandable to different numbers of parameters, like ©x© above.
    365 In the second example, the second ©x© argument can be resolved starting at the second or third parameter of ©swap©, depending which interpretation of ©x© was chosen for the first argument.
     356\end{lstlisting}
     357Tuple destructuring means that the mapping from the position of a subexpression in the argument list to the position of a paramter in the function declaration is not straightforward, as some arguments may be expandable to different numbers of parameters, like ©x© above.
    366358
    367359\subsection{Reference Types}
    368360I have been designing \emph{reference types} for \CFA, in collaboration with the rest of the \CFA research team.
    369361Given some type ©T©, a ©T&© (``reference to ©T©'') is essentially an automatically dereferenced pointer; with these semantics most of the C standard's discussions of lvalues can be expressed in terms of references instead, with the benefit of being able to express the difference between the reference and non-reference version of a type in user code.
    370 References preserve C's existing qualifier-dropping lvalue-to-rvalue conversion (\eg a ©const volatile int&© can be implicitly converted to a bare ©int©).
    371 The reference proposal also adds a rvalue-to-lvalue conversion to \CFA, implemented by storing the value in a new compiler-generated temporary and passing a reference to the temporary.
    372 These two conversions can chain, producing a qualifier-dropping conversion for references, for instance converting a reference to a ©const int© into a reference to a non-©const int© by copying the originally refered to value into a fresh temporary and taking a reference to this temporary, as in:
     362References preserve C's existing qualifier-dropping lvalue-to-rvalue conversion (\eg a ©const volatile int&© can be implicitly converted to a bare ©int©); the reference proposal also adds a rvalue-to-lvalue conversion to \CFA, implemented by storing the value in a new compiler-generated temporary and passing a reference to the temporary.
     363These two conversions can chain, producing a qualifier-dropping conversion for references, for instance converting a reference to a ©const int© into a reference to a non-©const int© by copying the originally refered to value into a fresh temporary and taking a reference to this temporary, as below:
    373364\begin{lstlisting}
    374365const int magic = 42;
     
    378369print_inc( magic ); // legal; implicitly generated code in green below:
    379370
    380 ¢int tmp = magic;¢ // to safely strip const-qualifier
     371¢int tmp = magic;¢ // copies to safely strip const-qualifier
    381372¢print_inc( tmp );¢ // tmp is incremented, magic is unchanged
    382373\end{lstlisting}
    383 These reference conversions may also chain with the other implicit type-conversions.
    384 The main implication of the reference conversions for expression resolution is the multiplication of available implicit conversions, though given the restricted context reference conversions may be able to be treated efficiently as a special case of implicit conversions.
     374These reference conversions may also chain with the other implicit type conversions.
     375The main implication of this for expression resolution is the multiplication of available implicit conversions, though in a restricted context that may be able to be treated efficiently as a special case.
    385376
    386377\subsection{Special Literal Types}
    387378Another proposal currently under consideration for the \CFA type-system is assigning special types to the literal values ©0© and ©1©.
    388 Implicit conversions from these types allow ©0© and ©1© to be considered as values of many different types, depending on context, allowing expression desugarings like ©if ( x ) {}© $\Rightarrow$ ©if ( x != 0 ) {}© to be implemented efficiently and precisely.
     379Implicit conversions from these types allow ©0© and ©1© to be considered as values of many different types, depending on context, allowing expression desugarings like ©if ( x ) {}© $\Rightarrow$ ©if ( x != 0 ) {}© to be implemented efficiently and precicely.
    389380This approach is a generalization of C's existing behaviour of treating ©0© as either an integer zero or a null pointer constant, and treating either of those values as boolean false.
    390381The main implication for expression resolution is that the frequently encountered expressions ©0© and ©1© may have a large number of valid interpretations.
     
    395386int somefn(char) = delete;
    396387\end{lstlisting}
    397 This feature is typically used in \CCeleven to make a type non-copyable by deleting its copy constructor and assignment operator\footnote{In previous versions of \CC a type could be made non-copyable by declaring a private copy constructor and assignment operator, but not defining either. This idiom is well-known, but depends on some rather subtle and \CC-specific rules about private members and implicitly-generated functions; the deleted-function form is both clearer and less verbose.}, or forbidding some interpretations of a polymorphic function by specifically deleting the forbidden overloads\footnote{Specific polymorphic function overloads can also be forbidden in previous \CC versions through use of template metaprogramming techniques, though this advanced usage is beyond the skills of many programmers. A similar effect can be produced on an ad-hoc basis at the appropriate call sites through use of casts to determine the function type. In both cases, the deleted-function form is clearer and more concise.}.
    398 To add a similar feature to \CFA involves including the deleted function declarations in expression resolution along with the normal declarations, but producing a compiler error if the deleted function is the best resolution.
     388This feature is typically used in \CCeleven to make a type non-copyable by deleting its copy constructor and assignment operator, or forbidding some interpretations of a polymorphic function by specifically deleting the forbidden overloads.
     389To add a similar feature to \CFA would involve including the deleted function declarations in expression resolution along with the normal declarations, but producing a compiler error if the deleted function was the best resolution.
    399390How conflicts should be handled between resolution of an expression to both a deleted and a non-deleted function is a small but open research question.
    400391
     
    413404%TODO: look up and lit review
    414405The second area of investigation is minimizing dependencies between argument-parameter matches; the current CFA compiler attempts to match entire argument combinations against functions at once, potentially attempting to match the same argument against the same parameter multiple times.
    415 Whether the feature set of \CFA admits an expression resolution algorithm where arguments can be matched to parameters independently of other arguments in the same function application is an area of open research; polymorphic type paramters produce enough cross-argument dependencies that the problem is not trivial.
     406Whether the feature set of \CFA admits an expression resolution algorithm where arguments can be matched to parameters independently of other arguments in the same function application is an area of open research; polymorphic type paramters produce enough of a cross-argument dependency that the problem is not trivial.
    416407If cross-argument resolution dependencies cannot be completely eliminated, effective caching strategies to reduce duplicated work between equivalent argument-parameter matches in different combinations may mitigate the asymptotic defecits of the whole-combination matching approach.
    417408The final area of investigation is heuristics and algorithmic approaches to reduce the number of argument interpretations considered in the common case; if argument-parameter matches cannot be made independent, even small reductions in $i$ should yield significant reductions in the $i^{p+1}$ resolver runtime factor.
     
    421412
    422413\subsection{Argument-Parameter Matching}
    423 The first axis for consideration is the 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.
     414The 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.
    424415For 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.
    425 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 in Figure~\ref{fig:res_dag}:
     416All 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:
    426417\begin{figure}[h]
    427418\centering
     
    442433\end{figure}
    443434
    444 Note that some interpretations may be part of more than one super-interpretation, as with the second $p_i$ in the bottom row, while some valid subexpression interpretations, like $f_d$ in the middle row, are not used in any interpretation of their superexpression.
     435Note that some interpretations may be part of more than one super-interpretation, as with $p_i$ in the bottom row, while some valid subexpression interpretations, like $f_d$ in the middle row, are not used in any interpretation of their containing expression.
    445436
    446437\subsubsection{Argument-directed (Bottom-up)}
     
    460451A reasonable hybrid approach might take a top-down approach when the expression to be matched has a fixed type, and a bottom-up approach in untyped contexts.
    461452This approach may involve switching from one type to another at different levels of the expression tree.
    462 For instance, in:
     453For instance:
    463454\begin{lstlisting}
    464455forall(otype T)
     
    469460int x = f( f( '!' ) );
    470461\end{lstlisting}
    471 the outer call to ©f© must have a return type that is (implicitly convertable to) ©int©, so a top-down approach is used to select \textit{(1)} as the proper interpretation of ©f©. \textit{(1)}'s parameter ©x©, however, is an unbound type variable, and can thus take a value of any complete type, providing no guidance for the choice of candidate for the inner call to ©f©. The leaf expression ©'!'©, however, determines a zero-cost interpretation of the inner ©f© as \textit{(2)}, providing a minimal-cost expression resolution where ©T© is bound to ©void*©.
    472 
    473 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 finding good heuristics for which subexpressions to swich matching strategies on is an open question.
    474 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.
     462The outer call to ©f© must have a return type that is (implicitly convertable to) ©int©, so a top-down approach is used to select \textit{(1)} as the proper interpretation of ©f©. \textit{(1)}'s parameter ©x©, however, is an unbound type variable, and can thus take a value of any complete type, providing no guidance for the choice of candidate for the inner call to ©f©. The leaf expression ©'!'©, however, determines a zero-cost interpretation of the inner ©f© as \textit{(2)}, providing a minimal-cost expression resolution where ©T© is bound to ©void*©.
     463
     464Deciding 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.
    475465
    476466Ganzinger 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.
    477467Persch~\etal~\cite{PW:overload} developed a similar two-pass approach where the bottom-up pass is followed by the top-down pass.
    478 These algorithms differ from the hybrid approach under investigation in that they take multiple passes over the expression tree to yield a solution, and that they also 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.
     468These algorithms differ from the hybrid approach under investigation in that they take multiple passes over the expression tree to yield a solution, and also in that they apply both filtering heuristics to all expression nodes; \CFA's polymorphic functions and implicit conversions make the approach of filtering out invalid types taken by all of these algorithms infeasible.
    479469
    480470\subsubsection{Common Subexpression Caching}
     
    490480\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.
    491481The upcoming Concepts standard~\cite{C++concepts} defines a system of type constraints similar in principle to \CFA's.
    492 Cormack and Wright~\cite{Cormack90} present an algorithm that integrates overload resolution with a polymorphic type inference approach very similar to \CFA's.
     482Cormack and Wright~\cite{Cormack90} present an algorithm which integrates overload resolution with a polymorphic type inference approach very similar to \CFA's.
    493483However, 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.}.
    494484
     
    496486Bilson does account for implicit conversions in his algorithm, but it is unclear if the approach is optimal.
    497487His 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.
    498 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; however, this approach does not generate implicit conversions that are not useful to match the containing function.
     488This 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.
     489Calculating implicit conversions on parameters pairs naturally with a top-down approach to expression resolution, though it can also be used in a bottom-up approach, as Bilson demonstrates.
    499490
    500491\subsubsection{On Arguments}
    501492Another approach is to generate a set of possible implicit conversions for each set of interpretations of a given argument.
    502493This approach has the benefit of detecting ambiguous interpretations of arguments at the level of the argument rather than its containing call, never finds more than one interpretation of the argument with a given type, and re-uses calculation of implicit conversions between function candidates.
    503 On the other hand, this approach may unnecessarily generate argument interpretations that never match any parameter, wasting work.
    504 Furthermore, in the presence of tuple types, this approach may lead to a combinatorial explosion of argument interpretations considered, unless the tuple can be considered as a sequence of elements rather than a unified whole.
     494On the other hand, this approach may unncessarily generate argument interpretations that never match any parameter, wasting work.
     495Further, in the presence of tuple types this approach may lead to a combinatorial explosion of argument interpretations considered, unless the tuple can be considered as a sequence of elements rather than a unified whole.
     496Calculating implicit conversions on arguments is a viable approach for bottom-up expression resolution, though it may be difficult to apply in a top-down approach due to the presence of a target type for the expression interpretation.
    505497
    506498\subsection{Candidate Set Generation}
    507 All the algorithms discussed to this point generate the complete set of candidate argument interpretations before attempting to match the containing function-call expression.
    508 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 wasted work.
    509 Under the assumption 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.
     499All the algorithms discussed to this point generate the complete set of candidate argument interpretations before attempting to match the containing function call expression.
     500However, 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.
     501Under 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.
    510502
    511503\subsubsection{Eager}
     
    571563This comparison closes Baker's open research question, as well as potentially improving Bilson's \CFA compiler.
    572564
    573 Rather than testing all of these algorithms in-place in the \CFA compiler, a resolver prototype is being developed that acts on a simplified input language encapsulating the essential details of the \CFA type-system\footnote{Note this simplified input language is not a usable programming language.}.
     565Rather than testing all of these algorithms in-place in the \CFA compiler, a resolver prototype is being developed which acts on a simplified input language encapsulating the essential details of the \CFA type-system\footnote{Note this simplified input language is not a usable programming language.}.
    574566Multiple variants of this resolver prototype will be implemented, each encapsulating a different expression resolution variant, sharing as much code as feasible.
    575567These variants will be instrumented to test runtime performance, and run on a variety of input files; the input files may be generated programmatically or from exisiting code in \CFA or similar languages.
     
    579571As an example, there are currently multiple open proposals for how implicit conversions should interact with polymorphic type binding in \CFA, each with distinct levels of expressive power; if the resolver prototype is modified to support each proposal, the optimal algorithm for each proposal can be compared, providing an empirical demonstration of the trade-off between expressive power and compiler runtime.
    580572
    581 This proposed project should provide valuable data on how to implement a performant compiler for programming languages such as \CFA with powerful static type-systems, specifically targeting the feature interaction between name overloading and implicit conversions.
     573This 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.
    582574This 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.
    583575
  • src/Common/Assert.cc

    re85a8631 r04cdd9b  
    1010// Created On       : Thu Aug 18 13:26:59 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Aug 19 17:07:08 2016
    13 // Update Count     : 10
     12// Last Modified On : Thu Aug 18 23:40:29 2016
     13// Update Count     : 8
    1414//
    1515
    1616#include <assert.h>
    17 #include <cstdarg>                                                                              // varargs
    18 #include <cstdio>                                                                               // fprintf
    19 #include <cstdlib>                                                                              // abort
     17#include <cstdarg>
     18#include <cstdio>
     19#include <cstdlib>
    2020
    2121extern const char * __progname;                                                 // global name of running executable (argv[0])
     
    2626void __assert_fail( const char *assertion, const char *file, unsigned int line, const char *function ) {
    2727        fprintf( stderr, CFA_ASSERT_FMT ".\n", __progname, function, line, file );
    28         abort();
     28        exit( EXIT_FAILURE );
    2929}
    3030
     
    3535        va_start( args, fmt );
    3636        vfprintf( stderr, fmt, args );
    37         abort();
     37        exit( EXIT_FAILURE );
    3838}
    3939
  • src/Common/utility.h

    re85a8631 r04cdd9b  
    5656}
    5757
     58
    5859template< typename Input_iterator >
    5960void printEnums( Input_iterator begin, Input_iterator end, const char * const *name_array, std::ostream &os ) {
  • src/Makefile.am

    re85a8631 r04cdd9b  
    1111## Created On       : Sun May 31 08:51:46 2015
    1212## Last Modified By : Peter A. Buhr
    13 ## Last Modified On : Sat Aug 20 11:13:12 2016
    14 ## Update Count     : 71
     13## Last Modified On : Thu Aug 18 17:47:06 2016
     14## Update Count     : 70
    1515###############################################################################
    1616
     
    4343driver_cfa_cpp_SOURCES = ${SRC}
    4444driver_cfa_cpp_LDADD = ${LEXLIB}                        # yywrap
    45 driver_cfa_cpp_CXXFLAGS = -Wno-deprecated -Wall -DDEBUG_ALL -rdynamic -I${abs_top_srcdir}/src/include
     45driver_cfa_cpp_CXXFLAGS = -Wno-deprecated -Wall -DDEBUG_ALL -I${abs_top_srcdir}/src/include
    4646
    4747MAINTAINERCLEANFILES += ${libdir}/${notdir ${cfa_cpplib_PROGRAMS}}
  • src/Makefile.in

    re85a8631 r04cdd9b  
    427427driver_cfa_cpp_SOURCES = ${SRC}
    428428driver_cfa_cpp_LDADD = ${LEXLIB}                        # yywrap
    429 driver_cfa_cpp_CXXFLAGS = -Wno-deprecated -Wall -DDEBUG_ALL -rdynamic -I${abs_top_srcdir}/src/include
     429driver_cfa_cpp_CXXFLAGS = -Wno-deprecated -Wall -DDEBUG_ALL -I${abs_top_srcdir}/src/include
    430430all: $(BUILT_SOURCES)
    431431        $(MAKE) $(AM_MAKEFLAGS) all-am
  • src/Parser/DeclarationNode.cc

    re85a8631 r04cdd9b  
    230230        DeclarationNode *newnode = new DeclarationNode;
    231231        newnode->name = assign_strptr( name );
    232         newnode->enumeratorValue.reset( constant );
     232        newnode->enumeratorValue = constant;
    233233        typedefTable.addToEnclosingScope( newnode->name, TypedefTable::ID );
    234234        return newnode;
     
    776776                } // if
    777777        } // if
    778         delete o;
    779778        return o;
    780779}
  • src/Parser/ExpressionNode.cc

    re85a8631 r04cdd9b  
    183183
    184184Expression *build_cast( DeclarationNode *decl_node, ExpressionNode *expr_node ) {
    185         Type *targetType = maybeMoveBuildType( decl_node );
     185        Type *targetType = decl_node->buildType();
    186186        if ( dynamic_cast< VoidType * >( targetType ) ) {
    187187                delete targetType;
     
    213213}
    214214Expression *build_sizeOftype( DeclarationNode *decl_node ) {
    215         return new SizeofExpr( maybeMoveBuildType( decl_node ) );
     215        Expression* ret = new SizeofExpr( decl_node->buildType() );
     216        delete decl_node;
     217        return ret;
    216218}
    217219Expression *build_alignOfexpr( ExpressionNode *expr_node ) {
     
    219221}
    220222Expression *build_alignOftype( DeclarationNode *decl_node ) {
    221         return new AlignofExpr( maybeMoveBuildType( decl_node) );
     223        return new AlignofExpr( decl_node->buildType() );
    222224}
    223225Expression *build_offsetOf( DeclarationNode *decl_node, NameExpr *member ) {
    224         Expression* ret = new UntypedOffsetofExpr( maybeMoveBuildType( decl_node ), member->get_name() );
     226        Expression* ret = new UntypedOffsetofExpr( decl_node->buildType(), member->get_name() );
     227        delete decl_node;
    225228        delete member;
    226229        return ret;
     
    266269}
    267270Expression *build_attrtype( NameExpr *var, DeclarationNode * decl_node ) {
    268         return new AttrExpr( var, maybeMoveBuildType( decl_node ) );
     271        return new AttrExpr( var, decl_node->buildType() );
    269272}
    270273
     
    293296}
    294297Expression *build_typevalue( DeclarationNode *decl ) {
    295         return new TypeExpr( maybeMoveBuildType( decl ) );
     298        return new TypeExpr( decl->buildType() );
    296299}
    297300
  • src/Parser/InitializerNode.cc

    re85a8631 r04cdd9b  
    4545InitializerNode::~InitializerNode() {
    4646        delete expr;
    47         delete designator;
    48         delete kids;
    4947}
    5048
  • src/Parser/ParseNode.h

    re85a8631 r04cdd9b  
    280280        LinkageSpec::Spec get_linkage() const { return linkage; }
    281281        DeclarationNode *extractAggregate() const;
    282         bool has_enumeratorValue() const { return (bool)enumeratorValue; }
    283         ExpressionNode *consume_enumeratorValue() const { return const_cast<DeclarationNode*>(this)->enumeratorValue.release(); }
     282        ExpressionNode *get_enumeratorValue() const { return enumeratorValue; }
    284283
    285284        bool get_extension() const { return extension; }
     
    296295        std::list< std::string > attributes;
    297296        ExpressionNode *bitfieldWidth;
    298         std::unique_ptr<ExpressionNode> enumeratorValue;
     297        ExpressionNode *enumeratorValue;
    299298        InitializerNode *initializer;
    300299        bool hasEllipsis;
     
    307306
    308307Type *buildType( TypeData *type );
    309 
    310 static inline Type * maybeMoveBuildType( const DeclarationNode *orig ) {
    311         Type* ret = orig ? orig->buildType() : nullptr;
    312         delete orig;
    313         return ret;
    314 }
    315308
    316309//##############################################################################
  • src/Parser/StatementNode.cc

    re85a8631 r04cdd9b  
    5454        // find end of list and maintain previous pointer
    5555        for ( StatementNode * curr = prev; curr != nullptr; curr = (StatementNode *)curr->get_next() ) {
    56                 StatementNode *node = safe_dynamic_cast< StatementNode * >(curr);
     56                StatementNode *node = dynamic_cast< StatementNode * >(curr);
     57                assert( node );
    5758                assert( dynamic_cast< CaseStmt * >(node->stmt.get()) );
    5859                prev = curr;
     
    159160        std::list< Statement * > branches;
    160161        buildMoveList< Statement, StatementNode >( catch_stmt, branches );
    161         CompoundStmt *tryBlock = safe_dynamic_cast< CompoundStmt * >(maybeMoveBuild< Statement >(try_stmt));
     162        CompoundStmt *tryBlock = dynamic_cast< CompoundStmt * >(maybeMoveBuild< Statement >(try_stmt));
     163        assert( tryBlock );
    162164        FinallyStmt *finallyBlock = dynamic_cast< FinallyStmt * >(maybeMoveBuild< Statement >(finally_stmt) );
    163165        return new TryStmt( noLabels, tryBlock, branches, finallyBlock );
  • src/Parser/TypeData.cc

    re85a8631 r04cdd9b  
    909909        std::list< Declaration * >::iterator members = ret->get_members().begin();
    910910        for ( const DeclarationNode *cur = enumeration->constants; cur != nullptr; cur = dynamic_cast< DeclarationNode * >( cur->get_next() ), ++members ) {
    911                 if ( cur->has_enumeratorValue() ) {
     911                if ( cur->get_enumeratorValue() != nullptr ) {
    912912                        ObjectDecl *member = dynamic_cast< ObjectDecl * >(*members);
    913                         member->set_init( new SingleInit( maybeMoveBuild< Expression >( cur->consume_enumeratorValue() ), std::list< Expression * >() ) );
     913                        member->set_init( new SingleInit( maybeBuild< Expression >( cur->get_enumeratorValue() ), std::list< Expression * >() ) );
    914914                } // if
    915915        } // for
  • src/Parser/parser.cc

    re85a8631 r04cdd9b  
    739739    1988,  1989,  1990,  1993,  1992,  2003,  2012,  2018,  2024,  2033,
    740740    2039,  2045,  2051,  2057,  2065,  2071,  2079,  2085,  2094,  2095,
    741     2096,  2100,  2104,  2106,  2112,  2113,  2117,  2118,  2123,  2129,
    742     2130,  2133,  2135,  2136,  2141,  2142,  2143,  2144,  2178,  2180,
    743     2181,  2183,  2188,  2193,  2198,  2200,  2202,  2207,  2209,  2211,
    744     2213,  2218,  2220,  2229,  2231,  2232,  2237,  2239,  2241,  2246,
    745     2248,  2250,  2255,  2257,  2259,  2268,  2269,  2270,  2274,  2276,
    746     2278,  2283,  2285,  2287,  2292,  2294,  2296,  2311,  2313,  2314,
    747     2316,  2321,  2322,  2327,  2329,  2331,  2336,  2338,  2340,  2342,
    748     2347,  2349,  2351,  2361,  2363,  2364,  2366,  2371,  2373,  2375,
    749     2380,  2382,  2384,  2386,  2391,  2393,  2395,  2426,  2428,  2429,
    750     2431,  2436,  2441,  2449,  2451,  2453,  2458,  2460,  2465,  2467,
    751     2481,  2482,  2484,  2489,  2491,  2493,  2495,  2497,  2502,  2503,
    752     2505,  2507,  2512,  2514,  2516,  2522,  2524,  2526,  2530,  2532,
    753     2534,  2536,  2550,  2551,  2553,  2558,  2560,  2562,  2564,  2566,
    754     2571,  2572,  2574,  2576,  2581,  2583,  2585,  2591,  2592,  2594,
    755     2603,  2606,  2608,  2611,  2613,  2615,  2628,  2629,  2631,  2636,
    756     2638,  2640,  2642,  2644,  2649,  2650,  2652,  2654,  2659,  2661,
    757     2669,  2670,  2671,  2676,  2677,  2681,  2683,  2685,  2687,  2689,
    758     2691,  2698,  2700,  2702,  2704,  2706,  2708,  2710,  2712,  2714,
    759     2716,  2721,  2723,  2725,  2730,  2756,  2757,  2759,  2763,  2764,
    760     2768,  2770,  2772,  2774,  2776,  2778,  2785,  2787,  2789,  2791,
    761     2793,  2795,  2800,  2805,  2807,  2809,  2827,  2829,  2834,  2835
     741    2096,  2100,  2104,  2106,  2111,  2112,  2116,  2117,  2122,  2128,
     742    2129,  2132,  2134,  2135,  2139,  2140,  2141,  2142,  2176,  2178,
     743    2179,  2181,  2186,  2191,  2196,  2198,  2200,  2205,  2207,  2209,
     744    2211,  2216,  2218,  2227,  2229,  2230,  2235,  2237,  2239,  2244,
     745    2246,  2248,  2253,  2255,  2257,  2266,  2267,  2268,  2272,  2274,
     746    2276,  2281,  2283,  2285,  2290,  2292,  2294,  2309,  2311,  2312,
     747    2314,  2319,  2320,  2325,  2327,  2329,  2334,  2336,  2338,  2340,
     748    2345,  2347,  2349,  2359,  2361,  2362,  2364,  2369,  2371,  2373,
     749    2378,  2380,  2382,  2384,  2389,  2391,  2393,  2424,  2426,  2427,
     750    2429,  2434,  2439,  2447,  2449,  2451,  2456,  2458,  2463,  2465,
     751    2479,  2480,  2482,  2487,  2489,  2491,  2493,  2495,  2500,  2501,
     752    2503,  2505,  2510,  2512,  2514,  2520,  2522,  2524,  2528,  2530,
     753    2532,  2534,  2548,  2549,  2551,  2556,  2558,  2560,  2562,  2564,
     754    2569,  2570,  2572,  2574,  2579,  2581,  2583,  2589,  2590,  2592,
     755    2601,  2604,  2606,  2609,  2611,  2613,  2626,  2627,  2629,  2634,
     756    2636,  2638,  2640,  2642,  2647,  2648,  2650,  2652,  2657,  2659,
     757    2667,  2668,  2669,  2674,  2675,  2679,  2681,  2683,  2685,  2687,
     758    2689,  2696,  2698,  2700,  2702,  2704,  2706,  2708,  2710,  2712,
     759    2714,  2719,  2721,  2723,  2728,  2754,  2755,  2757,  2761,  2762,
     760    2766,  2768,  2770,  2772,  2774,  2776,  2783,  2785,  2787,  2789,
     761    2791,  2793,  2798,  2803,  2805,  2807,  2825,  2827,  2832,  2833
    762762};
    763763#endif
     
    70757075    break;
    70767076
    7077   case 543:
    7078 #line 2107 "parser.yy" /* yacc.c:1646  */
    7079     { delete (yyvsp[-2].constant); }
     7077  case 544:
     7078#line 2111 "parser.yy" /* yacc.c:1646  */
     7079    { (yyval.decl) = 0; }
    70807080#line 7081 "Parser/parser.cc" /* yacc.c:1646  */
    70817081    break;
    70827082
    7083   case 544:
    7084 #line 2112 "parser.yy" /* yacc.c:1646  */
     7083  case 547:
     7084#line 2118 "parser.yy" /* yacc.c:1646  */
     7085    { (yyval.decl) = (yyvsp[0].decl)->addQualifiers( (yyvsp[-1].decl) ); }
     7086#line 7087 "Parser/parser.cc" /* yacc.c:1646  */
     7087    break;
     7088
     7089  case 548:
     7090#line 2124 "parser.yy" /* yacc.c:1646  */
    70857091    { (yyval.decl) = 0; }
    7086 #line 7087 "Parser/parser.cc" /* yacc.c:1646  */
    7087     break;
    7088 
    7089   case 547:
    7090 #line 2119 "parser.yy" /* yacc.c:1646  */
    7091     { (yyval.decl) = (yyvsp[0].decl)->addQualifiers( (yyvsp[-1].decl) ); }
    70927092#line 7093 "Parser/parser.cc" /* yacc.c:1646  */
    70937093    break;
    70947094
    7095   case 548:
    7096 #line 2125 "parser.yy" /* yacc.c:1646  */
    7097     { (yyval.decl) = 0; }
     7095  case 554:
     7096#line 2139 "parser.yy" /* yacc.c:1646  */
     7097    {}
    70987098#line 7099 "Parser/parser.cc" /* yacc.c:1646  */
    70997099    break;
    71007100
    7101   case 553:
    7102 #line 2137 "parser.yy" /* yacc.c:1646  */
    7103     { delete (yyvsp[-1].en); }
     7101  case 555:
     7102#line 2140 "parser.yy" /* yacc.c:1646  */
     7103    {}
    71047104#line 7105 "Parser/parser.cc" /* yacc.c:1646  */
    71057105    break;
    71067106
    7107   case 554:
     7107  case 556:
    71087108#line 2141 "parser.yy" /* yacc.c:1646  */
    7109     { delete (yyvsp[0].tok); }
     7109    {}
    71107110#line 7111 "Parser/parser.cc" /* yacc.c:1646  */
    71117111    break;
    71127112
    7113   case 555:
     7113  case 557:
    71147114#line 2142 "parser.yy" /* yacc.c:1646  */
    7115     { delete (yyvsp[0].decl); }
     7115    {}
    71167116#line 7117 "Parser/parser.cc" /* yacc.c:1646  */
    71177117    break;
    71187118
    7119   case 556:
    7120 #line 2143 "parser.yy" /* yacc.c:1646  */
    7121     { delete (yyvsp[0].decl); }
     7119  case 558:
     7120#line 2177 "parser.yy" /* yacc.c:1646  */
     7121    { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
    71227122#line 7123 "Parser/parser.cc" /* yacc.c:1646  */
    71237123    break;
    71247124
    7125   case 557:
    7126 #line 2144 "parser.yy" /* yacc.c:1646  */
    7127     { delete (yyvsp[0].decl); }
     7125  case 560:
     7126#line 2180 "parser.yy" /* yacc.c:1646  */
     7127    { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
    71287128#line 7129 "Parser/parser.cc" /* yacc.c:1646  */
    71297129    break;
    71307130
    7131   case 558:
    7132 #line 2179 "parser.yy" /* yacc.c:1646  */
     7131  case 561:
     7132#line 2182 "parser.yy" /* yacc.c:1646  */
    71337133    { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
    71347134#line 7135 "Parser/parser.cc" /* yacc.c:1646  */
    71357135    break;
    71367136
    7137   case 560:
    7138 #line 2182 "parser.yy" /* yacc.c:1646  */
    7139     { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
    7140 #line 7141 "Parser/parser.cc" /* yacc.c:1646  */
    7141     break;
    7142 
    7143   case 561:
    7144 #line 2184 "parser.yy" /* yacc.c:1646  */
    7145     { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
    7146 #line 7147 "Parser/parser.cc" /* yacc.c:1646  */
    7147     break;
    7148 
    71497137  case 562:
    7150 #line 2189 "parser.yy" /* yacc.c:1646  */
     7138#line 2187 "parser.yy" /* yacc.c:1646  */
    71517139    {
    71527140                        typedefTable.setNextIdentifier( *(yyvsp[0].tok) );
    71537141                        (yyval.decl) = DeclarationNode::newName( (yyvsp[0].tok) );
    71547142                }
     7143#line 7144 "Parser/parser.cc" /* yacc.c:1646  */
     7144    break;
     7145
     7146  case 563:
     7147#line 2192 "parser.yy" /* yacc.c:1646  */
     7148    { (yyval.decl) = (yyvsp[-1].decl); }
     7149#line 7150 "Parser/parser.cc" /* yacc.c:1646  */
     7150    break;
     7151
     7152  case 564:
     7153#line 2197 "parser.yy" /* yacc.c:1646  */
     7154    { (yyval.decl) = (yyvsp[0].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); }
    71557155#line 7156 "Parser/parser.cc" /* yacc.c:1646  */
    71567156    break;
    71577157
    7158   case 563:
    7159 #line 2194 "parser.yy" /* yacc.c:1646  */
     7158  case 565:
     7159#line 2199 "parser.yy" /* yacc.c:1646  */
     7160    { (yyval.decl) = (yyvsp[0].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[-1].decl) ) ); }
     7161#line 7162 "Parser/parser.cc" /* yacc.c:1646  */
     7162    break;
     7163
     7164  case 566:
     7165#line 2201 "parser.yy" /* yacc.c:1646  */
    71607166    { (yyval.decl) = (yyvsp[-1].decl); }
    7161 #line 7162 "Parser/parser.cc" /* yacc.c:1646  */
    7162     break;
    7163 
    7164   case 564:
    7165 #line 2199 "parser.yy" /* yacc.c:1646  */
    7166     { (yyval.decl) = (yyvsp[0].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); }
    71677167#line 7168 "Parser/parser.cc" /* yacc.c:1646  */
    71687168    break;
    71697169
    7170   case 565:
    7171 #line 2201 "parser.yy" /* yacc.c:1646  */
    7172     { (yyval.decl) = (yyvsp[0].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[-1].decl) ) ); }
     7170  case 567:
     7171#line 2206 "parser.yy" /* yacc.c:1646  */
     7172    { (yyval.decl) = (yyvsp[-1].decl)->addArray( (yyvsp[0].decl) ); }
    71737173#line 7174 "Parser/parser.cc" /* yacc.c:1646  */
    71747174    break;
    71757175
    7176   case 566:
    7177 #line 2203 "parser.yy" /* yacc.c:1646  */
    7178     { (yyval.decl) = (yyvsp[-1].decl); }
     7176  case 568:
     7177#line 2208 "parser.yy" /* yacc.c:1646  */
     7178    { (yyval.decl) = (yyvsp[-2].decl)->addArray( (yyvsp[0].decl) ); }
    71797179#line 7180 "Parser/parser.cc" /* yacc.c:1646  */
    71807180    break;
    71817181
    7182   case 567:
    7183 #line 2208 "parser.yy" /* yacc.c:1646  */
    7184     { (yyval.decl) = (yyvsp[-1].decl)->addArray( (yyvsp[0].decl) ); }
    7185 #line 7186 "Parser/parser.cc" /* yacc.c:1646  */
    7186     break;
    7187 
    7188   case 568:
     7182  case 569:
    71897183#line 2210 "parser.yy" /* yacc.c:1646  */
    71907184    { (yyval.decl) = (yyvsp[-2].decl)->addArray( (yyvsp[0].decl) ); }
     7185#line 7186 "Parser/parser.cc" /* yacc.c:1646  */
     7186    break;
     7187
     7188  case 570:
     7189#line 2212 "parser.yy" /* yacc.c:1646  */
     7190    { (yyval.decl) = (yyvsp[-1].decl); }
    71917191#line 7192 "Parser/parser.cc" /* yacc.c:1646  */
    71927192    break;
    71937193
    7194   case 569:
    7195 #line 2212 "parser.yy" /* yacc.c:1646  */
    7196     { (yyval.decl) = (yyvsp[-2].decl)->addArray( (yyvsp[0].decl) ); }
     7194  case 571:
     7195#line 2217 "parser.yy" /* yacc.c:1646  */
     7196    { (yyval.decl) = (yyvsp[-6].decl)->addParamList( (yyvsp[-2].decl) ); }
    71977197#line 7198 "Parser/parser.cc" /* yacc.c:1646  */
    71987198    break;
    71997199
    7200   case 570:
    7201 #line 2214 "parser.yy" /* yacc.c:1646  */
     7200  case 572:
     7201#line 2219 "parser.yy" /* yacc.c:1646  */
    72027202    { (yyval.decl) = (yyvsp[-1].decl); }
    72037203#line 7204 "Parser/parser.cc" /* yacc.c:1646  */
    72047204    break;
    72057205
    7206   case 571:
    7207 #line 2219 "parser.yy" /* yacc.c:1646  */
     7206  case 573:
     7207#line 2228 "parser.yy" /* yacc.c:1646  */
     7208    { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
     7209#line 7210 "Parser/parser.cc" /* yacc.c:1646  */
     7210    break;
     7211
     7212  case 575:
     7213#line 2231 "parser.yy" /* yacc.c:1646  */
     7214    { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
     7215#line 7216 "Parser/parser.cc" /* yacc.c:1646  */
     7216    break;
     7217
     7218  case 576:
     7219#line 2236 "parser.yy" /* yacc.c:1646  */
     7220    { (yyval.decl) = (yyvsp[-5].decl)->addParamList( (yyvsp[-2].decl) ); }
     7221#line 7222 "Parser/parser.cc" /* yacc.c:1646  */
     7222    break;
     7223
     7224  case 577:
     7225#line 2238 "parser.yy" /* yacc.c:1646  */
    72087226    { (yyval.decl) = (yyvsp[-6].decl)->addParamList( (yyvsp[-2].decl) ); }
    7209 #line 7210 "Parser/parser.cc" /* yacc.c:1646  */
    7210     break;
    7211 
    7212   case 572:
    7213 #line 2221 "parser.yy" /* yacc.c:1646  */
     7227#line 7228 "Parser/parser.cc" /* yacc.c:1646  */
     7228    break;
     7229
     7230  case 578:
     7231#line 2240 "parser.yy" /* yacc.c:1646  */
    72147232    { (yyval.decl) = (yyvsp[-1].decl); }
    7215 #line 7216 "Parser/parser.cc" /* yacc.c:1646  */
    7216     break;
    7217 
    7218   case 573:
    7219 #line 2230 "parser.yy" /* yacc.c:1646  */
    7220     { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
    7221 #line 7222 "Parser/parser.cc" /* yacc.c:1646  */
    7222     break;
    7223 
    7224   case 575:
    7225 #line 2233 "parser.yy" /* yacc.c:1646  */
    7226     { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
    7227 #line 7228 "Parser/parser.cc" /* yacc.c:1646  */
    7228     break;
    7229 
    7230   case 576:
    7231 #line 2238 "parser.yy" /* yacc.c:1646  */
    7232     { (yyval.decl) = (yyvsp[-5].decl)->addParamList( (yyvsp[-2].decl) ); }
    72337233#line 7234 "Parser/parser.cc" /* yacc.c:1646  */
    72347234    break;
    72357235
    7236   case 577:
    7237 #line 2240 "parser.yy" /* yacc.c:1646  */
    7238     { (yyval.decl) = (yyvsp[-6].decl)->addParamList( (yyvsp[-2].decl) ); }
     7236  case 579:
     7237#line 2245 "parser.yy" /* yacc.c:1646  */
     7238    { (yyval.decl) = (yyvsp[0].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); }
    72397239#line 7240 "Parser/parser.cc" /* yacc.c:1646  */
    72407240    break;
    72417241
    7242   case 578:
    7243 #line 2242 "parser.yy" /* yacc.c:1646  */
     7242  case 580:
     7243#line 2247 "parser.yy" /* yacc.c:1646  */
     7244    { (yyval.decl) = (yyvsp[0].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[-1].decl) ) ); }
     7245#line 7246 "Parser/parser.cc" /* yacc.c:1646  */
     7246    break;
     7247
     7248  case 581:
     7249#line 2249 "parser.yy" /* yacc.c:1646  */
    72447250    { (yyval.decl) = (yyvsp[-1].decl); }
    7245 #line 7246 "Parser/parser.cc" /* yacc.c:1646  */
    7246     break;
    7247 
    7248   case 579:
    7249 #line 2247 "parser.yy" /* yacc.c:1646  */
    7250     { (yyval.decl) = (yyvsp[0].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); }
    72517251#line 7252 "Parser/parser.cc" /* yacc.c:1646  */
    72527252    break;
    72537253
    7254   case 580:
    7255 #line 2249 "parser.yy" /* yacc.c:1646  */
    7256     { (yyval.decl) = (yyvsp[0].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[-1].decl) ) ); }
     7254  case 582:
     7255#line 2254 "parser.yy" /* yacc.c:1646  */
     7256    { (yyval.decl) = (yyvsp[-2].decl)->addArray( (yyvsp[0].decl) ); }
    72577257#line 7258 "Parser/parser.cc" /* yacc.c:1646  */
    72587258    break;
    72597259
    7260   case 581:
    7261 #line 2251 "parser.yy" /* yacc.c:1646  */
    7262     { (yyval.decl) = (yyvsp[-1].decl); }
    7263 #line 7264 "Parser/parser.cc" /* yacc.c:1646  */
    7264     break;
    7265 
    7266   case 582:
     7260  case 583:
    72677261#line 2256 "parser.yy" /* yacc.c:1646  */
    72687262    { (yyval.decl) = (yyvsp[-2].decl)->addArray( (yyvsp[0].decl) ); }
     7263#line 7264 "Parser/parser.cc" /* yacc.c:1646  */
     7264    break;
     7265
     7266  case 584:
     7267#line 2258 "parser.yy" /* yacc.c:1646  */
     7268    { (yyval.decl) = (yyvsp[-1].decl); }
    72697269#line 7270 "Parser/parser.cc" /* yacc.c:1646  */
    72707270    break;
    72717271
    7272   case 583:
    7273 #line 2258 "parser.yy" /* yacc.c:1646  */
     7272  case 588:
     7273#line 2273 "parser.yy" /* yacc.c:1646  */
     7274    { (yyval.decl) = (yyvsp[-3].decl)->addIdList( (yyvsp[-1].decl) ); }
     7275#line 7276 "Parser/parser.cc" /* yacc.c:1646  */
     7276    break;
     7277
     7278  case 589:
     7279#line 2275 "parser.yy" /* yacc.c:1646  */
     7280    { (yyval.decl) = (yyvsp[-4].decl)->addIdList( (yyvsp[-1].decl) ); }
     7281#line 7282 "Parser/parser.cc" /* yacc.c:1646  */
     7282    break;
     7283
     7284  case 590:
     7285#line 2277 "parser.yy" /* yacc.c:1646  */
     7286    { (yyval.decl) = (yyvsp[-1].decl); }
     7287#line 7288 "Parser/parser.cc" /* yacc.c:1646  */
     7288    break;
     7289
     7290  case 591:
     7291#line 2282 "parser.yy" /* yacc.c:1646  */
     7292    { (yyval.decl) = (yyvsp[0].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); }
     7293#line 7294 "Parser/parser.cc" /* yacc.c:1646  */
     7294    break;
     7295
     7296  case 592:
     7297#line 2284 "parser.yy" /* yacc.c:1646  */
     7298    { (yyval.decl) = (yyvsp[0].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[-1].decl) ) ); }
     7299#line 7300 "Parser/parser.cc" /* yacc.c:1646  */
     7300    break;
     7301
     7302  case 593:
     7303#line 2286 "parser.yy" /* yacc.c:1646  */
     7304    { (yyval.decl) = (yyvsp[-1].decl); }
     7305#line 7306 "Parser/parser.cc" /* yacc.c:1646  */
     7306    break;
     7307
     7308  case 594:
     7309#line 2291 "parser.yy" /* yacc.c:1646  */
    72747310    { (yyval.decl) = (yyvsp[-2].decl)->addArray( (yyvsp[0].decl) ); }
    7275 #line 7276 "Parser/parser.cc" /* yacc.c:1646  */
    7276     break;
    7277 
    7278   case 584:
    7279 #line 2260 "parser.yy" /* yacc.c:1646  */
    7280     { (yyval.decl) = (yyvsp[-1].decl); }
    7281 #line 7282 "Parser/parser.cc" /* yacc.c:1646  */
    7282     break;
    7283 
    7284   case 588:
    7285 #line 2275 "parser.yy" /* yacc.c:1646  */
    7286     { (yyval.decl) = (yyvsp[-3].decl)->addIdList( (yyvsp[-1].decl) ); }
    7287 #line 7288 "Parser/parser.cc" /* yacc.c:1646  */
    7288     break;
    7289 
    7290   case 589:
    7291 #line 2277 "parser.yy" /* yacc.c:1646  */
    7292     { (yyval.decl) = (yyvsp[-4].decl)->addIdList( (yyvsp[-1].decl) ); }
    7293 #line 7294 "Parser/parser.cc" /* yacc.c:1646  */
    7294     break;
    7295 
    7296   case 590:
    7297 #line 2279 "parser.yy" /* yacc.c:1646  */
    7298     { (yyval.decl) = (yyvsp[-1].decl); }
    7299 #line 7300 "Parser/parser.cc" /* yacc.c:1646  */
    7300     break;
    7301 
    7302   case 591:
    7303 #line 2284 "parser.yy" /* yacc.c:1646  */
    7304     { (yyval.decl) = (yyvsp[0].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); }
    7305 #line 7306 "Parser/parser.cc" /* yacc.c:1646  */
    7306     break;
    7307 
    7308   case 592:
    7309 #line 2286 "parser.yy" /* yacc.c:1646  */
    7310     { (yyval.decl) = (yyvsp[0].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[-1].decl) ) ); }
    73117311#line 7312 "Parser/parser.cc" /* yacc.c:1646  */
    73127312    break;
    73137313
    7314   case 593:
    7315 #line 2288 "parser.yy" /* yacc.c:1646  */
    7316     { (yyval.decl) = (yyvsp[-1].decl); }
    7317 #line 7318 "Parser/parser.cc" /* yacc.c:1646  */
    7318     break;
    7319 
    7320   case 594:
     7314  case 595:
    73217315#line 2293 "parser.yy" /* yacc.c:1646  */
    73227316    { (yyval.decl) = (yyvsp[-2].decl)->addArray( (yyvsp[0].decl) ); }
     7317#line 7318 "Parser/parser.cc" /* yacc.c:1646  */
     7318    break;
     7319
     7320  case 596:
     7321#line 2295 "parser.yy" /* yacc.c:1646  */
     7322    { (yyval.decl) = (yyvsp[-1].decl); }
    73237323#line 7324 "Parser/parser.cc" /* yacc.c:1646  */
    73247324    break;
    73257325
    7326   case 595:
    7327 #line 2295 "parser.yy" /* yacc.c:1646  */
    7328     { (yyval.decl) = (yyvsp[-2].decl)->addArray( (yyvsp[0].decl) ); }
     7326  case 597:
     7327#line 2310 "parser.yy" /* yacc.c:1646  */
     7328    { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
    73297329#line 7330 "Parser/parser.cc" /* yacc.c:1646  */
    73307330    break;
    73317331
    7332   case 596:
    7333 #line 2297 "parser.yy" /* yacc.c:1646  */
    7334     { (yyval.decl) = (yyvsp[-1].decl); }
     7332  case 599:
     7333#line 2313 "parser.yy" /* yacc.c:1646  */
     7334    { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
    73357335#line 7336 "Parser/parser.cc" /* yacc.c:1646  */
    73367336    break;
    73377337
    7338   case 597:
    7339 #line 2312 "parser.yy" /* yacc.c:1646  */
     7338  case 600:
     7339#line 2315 "parser.yy" /* yacc.c:1646  */
    73407340    { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
    73417341#line 7342 "Parser/parser.cc" /* yacc.c:1646  */
    73427342    break;
    73437343
    7344   case 599:
    7345 #line 2315 "parser.yy" /* yacc.c:1646  */
    7346     { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
     7344  case 602:
     7345#line 2321 "parser.yy" /* yacc.c:1646  */
     7346    { (yyval.decl) = (yyvsp[-1].decl); }
    73477347#line 7348 "Parser/parser.cc" /* yacc.c:1646  */
    73487348    break;
    73497349
    7350   case 600:
    7351 #line 2317 "parser.yy" /* yacc.c:1646  */
    7352     { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
     7350  case 603:
     7351#line 2326 "parser.yy" /* yacc.c:1646  */
     7352    { (yyval.decl) = (yyvsp[0].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); }
    73537353#line 7354 "Parser/parser.cc" /* yacc.c:1646  */
    73547354    break;
    73557355
    7356   case 602:
    7357 #line 2323 "parser.yy" /* yacc.c:1646  */
     7356  case 604:
     7357#line 2328 "parser.yy" /* yacc.c:1646  */
     7358    { (yyval.decl) = (yyvsp[0].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[-1].decl) ) ); }
     7359#line 7360 "Parser/parser.cc" /* yacc.c:1646  */
     7360    break;
     7361
     7362  case 605:
     7363#line 2330 "parser.yy" /* yacc.c:1646  */
    73587364    { (yyval.decl) = (yyvsp[-1].decl); }
    7359 #line 7360 "Parser/parser.cc" /* yacc.c:1646  */
    7360     break;
    7361 
    7362   case 603:
    7363 #line 2328 "parser.yy" /* yacc.c:1646  */
    7364     { (yyval.decl) = (yyvsp[0].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); }
    73657365#line 7366 "Parser/parser.cc" /* yacc.c:1646  */
    73667366    break;
    73677367
    7368   case 604:
    7369 #line 2330 "parser.yy" /* yacc.c:1646  */
    7370     { (yyval.decl) = (yyvsp[0].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[-1].decl) ) ); }
     7368  case 606:
     7369#line 2335 "parser.yy" /* yacc.c:1646  */
     7370    { (yyval.decl) = (yyvsp[-1].decl)->addArray( (yyvsp[0].decl) ); }
    73717371#line 7372 "Parser/parser.cc" /* yacc.c:1646  */
    73727372    break;
    73737373
    7374   case 605:
    7375 #line 2332 "parser.yy" /* yacc.c:1646  */
    7376     { (yyval.decl) = (yyvsp[-1].decl); }
     7374  case 607:
     7375#line 2337 "parser.yy" /* yacc.c:1646  */
     7376    { (yyval.decl) = (yyvsp[-2].decl)->addArray( (yyvsp[0].decl) ); }
    73777377#line 7378 "Parser/parser.cc" /* yacc.c:1646  */
    73787378    break;
    73797379
    7380   case 606:
    7381 #line 2337 "parser.yy" /* yacc.c:1646  */
    7382     { (yyval.decl) = (yyvsp[-1].decl)->addArray( (yyvsp[0].decl) ); }
    7383 #line 7384 "Parser/parser.cc" /* yacc.c:1646  */
    7384     break;
    7385 
    7386   case 607:
     7380  case 608:
    73877381#line 2339 "parser.yy" /* yacc.c:1646  */
    73887382    { (yyval.decl) = (yyvsp[-2].decl)->addArray( (yyvsp[0].decl) ); }
     7383#line 7384 "Parser/parser.cc" /* yacc.c:1646  */
     7384    break;
     7385
     7386  case 609:
     7387#line 2341 "parser.yy" /* yacc.c:1646  */
     7388    { (yyval.decl) = (yyvsp[-1].decl); }
    73897389#line 7390 "Parser/parser.cc" /* yacc.c:1646  */
    73907390    break;
    73917391
    7392   case 608:
    7393 #line 2341 "parser.yy" /* yacc.c:1646  */
    7394     { (yyval.decl) = (yyvsp[-2].decl)->addArray( (yyvsp[0].decl) ); }
     7392  case 610:
     7393#line 2346 "parser.yy" /* yacc.c:1646  */
     7394    { (yyval.decl) = (yyvsp[-5].decl)->addParamList( (yyvsp[-2].decl) ); }
    73957395#line 7396 "Parser/parser.cc" /* yacc.c:1646  */
    73967396    break;
    73977397
    7398   case 609:
    7399 #line 2343 "parser.yy" /* yacc.c:1646  */
     7398  case 611:
     7399#line 2348 "parser.yy" /* yacc.c:1646  */
     7400    { (yyval.decl) = (yyvsp[-6].decl)->addParamList( (yyvsp[-2].decl) ); }
     7401#line 7402 "Parser/parser.cc" /* yacc.c:1646  */
     7402    break;
     7403
     7404  case 612:
     7405#line 2350 "parser.yy" /* yacc.c:1646  */
    74007406    { (yyval.decl) = (yyvsp[-1].decl); }
    7401 #line 7402 "Parser/parser.cc" /* yacc.c:1646  */
    7402     break;
    7403 
    7404   case 610:
    7405 #line 2348 "parser.yy" /* yacc.c:1646  */
    7406     { (yyval.decl) = (yyvsp[-5].decl)->addParamList( (yyvsp[-2].decl) ); }
    74077407#line 7408 "Parser/parser.cc" /* yacc.c:1646  */
    74087408    break;
    74097409
    7410   case 611:
    7411 #line 2350 "parser.yy" /* yacc.c:1646  */
    7412     { (yyval.decl) = (yyvsp[-6].decl)->addParamList( (yyvsp[-2].decl) ); }
     7410  case 613:
     7411#line 2360 "parser.yy" /* yacc.c:1646  */
     7412    { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
    74137413#line 7414 "Parser/parser.cc" /* yacc.c:1646  */
    74147414    break;
    74157415
    7416   case 612:
    7417 #line 2352 "parser.yy" /* yacc.c:1646  */
    7418     { (yyval.decl) = (yyvsp[-1].decl); }
     7416  case 615:
     7417#line 2363 "parser.yy" /* yacc.c:1646  */
     7418    { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
    74197419#line 7420 "Parser/parser.cc" /* yacc.c:1646  */
    74207420    break;
    74217421
    7422   case 613:
    7423 #line 2362 "parser.yy" /* yacc.c:1646  */
     7422  case 616:
     7423#line 2365 "parser.yy" /* yacc.c:1646  */
    74247424    { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
    74257425#line 7426 "Parser/parser.cc" /* yacc.c:1646  */
    74267426    break;
    74277427
    7428   case 615:
    7429 #line 2365 "parser.yy" /* yacc.c:1646  */
    7430     { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
     7428  case 617:
     7429#line 2370 "parser.yy" /* yacc.c:1646  */
     7430    { (yyval.decl) = (yyvsp[0].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); }
    74317431#line 7432 "Parser/parser.cc" /* yacc.c:1646  */
    74327432    break;
    74337433
    7434   case 616:
    7435 #line 2367 "parser.yy" /* yacc.c:1646  */
    7436     { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
     7434  case 618:
     7435#line 2372 "parser.yy" /* yacc.c:1646  */
     7436    { (yyval.decl) = (yyvsp[0].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[-1].decl) ) ); }
    74377437#line 7438 "Parser/parser.cc" /* yacc.c:1646  */
    74387438    break;
    74397439
    7440   case 617:
    7441 #line 2372 "parser.yy" /* yacc.c:1646  */
    7442     { (yyval.decl) = (yyvsp[0].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); }
     7440  case 619:
     7441#line 2374 "parser.yy" /* yacc.c:1646  */
     7442    { (yyval.decl) = (yyvsp[-1].decl); }
    74437443#line 7444 "Parser/parser.cc" /* yacc.c:1646  */
    74447444    break;
    74457445
    7446   case 618:
    7447 #line 2374 "parser.yy" /* yacc.c:1646  */
    7448     { (yyval.decl) = (yyvsp[0].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[-1].decl) ) ); }
     7446  case 620:
     7447#line 2379 "parser.yy" /* yacc.c:1646  */
     7448    { (yyval.decl) = (yyvsp[-1].decl)->addArray( (yyvsp[0].decl) ); }
    74497449#line 7450 "Parser/parser.cc" /* yacc.c:1646  */
    74507450    break;
    74517451
    7452   case 619:
    7453 #line 2376 "parser.yy" /* yacc.c:1646  */
    7454     { (yyval.decl) = (yyvsp[-1].decl); }
     7452  case 621:
     7453#line 2381 "parser.yy" /* yacc.c:1646  */
     7454    { (yyval.decl) = (yyvsp[-2].decl)->addArray( (yyvsp[0].decl) ); }
    74557455#line 7456 "Parser/parser.cc" /* yacc.c:1646  */
    74567456    break;
    74577457
    7458   case 620:
    7459 #line 2381 "parser.yy" /* yacc.c:1646  */
    7460     { (yyval.decl) = (yyvsp[-1].decl)->addArray( (yyvsp[0].decl) ); }
    7461 #line 7462 "Parser/parser.cc" /* yacc.c:1646  */
    7462     break;
    7463 
    7464   case 621:
     7458  case 622:
    74657459#line 2383 "parser.yy" /* yacc.c:1646  */
    74667460    { (yyval.decl) = (yyvsp[-2].decl)->addArray( (yyvsp[0].decl) ); }
     7461#line 7462 "Parser/parser.cc" /* yacc.c:1646  */
     7462    break;
     7463
     7464  case 623:
     7465#line 2385 "parser.yy" /* yacc.c:1646  */
     7466    { (yyval.decl) = (yyvsp[-1].decl); }
    74677467#line 7468 "Parser/parser.cc" /* yacc.c:1646  */
    74687468    break;
    74697469
    7470   case 622:
    7471 #line 2385 "parser.yy" /* yacc.c:1646  */
    7472     { (yyval.decl) = (yyvsp[-2].decl)->addArray( (yyvsp[0].decl) ); }
     7470  case 624:
     7471#line 2390 "parser.yy" /* yacc.c:1646  */
     7472    { (yyval.decl) = (yyvsp[-5].decl)->addParamList( (yyvsp[-2].decl) ); }
    74737473#line 7474 "Parser/parser.cc" /* yacc.c:1646  */
    74747474    break;
    74757475
    7476   case 623:
    7477 #line 2387 "parser.yy" /* yacc.c:1646  */
     7476  case 625:
     7477#line 2392 "parser.yy" /* yacc.c:1646  */
     7478    { (yyval.decl) = (yyvsp[-6].decl)->addParamList( (yyvsp[-2].decl) ); }
     7479#line 7480 "Parser/parser.cc" /* yacc.c:1646  */
     7480    break;
     7481
     7482  case 626:
     7483#line 2394 "parser.yy" /* yacc.c:1646  */
    74787484    { (yyval.decl) = (yyvsp[-1].decl); }
    7479 #line 7480 "Parser/parser.cc" /* yacc.c:1646  */
    7480     break;
    7481 
    7482   case 624:
    7483 #line 2392 "parser.yy" /* yacc.c:1646  */
    7484     { (yyval.decl) = (yyvsp[-5].decl)->addParamList( (yyvsp[-2].decl) ); }
    74857485#line 7486 "Parser/parser.cc" /* yacc.c:1646  */
    74867486    break;
    74877487
    7488   case 625:
    7489 #line 2394 "parser.yy" /* yacc.c:1646  */
    7490     { (yyval.decl) = (yyvsp[-6].decl)->addParamList( (yyvsp[-2].decl) ); }
     7488  case 627:
     7489#line 2425 "parser.yy" /* yacc.c:1646  */
     7490    { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
    74917491#line 7492 "Parser/parser.cc" /* yacc.c:1646  */
    74927492    break;
    74937493
    7494   case 626:
    7495 #line 2396 "parser.yy" /* yacc.c:1646  */
    7496     { (yyval.decl) = (yyvsp[-1].decl); }
     7494  case 629:
     7495#line 2428 "parser.yy" /* yacc.c:1646  */
     7496    { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
    74977497#line 7498 "Parser/parser.cc" /* yacc.c:1646  */
    74987498    break;
    74997499
    7500   case 627:
    7501 #line 2427 "parser.yy" /* yacc.c:1646  */
     7500  case 630:
     7501#line 2430 "parser.yy" /* yacc.c:1646  */
    75027502    { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
    75037503#line 7504 "Parser/parser.cc" /* yacc.c:1646  */
    75047504    break;
    75057505
    7506   case 629:
    7507 #line 2430 "parser.yy" /* yacc.c:1646  */
    7508     { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
    7509 #line 7510 "Parser/parser.cc" /* yacc.c:1646  */
    7510     break;
    7511 
    7512   case 630:
    7513 #line 2432 "parser.yy" /* yacc.c:1646  */
    7514     { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
    7515 #line 7516 "Parser/parser.cc" /* yacc.c:1646  */
    7516     break;
    7517 
    75187506  case 631:
    7519 #line 2437 "parser.yy" /* yacc.c:1646  */
     7507#line 2435 "parser.yy" /* yacc.c:1646  */
    75207508    {
    75217509                        typedefTable.setNextIdentifier( *(yyvsp[0].tok) );
    75227510                        (yyval.decl) = DeclarationNode::newName( (yyvsp[0].tok) );
    75237511                }
    7524 #line 7525 "Parser/parser.cc" /* yacc.c:1646  */
     7512#line 7513 "Parser/parser.cc" /* yacc.c:1646  */
    75257513    break;
    75267514
    75277515  case 632:
    7528 #line 2442 "parser.yy" /* yacc.c:1646  */
     7516#line 2440 "parser.yy" /* yacc.c:1646  */
    75297517    {
    75307518                        typedefTable.setNextIdentifier( *(yyvsp[0].tok) );
    75317519                        (yyval.decl) = DeclarationNode::newName( (yyvsp[0].tok) );
    75327520                }
     7521#line 7522 "Parser/parser.cc" /* yacc.c:1646  */
     7522    break;
     7523
     7524  case 633:
     7525#line 2448 "parser.yy" /* yacc.c:1646  */
     7526    { (yyval.decl) = (yyvsp[0].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); }
     7527#line 7528 "Parser/parser.cc" /* yacc.c:1646  */
     7528    break;
     7529
     7530  case 634:
     7531#line 2450 "parser.yy" /* yacc.c:1646  */
     7532    { (yyval.decl) = (yyvsp[0].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[-1].decl) ) ); }
    75337533#line 7534 "Parser/parser.cc" /* yacc.c:1646  */
    75347534    break;
    75357535
    7536   case 633:
    7537 #line 2450 "parser.yy" /* yacc.c:1646  */
    7538     { (yyval.decl) = (yyvsp[0].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); }
     7536  case 635:
     7537#line 2452 "parser.yy" /* yacc.c:1646  */
     7538    { (yyval.decl) = (yyvsp[-1].decl); }
    75397539#line 7540 "Parser/parser.cc" /* yacc.c:1646  */
    75407540    break;
    75417541
    7542   case 634:
    7543 #line 2452 "parser.yy" /* yacc.c:1646  */
    7544     { (yyval.decl) = (yyvsp[0].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[-1].decl) ) ); }
     7542  case 636:
     7543#line 2457 "parser.yy" /* yacc.c:1646  */
     7544    { (yyval.decl) = (yyvsp[-1].decl)->addArray( (yyvsp[0].decl) ); }
    75457545#line 7546 "Parser/parser.cc" /* yacc.c:1646  */
    75467546    break;
    75477547
    7548   case 635:
    7549 #line 2454 "parser.yy" /* yacc.c:1646  */
    7550     { (yyval.decl) = (yyvsp[-1].decl); }
     7548  case 637:
     7549#line 2459 "parser.yy" /* yacc.c:1646  */
     7550    { (yyval.decl) = (yyvsp[-2].decl)->addArray( (yyvsp[0].decl) ); }
    75517551#line 7552 "Parser/parser.cc" /* yacc.c:1646  */
    75527552    break;
    75537553
    7554   case 636:
    7555 #line 2459 "parser.yy" /* yacc.c:1646  */
    7556     { (yyval.decl) = (yyvsp[-1].decl)->addArray( (yyvsp[0].decl) ); }
     7554  case 638:
     7555#line 2464 "parser.yy" /* yacc.c:1646  */
     7556    { (yyval.decl) = (yyvsp[-5].decl)->addParamList( (yyvsp[-2].decl) ); }
    75577557#line 7558 "Parser/parser.cc" /* yacc.c:1646  */
    75587558    break;
    75597559
    7560   case 637:
    7561 #line 2461 "parser.yy" /* yacc.c:1646  */
    7562     { (yyval.decl) = (yyvsp[-2].decl)->addArray( (yyvsp[0].decl) ); }
     7560  case 639:
     7561#line 2466 "parser.yy" /* yacc.c:1646  */
     7562    { (yyval.decl) = (yyvsp[-6].decl)->addParamList( (yyvsp[-2].decl) ); }
    75637563#line 7564 "Parser/parser.cc" /* yacc.c:1646  */
    75647564    break;
    75657565
    7566   case 638:
    7567 #line 2466 "parser.yy" /* yacc.c:1646  */
    7568     { (yyval.decl) = (yyvsp[-5].decl)->addParamList( (yyvsp[-2].decl) ); }
     7566  case 641:
     7567#line 2481 "parser.yy" /* yacc.c:1646  */
     7568    { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
    75697569#line 7570 "Parser/parser.cc" /* yacc.c:1646  */
    75707570    break;
    75717571
    7572   case 639:
    7573 #line 2468 "parser.yy" /* yacc.c:1646  */
    7574     { (yyval.decl) = (yyvsp[-6].decl)->addParamList( (yyvsp[-2].decl) ); }
    7575 #line 7576 "Parser/parser.cc" /* yacc.c:1646  */
    7576     break;
    7577 
    7578   case 641:
     7572  case 642:
    75797573#line 2483 "parser.yy" /* yacc.c:1646  */
    75807574    { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
     7575#line 7576 "Parser/parser.cc" /* yacc.c:1646  */
     7576    break;
     7577
     7578  case 643:
     7579#line 2488 "parser.yy" /* yacc.c:1646  */
     7580    { (yyval.decl) = DeclarationNode::newPointer( 0 ); }
    75817581#line 7582 "Parser/parser.cc" /* yacc.c:1646  */
    75827582    break;
    75837583
    7584   case 642:
    7585 #line 2485 "parser.yy" /* yacc.c:1646  */
    7586     { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
     7584  case 644:
     7585#line 2490 "parser.yy" /* yacc.c:1646  */
     7586    { (yyval.decl) = DeclarationNode::newPointer( (yyvsp[0].decl) ); }
    75877587#line 7588 "Parser/parser.cc" /* yacc.c:1646  */
    75887588    break;
    75897589
    7590   case 643:
    7591 #line 2490 "parser.yy" /* yacc.c:1646  */
    7592     { (yyval.decl) = DeclarationNode::newPointer( 0 ); }
     7590  case 645:
     7591#line 2492 "parser.yy" /* yacc.c:1646  */
     7592    { (yyval.decl) = (yyvsp[0].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); }
    75937593#line 7594 "Parser/parser.cc" /* yacc.c:1646  */
    75947594    break;
    75957595
    7596   case 644:
    7597 #line 2492 "parser.yy" /* yacc.c:1646  */
    7598     { (yyval.decl) = DeclarationNode::newPointer( (yyvsp[0].decl) ); }
     7596  case 646:
     7597#line 2494 "parser.yy" /* yacc.c:1646  */
     7598    { (yyval.decl) = (yyvsp[0].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[-1].decl) ) ); }
    75997599#line 7600 "Parser/parser.cc" /* yacc.c:1646  */
    76007600    break;
    76017601
    7602   case 645:
    7603 #line 2494 "parser.yy" /* yacc.c:1646  */
    7604     { (yyval.decl) = (yyvsp[0].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); }
     7602  case 647:
     7603#line 2496 "parser.yy" /* yacc.c:1646  */
     7604    { (yyval.decl) = (yyvsp[-1].decl); }
    76057605#line 7606 "Parser/parser.cc" /* yacc.c:1646  */
    76067606    break;
    76077607
    7608   case 646:
    7609 #line 2496 "parser.yy" /* yacc.c:1646  */
    7610     { (yyval.decl) = (yyvsp[0].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[-1].decl) ) ); }
     7608  case 649:
     7609#line 2502 "parser.yy" /* yacc.c:1646  */
     7610    { (yyval.decl) = (yyvsp[-2].decl)->addArray( (yyvsp[0].decl) ); }
    76117611#line 7612 "Parser/parser.cc" /* yacc.c:1646  */
    76127612    break;
    76137613
    7614   case 647:
    7615 #line 2498 "parser.yy" /* yacc.c:1646  */
    7616     { (yyval.decl) = (yyvsp[-1].decl); }
    7617 #line 7618 "Parser/parser.cc" /* yacc.c:1646  */
    7618     break;
    7619 
    7620   case 649:
     7614  case 650:
    76217615#line 2504 "parser.yy" /* yacc.c:1646  */
    76227616    { (yyval.decl) = (yyvsp[-2].decl)->addArray( (yyvsp[0].decl) ); }
     7617#line 7618 "Parser/parser.cc" /* yacc.c:1646  */
     7618    break;
     7619
     7620  case 651:
     7621#line 2506 "parser.yy" /* yacc.c:1646  */
     7622    { (yyval.decl) = (yyvsp[-1].decl); }
    76237623#line 7624 "Parser/parser.cc" /* yacc.c:1646  */
    76247624    break;
    76257625
    7626   case 650:
    7627 #line 2506 "parser.yy" /* yacc.c:1646  */
    7628     { (yyval.decl) = (yyvsp[-2].decl)->addArray( (yyvsp[0].decl) ); }
     7626  case 652:
     7627#line 2511 "parser.yy" /* yacc.c:1646  */
     7628    { (yyval.decl) = DeclarationNode::newFunction( 0, 0, (yyvsp[-2].decl), 0 ); }
    76297629#line 7630 "Parser/parser.cc" /* yacc.c:1646  */
    76307630    break;
    76317631
    7632   case 651:
    7633 #line 2508 "parser.yy" /* yacc.c:1646  */
     7632  case 653:
     7633#line 2513 "parser.yy" /* yacc.c:1646  */
     7634    { (yyval.decl) = (yyvsp[-6].decl)->addParamList( (yyvsp[-2].decl) ); }
     7635#line 7636 "Parser/parser.cc" /* yacc.c:1646  */
     7636    break;
     7637
     7638  case 654:
     7639#line 2515 "parser.yy" /* yacc.c:1646  */
    76347640    { (yyval.decl) = (yyvsp[-1].decl); }
    7635 #line 7636 "Parser/parser.cc" /* yacc.c:1646  */
    7636     break;
    7637 
    7638   case 652:
    7639 #line 2513 "parser.yy" /* yacc.c:1646  */
    7640     { (yyval.decl) = DeclarationNode::newFunction( 0, 0, (yyvsp[-2].decl), 0 ); }
    76417641#line 7642 "Parser/parser.cc" /* yacc.c:1646  */
    76427642    break;
    76437643
    7644   case 653:
    7645 #line 2515 "parser.yy" /* yacc.c:1646  */
    7646     { (yyval.decl) = (yyvsp[-6].decl)->addParamList( (yyvsp[-2].decl) ); }
     7644  case 655:
     7645#line 2521 "parser.yy" /* yacc.c:1646  */
     7646    { (yyval.decl) = DeclarationNode::newArray( 0, 0, false ); }
    76477647#line 7648 "Parser/parser.cc" /* yacc.c:1646  */
    76487648    break;
    76497649
    7650   case 654:
    7651 #line 2517 "parser.yy" /* yacc.c:1646  */
    7652     { (yyval.decl) = (yyvsp[-1].decl); }
     7650  case 656:
     7651#line 2523 "parser.yy" /* yacc.c:1646  */
     7652    { (yyval.decl) = DeclarationNode::newArray( 0, 0, false )->addArray( (yyvsp[0].decl) ); }
    76537653#line 7654 "Parser/parser.cc" /* yacc.c:1646  */
    76547654    break;
    76557655
    7656   case 655:
    7657 #line 2523 "parser.yy" /* yacc.c:1646  */
    7658     { (yyval.decl) = DeclarationNode::newArray( 0, 0, false ); }
     7656  case 658:
     7657#line 2529 "parser.yy" /* yacc.c:1646  */
     7658    { (yyval.decl) = DeclarationNode::newArray( (yyvsp[-2].en), 0, false ); }
    76597659#line 7660 "Parser/parser.cc" /* yacc.c:1646  */
    76607660    break;
    76617661
    7662   case 656:
    7663 #line 2525 "parser.yy" /* yacc.c:1646  */
    7664     { (yyval.decl) = DeclarationNode::newArray( 0, 0, false )->addArray( (yyvsp[0].decl) ); }
     7662  case 659:
     7663#line 2531 "parser.yy" /* yacc.c:1646  */
     7664    { (yyval.decl) = DeclarationNode::newVarArray( 0 ); }
    76657665#line 7666 "Parser/parser.cc" /* yacc.c:1646  */
    76667666    break;
    76677667
    7668   case 658:
    7669 #line 2531 "parser.yy" /* yacc.c:1646  */
    7670     { (yyval.decl) = DeclarationNode::newArray( (yyvsp[-2].en), 0, false ); }
     7668  case 660:
     7669#line 2533 "parser.yy" /* yacc.c:1646  */
     7670    { (yyval.decl) = (yyvsp[-5].decl)->addArray( DeclarationNode::newArray( (yyvsp[-2].en), 0, false ) ); }
    76717671#line 7672 "Parser/parser.cc" /* yacc.c:1646  */
    76727672    break;
    76737673
    7674   case 659:
    7675 #line 2533 "parser.yy" /* yacc.c:1646  */
    7676     { (yyval.decl) = DeclarationNode::newVarArray( 0 ); }
     7674  case 661:
     7675#line 2535 "parser.yy" /* yacc.c:1646  */
     7676    { (yyval.decl) = (yyvsp[-5].decl)->addArray( DeclarationNode::newVarArray( 0 ) ); }
    76777677#line 7678 "Parser/parser.cc" /* yacc.c:1646  */
    76787678    break;
    76797679
    7680   case 660:
    7681 #line 2535 "parser.yy" /* yacc.c:1646  */
    7682     { (yyval.decl) = (yyvsp[-5].decl)->addArray( DeclarationNode::newArray( (yyvsp[-2].en), 0, false ) ); }
     7680  case 663:
     7681#line 2550 "parser.yy" /* yacc.c:1646  */
     7682    { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
    76837683#line 7684 "Parser/parser.cc" /* yacc.c:1646  */
    76847684    break;
    76857685
    7686   case 661:
    7687 #line 2537 "parser.yy" /* yacc.c:1646  */
    7688     { (yyval.decl) = (yyvsp[-5].decl)->addArray( DeclarationNode::newVarArray( 0 ) ); }
    7689 #line 7690 "Parser/parser.cc" /* yacc.c:1646  */
    7690     break;
    7691 
    7692   case 663:
     7686  case 664:
    76937687#line 2552 "parser.yy" /* yacc.c:1646  */
    76947688    { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
     7689#line 7690 "Parser/parser.cc" /* yacc.c:1646  */
     7690    break;
     7691
     7692  case 665:
     7693#line 2557 "parser.yy" /* yacc.c:1646  */
     7694    { (yyval.decl) = DeclarationNode::newPointer( 0 ); }
    76957695#line 7696 "Parser/parser.cc" /* yacc.c:1646  */
    76967696    break;
    76977697
    7698   case 664:
    7699 #line 2554 "parser.yy" /* yacc.c:1646  */
    7700     { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
     7698  case 666:
     7699#line 2559 "parser.yy" /* yacc.c:1646  */
     7700    { (yyval.decl) = DeclarationNode::newPointer( (yyvsp[0].decl) ); }
    77017701#line 7702 "Parser/parser.cc" /* yacc.c:1646  */
    77027702    break;
    77037703
    7704   case 665:
    7705 #line 2559 "parser.yy" /* yacc.c:1646  */
    7706     { (yyval.decl) = DeclarationNode::newPointer( 0 ); }
     7704  case 667:
     7705#line 2561 "parser.yy" /* yacc.c:1646  */
     7706    { (yyval.decl) = (yyvsp[0].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); }
    77077707#line 7708 "Parser/parser.cc" /* yacc.c:1646  */
    77087708    break;
    77097709
    7710   case 666:
    7711 #line 2561 "parser.yy" /* yacc.c:1646  */
    7712     { (yyval.decl) = DeclarationNode::newPointer( (yyvsp[0].decl) ); }
     7710  case 668:
     7711#line 2563 "parser.yy" /* yacc.c:1646  */
     7712    { (yyval.decl) = (yyvsp[0].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[-1].decl) ) ); }
    77137713#line 7714 "Parser/parser.cc" /* yacc.c:1646  */
    77147714    break;
    77157715
    7716   case 667:
    7717 #line 2563 "parser.yy" /* yacc.c:1646  */
    7718     { (yyval.decl) = (yyvsp[0].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); }
     7716  case 669:
     7717#line 2565 "parser.yy" /* yacc.c:1646  */
     7718    { (yyval.decl) = (yyvsp[-1].decl); }
    77197719#line 7720 "Parser/parser.cc" /* yacc.c:1646  */
    77207720    break;
    77217721
    7722   case 668:
    7723 #line 2565 "parser.yy" /* yacc.c:1646  */
    7724     { (yyval.decl) = (yyvsp[0].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[-1].decl) ) ); }
     7722  case 671:
     7723#line 2571 "parser.yy" /* yacc.c:1646  */
     7724    { (yyval.decl) = (yyvsp[-2].decl)->addArray( (yyvsp[0].decl) ); }
    77257725#line 7726 "Parser/parser.cc" /* yacc.c:1646  */
    77267726    break;
    77277727
    7728   case 669:
    7729 #line 2567 "parser.yy" /* yacc.c:1646  */
    7730     { (yyval.decl) = (yyvsp[-1].decl); }
    7731 #line 7732 "Parser/parser.cc" /* yacc.c:1646  */
    7732     break;
    7733 
    7734   case 671:
     7728  case 672:
    77357729#line 2573 "parser.yy" /* yacc.c:1646  */
    77367730    { (yyval.decl) = (yyvsp[-2].decl)->addArray( (yyvsp[0].decl) ); }
     7731#line 7732 "Parser/parser.cc" /* yacc.c:1646  */
     7732    break;
     7733
     7734  case 673:
     7735#line 2575 "parser.yy" /* yacc.c:1646  */
     7736    { (yyval.decl) = (yyvsp[-1].decl); }
    77377737#line 7738 "Parser/parser.cc" /* yacc.c:1646  */
    77387738    break;
    77397739
    7740   case 672:
    7741 #line 2575 "parser.yy" /* yacc.c:1646  */
    7742     { (yyval.decl) = (yyvsp[-2].decl)->addArray( (yyvsp[0].decl) ); }
     7740  case 674:
     7741#line 2580 "parser.yy" /* yacc.c:1646  */
     7742    { (yyval.decl) = DeclarationNode::newFunction( 0, 0, (yyvsp[-2].decl), 0 ); }
    77437743#line 7744 "Parser/parser.cc" /* yacc.c:1646  */
    77447744    break;
    77457745
    7746   case 673:
    7747 #line 2577 "parser.yy" /* yacc.c:1646  */
     7746  case 675:
     7747#line 2582 "parser.yy" /* yacc.c:1646  */
     7748    { (yyval.decl) = (yyvsp[-6].decl)->addParamList( (yyvsp[-2].decl) ); }
     7749#line 7750 "Parser/parser.cc" /* yacc.c:1646  */
     7750    break;
     7751
     7752  case 676:
     7753#line 2584 "parser.yy" /* yacc.c:1646  */
    77487754    { (yyval.decl) = (yyvsp[-1].decl); }
    7749 #line 7750 "Parser/parser.cc" /* yacc.c:1646  */
    7750     break;
    7751 
    7752   case 674:
    7753 #line 2582 "parser.yy" /* yacc.c:1646  */
    7754     { (yyval.decl) = DeclarationNode::newFunction( 0, 0, (yyvsp[-2].decl), 0 ); }
    77557755#line 7756 "Parser/parser.cc" /* yacc.c:1646  */
    77567756    break;
    77577757
    7758   case 675:
    7759 #line 2584 "parser.yy" /* yacc.c:1646  */
    7760     { (yyval.decl) = (yyvsp[-6].decl)->addParamList( (yyvsp[-2].decl) ); }
     7758  case 678:
     7759#line 2591 "parser.yy" /* yacc.c:1646  */
     7760    { (yyval.decl) = (yyvsp[-1].decl)->addArray( (yyvsp[0].decl) ); }
    77617761#line 7762 "Parser/parser.cc" /* yacc.c:1646  */
    77627762    break;
    77637763
    7764   case 676:
    7765 #line 2586 "parser.yy" /* yacc.c:1646  */
    7766     { (yyval.decl) = (yyvsp[-1].decl); }
     7764  case 680:
     7765#line 2602 "parser.yy" /* yacc.c:1646  */
     7766    { (yyval.decl) = DeclarationNode::newArray( 0, 0, false ); }
    77677767#line 7768 "Parser/parser.cc" /* yacc.c:1646  */
    77687768    break;
    77697769
    7770   case 678:
    7771 #line 2593 "parser.yy" /* yacc.c:1646  */
    7772     { (yyval.decl) = (yyvsp[-1].decl)->addArray( (yyvsp[0].decl) ); }
     7770  case 681:
     7771#line 2605 "parser.yy" /* yacc.c:1646  */
     7772    { (yyval.decl) = DeclarationNode::newVarArray( (yyvsp[-3].decl) ); }
    77737773#line 7774 "Parser/parser.cc" /* yacc.c:1646  */
    77747774    break;
    77757775
    7776   case 680:
    7777 #line 2604 "parser.yy" /* yacc.c:1646  */
    7778     { (yyval.decl) = DeclarationNode::newArray( 0, 0, false ); }
     7776  case 682:
     7777#line 2607 "parser.yy" /* yacc.c:1646  */
     7778    { (yyval.decl) = DeclarationNode::newArray( 0, (yyvsp[-2].decl), false ); }
    77797779#line 7780 "Parser/parser.cc" /* yacc.c:1646  */
    77807780    break;
    77817781
    7782   case 681:
    7783 #line 2607 "parser.yy" /* yacc.c:1646  */
    7784     { (yyval.decl) = DeclarationNode::newVarArray( (yyvsp[-3].decl) ); }
     7782  case 683:
     7783#line 2610 "parser.yy" /* yacc.c:1646  */
     7784    { (yyval.decl) = DeclarationNode::newArray( (yyvsp[-2].en), (yyvsp[-3].decl), false ); }
    77857785#line 7786 "Parser/parser.cc" /* yacc.c:1646  */
    77867786    break;
    77877787
    7788   case 682:
    7789 #line 2609 "parser.yy" /* yacc.c:1646  */
    7790     { (yyval.decl) = DeclarationNode::newArray( 0, (yyvsp[-2].decl), false ); }
     7788  case 684:
     7789#line 2612 "parser.yy" /* yacc.c:1646  */
     7790    { (yyval.decl) = DeclarationNode::newArray( (yyvsp[-2].en), (yyvsp[-3].decl), true ); }
    77917791#line 7792 "Parser/parser.cc" /* yacc.c:1646  */
    77927792    break;
    77937793
    7794   case 683:
    7795 #line 2612 "parser.yy" /* yacc.c:1646  */
    7796     { (yyval.decl) = DeclarationNode::newArray( (yyvsp[-2].en), (yyvsp[-3].decl), false ); }
     7794  case 685:
     7795#line 2614 "parser.yy" /* yacc.c:1646  */
     7796    { (yyval.decl) = DeclarationNode::newArray( (yyvsp[-2].en), (yyvsp[-4].decl), true ); }
    77977797#line 7798 "Parser/parser.cc" /* yacc.c:1646  */
    77987798    break;
    77997799
    7800   case 684:
    7801 #line 2614 "parser.yy" /* yacc.c:1646  */
    7802     { (yyval.decl) = DeclarationNode::newArray( (yyvsp[-2].en), (yyvsp[-3].decl), true ); }
     7800  case 687:
     7801#line 2628 "parser.yy" /* yacc.c:1646  */
     7802    { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
    78037803#line 7804 "Parser/parser.cc" /* yacc.c:1646  */
    78047804    break;
    78057805
    7806   case 685:
    7807 #line 2616 "parser.yy" /* yacc.c:1646  */
    7808     { (yyval.decl) = DeclarationNode::newArray( (yyvsp[-2].en), (yyvsp[-4].decl), true ); }
    7809 #line 7810 "Parser/parser.cc" /* yacc.c:1646  */
    7810     break;
    7811 
    7812   case 687:
     7806  case 688:
    78137807#line 2630 "parser.yy" /* yacc.c:1646  */
    78147808    { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
     7809#line 7810 "Parser/parser.cc" /* yacc.c:1646  */
     7810    break;
     7811
     7812  case 689:
     7813#line 2635 "parser.yy" /* yacc.c:1646  */
     7814    { (yyval.decl) = DeclarationNode::newPointer( 0 ); }
    78157815#line 7816 "Parser/parser.cc" /* yacc.c:1646  */
    78167816    break;
    78177817
    7818   case 688:
    7819 #line 2632 "parser.yy" /* yacc.c:1646  */
    7820     { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
     7818  case 690:
     7819#line 2637 "parser.yy" /* yacc.c:1646  */
     7820    { (yyval.decl) = DeclarationNode::newPointer( (yyvsp[0].decl) ); }
    78217821#line 7822 "Parser/parser.cc" /* yacc.c:1646  */
    78227822    break;
    78237823
    7824   case 689:
    7825 #line 2637 "parser.yy" /* yacc.c:1646  */
    7826     { (yyval.decl) = DeclarationNode::newPointer( 0 ); }
     7824  case 691:
     7825#line 2639 "parser.yy" /* yacc.c:1646  */
     7826    { (yyval.decl) = (yyvsp[0].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); }
    78277827#line 7828 "Parser/parser.cc" /* yacc.c:1646  */
    78287828    break;
    78297829
    7830   case 690:
    7831 #line 2639 "parser.yy" /* yacc.c:1646  */
    7832     { (yyval.decl) = DeclarationNode::newPointer( (yyvsp[0].decl) ); }
     7830  case 692:
     7831#line 2641 "parser.yy" /* yacc.c:1646  */
     7832    { (yyval.decl) = (yyvsp[0].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[-1].decl) ) ); }
    78337833#line 7834 "Parser/parser.cc" /* yacc.c:1646  */
    78347834    break;
    78357835
    7836   case 691:
    7837 #line 2641 "parser.yy" /* yacc.c:1646  */
    7838     { (yyval.decl) = (yyvsp[0].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); }
     7836  case 693:
     7837#line 2643 "parser.yy" /* yacc.c:1646  */
     7838    { (yyval.decl) = (yyvsp[-1].decl); }
    78397839#line 7840 "Parser/parser.cc" /* yacc.c:1646  */
    78407840    break;
    78417841
    7842   case 692:
    7843 #line 2643 "parser.yy" /* yacc.c:1646  */
    7844     { (yyval.decl) = (yyvsp[0].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[-1].decl) ) ); }
     7842  case 695:
     7843#line 2649 "parser.yy" /* yacc.c:1646  */
     7844    { (yyval.decl) = (yyvsp[-2].decl)->addArray( (yyvsp[0].decl) ); }
    78457845#line 7846 "Parser/parser.cc" /* yacc.c:1646  */
    78467846    break;
    78477847
    7848   case 693:
    7849 #line 2645 "parser.yy" /* yacc.c:1646  */
    7850     { (yyval.decl) = (yyvsp[-1].decl); }
    7851 #line 7852 "Parser/parser.cc" /* yacc.c:1646  */
    7852     break;
    7853 
    7854   case 695:
     7848  case 696:
    78557849#line 2651 "parser.yy" /* yacc.c:1646  */
    78567850    { (yyval.decl) = (yyvsp[-2].decl)->addArray( (yyvsp[0].decl) ); }
     7851#line 7852 "Parser/parser.cc" /* yacc.c:1646  */
     7852    break;
     7853
     7854  case 697:
     7855#line 2653 "parser.yy" /* yacc.c:1646  */
     7856    { (yyval.decl) = (yyvsp[-1].decl); }
    78577857#line 7858 "Parser/parser.cc" /* yacc.c:1646  */
    78587858    break;
    78597859
    7860   case 696:
    7861 #line 2653 "parser.yy" /* yacc.c:1646  */
    7862     { (yyval.decl) = (yyvsp[-2].decl)->addArray( (yyvsp[0].decl) ); }
     7860  case 698:
     7861#line 2658 "parser.yy" /* yacc.c:1646  */
     7862    { (yyval.decl) = (yyvsp[-6].decl)->addParamList( (yyvsp[-2].decl) ); }
    78637863#line 7864 "Parser/parser.cc" /* yacc.c:1646  */
    78647864    break;
    78657865
    7866   case 697:
    7867 #line 2655 "parser.yy" /* yacc.c:1646  */
     7866  case 699:
     7867#line 2660 "parser.yy" /* yacc.c:1646  */
    78687868    { (yyval.decl) = (yyvsp[-1].decl); }
    78697869#line 7870 "Parser/parser.cc" /* yacc.c:1646  */
    78707870    break;
    78717871
    7872   case 698:
    7873 #line 2660 "parser.yy" /* yacc.c:1646  */
    7874     { (yyval.decl) = (yyvsp[-6].decl)->addParamList( (yyvsp[-2].decl) ); }
     7872  case 702:
     7873#line 2670 "parser.yy" /* yacc.c:1646  */
     7874    { (yyval.decl) = (yyvsp[0].decl)->addQualifiers( (yyvsp[-1].decl) ); }
    78757875#line 7876 "Parser/parser.cc" /* yacc.c:1646  */
    78767876    break;
    78777877
    7878   case 699:
    7879 #line 2662 "parser.yy" /* yacc.c:1646  */
    7880     { (yyval.decl) = (yyvsp[-1].decl); }
     7878  case 705:
     7879#line 2680 "parser.yy" /* yacc.c:1646  */
     7880    { (yyval.decl) = (yyvsp[0].decl)->addNewPointer( DeclarationNode::newPointer( 0 ) ); }
    78817881#line 7882 "Parser/parser.cc" /* yacc.c:1646  */
    78827882    break;
    78837883
    7884   case 702:
    7885 #line 2672 "parser.yy" /* yacc.c:1646  */
    7886     { (yyval.decl) = (yyvsp[0].decl)->addQualifiers( (yyvsp[-1].decl) ); }
     7884  case 706:
     7885#line 2682 "parser.yy" /* yacc.c:1646  */
     7886    { (yyval.decl) = (yyvsp[0].decl)->addNewPointer( DeclarationNode::newPointer( (yyvsp[-2].decl) ) ); }
    78877887#line 7888 "Parser/parser.cc" /* yacc.c:1646  */
    78887888    break;
    78897889
    7890   case 705:
    7891 #line 2682 "parser.yy" /* yacc.c:1646  */
     7890  case 707:
     7891#line 2684 "parser.yy" /* yacc.c:1646  */
    78927892    { (yyval.decl) = (yyvsp[0].decl)->addNewPointer( DeclarationNode::newPointer( 0 ) ); }
    78937893#line 7894 "Parser/parser.cc" /* yacc.c:1646  */
    78947894    break;
    78957895
    7896   case 706:
    7897 #line 2684 "parser.yy" /* yacc.c:1646  */
     7896  case 708:
     7897#line 2686 "parser.yy" /* yacc.c:1646  */
    78987898    { (yyval.decl) = (yyvsp[0].decl)->addNewPointer( DeclarationNode::newPointer( (yyvsp[-2].decl) ) ); }
    78997899#line 7900 "Parser/parser.cc" /* yacc.c:1646  */
    79007900    break;
    79017901
    7902   case 707:
    7903 #line 2686 "parser.yy" /* yacc.c:1646  */
     7902  case 709:
     7903#line 2688 "parser.yy" /* yacc.c:1646  */
    79047904    { (yyval.decl) = (yyvsp[0].decl)->addNewPointer( DeclarationNode::newPointer( 0 ) ); }
    79057905#line 7906 "Parser/parser.cc" /* yacc.c:1646  */
    79067906    break;
    79077907
    7908   case 708:
    7909 #line 2688 "parser.yy" /* yacc.c:1646  */
     7908  case 710:
     7909#line 2690 "parser.yy" /* yacc.c:1646  */
    79107910    { (yyval.decl) = (yyvsp[0].decl)->addNewPointer( DeclarationNode::newPointer( (yyvsp[-2].decl) ) ); }
    79117911#line 7912 "Parser/parser.cc" /* yacc.c:1646  */
    79127912    break;
    79137913
    7914   case 709:
    7915 #line 2690 "parser.yy" /* yacc.c:1646  */
    7916     { (yyval.decl) = (yyvsp[0].decl)->addNewPointer( DeclarationNode::newPointer( 0 ) ); }
     7914  case 711:
     7915#line 2697 "parser.yy" /* yacc.c:1646  */
     7916    { (yyval.decl) = (yyvsp[0].decl)->addNewArray( DeclarationNode::newArray( 0, 0, false ) ); }
    79177917#line 7918 "Parser/parser.cc" /* yacc.c:1646  */
    79187918    break;
    79197919
    7920   case 710:
    7921 #line 2692 "parser.yy" /* yacc.c:1646  */
    7922     { (yyval.decl) = (yyvsp[0].decl)->addNewPointer( DeclarationNode::newPointer( (yyvsp[-2].decl) ) ); }
     7920  case 712:
     7921#line 2699 "parser.yy" /* yacc.c:1646  */
     7922    { (yyval.decl) = (yyvsp[0].decl)->addNewArray( (yyvsp[-1].decl) ); }
    79237923#line 7924 "Parser/parser.cc" /* yacc.c:1646  */
    79247924    break;
    79257925
    7926   case 711:
    7927 #line 2699 "parser.yy" /* yacc.c:1646  */
     7926  case 713:
     7927#line 2701 "parser.yy" /* yacc.c:1646  */
     7928    { (yyval.decl) = (yyvsp[0].decl)->addNewArray( (yyvsp[-1].decl) )->addNewArray( DeclarationNode::newArray( 0, 0, false ) ); }
     7929#line 7930 "Parser/parser.cc" /* yacc.c:1646  */
     7930    break;
     7931
     7932  case 714:
     7933#line 2703 "parser.yy" /* yacc.c:1646  */
     7934    { (yyval.decl) = (yyvsp[0].decl)->addNewArray( (yyvsp[-1].decl) )->addNewArray( (yyvsp[-2].decl) ); }
     7935#line 7936 "Parser/parser.cc" /* yacc.c:1646  */
     7936    break;
     7937
     7938  case 715:
     7939#line 2705 "parser.yy" /* yacc.c:1646  */
     7940    { (yyval.decl) = (yyvsp[0].decl)->addNewArray( (yyvsp[-1].decl) ); }
     7941#line 7942 "Parser/parser.cc" /* yacc.c:1646  */
     7942    break;
     7943
     7944  case 716:
     7945#line 2707 "parser.yy" /* yacc.c:1646  */
    79287946    { (yyval.decl) = (yyvsp[0].decl)->addNewArray( DeclarationNode::newArray( 0, 0, false ) ); }
    7929 #line 7930 "Parser/parser.cc" /* yacc.c:1646  */
    7930     break;
    7931 
    7932   case 712:
    7933 #line 2701 "parser.yy" /* yacc.c:1646  */
    7934     { (yyval.decl) = (yyvsp[0].decl)->addNewArray( (yyvsp[-1].decl) ); }
    7935 #line 7936 "Parser/parser.cc" /* yacc.c:1646  */
    7936     break;
    7937 
    7938   case 713:
    7939 #line 2703 "parser.yy" /* yacc.c:1646  */
    7940     { (yyval.decl) = (yyvsp[0].decl)->addNewArray( (yyvsp[-1].decl) )->addNewArray( DeclarationNode::newArray( 0, 0, false ) ); }
    7941 #line 7942 "Parser/parser.cc" /* yacc.c:1646  */
    7942     break;
    7943 
    7944   case 714:
    7945 #line 2705 "parser.yy" /* yacc.c:1646  */
    7946     { (yyval.decl) = (yyvsp[0].decl)->addNewArray( (yyvsp[-1].decl) )->addNewArray( (yyvsp[-2].decl) ); }
    79477947#line 7948 "Parser/parser.cc" /* yacc.c:1646  */
    79487948    break;
    79497949
    7950   case 715:
    7951 #line 2707 "parser.yy" /* yacc.c:1646  */
     7950  case 717:
     7951#line 2709 "parser.yy" /* yacc.c:1646  */
    79527952    { (yyval.decl) = (yyvsp[0].decl)->addNewArray( (yyvsp[-1].decl) ); }
    79537953#line 7954 "Parser/parser.cc" /* yacc.c:1646  */
    79547954    break;
    79557955
    7956   case 716:
    7957 #line 2709 "parser.yy" /* yacc.c:1646  */
    7958     { (yyval.decl) = (yyvsp[0].decl)->addNewArray( DeclarationNode::newArray( 0, 0, false ) ); }
     7956  case 718:
     7957#line 2711 "parser.yy" /* yacc.c:1646  */
     7958    { (yyval.decl) = (yyvsp[0].decl)->addNewArray( (yyvsp[-1].decl) )->addNewArray( DeclarationNode::newArray( 0, 0, false ) ); }
    79597959#line 7960 "Parser/parser.cc" /* yacc.c:1646  */
    79607960    break;
    79617961
    7962   case 717:
    7963 #line 2711 "parser.yy" /* yacc.c:1646  */
     7962  case 719:
     7963#line 2713 "parser.yy" /* yacc.c:1646  */
     7964    { (yyval.decl) = (yyvsp[0].decl)->addNewArray( (yyvsp[-1].decl) )->addNewArray( (yyvsp[-2].decl) ); }
     7965#line 7966 "Parser/parser.cc" /* yacc.c:1646  */
     7966    break;
     7967
     7968  case 720:
     7969#line 2715 "parser.yy" /* yacc.c:1646  */
    79647970    { (yyval.decl) = (yyvsp[0].decl)->addNewArray( (yyvsp[-1].decl) ); }
    7965 #line 7966 "Parser/parser.cc" /* yacc.c:1646  */
    7966     break;
    7967 
    7968   case 718:
    7969 #line 2713 "parser.yy" /* yacc.c:1646  */
    7970     { (yyval.decl) = (yyvsp[0].decl)->addNewArray( (yyvsp[-1].decl) )->addNewArray( DeclarationNode::newArray( 0, 0, false ) ); }
    79717971#line 7972 "Parser/parser.cc" /* yacc.c:1646  */
    79727972    break;
    79737973
    7974   case 719:
    7975 #line 2715 "parser.yy" /* yacc.c:1646  */
    7976     { (yyval.decl) = (yyvsp[0].decl)->addNewArray( (yyvsp[-1].decl) )->addNewArray( (yyvsp[-2].decl) ); }
     7974  case 721:
     7975#line 2720 "parser.yy" /* yacc.c:1646  */
     7976    { (yyval.decl) = DeclarationNode::newVarArray( (yyvsp[-3].decl) ); }
    79777977#line 7978 "Parser/parser.cc" /* yacc.c:1646  */
    79787978    break;
    79797979
    7980   case 720:
    7981 #line 2717 "parser.yy" /* yacc.c:1646  */
    7982     { (yyval.decl) = (yyvsp[0].decl)->addNewArray( (yyvsp[-1].decl) ); }
     7980  case 722:
     7981#line 2722 "parser.yy" /* yacc.c:1646  */
     7982    { (yyval.decl) = DeclarationNode::newArray( (yyvsp[-2].en), (yyvsp[-3].decl), false ); }
    79837983#line 7984 "Parser/parser.cc" /* yacc.c:1646  */
    79847984    break;
    79857985
    7986   case 721:
    7987 #line 2722 "parser.yy" /* yacc.c:1646  */
    7988     { (yyval.decl) = DeclarationNode::newVarArray( (yyvsp[-3].decl) ); }
     7986  case 723:
     7987#line 2727 "parser.yy" /* yacc.c:1646  */
     7988    { (yyval.decl) = DeclarationNode::newArray( (yyvsp[-2].en), (yyvsp[-3].decl), true ); }
    79897989#line 7990 "Parser/parser.cc" /* yacc.c:1646  */
    79907990    break;
    79917991
    7992   case 722:
    7993 #line 2724 "parser.yy" /* yacc.c:1646  */
    7994     { (yyval.decl) = DeclarationNode::newArray( (yyvsp[-2].en), (yyvsp[-3].decl), false ); }
     7992  case 724:
     7993#line 2729 "parser.yy" /* yacc.c:1646  */
     7994    { (yyval.decl) = DeclarationNode::newArray( (yyvsp[-2].en), (yyvsp[-3].decl)->addQualifiers( (yyvsp[-4].decl) ), true ); }
    79957995#line 7996 "Parser/parser.cc" /* yacc.c:1646  */
    79967996    break;
    79977997
    7998   case 723:
    7999 #line 2729 "parser.yy" /* yacc.c:1646  */
    8000     { (yyval.decl) = DeclarationNode::newArray( (yyvsp[-2].en), (yyvsp[-3].decl), true ); }
     7998  case 726:
     7999#line 2756 "parser.yy" /* yacc.c:1646  */
     8000    { (yyval.decl) = (yyvsp[0].decl)->addQualifiers( (yyvsp[-1].decl) ); }
    80018001#line 8002 "Parser/parser.cc" /* yacc.c:1646  */
    80028002    break;
    80038003
    8004   case 724:
    8005 #line 2731 "parser.yy" /* yacc.c:1646  */
    8006     { (yyval.decl) = DeclarationNode::newArray( (yyvsp[-2].en), (yyvsp[-3].decl)->addQualifiers( (yyvsp[-4].decl) ), true ); }
     8004  case 730:
     8005#line 2767 "parser.yy" /* yacc.c:1646  */
     8006    { (yyval.decl) = (yyvsp[0].decl)->addNewPointer( DeclarationNode::newPointer( 0 ) ); }
    80078007#line 8008 "Parser/parser.cc" /* yacc.c:1646  */
    80088008    break;
    80098009
    8010   case 726:
    8011 #line 2758 "parser.yy" /* yacc.c:1646  */
    8012     { (yyval.decl) = (yyvsp[0].decl)->addQualifiers( (yyvsp[-1].decl) ); }
     8010  case 731:
     8011#line 2769 "parser.yy" /* yacc.c:1646  */
     8012    { (yyval.decl) = (yyvsp[0].decl)->addNewPointer( DeclarationNode::newPointer( (yyvsp[-2].decl) ) ); }
    80138013#line 8014 "Parser/parser.cc" /* yacc.c:1646  */
    80148014    break;
    80158015
    8016   case 730:
    8017 #line 2769 "parser.yy" /* yacc.c:1646  */
     8016  case 732:
     8017#line 2771 "parser.yy" /* yacc.c:1646  */
    80188018    { (yyval.decl) = (yyvsp[0].decl)->addNewPointer( DeclarationNode::newPointer( 0 ) ); }
    80198019#line 8020 "Parser/parser.cc" /* yacc.c:1646  */
    80208020    break;
    80218021
    8022   case 731:
    8023 #line 2771 "parser.yy" /* yacc.c:1646  */
     8022  case 733:
     8023#line 2773 "parser.yy" /* yacc.c:1646  */
    80248024    { (yyval.decl) = (yyvsp[0].decl)->addNewPointer( DeclarationNode::newPointer( (yyvsp[-2].decl) ) ); }
    80258025#line 8026 "Parser/parser.cc" /* yacc.c:1646  */
    80268026    break;
    80278027
    8028   case 732:
    8029 #line 2773 "parser.yy" /* yacc.c:1646  */
     8028  case 734:
     8029#line 2775 "parser.yy" /* yacc.c:1646  */
    80308030    { (yyval.decl) = (yyvsp[0].decl)->addNewPointer( DeclarationNode::newPointer( 0 ) ); }
    80318031#line 8032 "Parser/parser.cc" /* yacc.c:1646  */
    80328032    break;
    80338033
    8034   case 733:
    8035 #line 2775 "parser.yy" /* yacc.c:1646  */
     8034  case 735:
     8035#line 2777 "parser.yy" /* yacc.c:1646  */
    80368036    { (yyval.decl) = (yyvsp[0].decl)->addNewPointer( DeclarationNode::newPointer( (yyvsp[-2].decl) ) ); }
    80378037#line 8038 "Parser/parser.cc" /* yacc.c:1646  */
    80388038    break;
    80398039
    8040   case 734:
    8041 #line 2777 "parser.yy" /* yacc.c:1646  */
    8042     { (yyval.decl) = (yyvsp[0].decl)->addNewPointer( DeclarationNode::newPointer( 0 ) ); }
     8040  case 736:
     8041#line 2784 "parser.yy" /* yacc.c:1646  */
     8042    { (yyval.decl) = (yyvsp[0].decl)->addNewArray( DeclarationNode::newArray( 0, 0, false ) ); }
    80438043#line 8044 "Parser/parser.cc" /* yacc.c:1646  */
    80448044    break;
    80458045
    8046   case 735:
    8047 #line 2779 "parser.yy" /* yacc.c:1646  */
    8048     { (yyval.decl) = (yyvsp[0].decl)->addNewPointer( DeclarationNode::newPointer( (yyvsp[-2].decl) ) ); }
     8046  case 737:
     8047#line 2786 "parser.yy" /* yacc.c:1646  */
     8048    { (yyval.decl) = (yyvsp[0].decl)->addNewArray( (yyvsp[-1].decl) )->addNewArray( DeclarationNode::newArray( 0, 0, false ) ); }
    80498049#line 8050 "Parser/parser.cc" /* yacc.c:1646  */
    80508050    break;
    80518051
    8052   case 736:
    8053 #line 2786 "parser.yy" /* yacc.c:1646  */
     8052  case 738:
     8053#line 2788 "parser.yy" /* yacc.c:1646  */
     8054    { (yyval.decl) = (yyvsp[0].decl)->addNewArray( (yyvsp[-1].decl) ); }
     8055#line 8056 "Parser/parser.cc" /* yacc.c:1646  */
     8056    break;
     8057
     8058  case 739:
     8059#line 2790 "parser.yy" /* yacc.c:1646  */
    80548060    { (yyval.decl) = (yyvsp[0].decl)->addNewArray( DeclarationNode::newArray( 0, 0, false ) ); }
    8055 #line 8056 "Parser/parser.cc" /* yacc.c:1646  */
    8056     break;
    8057 
    8058   case 737:
    8059 #line 2788 "parser.yy" /* yacc.c:1646  */
     8061#line 8062 "Parser/parser.cc" /* yacc.c:1646  */
     8062    break;
     8063
     8064  case 740:
     8065#line 2792 "parser.yy" /* yacc.c:1646  */
    80608066    { (yyval.decl) = (yyvsp[0].decl)->addNewArray( (yyvsp[-1].decl) )->addNewArray( DeclarationNode::newArray( 0, 0, false ) ); }
    8061 #line 8062 "Parser/parser.cc" /* yacc.c:1646  */
    8062     break;
    8063 
    8064   case 738:
    8065 #line 2790 "parser.yy" /* yacc.c:1646  */
     8067#line 8068 "Parser/parser.cc" /* yacc.c:1646  */
     8068    break;
     8069
     8070  case 741:
     8071#line 2794 "parser.yy" /* yacc.c:1646  */
    80668072    { (yyval.decl) = (yyvsp[0].decl)->addNewArray( (yyvsp[-1].decl) ); }
    8067 #line 8068 "Parser/parser.cc" /* yacc.c:1646  */
    8068     break;
    8069 
    8070   case 739:
    8071 #line 2792 "parser.yy" /* yacc.c:1646  */
    8072     { (yyval.decl) = (yyvsp[0].decl)->addNewArray( DeclarationNode::newArray( 0, 0, false ) ); }
    80738073#line 8074 "Parser/parser.cc" /* yacc.c:1646  */
    80748074    break;
    80758075
    8076   case 740:
    8077 #line 2794 "parser.yy" /* yacc.c:1646  */
    8078     { (yyval.decl) = (yyvsp[0].decl)->addNewArray( (yyvsp[-1].decl) )->addNewArray( DeclarationNode::newArray( 0, 0, false ) ); }
     8076  case 742:
     8077#line 2799 "parser.yy" /* yacc.c:1646  */
     8078    { (yyval.decl) = DeclarationNode::newTuple( (yyvsp[-2].decl) ); }
    80798079#line 8080 "Parser/parser.cc" /* yacc.c:1646  */
    80808080    break;
    80818081
    8082   case 741:
    8083 #line 2796 "parser.yy" /* yacc.c:1646  */
    8084     { (yyval.decl) = (yyvsp[0].decl)->addNewArray( (yyvsp[-1].decl) ); }
     8082  case 743:
     8083#line 2804 "parser.yy" /* yacc.c:1646  */
     8084    { (yyval.decl) = DeclarationNode::newFunction( 0, DeclarationNode::newTuple( 0 ), (yyvsp[-1].decl), 0 ); }
    80858085#line 8086 "Parser/parser.cc" /* yacc.c:1646  */
    80868086    break;
    80878087
    8088   case 742:
    8089 #line 2801 "parser.yy" /* yacc.c:1646  */
    8090     { (yyval.decl) = DeclarationNode::newTuple( (yyvsp[-2].decl) ); }
     8088  case 744:
     8089#line 2806 "parser.yy" /* yacc.c:1646  */
     8090    { (yyval.decl) = DeclarationNode::newFunction( 0, (yyvsp[-5].decl), (yyvsp[-2].decl), 0 ); }
    80918091#line 8092 "Parser/parser.cc" /* yacc.c:1646  */
    80928092    break;
    80938093
    8094   case 743:
    8095 #line 2806 "parser.yy" /* yacc.c:1646  */
    8096     { (yyval.decl) = DeclarationNode::newFunction( 0, DeclarationNode::newTuple( 0 ), (yyvsp[-1].decl), 0 ); }
    8097 #line 8098 "Parser/parser.cc" /* yacc.c:1646  */
    8098     break;
    8099 
    8100   case 744:
     8094  case 745:
    81018095#line 2808 "parser.yy" /* yacc.c:1646  */
    81028096    { (yyval.decl) = DeclarationNode::newFunction( 0, (yyvsp[-5].decl), (yyvsp[-2].decl), 0 ); }
     8097#line 8098 "Parser/parser.cc" /* yacc.c:1646  */
     8098    break;
     8099
     8100  case 748:
     8101#line 2832 "parser.yy" /* yacc.c:1646  */
     8102    { (yyval.en) = 0; }
    81038103#line 8104 "Parser/parser.cc" /* yacc.c:1646  */
    81048104    break;
    81058105
    8106   case 745:
    8107 #line 2810 "parser.yy" /* yacc.c:1646  */
    8108     { (yyval.decl) = DeclarationNode::newFunction( 0, (yyvsp[-5].decl), (yyvsp[-2].decl), 0 ); }
     8106  case 749:
     8107#line 2834 "parser.yy" /* yacc.c:1646  */
     8108    { (yyval.en) = (yyvsp[0].en); }
    81098109#line 8110 "Parser/parser.cc" /* yacc.c:1646  */
    81108110    break;
    81118111
    8112   case 748:
    8113 #line 2834 "parser.yy" /* yacc.c:1646  */
    8114     { (yyval.en) = 0; }
    8115 #line 8116 "Parser/parser.cc" /* yacc.c:1646  */
    8116     break;
    8117 
    8118   case 749:
    8119 #line 2836 "parser.yy" /* yacc.c:1646  */
    8120     { (yyval.en) = (yyvsp[0].en); }
    8121 #line 8122 "Parser/parser.cc" /* yacc.c:1646  */
    8122     break;
    8123 
    8124 
    8125 #line 8126 "Parser/parser.cc" /* yacc.c:1646  */
     8112
     8113#line 8114 "Parser/parser.cc" /* yacc.c:1646  */
    81268114      default: break;
    81278115    }
     
    83518339  return yyresult;
    83528340}
    8353 #line 2839 "parser.yy" /* yacc.c:1906  */
     8341#line 2837 "parser.yy" /* yacc.c:1906  */
    83548342
    83558343// ----end of grammar----
  • src/Parser/parser.yy

    re85a8631 r04cdd9b  
    21052105        // empty
    21062106        | ASM '(' string_literal_list ')' attribute_list_opt
    2107                 { delete $3; }
    21082107        ;
    21092108
     
    21352134        | any_word
    21362135        | any_word '(' comma_expression_opt ')'
    2137                 { delete $3; }
    21382136        ;
    21392137
    21402138any_word:                                                                                               // GCC
    2141         identifier_or_type_name { delete $1; }
    2142         | storage_class { delete $1; }
    2143         | basic_type_name { delete $1; }
    2144         | type_qualifier { delete $1; }
     2139        identifier_or_type_name {}
     2140        | storage_class {}
     2141        | basic_type_name {}
     2142        | type_qualifier {}
    21452143        ;
    21462144
  • src/SynTree/Expression.cc

    re85a8631 r04cdd9b  
    385385UntypedExpr::~UntypedExpr() {
    386386        delete function;
    387         // deleteAll( args );  //TODO FIXME the arguments are leaked but they seem to be shared in some way
    388387}
    389388
  • src/SynTree/FunctionDecl.cc

    re85a8631 r04cdd9b  
    3939        delete type;
    4040        delete statements;
    41         deleteAll( oldDecls );
    4241}
    4342
  • src/SynTree/Statement.cc

    re85a8631 r04cdd9b  
    159159        delete condition;
    160160        // destroy statements
    161         deleteAll( statements );
    162161}
    163162
     
    188187CaseStmt::~CaseStmt() {
    189188        delete condition;
    190         deleteAll( stmts );
    191189}
    192190
     
    222220WhileStmt::~WhileStmt() {
    223221        delete body;
    224         delete condition;
    225222}
    226223
     
    297294TryStmt::~TryStmt() {
    298295        delete block;
    299         deleteAll( handlers );
    300         delete finallyBlock;
    301296}
    302297
  • src/include/assert.h

    re85a8631 r04cdd9b  
    44// The contents of this file are covered under the licence agreement in the
    55// file "LICENCE" distributed with Cforall.
    6 //
    7 // assert.h --
    8 //
     6// 
     7// assert.h -- 
     8// 
    99// Author           : Peter A. Buhr
    1010// Created On       : Thu Aug 18 13:19:26 2016
     
    1212// Last Modified On : Thu Aug 18 13:25:55 2016
    1313// Update Count     : 4
    14 //
    15 
    16 #pragma once
     14//
    1715
    1816#include_next <assert.h>
     
    2422void __assert_fail_f( const char *assertion, const char *file, unsigned int line, const char *function, const char *fmt, ... );
    2523
    26 template<typename T, typename U>
    27 static inline T safe_dynamic_cast(const U& src) {
    28         T ret = dynamic_cast<T>(src);
    29         assert(ret);
    30         return ret;
    31 }
    32 
    3324// Local Variables: //
    3425// tab-width: 4 //
  • src/main.cc

    re85a8631 r04cdd9b  
    1010// Created On       : Fri May 15 23:12:02 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Aug 20 12:52:22 2016
    13 // Update Count     : 403
     12// Last Modified On : Fri Aug 19 08:31:22 2016
     13// Update Count     : 350
    1414//
    1515
    1616#include <iostream>
    1717#include <fstream>
    18 #include <signal.h>                                                                             // signal
    19 #include <getopt.h>                                                                             // getopt
    20 #include <execinfo.h>                                                                   // backtrace, backtrace_symbols_fd
    21 #include <cxxabi.h>                                                                             // __cxa_demangle
    22 
    23 using namespace std;
    24 
     18#include <getopt.h>
    2519#include "Parser/lex.h"
    2620#include "Parser/parser.h"
     
    4135#include "InitTweak/FixInit.h"
    4236#include "Common/UnimplementedError.h"
     37
    4338#include "../config.h"
    4439
    4540using namespace std;
    4641
    47 #define OPTPRINT(x) if ( errorp ) cerr << x << endl;
     42#define OPTPRINT(x) if ( errorp ) std::cerr << x << std::endl;
    4843
    4944
     
    7368static void parse_cmdline( int argc, char *argv[], const char *& filename );
    7469static void parse( FILE * input, LinkageSpec::Spec linkage, bool shouldExit = false );
    75 static void dump( list< Declaration * > & translationUnit, ostream & out = cout );
    76 
    77 void sigSegvBusHandler( int sig_num ) {
    78         enum { Frames = 50 };
    79         void * array[Frames];
    80         int size = backtrace( array, Frames );
    81 
    82         cerr << "*CFA runtime error* program cfa-cpp terminated with "
    83                  <<     (sig_num == SIGSEGV ? "segment fault" : "bus error")
    84                  << " backtrace:" << endl;
    85 
    86         char ** messages = backtrace_symbols( array, size );   
    87 
    88         // skip first stack frame (points here)
    89         for ( int i = 2; i < size - 2 && messages != nullptr; i += 1 ) {
    90                 char * mangled_name = nullptr, * offset_begin = nullptr, * offset_end = nullptr;
    91                 for ( char *p = messages[i]; *p; ++p ) {        // find parantheses and +offset
    92                         if (*p == '(') {
    93                                 mangled_name = p;
    94                         } else if (*p == '+') {
    95                                 offset_begin = p;
    96                         } else if (*p == ')') {
    97                                 offset_end = p;
    98                                 break;
    99                         } // if
    100                 } // for
    101 
    102                 // if line contains symbol, attempt to demangle
    103                 if ( mangled_name && offset_begin && offset_end && mangled_name < offset_begin ) {
    104                         *mangled_name++ = '\0';
    105                         *offset_begin++ = '\0';
    106                         *offset_end++ = '\0';
    107 
    108                         int status;
    109                         char * real_name = __cxxabiv1::__cxa_demangle( mangled_name, 0, 0, &status );
    110                         if ( status == 0 ) {                                            // demangling successful ?
    111                                 cerr << "(" << i - 2 << ") " << messages[i] << " : "
    112                                          << real_name << "+" << offset_begin << offset_end << endl;
    113 
    114                         } else {                                                                        // otherwise, output mangled name
    115                                 cerr << "(" << i - 2 << ") " << messages[i] << " : "
    116                                          << mangled_name << "+" << offset_begin << offset_end << endl;
    117                         } // if
    118                         free( real_name );
    119                 } else {                                                                                // otherwise, print the whole line
    120                         cerr << "(" << i - 2 << ") " << messages[i] << endl;
    121                 } // if
    122         } // for
    123         free( messages );
    124         exit( EXIT_FAILURE );
    125 } // sigSegvBusHandler
     70static void dump( std::list< Declaration * > & translationUnit, std::ostream & out = std::cout );
    12671
    12772int main( int argc, char * argv[] ) {
    12873        FILE * input;                                                                           // use FILE rather than istream because yyin is FILE
    129         ostream *output = & cout;
     74        std::ostream *output = & std::cout;
     75        std::list< Declaration * > translationUnit;
    13076        const char *filename = nullptr;
    131         list< Declaration * > translationUnit;
    132 
    133         signal( SIGSEGV, sigSegvBusHandler );
    134         signal( SIGBUS, sigSegvBusHandler );
    13577
    13678        parse_cmdline( argc, argv, filename );                          // process command-line arguments
     
    180122
    181123                if ( parsep ) {
    182                         parseTree->printList( cout );
     124                        parseTree->printList( std::cout );
    183125                        delete parseTree;
    184126                        return 0;
     
    202144
    203145                if ( expraltp ) {
    204                         ResolvExpr::AlternativePrinter printer( cout );
     146                        ResolvExpr::AlternativePrinter printer( std::cout );
    205147                        acceptAll( translationUnit, printer );
    206148                        return 0;
     
    268210                CodeGen::generate( translationUnit, *output, ! noprotop );
    269211
    270                 if ( output != &cout ) {
     212                if ( output != &std::cout ) {
    271213                        delete output;
    272214                } // if
    273215        } catch ( SemanticError &e ) {
    274216                if ( errorp ) {
    275                         cerr << "---AST at error:---" << endl;
    276                         dump( translationUnit, cerr );
    277                         cerr << endl << "---End of AST, begin error message:---\n" << endl;
    278                 } // if
    279                 e.print( cerr );
    280                 if ( output != &cout ) {
     217                        std::cerr << "---AST at error:---" << std::endl;
     218                        dump( translationUnit, std::cerr );
     219                        std::cerr << std::endl << "---End of AST, begin error message:---\n" << std::endl;
     220                } // if
     221                e.print( std::cerr );
     222                if ( output != &std::cout ) {
    281223                        delete output;
    282224                } // if
    283225                return 1;
    284226        } catch ( UnimplementedError &e ) {
    285                 cout << "Sorry, " << e.get_what() << " is not currently implemented" << endl;
    286                 if ( output != &cout ) {
     227                std::cout << "Sorry, " << e.get_what() << " is not currently implemented" << std::endl;
     228                if ( output != &std::cout ) {
    287229                        delete output;
    288230                } // if
    289231                return 1;
    290232        } catch ( CompilerError &e ) {
    291                 cerr << "Compiler Error: " << e.get_what() << endl;
    292                 cerr << "(please report bugs to " << endl;
    293                 if ( output != &cout ) {
     233                std::cerr << "Compiler Error: " << e.get_what() << std::endl;
     234                std::cerr << "(please report bugs to " << std::endl;
     235                if ( output != &std::cout ) {
    294236                        delete output;
    295237                } // if
     
    427369} // notPrelude
    428370
    429 static void dump( list< Declaration * > & translationUnit, ostream & out ) {
    430         list< Declaration * > decls;
     371static void dump( std::list< Declaration * > & translationUnit, std::ostream & out ) {
     372        std::list< Declaration * > decls;
    431373
    432374        if ( noprotop ) {
    433                 filter( translationUnit.begin(), translationUnit.end(), back_inserter( decls ), notPrelude );
     375                filter( translationUnit.begin(), translationUnit.end(), std::back_inserter( decls ), notPrelude );
    434376        } else {
    435377                decls = translationUnit;
Note: See TracChangeset for help on using the changeset viewer.