Changeset e85a8631


Ignore:
Timestamp:
Aug 22, 2016, 2:15:19 PM (8 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
f87408e
Parents:
04cdd9b (diff), 8d2844a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into ctor

Files:
18 edited

Legend:

Unmodified
Added
Removed
  • doc/aaron_comp_II/comp_II.tex

    r04cdd9b re85a8631  
    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 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.
     93The 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.
    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 also 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 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 to ©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 of ©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 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 \emph{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     M aa = abs(a), ab = abs(b);
    173     return aa < ab ? b : a;
     172    return abs(a) < abs(b) ? b : a;
    174173}
    175174\end{lstlisting}
    176175
    177176Semantically, 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.
    178 Unlike Java interfaces or \CC base classes, \CFA types do not explicitly state any inheritance relationship to traits they satisfy; this can be considered a form of structural inheritance, similar to interface implementation in Go, as opposed to the nominal inheritance model of Java and \CC.
     177Unlike 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.
    179178Nominal inheritance can be simulated with traits using marker variables or functions:
    180179\begin{lstlisting}
     
    190189\end{lstlisting}
    191190
    192 Traits, 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.
    193 Secondly, 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:
     191Traits, 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.
     192Secondly, 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:
    194193\begin{lstlisting}
    195194trait pointer_like(®otype Ptr, otype El®) {
     
    202201};
    203202
    204 typedef list* list_iterator;
     203typedef list *list_iterator;
    205204
    206205lvalue int *?( list_iterator it ) {
     
    209208\end{lstlisting}
    210209
    211 In 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.
     210In 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.
     211Given 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©).
    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 could 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 can 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 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 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.
    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 7
    232 max(max, 3.14); // uses (2) and (4), by matching double type of 3.14
     231max(7, -max);   // uses (1) and (3), by matching int type of the constant 7
     232max(max, 3.14); // uses (2) and (4), by matching double type of the constant 3.14
    233233
    234234max(max, -max);  // ERROR: ambiguous
    235 int m = max(max, -max); // uses (1) and (3) twice, by return type
     235int m = max(max, -max); // uses (1) once and (3) twice, by matching 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 also supports all of the implicit conversions present in C, producing further candidate interpretations for expressions.
    242 C 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 
    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 must support all of the implicit conversions present in C for backward compatibility, producing further candidate interpretations for expressions.
     242C 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
     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 ©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).
     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.
     248While 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).
    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} has laid out a framework for using polymorphic-conversion-constructor functions to create a directed acyclic graph (DAG) of conversions.
     254Ditchfield~\cite{Ditchfield:conversions} 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 as path length through the DAG.
     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 the length of the shortest path through the DAG from one type to another.
    257257\begin{figure}[h]
    258258\centering
    259259\includegraphics{conversion_dag}
    260 \caption{A portion of the implicit conversion DAG for built-in types.}
     260\caption{A portion of the implicit conversion DAG for built-in types.}\label{fig:conv_dag}
    261261\end{figure}
    262 As 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©).
     262As 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©).
    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 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?
     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?
    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; for ©struct© types these functions each call their equivalents on each field of the ©struct©.
    274 This 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.
     274For ©struct© types these functions each call their equivalents on each field of the ©struct©.
     275This 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.
    275276The following example shows the implicitly-generated code in green:
    276277\begin{lstlisting}
     
    280281};
    281282
    282 ¢void ?{}(kv *this) {
    283     ?{}(&this->key);
    284     ?{}(&this->value);
    285 }
    286 void ?{}(kv *this, kv that) {
    287     ?{}(&this->key, that.key);
    288     ?{}(&this->value, that.value);
    289 }
    290 kv ?=?(kv *this, kv that) {
    291     ?=?(&this->key, that.key);
    292     ?=?(&this->value, that.value);
     283¢void ?{}(kv *this) {  // default constructor
     284    ?{}(&(this->key));  // call recursively on members
     285    ?{}(&(this->value));
     286}
     287void ?{}(kv *this, kv that) {  // copy constructor
     288    ?{}(&(this->key), that.key);
     289    ?{}(&(this->value), that.value);
     290}
     291kv ?=?(kv *this, kv that) {  // assignment operator
     292    ?=?(&(this->key), that.key);
     293    ?=?(&(this->value), that.value);
    293294    return *this;
    294295}
    295 void ^?{}(kv *this) {
    296     ^?{}(&this->key);
    297     ^?{}(&this->value);
     296void ^?{}(kv *this) {  // destructor
     297    ^?{}(&(this->key));
     298    ^?{}(&(this->value));
    298299
    299300
     
    335336\begin{itemize}
    336337\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)©.
    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©.
     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©.
    338339\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©.
    339340\item The previous step repeats until stopped, with four times as much work performed at each step.
    340341\end{itemize}
    341 This 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.
     342This 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.
     343However, 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.
    342344As 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.
    343345
     
    345347\CFA adds \emph{tuple types} to C, a syntactic facility for referring to lists of values anonymously or with a single identifier.
    346348An identifier may name a tuple, and a function may return one.
    347 Particularly 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 = [ '!', '?' ];
    350 int x = 42;
    351 
    352 forall(otype T) [T, T] swap( T a, T b ) { return [b, a]; }
     349Particularly 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)
     352int x = 42;  // (2)
     353
     354forall(otype T) [T, T] swap( T a, T b ) { return [b, a]; }  // (3)
    353355
    354356x = swap( x ); // destructure [char, char] x into two elements of parameter list
    355357// cannot use int x for parameter, not enough arguments to swap
    356 \end{lstlisting}
    357 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.
     358
     359void swap( int, char, char ); // (4)
     360
     361swap( 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}
     364Tuple 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.
     365In 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.
    358366
    359367\subsection{Reference Types}
    360368I have been designing \emph{reference types} for \CFA, in collaboration with the rest of the \CFA research team.
    361369Given 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.
    362 References 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.
    363 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 below:
     370References preserve C's existing qualifier-dropping lvalue-to-rvalue conversion (\eg a ©const volatile int&© can be implicitly converted to a bare ©int©).
     371The 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.
     372These 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:
    364373\begin{lstlisting}
    365374const int magic = 42;
     
    369378print_inc( magic ); // legal; implicitly generated code in green below:
    370379
    371 ¢int tmp = magic;¢ // copies to safely strip const-qualifier
     380¢int tmp = magic;¢ // to safely strip const-qualifier
    372381¢print_inc( tmp );¢ // tmp is incremented, magic is unchanged
    373382\end{lstlisting}
    374 These reference conversions may also chain with the other implicit type conversions.
    375 The 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.
     383These reference conversions may also chain with the other implicit type-conversions.
     384The 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.
    376385
    377386\subsection{Special Literal Types}
    378387Another proposal currently under consideration for the \CFA type-system is assigning special types to the literal values ©0© and ©1©.
    379 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 precicely.
     388Implicit 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.
    380389This 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.
    381390The main implication for expression resolution is that the frequently encountered expressions ©0© and ©1© may have a large number of valid interpretations.
     
    386395int somefn(char) = delete;
    387396\end{lstlisting}
    388 This 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.
    389 To 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.
     397This 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.}.
     398To 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.
    390399How 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.
    391400
     
    404413%TODO: look up and lit review
    405414The 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.
    406 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 of a cross-argument dependency that the problem is not trivial.
     415Whether 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.
    407416If 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.
    408417The 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.
     
    412421
    413422\subsection{Argument-Parameter Matching}
    414 The first axis for consideration is argument-parameter matching direction --- whether the type matching for a candidate function to a set of candidate arguments is directed by the argument types or the parameter types.
     423The 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.
    415424For 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.
    416 All expression resolution algorithms form a DAG of interpretations, some explicitly, some implicitly; in this DAG, arcs point from function-call interpretations to argument interpretations, as below:
     425All 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}:
    417426\begin{figure}[h]
    418427\centering
     
    433442\end{figure}
    434443
    435 Note 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.
     444Note 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.
    436445
    437446\subsubsection{Argument-directed (Bottom-up)}
     
    451460A 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.
    452461This approach may involve switching from one type to another at different levels of the expression tree.
    453 For instance:
     462For instance, in:
    454463\begin{lstlisting}
    455464forall(otype T)
     
    460469int x = f( f( '!' ) );
    461470\end{lstlisting}
    462 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*©.
    463 
    464 Deciding when to switch between bottom-up and top-down resolution to minimize wasted work in a hybrid algorithm is a necessarily heuristic process, and though finding good heuristics for which subexpressions to swich matching strategies on is an open question, one reasonable approach might be to set a threshold $t$ for the number of candidate functions, and to use top-down resolution for any subexpression with fewer than $t$ candidate functions, to minimize the number of unmatchable argument interpretations computed, but to use bottom-up resolution for any subexpression with at least $t$ candidate functions, to reduce duplication in argument interpretation computation between the different candidate functions.
     471the 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
     473Deciding 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.
     474One 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.
    465475
    466476Ganzinger 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.
    467477Persch~\etal~\cite{PW:overload} developed a similar two-pass approach where the bottom-up pass is followed by the top-down pass.
    468 These algorithms differ from the hybrid approach under investigation in that they take multiple passes over the expression tree to yield a solution, and also in that they apply both filtering heuristics to all expression nodes; \CFA's polymorphic functions and implicit conversions make the approach of filtering out invalid types taken by all of these algorithms infeasible.
     478These 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.
    469479
    470480\subsubsection{Common Subexpression Caching}
     
    480490\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.
    481491The upcoming Concepts standard~\cite{C++concepts} defines a system of type constraints similar in principle to \CFA's.
    482 Cormack and Wright~\cite{Cormack90} present an algorithm which integrates overload resolution with a polymorphic type inference approach very similar to \CFA's.
     492Cormack and Wright~\cite{Cormack90} present an algorithm that integrates overload resolution with a polymorphic type inference approach very similar to \CFA's.
    483493However, 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.}.
    484494
     
    486496Bilson does account for implicit conversions in his algorithm, but it is unclear if the approach is optimal.
    487497His 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.
    488 This approach may result in the same subexpression being checked for a type match with the same type multiple times, though again memoization may mitigate this cost, and this approach does not generate implicit conversions that are not useful to match the containing function.
    489 Calculating 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.
     498This 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.
    490499
    491500\subsubsection{On Arguments}
    492501Another approach is to generate a set of possible implicit conversions for each set of interpretations of a given argument.
    493502This 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.
    494 On the other hand, this approach may unncessarily generate argument interpretations that never match any parameter, wasting work.
    495 Further, 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.
    496 Calculating 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.
     503On the other hand, this approach may unnecessarily generate argument interpretations that never match any parameter, wasting work.
     504Furthermore, 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.
    497505
    498506\subsection{Candidate Set Generation}
    499 All the algorithms discussed to this point generate the complete set of candidate argument interpretations before attempting to match the containing function call expression.
    500 However, given that the top-level expression interpretation that is ultimately chosen is the minimal-cost valid interpretation, any consideration of non-minimal-cost interpretations is in some sense wasted work.
    501 Under the assumption that that programmers generally write function calls with relatively low-cost interpretations, a possible work-saving heuristic is to generate only the lowest-cost argument interpretations first, attempt to find a valid top-level interpretation using them, and only if that fails generate the next higher-cost argument interpretations.
     507All the algorithms discussed to this point generate the complete set of candidate argument interpretations before attempting to match the containing function-call expression.
     508However, 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.
     509Under 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.
    502510
    503511\subsubsection{Eager}
     
    563571This comparison closes Baker's open research question, as well as potentially improving Bilson's \CFA compiler.
    564572
    565 Rather 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.}.
     573Rather 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.}.
    566574Multiple variants of this resolver prototype will be implemented, each encapsulating a different expression resolution variant, sharing as much code as feasible.
    567575These 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.
     
    571579As 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.
    572580
    573 This proposed project should provide valuable data on how to implement a performant compiler for modern programming languages such as \CFA with powerful static type-systems, specifically targeting the feature interaction between name overloading and implicit conversions.
     581This 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.
    574582This 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.
    575583
  • src/Common/Assert.cc

    r04cdd9b re85a8631  
    1010// Created On       : Thu Aug 18 13:26:59 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Aug 18 23:40:29 2016
    13 // Update Count     : 8
     12// Last Modified On : Fri Aug 19 17:07:08 2016
     13// Update Count     : 10
    1414//
    1515
    1616#include <assert.h>
    17 #include <cstdarg>
    18 #include <cstdio>
    19 #include <cstdlib>
     17#include <cstdarg>                                                                              // varargs
     18#include <cstdio>                                                                               // fprintf
     19#include <cstdlib>                                                                              // abort
    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         exit( EXIT_FAILURE );
     28        abort();
    2929}
    3030
     
    3535        va_start( args, fmt );
    3636        vfprintf( stderr, fmt, args );
    37         exit( EXIT_FAILURE );
     37        abort();
    3838}
    3939
  • src/Common/utility.h

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

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

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

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

    r04cdd9b re85a8631  
    183183
    184184Expression *build_cast( DeclarationNode *decl_node, ExpressionNode *expr_node ) {
    185         Type *targetType = decl_node->buildType();
     185        Type *targetType = maybeMoveBuildType( decl_node );
    186186        if ( dynamic_cast< VoidType * >( targetType ) ) {
    187187                delete targetType;
     
    213213}
    214214Expression *build_sizeOftype( DeclarationNode *decl_node ) {
    215         Expression* ret = new SizeofExpr( decl_node->buildType() );
    216         delete decl_node;
    217         return ret;
     215        return new SizeofExpr( maybeMoveBuildType( decl_node ) );
    218216}
    219217Expression *build_alignOfexpr( ExpressionNode *expr_node ) {
     
    221219}
    222220Expression *build_alignOftype( DeclarationNode *decl_node ) {
    223         return new AlignofExpr( decl_node->buildType() );
     221        return new AlignofExpr( maybeMoveBuildType( decl_node) );
    224222}
    225223Expression *build_offsetOf( DeclarationNode *decl_node, NameExpr *member ) {
    226         Expression* ret = new UntypedOffsetofExpr( decl_node->buildType(), member->get_name() );
    227         delete decl_node;
     224        Expression* ret = new UntypedOffsetofExpr( maybeMoveBuildType( decl_node ), member->get_name() );
    228225        delete member;
    229226        return ret;
     
    269266}
    270267Expression *build_attrtype( NameExpr *var, DeclarationNode * decl_node ) {
    271         return new AttrExpr( var, decl_node->buildType() );
     268        return new AttrExpr( var, maybeMoveBuildType( decl_node ) );
    272269}
    273270
     
    296293}
    297294Expression *build_typevalue( DeclarationNode *decl ) {
    298         return new TypeExpr( decl->buildType() );
     295        return new TypeExpr( maybeMoveBuildType( decl ) );
    299296}
    300297
  • src/Parser/InitializerNode.cc

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

    r04cdd9b re85a8631  
    280280        LinkageSpec::Spec get_linkage() const { return linkage; }
    281281        DeclarationNode *extractAggregate() const;
    282         ExpressionNode *get_enumeratorValue() const { return enumeratorValue; }
     282        bool has_enumeratorValue() const { return (bool)enumeratorValue; }
     283        ExpressionNode *consume_enumeratorValue() const { return const_cast<DeclarationNode*>(this)->enumeratorValue.release(); }
    283284
    284285        bool get_extension() const { return extension; }
     
    295296        std::list< std::string > attributes;
    296297        ExpressionNode *bitfieldWidth;
    297         ExpressionNode *enumeratorValue;
     298        std::unique_ptr<ExpressionNode> enumeratorValue;
    298299        InitializerNode *initializer;
    299300        bool hasEllipsis;
     
    306307
    307308Type *buildType( TypeData *type );
     309
     310static inline Type * maybeMoveBuildType( const DeclarationNode *orig ) {
     311        Type* ret = orig ? orig->buildType() : nullptr;
     312        delete orig;
     313        return ret;
     314}
    308315
    309316//##############################################################################
  • src/Parser/StatementNode.cc

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

    r04cdd9b re85a8631  
    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->get_enumeratorValue() != nullptr ) {
     911                if ( cur->has_enumeratorValue() ) {
    912912                        ObjectDecl *member = dynamic_cast< ObjectDecl * >(*members);
    913                         member->set_init( new SingleInit( maybeBuild< Expression >( cur->get_enumeratorValue() ), std::list< Expression * >() ) );
     913                        member->set_init( new SingleInit( maybeMoveBuild< Expression >( cur->consume_enumeratorValue() ), std::list< Expression * >() ) );
    914914                } // if
    915915        } // for
  • src/Parser/parser.cc

    r04cdd9b re85a8631  
    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,  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
     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
    762762};
    763763#endif
     
    70757075    break;
    70767076
     7077  case 543:
     7078#line 2107 "parser.yy" /* yacc.c:1646  */
     7079    { delete (yyvsp[-2].constant); }
     7080#line 7081 "Parser/parser.cc" /* yacc.c:1646  */
     7081    break;
     7082
    70777083  case 544:
    7078 #line 2111 "parser.yy" /* yacc.c:1646  */
     7084#line 2112 "parser.yy" /* yacc.c:1646  */
    70797085    { (yyval.decl) = 0; }
    7080 #line 7081 "Parser/parser.cc" /* yacc.c:1646  */
     7086#line 7087 "Parser/parser.cc" /* yacc.c:1646  */
    70817087    break;
    70827088
    70837089  case 547:
    7084 #line 2118 "parser.yy" /* yacc.c:1646  */
     7090#line 2119 "parser.yy" /* yacc.c:1646  */
    70857091    { (yyval.decl) = (yyvsp[0].decl)->addQualifiers( (yyvsp[-1].decl) ); }
    7086 #line 7087 "Parser/parser.cc" /* yacc.c:1646  */
     7092#line 7093 "Parser/parser.cc" /* yacc.c:1646  */
    70877093    break;
    70887094
    70897095  case 548:
    7090 #line 2124 "parser.yy" /* yacc.c:1646  */
     7096#line 2125 "parser.yy" /* yacc.c:1646  */
    70917097    { (yyval.decl) = 0; }
    7092 #line 7093 "Parser/parser.cc" /* yacc.c:1646  */
     7098#line 7099 "Parser/parser.cc" /* yacc.c:1646  */
     7099    break;
     7100
     7101  case 553:
     7102#line 2137 "parser.yy" /* yacc.c:1646  */
     7103    { delete (yyvsp[-1].en); }
     7104#line 7105 "Parser/parser.cc" /* yacc.c:1646  */
    70937105    break;
    70947106
    70957107  case 554:
    7096 #line 2139 "parser.yy" /* yacc.c:1646  */
    7097     {}
    7098 #line 7099 "Parser/parser.cc" /* yacc.c:1646  */
     7108#line 2141 "parser.yy" /* yacc.c:1646  */
     7109    { delete (yyvsp[0].tok); }
     7110#line 7111 "Parser/parser.cc" /* yacc.c:1646  */
    70997111    break;
    71007112
    71017113  case 555:
    7102 #line 2140 "parser.yy" /* yacc.c:1646  */
    7103     {}
    7104 #line 7105 "Parser/parser.cc" /* yacc.c:1646  */
     7114#line 2142 "parser.yy" /* yacc.c:1646  */
     7115    { delete (yyvsp[0].decl); }
     7116#line 7117 "Parser/parser.cc" /* yacc.c:1646  */
    71057117    break;
    71067118
    71077119  case 556:
    7108 #line 2141 "parser.yy" /* yacc.c:1646  */
    7109     {}
    7110 #line 7111 "Parser/parser.cc" /* yacc.c:1646  */
     7120#line 2143 "parser.yy" /* yacc.c:1646  */
     7121    { delete (yyvsp[0].decl); }
     7122#line 7123 "Parser/parser.cc" /* yacc.c:1646  */
    71117123    break;
    71127124
    71137125  case 557:
    7114 #line 2142 "parser.yy" /* yacc.c:1646  */
    7115     {}
    7116 #line 7117 "Parser/parser.cc" /* yacc.c:1646  */
     7126#line 2144 "parser.yy" /* yacc.c:1646  */
     7127    { delete (yyvsp[0].decl); }
     7128#line 7129 "Parser/parser.cc" /* yacc.c:1646  */
    71177129    break;
    71187130
    71197131  case 558:
    7120 #line 2177 "parser.yy" /* yacc.c:1646  */
     7132#line 2179 "parser.yy" /* yacc.c:1646  */
    71217133    { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
    7122 #line 7123 "Parser/parser.cc" /* yacc.c:1646  */
     7134#line 7135 "Parser/parser.cc" /* yacc.c:1646  */
    71237135    break;
    71247136
    71257137  case 560:
    7126 #line 2180 "parser.yy" /* yacc.c:1646  */
    7127     { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
    7128 #line 7129 "Parser/parser.cc" /* yacc.c:1646  */
    7129     break;
    7130 
    7131   case 561:
    71327138#line 2182 "parser.yy" /* yacc.c:1646  */
    71337139    { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
    7134 #line 7135 "Parser/parser.cc" /* yacc.c:1646  */
     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  */
    71357147    break;
    71367148
    71377149  case 562:
    7138 #line 2187 "parser.yy" /* yacc.c:1646  */
     7150#line 2189 "parser.yy" /* yacc.c:1646  */
    71397151    {
    71407152                        typedefTable.setNextIdentifier( *(yyvsp[0].tok) );
    71417153                        (yyval.decl) = DeclarationNode::newName( (yyvsp[0].tok) );
    71427154                }
    7143 #line 7144 "Parser/parser.cc" /* yacc.c:1646  */
     7155#line 7156 "Parser/parser.cc" /* yacc.c:1646  */
    71447156    break;
    71457157
    71467158  case 563:
    7147 #line 2192 "parser.yy" /* yacc.c:1646  */
     7159#line 2194 "parser.yy" /* yacc.c:1646  */
    71487160    { (yyval.decl) = (yyvsp[-1].decl); }
    7149 #line 7150 "Parser/parser.cc" /* yacc.c:1646  */
     7161#line 7162 "Parser/parser.cc" /* yacc.c:1646  */
    71507162    break;
    71517163
    71527164  case 564:
    7153 #line 2197 "parser.yy" /* yacc.c:1646  */
     7165#line 2199 "parser.yy" /* yacc.c:1646  */
    71547166    { (yyval.decl) = (yyvsp[0].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); }
    7155 #line 7156 "Parser/parser.cc" /* yacc.c:1646  */
     7167#line 7168 "Parser/parser.cc" /* yacc.c:1646  */
    71567168    break;
    71577169
    71587170  case 565:
    7159 #line 2199 "parser.yy" /* yacc.c:1646  */
     7171#line 2201 "parser.yy" /* yacc.c:1646  */
    71607172    { (yyval.decl) = (yyvsp[0].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[-1].decl) ) ); }
    7161 #line 7162 "Parser/parser.cc" /* yacc.c:1646  */
     7173#line 7174 "Parser/parser.cc" /* yacc.c:1646  */
    71627174    break;
    71637175
    71647176  case 566:
    7165 #line 2201 "parser.yy" /* yacc.c:1646  */
     7177#line 2203 "parser.yy" /* yacc.c:1646  */
    71667178    { (yyval.decl) = (yyvsp[-1].decl); }
    7167 #line 7168 "Parser/parser.cc" /* yacc.c:1646  */
     7179#line 7180 "Parser/parser.cc" /* yacc.c:1646  */
    71687180    break;
    71697181
    71707182  case 567:
    7171 #line 2206 "parser.yy" /* yacc.c:1646  */
     7183#line 2208 "parser.yy" /* yacc.c:1646  */
    71727184    { (yyval.decl) = (yyvsp[-1].decl)->addArray( (yyvsp[0].decl) ); }
    7173 #line 7174 "Parser/parser.cc" /* yacc.c:1646  */
     7185#line 7186 "Parser/parser.cc" /* yacc.c:1646  */
    71747186    break;
    71757187
    71767188  case 568:
    7177 #line 2208 "parser.yy" /* yacc.c:1646  */
    7178     { (yyval.decl) = (yyvsp[-2].decl)->addArray( (yyvsp[0].decl) ); }
    7179 #line 7180 "Parser/parser.cc" /* yacc.c:1646  */
    7180     break;
    7181 
    7182   case 569:
    71837189#line 2210 "parser.yy" /* yacc.c:1646  */
    71847190    { (yyval.decl) = (yyvsp[-2].decl)->addArray( (yyvsp[0].decl) ); }
    7185 #line 7186 "Parser/parser.cc" /* yacc.c:1646  */
     7191#line 7192 "Parser/parser.cc" /* yacc.c:1646  */
     7192    break;
     7193
     7194  case 569:
     7195#line 2212 "parser.yy" /* yacc.c:1646  */
     7196    { (yyval.decl) = (yyvsp[-2].decl)->addArray( (yyvsp[0].decl) ); }
     7197#line 7198 "Parser/parser.cc" /* yacc.c:1646  */
    71867198    break;
    71877199
    71887200  case 570:
    7189 #line 2212 "parser.yy" /* yacc.c:1646  */
    7190     { (yyval.decl) = (yyvsp[-1].decl); }
    7191 #line 7192 "Parser/parser.cc" /* yacc.c:1646  */
    7192     break;
    7193 
    7194   case 571:
    7195 #line 2217 "parser.yy" /* yacc.c:1646  */
    7196     { (yyval.decl) = (yyvsp[-6].decl)->addParamList( (yyvsp[-2].decl) ); }
    7197 #line 7198 "Parser/parser.cc" /* yacc.c:1646  */
    7198     break;
    7199 
    7200   case 572:
    7201 #line 2219 "parser.yy" /* yacc.c:1646  */
     7201#line 2214 "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  */
     7208    { (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  */
     7214    { (yyval.decl) = (yyvsp[-1].decl); }
     7215#line 7216 "Parser/parser.cc" /* yacc.c:1646  */
     7216    break;
     7217
    72067218  case 573:
    7207 #line 2228 "parser.yy" /* yacc.c:1646  */
     7219#line 2230 "parser.yy" /* yacc.c:1646  */
    72087220    { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
    7209 #line 7210 "Parser/parser.cc" /* yacc.c:1646  */
     7221#line 7222 "Parser/parser.cc" /* yacc.c:1646  */
    72107222    break;
    72117223
    72127224  case 575:
    7213 #line 2231 "parser.yy" /* yacc.c:1646  */
     7225#line 2233 "parser.yy" /* yacc.c:1646  */
    72147226    { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
    7215 #line 7216 "Parser/parser.cc" /* yacc.c:1646  */
     7227#line 7228 "Parser/parser.cc" /* yacc.c:1646  */
    72167228    break;
    72177229
    72187230  case 576:
    7219 #line 2236 "parser.yy" /* yacc.c:1646  */
     7231#line 2238 "parser.yy" /* yacc.c:1646  */
    72207232    { (yyval.decl) = (yyvsp[-5].decl)->addParamList( (yyvsp[-2].decl) ); }
    7221 #line 7222 "Parser/parser.cc" /* yacc.c:1646  */
     7233#line 7234 "Parser/parser.cc" /* yacc.c:1646  */
    72227234    break;
    72237235
    72247236  case 577:
    7225 #line 2238 "parser.yy" /* yacc.c:1646  */
     7237#line 2240 "parser.yy" /* yacc.c:1646  */
    72267238    { (yyval.decl) = (yyvsp[-6].decl)->addParamList( (yyvsp[-2].decl) ); }
    7227 #line 7228 "Parser/parser.cc" /* yacc.c:1646  */
     7239#line 7240 "Parser/parser.cc" /* yacc.c:1646  */
    72287240    break;
    72297241
    72307242  case 578:
    7231 #line 2240 "parser.yy" /* yacc.c:1646  */
     7243#line 2242 "parser.yy" /* yacc.c:1646  */
    72327244    { (yyval.decl) = (yyvsp[-1].decl); }
    7233 #line 7234 "Parser/parser.cc" /* yacc.c:1646  */
     7245#line 7246 "Parser/parser.cc" /* yacc.c:1646  */
    72347246    break;
    72357247
    72367248  case 579:
    7237 #line 2245 "parser.yy" /* yacc.c:1646  */
     7249#line 2247 "parser.yy" /* yacc.c:1646  */
    72387250    { (yyval.decl) = (yyvsp[0].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); }
    7239 #line 7240 "Parser/parser.cc" /* yacc.c:1646  */
     7251#line 7252 "Parser/parser.cc" /* yacc.c:1646  */
    72407252    break;
    72417253
    72427254  case 580:
    7243 #line 2247 "parser.yy" /* yacc.c:1646  */
     7255#line 2249 "parser.yy" /* yacc.c:1646  */
    72447256    { (yyval.decl) = (yyvsp[0].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[-1].decl) ) ); }
    7245 #line 7246 "Parser/parser.cc" /* yacc.c:1646  */
     7257#line 7258 "Parser/parser.cc" /* yacc.c:1646  */
    72467258    break;
    72477259
    72487260  case 581:
    7249 #line 2249 "parser.yy" /* yacc.c:1646  */
     7261#line 2251 "parser.yy" /* yacc.c:1646  */
    72507262    { (yyval.decl) = (yyvsp[-1].decl); }
    7251 #line 7252 "Parser/parser.cc" /* yacc.c:1646  */
     7263#line 7264 "Parser/parser.cc" /* yacc.c:1646  */
    72527264    break;
    72537265
    72547266  case 582:
    7255 #line 2254 "parser.yy" /* yacc.c:1646  */
    7256     { (yyval.decl) = (yyvsp[-2].decl)->addArray( (yyvsp[0].decl) ); }
    7257 #line 7258 "Parser/parser.cc" /* yacc.c:1646  */
    7258     break;
    7259 
    7260   case 583:
    72617267#line 2256 "parser.yy" /* yacc.c:1646  */
    72627268    { (yyval.decl) = (yyvsp[-2].decl)->addArray( (yyvsp[0].decl) ); }
    7263 #line 7264 "Parser/parser.cc" /* yacc.c:1646  */
     7269#line 7270 "Parser/parser.cc" /* yacc.c:1646  */
     7270    break;
     7271
     7272  case 583:
     7273#line 2258 "parser.yy" /* yacc.c:1646  */
     7274    { (yyval.decl) = (yyvsp[-2].decl)->addArray( (yyvsp[0].decl) ); }
     7275#line 7276 "Parser/parser.cc" /* yacc.c:1646  */
    72647276    break;
    72657277
    72667278  case 584:
    7267 #line 2258 "parser.yy" /* yacc.c:1646  */
     7279#line 2260 "parser.yy" /* yacc.c:1646  */
    72687280    { (yyval.decl) = (yyvsp[-1].decl); }
    7269 #line 7270 "Parser/parser.cc" /* yacc.c:1646  */
     7281#line 7282 "Parser/parser.cc" /* yacc.c:1646  */
    72707282    break;
    72717283
    72727284  case 588:
    7273 #line 2273 "parser.yy" /* yacc.c:1646  */
     7285#line 2275 "parser.yy" /* yacc.c:1646  */
    72747286    { (yyval.decl) = (yyvsp[-3].decl)->addIdList( (yyvsp[-1].decl) ); }
    7275 #line 7276 "Parser/parser.cc" /* yacc.c:1646  */
     7287#line 7288 "Parser/parser.cc" /* yacc.c:1646  */
    72767288    break;
    72777289
    72787290  case 589:
    7279 #line 2275 "parser.yy" /* yacc.c:1646  */
     7291#line 2277 "parser.yy" /* yacc.c:1646  */
    72807292    { (yyval.decl) = (yyvsp[-4].decl)->addIdList( (yyvsp[-1].decl) ); }
    7281 #line 7282 "Parser/parser.cc" /* yacc.c:1646  */
     7293#line 7294 "Parser/parser.cc" /* yacc.c:1646  */
    72827294    break;
    72837295
    72847296  case 590:
    7285 #line 2277 "parser.yy" /* yacc.c:1646  */
     7297#line 2279 "parser.yy" /* yacc.c:1646  */
    72867298    { (yyval.decl) = (yyvsp[-1].decl); }
    7287 #line 7288 "Parser/parser.cc" /* yacc.c:1646  */
     7299#line 7300 "Parser/parser.cc" /* yacc.c:1646  */
    72887300    break;
    72897301
    72907302  case 591:
    7291 #line 2282 "parser.yy" /* yacc.c:1646  */
     7303#line 2284 "parser.yy" /* yacc.c:1646  */
    72927304    { (yyval.decl) = (yyvsp[0].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); }
    7293 #line 7294 "Parser/parser.cc" /* yacc.c:1646  */
     7305#line 7306 "Parser/parser.cc" /* yacc.c:1646  */
    72947306    break;
    72957307
    72967308  case 592:
    7297 #line 2284 "parser.yy" /* yacc.c:1646  */
     7309#line 2286 "parser.yy" /* yacc.c:1646  */
    72987310    { (yyval.decl) = (yyvsp[0].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[-1].decl) ) ); }
    7299 #line 7300 "Parser/parser.cc" /* yacc.c:1646  */
     7311#line 7312 "Parser/parser.cc" /* yacc.c:1646  */
    73007312    break;
    73017313
    73027314  case 593:
    7303 #line 2286 "parser.yy" /* yacc.c:1646  */
     7315#line 2288 "parser.yy" /* yacc.c:1646  */
    73047316    { (yyval.decl) = (yyvsp[-1].decl); }
    7305 #line 7306 "Parser/parser.cc" /* yacc.c:1646  */
     7317#line 7318 "Parser/parser.cc" /* yacc.c:1646  */
    73067318    break;
    73077319
    73087320  case 594:
    7309 #line 2291 "parser.yy" /* yacc.c:1646  */
    7310     { (yyval.decl) = (yyvsp[-2].decl)->addArray( (yyvsp[0].decl) ); }
    7311 #line 7312 "Parser/parser.cc" /* yacc.c:1646  */
    7312     break;
    7313 
    7314   case 595:
    73157321#line 2293 "parser.yy" /* yacc.c:1646  */
    73167322    { (yyval.decl) = (yyvsp[-2].decl)->addArray( (yyvsp[0].decl) ); }
    7317 #line 7318 "Parser/parser.cc" /* yacc.c:1646  */
     7323#line 7324 "Parser/parser.cc" /* yacc.c:1646  */
     7324    break;
     7325
     7326  case 595:
     7327#line 2295 "parser.yy" /* yacc.c:1646  */
     7328    { (yyval.decl) = (yyvsp[-2].decl)->addArray( (yyvsp[0].decl) ); }
     7329#line 7330 "Parser/parser.cc" /* yacc.c:1646  */
    73187330    break;
    73197331
    73207332  case 596:
    7321 #line 2295 "parser.yy" /* yacc.c:1646  */
     7333#line 2297 "parser.yy" /* yacc.c:1646  */
    73227334    { (yyval.decl) = (yyvsp[-1].decl); }
    7323 #line 7324 "Parser/parser.cc" /* yacc.c:1646  */
     7335#line 7336 "Parser/parser.cc" /* yacc.c:1646  */
    73247336    break;
    73257337
    73267338  case 597:
    7327 #line 2310 "parser.yy" /* yacc.c:1646  */
     7339#line 2312 "parser.yy" /* yacc.c:1646  */
    73287340    { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
    7329 #line 7330 "Parser/parser.cc" /* yacc.c:1646  */
     7341#line 7342 "Parser/parser.cc" /* yacc.c:1646  */
    73307342    break;
    73317343
    73327344  case 599:
    7333 #line 2313 "parser.yy" /* yacc.c:1646  */
    7334     { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
    7335 #line 7336 "Parser/parser.cc" /* yacc.c:1646  */
    7336     break;
    7337 
    7338   case 600:
    73397345#line 2315 "parser.yy" /* yacc.c:1646  */
    73407346    { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
    7341 #line 7342 "Parser/parser.cc" /* yacc.c:1646  */
     7347#line 7348 "Parser/parser.cc" /* yacc.c:1646  */
     7348    break;
     7349
     7350  case 600:
     7351#line 2317 "parser.yy" /* yacc.c:1646  */
     7352    { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
     7353#line 7354 "Parser/parser.cc" /* yacc.c:1646  */
    73427354    break;
    73437355
    73447356  case 602:
    7345 #line 2321 "parser.yy" /* yacc.c:1646  */
     7357#line 2323 "parser.yy" /* yacc.c:1646  */
    73467358    { (yyval.decl) = (yyvsp[-1].decl); }
    7347 #line 7348 "Parser/parser.cc" /* yacc.c:1646  */
     7359#line 7360 "Parser/parser.cc" /* yacc.c:1646  */
    73487360    break;
    73497361
    73507362  case 603:
    7351 #line 2326 "parser.yy" /* yacc.c:1646  */
     7363#line 2328 "parser.yy" /* yacc.c:1646  */
    73527364    { (yyval.decl) = (yyvsp[0].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); }
    7353 #line 7354 "Parser/parser.cc" /* yacc.c:1646  */
     7365#line 7366 "Parser/parser.cc" /* yacc.c:1646  */
    73547366    break;
    73557367
    73567368  case 604:
    7357 #line 2328 "parser.yy" /* yacc.c:1646  */
     7369#line 2330 "parser.yy" /* yacc.c:1646  */
    73587370    { (yyval.decl) = (yyvsp[0].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[-1].decl) ) ); }
    7359 #line 7360 "Parser/parser.cc" /* yacc.c:1646  */
     7371#line 7372 "Parser/parser.cc" /* yacc.c:1646  */
    73607372    break;
    73617373
    73627374  case 605:
    7363 #line 2330 "parser.yy" /* yacc.c:1646  */
     7375#line 2332 "parser.yy" /* yacc.c:1646  */
    73647376    { (yyval.decl) = (yyvsp[-1].decl); }
    7365 #line 7366 "Parser/parser.cc" /* yacc.c:1646  */
     7377#line 7378 "Parser/parser.cc" /* yacc.c:1646  */
    73667378    break;
    73677379
    73687380  case 606:
    7369 #line 2335 "parser.yy" /* yacc.c:1646  */
     7381#line 2337 "parser.yy" /* yacc.c:1646  */
    73707382    { (yyval.decl) = (yyvsp[-1].decl)->addArray( (yyvsp[0].decl) ); }
    7371 #line 7372 "Parser/parser.cc" /* yacc.c:1646  */
     7383#line 7384 "Parser/parser.cc" /* yacc.c:1646  */
    73727384    break;
    73737385
    73747386  case 607:
    7375 #line 2337 "parser.yy" /* yacc.c:1646  */
    7376     { (yyval.decl) = (yyvsp[-2].decl)->addArray( (yyvsp[0].decl) ); }
    7377 #line 7378 "Parser/parser.cc" /* yacc.c:1646  */
    7378     break;
    7379 
    7380   case 608:
    73817387#line 2339 "parser.yy" /* yacc.c:1646  */
    73827388    { (yyval.decl) = (yyvsp[-2].decl)->addArray( (yyvsp[0].decl) ); }
    7383 #line 7384 "Parser/parser.cc" /* yacc.c:1646  */
     7389#line 7390 "Parser/parser.cc" /* yacc.c:1646  */
     7390    break;
     7391
     7392  case 608:
     7393#line 2341 "parser.yy" /* yacc.c:1646  */
     7394    { (yyval.decl) = (yyvsp[-2].decl)->addArray( (yyvsp[0].decl) ); }
     7395#line 7396 "Parser/parser.cc" /* yacc.c:1646  */
    73847396    break;
    73857397
    73867398  case 609:
    7387 #line 2341 "parser.yy" /* yacc.c:1646  */
     7399#line 2343 "parser.yy" /* yacc.c:1646  */
    73887400    { (yyval.decl) = (yyvsp[-1].decl); }
    7389 #line 7390 "Parser/parser.cc" /* yacc.c:1646  */
     7401#line 7402 "Parser/parser.cc" /* yacc.c:1646  */
    73907402    break;
    73917403
    73927404  case 610:
    7393 #line 2346 "parser.yy" /* yacc.c:1646  */
     7405#line 2348 "parser.yy" /* yacc.c:1646  */
    73947406    { (yyval.decl) = (yyvsp[-5].decl)->addParamList( (yyvsp[-2].decl) ); }
    7395 #line 7396 "Parser/parser.cc" /* yacc.c:1646  */
     7407#line 7408 "Parser/parser.cc" /* yacc.c:1646  */
    73967408    break;
    73977409
    73987410  case 611:
    7399 #line 2348 "parser.yy" /* yacc.c:1646  */
     7411#line 2350 "parser.yy" /* yacc.c:1646  */
    74007412    { (yyval.decl) = (yyvsp[-6].decl)->addParamList( (yyvsp[-2].decl) ); }
    7401 #line 7402 "Parser/parser.cc" /* yacc.c:1646  */
     7413#line 7414 "Parser/parser.cc" /* yacc.c:1646  */
    74027414    break;
    74037415
    74047416  case 612:
    7405 #line 2350 "parser.yy" /* yacc.c:1646  */
     7417#line 2352 "parser.yy" /* yacc.c:1646  */
    74067418    { (yyval.decl) = (yyvsp[-1].decl); }
    7407 #line 7408 "Parser/parser.cc" /* yacc.c:1646  */
     7419#line 7420 "Parser/parser.cc" /* yacc.c:1646  */
    74087420    break;
    74097421
    74107422  case 613:
    7411 #line 2360 "parser.yy" /* yacc.c:1646  */
     7423#line 2362 "parser.yy" /* yacc.c:1646  */
    74127424    { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
    7413 #line 7414 "Parser/parser.cc" /* yacc.c:1646  */
     7425#line 7426 "Parser/parser.cc" /* yacc.c:1646  */
    74147426    break;
    74157427
    74167428  case 615:
    7417 #line 2363 "parser.yy" /* yacc.c:1646  */
    7418     { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
    7419 #line 7420 "Parser/parser.cc" /* yacc.c:1646  */
    7420     break;
    7421 
    7422   case 616:
    74237429#line 2365 "parser.yy" /* yacc.c:1646  */
    74247430    { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
    7425 #line 7426 "Parser/parser.cc" /* yacc.c:1646  */
     7431#line 7432 "Parser/parser.cc" /* yacc.c:1646  */
     7432    break;
     7433
     7434  case 616:
     7435#line 2367 "parser.yy" /* yacc.c:1646  */
     7436    { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
     7437#line 7438 "Parser/parser.cc" /* yacc.c:1646  */
    74267438    break;
    74277439
    74287440  case 617:
    7429 #line 2370 "parser.yy" /* yacc.c:1646  */
     7441#line 2372 "parser.yy" /* yacc.c:1646  */
    74307442    { (yyval.decl) = (yyvsp[0].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); }
    7431 #line 7432 "Parser/parser.cc" /* yacc.c:1646  */
     7443#line 7444 "Parser/parser.cc" /* yacc.c:1646  */
    74327444    break;
    74337445
    74347446  case 618:
    7435 #line 2372 "parser.yy" /* yacc.c:1646  */
     7447#line 2374 "parser.yy" /* yacc.c:1646  */
    74367448    { (yyval.decl) = (yyvsp[0].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[-1].decl) ) ); }
    7437 #line 7438 "Parser/parser.cc" /* yacc.c:1646  */
     7449#line 7450 "Parser/parser.cc" /* yacc.c:1646  */
    74387450    break;
    74397451
    74407452  case 619:
    7441 #line 2374 "parser.yy" /* yacc.c:1646  */
     7453#line 2376 "parser.yy" /* yacc.c:1646  */
    74427454    { (yyval.decl) = (yyvsp[-1].decl); }
    7443 #line 7444 "Parser/parser.cc" /* yacc.c:1646  */
     7455#line 7456 "Parser/parser.cc" /* yacc.c:1646  */
    74447456    break;
    74457457
    74467458  case 620:
    7447 #line 2379 "parser.yy" /* yacc.c:1646  */
     7459#line 2381 "parser.yy" /* yacc.c:1646  */
    74487460    { (yyval.decl) = (yyvsp[-1].decl)->addArray( (yyvsp[0].decl) ); }
    7449 #line 7450 "Parser/parser.cc" /* yacc.c:1646  */
     7461#line 7462 "Parser/parser.cc" /* yacc.c:1646  */
    74507462    break;
    74517463
    74527464  case 621:
    7453 #line 2381 "parser.yy" /* yacc.c:1646  */
    7454     { (yyval.decl) = (yyvsp[-2].decl)->addArray( (yyvsp[0].decl) ); }
    7455 #line 7456 "Parser/parser.cc" /* yacc.c:1646  */
    7456     break;
    7457 
    7458   case 622:
    74597465#line 2383 "parser.yy" /* yacc.c:1646  */
    74607466    { (yyval.decl) = (yyvsp[-2].decl)->addArray( (yyvsp[0].decl) ); }
    7461 #line 7462 "Parser/parser.cc" /* yacc.c:1646  */
     7467#line 7468 "Parser/parser.cc" /* yacc.c:1646  */
     7468    break;
     7469
     7470  case 622:
     7471#line 2385 "parser.yy" /* yacc.c:1646  */
     7472    { (yyval.decl) = (yyvsp[-2].decl)->addArray( (yyvsp[0].decl) ); }
     7473#line 7474 "Parser/parser.cc" /* yacc.c:1646  */
    74627474    break;
    74637475
    74647476  case 623:
    7465 #line 2385 "parser.yy" /* yacc.c:1646  */
     7477#line 2387 "parser.yy" /* yacc.c:1646  */
    74667478    { (yyval.decl) = (yyvsp[-1].decl); }
    7467 #line 7468 "Parser/parser.cc" /* yacc.c:1646  */
     7479#line 7480 "Parser/parser.cc" /* yacc.c:1646  */
    74687480    break;
    74697481
    74707482  case 624:
    7471 #line 2390 "parser.yy" /* yacc.c:1646  */
     7483#line 2392 "parser.yy" /* yacc.c:1646  */
    74727484    { (yyval.decl) = (yyvsp[-5].decl)->addParamList( (yyvsp[-2].decl) ); }
    7473 #line 7474 "Parser/parser.cc" /* yacc.c:1646  */
     7485#line 7486 "Parser/parser.cc" /* yacc.c:1646  */
    74747486    break;
    74757487
    74767488  case 625:
    7477 #line 2392 "parser.yy" /* yacc.c:1646  */
     7489#line 2394 "parser.yy" /* yacc.c:1646  */
    74787490    { (yyval.decl) = (yyvsp[-6].decl)->addParamList( (yyvsp[-2].decl) ); }
    7479 #line 7480 "Parser/parser.cc" /* yacc.c:1646  */
     7491#line 7492 "Parser/parser.cc" /* yacc.c:1646  */
    74807492    break;
    74817493
    74827494  case 626:
    7483 #line 2394 "parser.yy" /* yacc.c:1646  */
     7495#line 2396 "parser.yy" /* yacc.c:1646  */
    74847496    { (yyval.decl) = (yyvsp[-1].decl); }
    7485 #line 7486 "Parser/parser.cc" /* yacc.c:1646  */
     7497#line 7498 "Parser/parser.cc" /* yacc.c:1646  */
    74867498    break;
    74877499
    74887500  case 627:
    7489 #line 2425 "parser.yy" /* yacc.c:1646  */
     7501#line 2427 "parser.yy" /* yacc.c:1646  */
    74907502    { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
    7491 #line 7492 "Parser/parser.cc" /* yacc.c:1646  */
     7503#line 7504 "Parser/parser.cc" /* yacc.c:1646  */
    74927504    break;
    74937505
    74947506  case 629:
    7495 #line 2428 "parser.yy" /* yacc.c:1646  */
    7496     { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
    7497 #line 7498 "Parser/parser.cc" /* yacc.c:1646  */
    7498     break;
    7499 
    7500   case 630:
    75017507#line 2430 "parser.yy" /* yacc.c:1646  */
    75027508    { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
    7503 #line 7504 "Parser/parser.cc" /* yacc.c:1646  */
     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  */
    75047516    break;
    75057517
    75067518  case 631:
    7507 #line 2435 "parser.yy" /* yacc.c:1646  */
     7519#line 2437 "parser.yy" /* yacc.c:1646  */
    75087520    {
    75097521                        typedefTable.setNextIdentifier( *(yyvsp[0].tok) );
    75107522                        (yyval.decl) = DeclarationNode::newName( (yyvsp[0].tok) );
    75117523                }
    7512 #line 7513 "Parser/parser.cc" /* yacc.c:1646  */
     7524#line 7525 "Parser/parser.cc" /* yacc.c:1646  */
    75137525    break;
    75147526
    75157527  case 632:
    7516 #line 2440 "parser.yy" /* yacc.c:1646  */
     7528#line 2442 "parser.yy" /* yacc.c:1646  */
    75177529    {
    75187530                        typedefTable.setNextIdentifier( *(yyvsp[0].tok) );
    75197531                        (yyval.decl) = DeclarationNode::newName( (yyvsp[0].tok) );
    75207532                }
    7521 #line 7522 "Parser/parser.cc" /* yacc.c:1646  */
     7533#line 7534 "Parser/parser.cc" /* yacc.c:1646  */
    75227534    break;
    75237535
    75247536  case 633:
    7525 #line 2448 "parser.yy" /* yacc.c:1646  */
     7537#line 2450 "parser.yy" /* yacc.c:1646  */
    75267538    { (yyval.decl) = (yyvsp[0].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); }
    7527 #line 7528 "Parser/parser.cc" /* yacc.c:1646  */
     7539#line 7540 "Parser/parser.cc" /* yacc.c:1646  */
    75287540    break;
    75297541
    75307542  case 634:
    7531 #line 2450 "parser.yy" /* yacc.c:1646  */
     7543#line 2452 "parser.yy" /* yacc.c:1646  */
    75327544    { (yyval.decl) = (yyvsp[0].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[-1].decl) ) ); }
    7533 #line 7534 "Parser/parser.cc" /* yacc.c:1646  */
     7545#line 7546 "Parser/parser.cc" /* yacc.c:1646  */
    75347546    break;
    75357547
    75367548  case 635:
    7537 #line 2452 "parser.yy" /* yacc.c:1646  */
     7549#line 2454 "parser.yy" /* yacc.c:1646  */
    75387550    { (yyval.decl) = (yyvsp[-1].decl); }
    7539 #line 7540 "Parser/parser.cc" /* yacc.c:1646  */
     7551#line 7552 "Parser/parser.cc" /* yacc.c:1646  */
    75407552    break;
    75417553
    75427554  case 636:
    7543 #line 2457 "parser.yy" /* yacc.c:1646  */
     7555#line 2459 "parser.yy" /* yacc.c:1646  */
    75447556    { (yyval.decl) = (yyvsp[-1].decl)->addArray( (yyvsp[0].decl) ); }
    7545 #line 7546 "Parser/parser.cc" /* yacc.c:1646  */
     7557#line 7558 "Parser/parser.cc" /* yacc.c:1646  */
    75467558    break;
    75477559
    75487560  case 637:
    7549 #line 2459 "parser.yy" /* yacc.c:1646  */
     7561#line 2461 "parser.yy" /* yacc.c:1646  */
    75507562    { (yyval.decl) = (yyvsp[-2].decl)->addArray( (yyvsp[0].decl) ); }
    7551 #line 7552 "Parser/parser.cc" /* yacc.c:1646  */
     7563#line 7564 "Parser/parser.cc" /* yacc.c:1646  */
    75527564    break;
    75537565
    75547566  case 638:
    7555 #line 2464 "parser.yy" /* yacc.c:1646  */
     7567#line 2466 "parser.yy" /* yacc.c:1646  */
    75567568    { (yyval.decl) = (yyvsp[-5].decl)->addParamList( (yyvsp[-2].decl) ); }
    7557 #line 7558 "Parser/parser.cc" /* yacc.c:1646  */
     7569#line 7570 "Parser/parser.cc" /* yacc.c:1646  */
    75587570    break;
    75597571
    75607572  case 639:
    7561 #line 2466 "parser.yy" /* yacc.c:1646  */
     7573#line 2468 "parser.yy" /* yacc.c:1646  */
    75627574    { (yyval.decl) = (yyvsp[-6].decl)->addParamList( (yyvsp[-2].decl) ); }
    7563 #line 7564 "Parser/parser.cc" /* yacc.c:1646  */
     7575#line 7576 "Parser/parser.cc" /* yacc.c:1646  */
    75647576    break;
    75657577
    75667578  case 641:
    7567 #line 2481 "parser.yy" /* yacc.c:1646  */
    7568     { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
    7569 #line 7570 "Parser/parser.cc" /* yacc.c:1646  */
    7570     break;
    7571 
    7572   case 642:
    75737579#line 2483 "parser.yy" /* yacc.c:1646  */
    75747580    { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
    7575 #line 7576 "Parser/parser.cc" /* yacc.c:1646  */
     7581#line 7582 "Parser/parser.cc" /* yacc.c:1646  */
     7582    break;
     7583
     7584  case 642:
     7585#line 2485 "parser.yy" /* yacc.c:1646  */
     7586    { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
     7587#line 7588 "Parser/parser.cc" /* yacc.c:1646  */
    75767588    break;
    75777589
    75787590  case 643:
    7579 #line 2488 "parser.yy" /* yacc.c:1646  */
     7591#line 2490 "parser.yy" /* yacc.c:1646  */
    75807592    { (yyval.decl) = DeclarationNode::newPointer( 0 ); }
    7581 #line 7582 "Parser/parser.cc" /* yacc.c:1646  */
     7593#line 7594 "Parser/parser.cc" /* yacc.c:1646  */
    75827594    break;
    75837595
    75847596  case 644:
    7585 #line 2490 "parser.yy" /* yacc.c:1646  */
     7597#line 2492 "parser.yy" /* yacc.c:1646  */
    75867598    { (yyval.decl) = DeclarationNode::newPointer( (yyvsp[0].decl) ); }
    7587 #line 7588 "Parser/parser.cc" /* yacc.c:1646  */
     7599#line 7600 "Parser/parser.cc" /* yacc.c:1646  */
    75887600    break;
    75897601
    75907602  case 645:
    7591 #line 2492 "parser.yy" /* yacc.c:1646  */
     7603#line 2494 "parser.yy" /* yacc.c:1646  */
    75927604    { (yyval.decl) = (yyvsp[0].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); }
    7593 #line 7594 "Parser/parser.cc" /* yacc.c:1646  */
     7605#line 7606 "Parser/parser.cc" /* yacc.c:1646  */
    75947606    break;
    75957607
    75967608  case 646:
    7597 #line 2494 "parser.yy" /* yacc.c:1646  */
     7609#line 2496 "parser.yy" /* yacc.c:1646  */
    75987610    { (yyval.decl) = (yyvsp[0].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[-1].decl) ) ); }
    7599 #line 7600 "Parser/parser.cc" /* yacc.c:1646  */
     7611#line 7612 "Parser/parser.cc" /* yacc.c:1646  */
    76007612    break;
    76017613
    76027614  case 647:
    7603 #line 2496 "parser.yy" /* yacc.c:1646  */
     7615#line 2498 "parser.yy" /* yacc.c:1646  */
    76047616    { (yyval.decl) = (yyvsp[-1].decl); }
    7605 #line 7606 "Parser/parser.cc" /* yacc.c:1646  */
     7617#line 7618 "Parser/parser.cc" /* yacc.c:1646  */
    76067618    break;
    76077619
    76087620  case 649:
    7609 #line 2502 "parser.yy" /* yacc.c:1646  */
    7610     { (yyval.decl) = (yyvsp[-2].decl)->addArray( (yyvsp[0].decl) ); }
    7611 #line 7612 "Parser/parser.cc" /* yacc.c:1646  */
    7612     break;
    7613 
    7614   case 650:
    76157621#line 2504 "parser.yy" /* yacc.c:1646  */
    76167622    { (yyval.decl) = (yyvsp[-2].decl)->addArray( (yyvsp[0].decl) ); }
    7617 #line 7618 "Parser/parser.cc" /* yacc.c:1646  */
     7623#line 7624 "Parser/parser.cc" /* yacc.c:1646  */
     7624    break;
     7625
     7626  case 650:
     7627#line 2506 "parser.yy" /* yacc.c:1646  */
     7628    { (yyval.decl) = (yyvsp[-2].decl)->addArray( (yyvsp[0].decl) ); }
     7629#line 7630 "Parser/parser.cc" /* yacc.c:1646  */
    76187630    break;
    76197631
    76207632  case 651:
    7621 #line 2506 "parser.yy" /* yacc.c:1646  */
     7633#line 2508 "parser.yy" /* yacc.c:1646  */
    76227634    { (yyval.decl) = (yyvsp[-1].decl); }
    7623 #line 7624 "Parser/parser.cc" /* yacc.c:1646  */
     7635#line 7636 "Parser/parser.cc" /* yacc.c:1646  */
    76247636    break;
    76257637
    76267638  case 652:
    7627 #line 2511 "parser.yy" /* yacc.c:1646  */
     7639#line 2513 "parser.yy" /* yacc.c:1646  */
    76287640    { (yyval.decl) = DeclarationNode::newFunction( 0, 0, (yyvsp[-2].decl), 0 ); }
    7629 #line 7630 "Parser/parser.cc" /* yacc.c:1646  */
     7641#line 7642 "Parser/parser.cc" /* yacc.c:1646  */
    76307642    break;
    76317643
    76327644  case 653:
    7633 #line 2513 "parser.yy" /* yacc.c:1646  */
     7645#line 2515 "parser.yy" /* yacc.c:1646  */
    76347646    { (yyval.decl) = (yyvsp[-6].decl)->addParamList( (yyvsp[-2].decl) ); }
    7635 #line 7636 "Parser/parser.cc" /* yacc.c:1646  */
     7647#line 7648 "Parser/parser.cc" /* yacc.c:1646  */
    76367648    break;
    76377649
    76387650  case 654:
    7639 #line 2515 "parser.yy" /* yacc.c:1646  */
     7651#line 2517 "parser.yy" /* yacc.c:1646  */
    76407652    { (yyval.decl) = (yyvsp[-1].decl); }
    7641 #line 7642 "Parser/parser.cc" /* yacc.c:1646  */
     7653#line 7654 "Parser/parser.cc" /* yacc.c:1646  */
    76427654    break;
    76437655
    76447656  case 655:
    7645 #line 2521 "parser.yy" /* yacc.c:1646  */
     7657#line 2523 "parser.yy" /* yacc.c:1646  */
    76467658    { (yyval.decl) = DeclarationNode::newArray( 0, 0, false ); }
    7647 #line 7648 "Parser/parser.cc" /* yacc.c:1646  */
     7659#line 7660 "Parser/parser.cc" /* yacc.c:1646  */
    76487660    break;
    76497661
    76507662  case 656:
    7651 #line 2523 "parser.yy" /* yacc.c:1646  */
     7663#line 2525 "parser.yy" /* yacc.c:1646  */
    76527664    { (yyval.decl) = DeclarationNode::newArray( 0, 0, false )->addArray( (yyvsp[0].decl) ); }
    7653 #line 7654 "Parser/parser.cc" /* yacc.c:1646  */
     7665#line 7666 "Parser/parser.cc" /* yacc.c:1646  */
    76547666    break;
    76557667
    76567668  case 658:
    7657 #line 2529 "parser.yy" /* yacc.c:1646  */
     7669#line 2531 "parser.yy" /* yacc.c:1646  */
    76587670    { (yyval.decl) = DeclarationNode::newArray( (yyvsp[-2].en), 0, false ); }
    7659 #line 7660 "Parser/parser.cc" /* yacc.c:1646  */
     7671#line 7672 "Parser/parser.cc" /* yacc.c:1646  */
    76607672    break;
    76617673
    76627674  case 659:
    7663 #line 2531 "parser.yy" /* yacc.c:1646  */
     7675#line 2533 "parser.yy" /* yacc.c:1646  */
    76647676    { (yyval.decl) = DeclarationNode::newVarArray( 0 ); }
    7665 #line 7666 "Parser/parser.cc" /* yacc.c:1646  */
     7677#line 7678 "Parser/parser.cc" /* yacc.c:1646  */
    76667678    break;
    76677679
    76687680  case 660:
    7669 #line 2533 "parser.yy" /* yacc.c:1646  */
     7681#line 2535 "parser.yy" /* yacc.c:1646  */
    76707682    { (yyval.decl) = (yyvsp[-5].decl)->addArray( DeclarationNode::newArray( (yyvsp[-2].en), 0, false ) ); }
    7671 #line 7672 "Parser/parser.cc" /* yacc.c:1646  */
     7683#line 7684 "Parser/parser.cc" /* yacc.c:1646  */
    76727684    break;
    76737685
    76747686  case 661:
    7675 #line 2535 "parser.yy" /* yacc.c:1646  */
     7687#line 2537 "parser.yy" /* yacc.c:1646  */
    76767688    { (yyval.decl) = (yyvsp[-5].decl)->addArray( DeclarationNode::newVarArray( 0 ) ); }
    7677 #line 7678 "Parser/parser.cc" /* yacc.c:1646  */
     7689#line 7690 "Parser/parser.cc" /* yacc.c:1646  */
    76787690    break;
    76797691
    76807692  case 663:
    7681 #line 2550 "parser.yy" /* yacc.c:1646  */
    7682     { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
    7683 #line 7684 "Parser/parser.cc" /* yacc.c:1646  */
    7684     break;
    7685 
    7686   case 664:
    76877693#line 2552 "parser.yy" /* yacc.c:1646  */
    76887694    { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
    7689 #line 7690 "Parser/parser.cc" /* yacc.c:1646  */
     7695#line 7696 "Parser/parser.cc" /* yacc.c:1646  */
     7696    break;
     7697
     7698  case 664:
     7699#line 2554 "parser.yy" /* yacc.c:1646  */
     7700    { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
     7701#line 7702 "Parser/parser.cc" /* yacc.c:1646  */
    76907702    break;
    76917703
    76927704  case 665:
    7693 #line 2557 "parser.yy" /* yacc.c:1646  */
     7705#line 2559 "parser.yy" /* yacc.c:1646  */
    76947706    { (yyval.decl) = DeclarationNode::newPointer( 0 ); }
    7695 #line 7696 "Parser/parser.cc" /* yacc.c:1646  */
     7707#line 7708 "Parser/parser.cc" /* yacc.c:1646  */
    76967708    break;
    76977709
    76987710  case 666:
    7699 #line 2559 "parser.yy" /* yacc.c:1646  */
     7711#line 2561 "parser.yy" /* yacc.c:1646  */
    77007712    { (yyval.decl) = DeclarationNode::newPointer( (yyvsp[0].decl) ); }
    7701 #line 7702 "Parser/parser.cc" /* yacc.c:1646  */
     7713#line 7714 "Parser/parser.cc" /* yacc.c:1646  */
    77027714    break;
    77037715
    77047716  case 667:
    7705 #line 2561 "parser.yy" /* yacc.c:1646  */
     7717#line 2563 "parser.yy" /* yacc.c:1646  */
    77067718    { (yyval.decl) = (yyvsp[0].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); }
    7707 #line 7708 "Parser/parser.cc" /* yacc.c:1646  */
     7719#line 7720 "Parser/parser.cc" /* yacc.c:1646  */
    77087720    break;
    77097721
    77107722  case 668:
    7711 #line 2563 "parser.yy" /* yacc.c:1646  */
     7723#line 2565 "parser.yy" /* yacc.c:1646  */
    77127724    { (yyval.decl) = (yyvsp[0].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[-1].decl) ) ); }
    7713 #line 7714 "Parser/parser.cc" /* yacc.c:1646  */
     7725#line 7726 "Parser/parser.cc" /* yacc.c:1646  */
    77147726    break;
    77157727
    77167728  case 669:
    7717 #line 2565 "parser.yy" /* yacc.c:1646  */
     7729#line 2567 "parser.yy" /* yacc.c:1646  */
    77187730    { (yyval.decl) = (yyvsp[-1].decl); }
    7719 #line 7720 "Parser/parser.cc" /* yacc.c:1646  */
     7731#line 7732 "Parser/parser.cc" /* yacc.c:1646  */
    77207732    break;
    77217733
    77227734  case 671:
    7723 #line 2571 "parser.yy" /* yacc.c:1646  */
    7724     { (yyval.decl) = (yyvsp[-2].decl)->addArray( (yyvsp[0].decl) ); }
    7725 #line 7726 "Parser/parser.cc" /* yacc.c:1646  */
    7726     break;
    7727 
    7728   case 672:
    77297735#line 2573 "parser.yy" /* yacc.c:1646  */
    77307736    { (yyval.decl) = (yyvsp[-2].decl)->addArray( (yyvsp[0].decl) ); }
    7731 #line 7732 "Parser/parser.cc" /* yacc.c:1646  */
     7737#line 7738 "Parser/parser.cc" /* yacc.c:1646  */
     7738    break;
     7739
     7740  case 672:
     7741#line 2575 "parser.yy" /* yacc.c:1646  */
     7742    { (yyval.decl) = (yyvsp[-2].decl)->addArray( (yyvsp[0].decl) ); }
     7743#line 7744 "Parser/parser.cc" /* yacc.c:1646  */
    77327744    break;
    77337745
    77347746  case 673:
    7735 #line 2575 "parser.yy" /* yacc.c:1646  */
     7747#line 2577 "parser.yy" /* yacc.c:1646  */
    77367748    { (yyval.decl) = (yyvsp[-1].decl); }
    7737 #line 7738 "Parser/parser.cc" /* yacc.c:1646  */
     7749#line 7750 "Parser/parser.cc" /* yacc.c:1646  */
    77387750    break;
    77397751
    77407752  case 674:
    7741 #line 2580 "parser.yy" /* yacc.c:1646  */
     7753#line 2582 "parser.yy" /* yacc.c:1646  */
    77427754    { (yyval.decl) = DeclarationNode::newFunction( 0, 0, (yyvsp[-2].decl), 0 ); }
    7743 #line 7744 "Parser/parser.cc" /* yacc.c:1646  */
     7755#line 7756 "Parser/parser.cc" /* yacc.c:1646  */
    77447756    break;
    77457757
    77467758  case 675:
    7747 #line 2582 "parser.yy" /* yacc.c:1646  */
     7759#line 2584 "parser.yy" /* yacc.c:1646  */
    77487760    { (yyval.decl) = (yyvsp[-6].decl)->addParamList( (yyvsp[-2].decl) ); }
    7749 #line 7750 "Parser/parser.cc" /* yacc.c:1646  */
     7761#line 7762 "Parser/parser.cc" /* yacc.c:1646  */
    77507762    break;
    77517763
    77527764  case 676:
    7753 #line 2584 "parser.yy" /* yacc.c:1646  */
     7765#line 2586 "parser.yy" /* yacc.c:1646  */
    77547766    { (yyval.decl) = (yyvsp[-1].decl); }
    7755 #line 7756 "Parser/parser.cc" /* yacc.c:1646  */
     7767#line 7768 "Parser/parser.cc" /* yacc.c:1646  */
    77567768    break;
    77577769
    77587770  case 678:
    7759 #line 2591 "parser.yy" /* yacc.c:1646  */
     7771#line 2593 "parser.yy" /* yacc.c:1646  */
    77607772    { (yyval.decl) = (yyvsp[-1].decl)->addArray( (yyvsp[0].decl) ); }
    7761 #line 7762 "Parser/parser.cc" /* yacc.c:1646  */
     7773#line 7774 "Parser/parser.cc" /* yacc.c:1646  */
    77627774    break;
    77637775
    77647776  case 680:
    7765 #line 2602 "parser.yy" /* yacc.c:1646  */
     7777#line 2604 "parser.yy" /* yacc.c:1646  */
    77667778    { (yyval.decl) = DeclarationNode::newArray( 0, 0, false ); }
    7767 #line 7768 "Parser/parser.cc" /* yacc.c:1646  */
     7779#line 7780 "Parser/parser.cc" /* yacc.c:1646  */
    77687780    break;
    77697781
    77707782  case 681:
    7771 #line 2605 "parser.yy" /* yacc.c:1646  */
     7783#line 2607 "parser.yy" /* yacc.c:1646  */
    77727784    { (yyval.decl) = DeclarationNode::newVarArray( (yyvsp[-3].decl) ); }
    7773 #line 7774 "Parser/parser.cc" /* yacc.c:1646  */
     7785#line 7786 "Parser/parser.cc" /* yacc.c:1646  */
    77747786    break;
    77757787
    77767788  case 682:
    7777 #line 2607 "parser.yy" /* yacc.c:1646  */
     7789#line 2609 "parser.yy" /* yacc.c:1646  */
    77787790    { (yyval.decl) = DeclarationNode::newArray( 0, (yyvsp[-2].decl), false ); }
    7779 #line 7780 "Parser/parser.cc" /* yacc.c:1646  */
     7791#line 7792 "Parser/parser.cc" /* yacc.c:1646  */
    77807792    break;
    77817793
    77827794  case 683:
    7783 #line 2610 "parser.yy" /* yacc.c:1646  */
     7795#line 2612 "parser.yy" /* yacc.c:1646  */
    77847796    { (yyval.decl) = DeclarationNode::newArray( (yyvsp[-2].en), (yyvsp[-3].decl), false ); }
    7785 #line 7786 "Parser/parser.cc" /* yacc.c:1646  */
     7797#line 7798 "Parser/parser.cc" /* yacc.c:1646  */
    77867798    break;
    77877799
    77887800  case 684:
    7789 #line 2612 "parser.yy" /* yacc.c:1646  */
     7801#line 2614 "parser.yy" /* yacc.c:1646  */
    77907802    { (yyval.decl) = DeclarationNode::newArray( (yyvsp[-2].en), (yyvsp[-3].decl), true ); }
    7791 #line 7792 "Parser/parser.cc" /* yacc.c:1646  */
     7803#line 7804 "Parser/parser.cc" /* yacc.c:1646  */
    77927804    break;
    77937805
    77947806  case 685:
    7795 #line 2614 "parser.yy" /* yacc.c:1646  */
     7807#line 2616 "parser.yy" /* yacc.c:1646  */
    77967808    { (yyval.decl) = DeclarationNode::newArray( (yyvsp[-2].en), (yyvsp[-4].decl), true ); }
    7797 #line 7798 "Parser/parser.cc" /* yacc.c:1646  */
     7809#line 7810 "Parser/parser.cc" /* yacc.c:1646  */
    77987810    break;
    77997811
    78007812  case 687:
    7801 #line 2628 "parser.yy" /* yacc.c:1646  */
    7802     { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
    7803 #line 7804 "Parser/parser.cc" /* yacc.c:1646  */
    7804     break;
    7805 
    7806   case 688:
    78077813#line 2630 "parser.yy" /* yacc.c:1646  */
    78087814    { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
    7809 #line 7810 "Parser/parser.cc" /* yacc.c:1646  */
     7815#line 7816 "Parser/parser.cc" /* yacc.c:1646  */
     7816    break;
     7817
     7818  case 688:
     7819#line 2632 "parser.yy" /* yacc.c:1646  */
     7820    { (yyval.decl) = (yyvsp[-1].decl)->addQualifiers( (yyvsp[0].decl) ); }
     7821#line 7822 "Parser/parser.cc" /* yacc.c:1646  */
    78107822    break;
    78117823
    78127824  case 689:
    7813 #line 2635 "parser.yy" /* yacc.c:1646  */
     7825#line 2637 "parser.yy" /* yacc.c:1646  */
    78147826    { (yyval.decl) = DeclarationNode::newPointer( 0 ); }
    7815 #line 7816 "Parser/parser.cc" /* yacc.c:1646  */
     7827#line 7828 "Parser/parser.cc" /* yacc.c:1646  */
    78167828    break;
    78177829
    78187830  case 690:
    7819 #line 2637 "parser.yy" /* yacc.c:1646  */
     7831#line 2639 "parser.yy" /* yacc.c:1646  */
    78207832    { (yyval.decl) = DeclarationNode::newPointer( (yyvsp[0].decl) ); }
    7821 #line 7822 "Parser/parser.cc" /* yacc.c:1646  */
     7833#line 7834 "Parser/parser.cc" /* yacc.c:1646  */
    78227834    break;
    78237835
    78247836  case 691:
    7825 #line 2639 "parser.yy" /* yacc.c:1646  */
     7837#line 2641 "parser.yy" /* yacc.c:1646  */
    78267838    { (yyval.decl) = (yyvsp[0].decl)->addPointer( DeclarationNode::newPointer( 0 ) ); }
    7827 #line 7828 "Parser/parser.cc" /* yacc.c:1646  */
     7839#line 7840 "Parser/parser.cc" /* yacc.c:1646  */
    78287840    break;
    78297841
    78307842  case 692:
    7831 #line 2641 "parser.yy" /* yacc.c:1646  */
     7843#line 2643 "parser.yy" /* yacc.c:1646  */
    78327844    { (yyval.decl) = (yyvsp[0].decl)->addPointer( DeclarationNode::newPointer( (yyvsp[-1].decl) ) ); }
    7833 #line 7834 "Parser/parser.cc" /* yacc.c:1646  */
     7845#line 7846 "Parser/parser.cc" /* yacc.c:1646  */
    78347846    break;
    78357847
    78367848  case 693:
    7837 #line 2643 "parser.yy" /* yacc.c:1646  */
     7849#line 2645 "parser.yy" /* yacc.c:1646  */
    78387850    { (yyval.decl) = (yyvsp[-1].decl); }
    7839 #line 7840 "Parser/parser.cc" /* yacc.c:1646  */
     7851#line 7852 "Parser/parser.cc" /* yacc.c:1646  */
    78407852    break;
    78417853
    78427854  case 695:
    7843 #line 2649 "parser.yy" /* yacc.c:1646  */
    7844     { (yyval.decl) = (yyvsp[-2].decl)->addArray( (yyvsp[0].decl) ); }
    7845 #line 7846 "Parser/parser.cc" /* yacc.c:1646  */
    7846     break;
    7847 
    7848   case 696:
    78497855#line 2651 "parser.yy" /* yacc.c:1646  */
    78507856    { (yyval.decl) = (yyvsp[-2].decl)->addArray( (yyvsp[0].decl) ); }
    7851 #line 7852 "Parser/parser.cc" /* yacc.c:1646  */
     7857#line 7858 "Parser/parser.cc" /* yacc.c:1646  */
     7858    break;
     7859
     7860  case 696:
     7861#line 2653 "parser.yy" /* yacc.c:1646  */
     7862    { (yyval.decl) = (yyvsp[-2].decl)->addArray( (yyvsp[0].decl) ); }
     7863#line 7864 "Parser/parser.cc" /* yacc.c:1646  */
    78527864    break;
    78537865
    78547866  case 697:
    7855 #line 2653 "parser.yy" /* yacc.c:1646  */
    7856     { (yyval.decl) = (yyvsp[-1].decl); }
    7857 #line 7858 "Parser/parser.cc" /* yacc.c:1646  */
    7858     break;
    7859 
    7860   case 698:
    7861 #line 2658 "parser.yy" /* yacc.c:1646  */
    7862     { (yyval.decl) = (yyvsp[-6].decl)->addParamList( (yyvsp[-2].decl) ); }
    7863 #line 7864 "Parser/parser.cc" /* yacc.c:1646  */
    7864     break;
    7865 
    7866   case 699:
    7867 #line 2660 "parser.yy" /* yacc.c:1646  */
     7867#line 2655 "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) ); }
     7875#line 7876 "Parser/parser.cc" /* yacc.c:1646  */
     7876    break;
     7877
     7878  case 699:
     7879#line 2662 "parser.yy" /* yacc.c:1646  */
     7880    { (yyval.decl) = (yyvsp[-1].decl); }
     7881#line 7882 "Parser/parser.cc" /* yacc.c:1646  */
     7882    break;
     7883
    78727884  case 702:
    7873 #line 2670 "parser.yy" /* yacc.c:1646  */
     7885#line 2672 "parser.yy" /* yacc.c:1646  */
    78747886    { (yyval.decl) = (yyvsp[0].decl)->addQualifiers( (yyvsp[-1].decl) ); }
    7875 #line 7876 "Parser/parser.cc" /* yacc.c:1646  */
     7887#line 7888 "Parser/parser.cc" /* yacc.c:1646  */
    78767888    break;
    78777889
    78787890  case 705:
    7879 #line 2680 "parser.yy" /* yacc.c:1646  */
    7880     { (yyval.decl) = (yyvsp[0].decl)->addNewPointer( DeclarationNode::newPointer( 0 ) ); }
    7881 #line 7882 "Parser/parser.cc" /* yacc.c:1646  */
    7882     break;
    7883 
    7884   case 706:
    78857891#line 2682 "parser.yy" /* yacc.c:1646  */
    7886     { (yyval.decl) = (yyvsp[0].decl)->addNewPointer( DeclarationNode::newPointer( (yyvsp[-2].decl) ) ); }
    7887 #line 7888 "Parser/parser.cc" /* yacc.c:1646  */
    7888     break;
    7889 
    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 708:
    7897 #line 2686 "parser.yy" /* yacc.c:1646  */
     7896  case 706:
     7897#line 2684 "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 709:
    7903 #line 2688 "parser.yy" /* yacc.c:1646  */
     7902  case 707:
     7903#line 2686 "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 710:
    7909 #line 2690 "parser.yy" /* yacc.c:1646  */
     7908  case 708:
     7909#line 2688 "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 ) ); }
     7917#line 7918 "Parser/parser.cc" /* yacc.c:1646  */
     7918    break;
     7919
     7920  case 710:
     7921#line 2692 "parser.yy" /* yacc.c:1646  */
     7922    { (yyval.decl) = (yyvsp[0].decl)->addNewPointer( DeclarationNode::newPointer( (yyvsp[-2].decl) ) ); }
     7923#line 7924 "Parser/parser.cc" /* yacc.c:1646  */
     7924    break;
     7925
    79147926  case 711:
    7915 #line 2697 "parser.yy" /* yacc.c:1646  */
     7927#line 2699 "parser.yy" /* yacc.c:1646  */
    79167928    { (yyval.decl) = (yyvsp[0].decl)->addNewArray( DeclarationNode::newArray( 0, 0, false ) ); }
    7917 #line 7918 "Parser/parser.cc" /* yacc.c:1646  */
     7929#line 7930 "Parser/parser.cc" /* yacc.c:1646  */
    79187930    break;
    79197931
    79207932  case 712:
    7921 #line 2699 "parser.yy" /* yacc.c:1646  */
     7933#line 2701 "parser.yy" /* yacc.c:1646  */
    79227934    { (yyval.decl) = (yyvsp[0].decl)->addNewArray( (yyvsp[-1].decl) ); }
    7923 #line 7924 "Parser/parser.cc" /* yacc.c:1646  */
     7935#line 7936 "Parser/parser.cc" /* yacc.c:1646  */
    79247936    break;
    79257937
    79267938  case 713:
    7927 #line 2701 "parser.yy" /* yacc.c:1646  */
     7939#line 2703 "parser.yy" /* yacc.c:1646  */
    79287940    { (yyval.decl) = (yyvsp[0].decl)->addNewArray( (yyvsp[-1].decl) )->addNewArray( DeclarationNode::newArray( 0, 0, false ) ); }
    7929 #line 7930 "Parser/parser.cc" /* yacc.c:1646  */
     7941#line 7942 "Parser/parser.cc" /* yacc.c:1646  */
    79307942    break;
    79317943
    79327944  case 714:
    7933 #line 2703 "parser.yy" /* yacc.c:1646  */
     7945#line 2705 "parser.yy" /* yacc.c:1646  */
    79347946    { (yyval.decl) = (yyvsp[0].decl)->addNewArray( (yyvsp[-1].decl) )->addNewArray( (yyvsp[-2].decl) ); }
    7935 #line 7936 "Parser/parser.cc" /* yacc.c:1646  */
     7947#line 7948 "Parser/parser.cc" /* yacc.c:1646  */
    79367948    break;
    79377949
    79387950  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:
    79457951#line 2707 "parser.yy" /* yacc.c:1646  */
    7946     { (yyval.decl) = (yyvsp[0].decl)->addNewArray( DeclarationNode::newArray( 0, 0, false ) ); }
    7947 #line 7948 "Parser/parser.cc" /* yacc.c:1646  */
    7948     break;
    7949 
    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 ) ); }
     7959#line 7960 "Parser/parser.cc" /* yacc.c:1646  */
     7960    break;
     7961
     7962  case 717:
     7963#line 2711 "parser.yy" /* yacc.c:1646  */
     7964    { (yyval.decl) = (yyvsp[0].decl)->addNewArray( (yyvsp[-1].decl) ); }
     7965#line 7966 "Parser/parser.cc" /* yacc.c:1646  */
     7966    break;
     7967
    79567968  case 718:
    7957 #line 2711 "parser.yy" /* yacc.c:1646  */
     7969#line 2713 "parser.yy" /* yacc.c:1646  */
    79587970    { (yyval.decl) = (yyvsp[0].decl)->addNewArray( (yyvsp[-1].decl) )->addNewArray( DeclarationNode::newArray( 0, 0, false ) ); }
    7959 #line 7960 "Parser/parser.cc" /* yacc.c:1646  */
     7971#line 7972 "Parser/parser.cc" /* yacc.c:1646  */
    79607972    break;
    79617973
    79627974  case 719:
    7963 #line 2713 "parser.yy" /* yacc.c:1646  */
     7975#line 2715 "parser.yy" /* yacc.c:1646  */
    79647976    { (yyval.decl) = (yyvsp[0].decl)->addNewArray( (yyvsp[-1].decl) )->addNewArray( (yyvsp[-2].decl) ); }
    7965 #line 7966 "Parser/parser.cc" /* yacc.c:1646  */
     7977#line 7978 "Parser/parser.cc" /* yacc.c:1646  */
    79667978    break;
    79677979
    79687980  case 720:
    7969 #line 2715 "parser.yy" /* yacc.c:1646  */
     7981#line 2717 "parser.yy" /* yacc.c:1646  */
    79707982    { (yyval.decl) = (yyvsp[0].decl)->addNewArray( (yyvsp[-1].decl) ); }
    7971 #line 7972 "Parser/parser.cc" /* yacc.c:1646  */
     7983#line 7984 "Parser/parser.cc" /* yacc.c:1646  */
    79727984    break;
    79737985
    79747986  case 721:
    7975 #line 2720 "parser.yy" /* yacc.c:1646  */
     7987#line 2722 "parser.yy" /* yacc.c:1646  */
    79767988    { (yyval.decl) = DeclarationNode::newVarArray( (yyvsp[-3].decl) ); }
    7977 #line 7978 "Parser/parser.cc" /* yacc.c:1646  */
     7989#line 7990 "Parser/parser.cc" /* yacc.c:1646  */
    79787990    break;
    79797991
    79807992  case 722:
    7981 #line 2722 "parser.yy" /* yacc.c:1646  */
     7993#line 2724 "parser.yy" /* yacc.c:1646  */
    79827994    { (yyval.decl) = DeclarationNode::newArray( (yyvsp[-2].en), (yyvsp[-3].decl), false ); }
    7983 #line 7984 "Parser/parser.cc" /* yacc.c:1646  */
     7995#line 7996 "Parser/parser.cc" /* yacc.c:1646  */
    79847996    break;
    79857997
    79867998  case 723:
    7987 #line 2727 "parser.yy" /* yacc.c:1646  */
     7999#line 2729 "parser.yy" /* yacc.c:1646  */
    79888000    { (yyval.decl) = DeclarationNode::newArray( (yyvsp[-2].en), (yyvsp[-3].decl), true ); }
    7989 #line 7990 "Parser/parser.cc" /* yacc.c:1646  */
     8001#line 8002 "Parser/parser.cc" /* yacc.c:1646  */
    79908002    break;
    79918003
    79928004  case 724:
    7993 #line 2729 "parser.yy" /* yacc.c:1646  */
     8005#line 2731 "parser.yy" /* yacc.c:1646  */
    79948006    { (yyval.decl) = DeclarationNode::newArray( (yyvsp[-2].en), (yyvsp[-3].decl)->addQualifiers( (yyvsp[-4].decl) ), true ); }
    7995 #line 7996 "Parser/parser.cc" /* yacc.c:1646  */
     8007#line 8008 "Parser/parser.cc" /* yacc.c:1646  */
    79968008    break;
    79978009
    79988010  case 726:
    7999 #line 2756 "parser.yy" /* yacc.c:1646  */
     8011#line 2758 "parser.yy" /* yacc.c:1646  */
    80008012    { (yyval.decl) = (yyvsp[0].decl)->addQualifiers( (yyvsp[-1].decl) ); }
    8001 #line 8002 "Parser/parser.cc" /* yacc.c:1646  */
     8013#line 8014 "Parser/parser.cc" /* yacc.c:1646  */
    80028014    break;
    80038015
    80048016  case 730:
    8005 #line 2767 "parser.yy" /* yacc.c:1646  */
    8006     { (yyval.decl) = (yyvsp[0].decl)->addNewPointer( DeclarationNode::newPointer( 0 ) ); }
    8007 #line 8008 "Parser/parser.cc" /* yacc.c:1646  */
    8008     break;
    8009 
    8010   case 731:
    80118017#line 2769 "parser.yy" /* yacc.c:1646  */
    8012     { (yyval.decl) = (yyvsp[0].decl)->addNewPointer( DeclarationNode::newPointer( (yyvsp[-2].decl) ) ); }
    8013 #line 8014 "Parser/parser.cc" /* yacc.c:1646  */
    8014     break;
    8015 
    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 733:
    8023 #line 2773 "parser.yy" /* yacc.c:1646  */
     8022  case 731:
     8023#line 2771 "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 734:
    8029 #line 2775 "parser.yy" /* yacc.c:1646  */
     8028  case 732:
     8029#line 2773 "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 735:
    8035 #line 2777 "parser.yy" /* yacc.c:1646  */
     8034  case 733:
     8035#line 2775 "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 ) ); }
     8043#line 8044 "Parser/parser.cc" /* yacc.c:1646  */
     8044    break;
     8045
     8046  case 735:
     8047#line 2779 "parser.yy" /* yacc.c:1646  */
     8048    { (yyval.decl) = (yyvsp[0].decl)->addNewPointer( DeclarationNode::newPointer( (yyvsp[-2].decl) ) ); }
     8049#line 8050 "Parser/parser.cc" /* yacc.c:1646  */
     8050    break;
     8051
    80408052  case 736:
    8041 #line 2784 "parser.yy" /* yacc.c:1646  */
     8053#line 2786 "parser.yy" /* yacc.c:1646  */
    80428054    { (yyval.decl) = (yyvsp[0].decl)->addNewArray( DeclarationNode::newArray( 0, 0, false ) ); }
    8043 #line 8044 "Parser/parser.cc" /* yacc.c:1646  */
     8055#line 8056 "Parser/parser.cc" /* yacc.c:1646  */
    80448056    break;
    80458057
    80468058  case 737:
    8047 #line 2786 "parser.yy" /* yacc.c:1646  */
     8059#line 2788 "parser.yy" /* yacc.c:1646  */
    80488060    { (yyval.decl) = (yyvsp[0].decl)->addNewArray( (yyvsp[-1].decl) )->addNewArray( DeclarationNode::newArray( 0, 0, false ) ); }
    8049 #line 8050 "Parser/parser.cc" /* yacc.c:1646  */
     8061#line 8062 "Parser/parser.cc" /* yacc.c:1646  */
    80508062    break;
    80518063
    80528064  case 738:
    8053 #line 2788 "parser.yy" /* yacc.c:1646  */
     8065#line 2790 "parser.yy" /* yacc.c:1646  */
    80548066    { (yyval.decl) = (yyvsp[0].decl)->addNewArray( (yyvsp[-1].decl) ); }
    8055 #line 8056 "Parser/parser.cc" /* yacc.c:1646  */
     8067#line 8068 "Parser/parser.cc" /* yacc.c:1646  */
    80568068    break;
    80578069
    80588070  case 739:
    8059 #line 2790 "parser.yy" /* yacc.c:1646  */
     8071#line 2792 "parser.yy" /* yacc.c:1646  */
    80608072    { (yyval.decl) = (yyvsp[0].decl)->addNewArray( DeclarationNode::newArray( 0, 0, false ) ); }
    8061 #line 8062 "Parser/parser.cc" /* yacc.c:1646  */
     8073#line 8074 "Parser/parser.cc" /* yacc.c:1646  */
    80628074    break;
    80638075
    80648076  case 740:
    8065 #line 2792 "parser.yy" /* yacc.c:1646  */
     8077#line 2794 "parser.yy" /* yacc.c:1646  */
    80668078    { (yyval.decl) = (yyvsp[0].decl)->addNewArray( (yyvsp[-1].decl) )->addNewArray( DeclarationNode::newArray( 0, 0, false ) ); }
    8067 #line 8068 "Parser/parser.cc" /* yacc.c:1646  */
     8079#line 8080 "Parser/parser.cc" /* yacc.c:1646  */
    80688080    break;
    80698081
    80708082  case 741:
    8071 #line 2794 "parser.yy" /* yacc.c:1646  */
     8083#line 2796 "parser.yy" /* yacc.c:1646  */
    80728084    { (yyval.decl) = (yyvsp[0].decl)->addNewArray( (yyvsp[-1].decl) ); }
    8073 #line 8074 "Parser/parser.cc" /* yacc.c:1646  */
     8085#line 8086 "Parser/parser.cc" /* yacc.c:1646  */
    80748086    break;
    80758087
    80768088  case 742:
    8077 #line 2799 "parser.yy" /* yacc.c:1646  */
     8089#line 2801 "parser.yy" /* yacc.c:1646  */
    80788090    { (yyval.decl) = DeclarationNode::newTuple( (yyvsp[-2].decl) ); }
    8079 #line 8080 "Parser/parser.cc" /* yacc.c:1646  */
     8091#line 8092 "Parser/parser.cc" /* yacc.c:1646  */
    80808092    break;
    80818093
    80828094  case 743:
    8083 #line 2804 "parser.yy" /* yacc.c:1646  */
     8095#line 2806 "parser.yy" /* yacc.c:1646  */
    80848096    { (yyval.decl) = DeclarationNode::newFunction( 0, DeclarationNode::newTuple( 0 ), (yyvsp[-1].decl), 0 ); }
    8085 #line 8086 "Parser/parser.cc" /* yacc.c:1646  */
     8097#line 8098 "Parser/parser.cc" /* yacc.c:1646  */
    80868098    break;
    80878099
    80888100  case 744:
    8089 #line 2806 "parser.yy" /* yacc.c:1646  */
    8090     { (yyval.decl) = DeclarationNode::newFunction( 0, (yyvsp[-5].decl), (yyvsp[-2].decl), 0 ); }
    8091 #line 8092 "Parser/parser.cc" /* yacc.c:1646  */
    8092     break;
    8093 
    8094   case 745:
    80958101#line 2808 "parser.yy" /* yacc.c:1646  */
    80968102    { (yyval.decl) = DeclarationNode::newFunction( 0, (yyvsp[-5].decl), (yyvsp[-2].decl), 0 ); }
    8097 #line 8098 "Parser/parser.cc" /* yacc.c:1646  */
     8103#line 8104 "Parser/parser.cc" /* yacc.c:1646  */
     8104    break;
     8105
     8106  case 745:
     8107#line 2810 "parser.yy" /* yacc.c:1646  */
     8108    { (yyval.decl) = DeclarationNode::newFunction( 0, (yyvsp[-5].decl), (yyvsp[-2].decl), 0 ); }
     8109#line 8110 "Parser/parser.cc" /* yacc.c:1646  */
    80988110    break;
    80998111
    81008112  case 748:
    8101 #line 2832 "parser.yy" /* yacc.c:1646  */
     8113#line 2834 "parser.yy" /* yacc.c:1646  */
    81028114    { (yyval.en) = 0; }
    8103 #line 8104 "Parser/parser.cc" /* yacc.c:1646  */
     8115#line 8116 "Parser/parser.cc" /* yacc.c:1646  */
    81048116    break;
    81058117
    81068118  case 749:
    8107 #line 2834 "parser.yy" /* yacc.c:1646  */
     8119#line 2836 "parser.yy" /* yacc.c:1646  */
    81088120    { (yyval.en) = (yyvsp[0].en); }
    8109 #line 8110 "Parser/parser.cc" /* yacc.c:1646  */
    8110     break;
    8111 
    8112 
    8113 #line 8114 "Parser/parser.cc" /* yacc.c:1646  */
     8121#line 8122 "Parser/parser.cc" /* yacc.c:1646  */
     8122    break;
     8123
     8124
     8125#line 8126 "Parser/parser.cc" /* yacc.c:1646  */
    81148126      default: break;
    81158127    }
     
    83398351  return yyresult;
    83408352}
    8341 #line 2837 "parser.yy" /* yacc.c:1906  */
     8353#line 2839 "parser.yy" /* yacc.c:1906  */
    83428354
    83438355// ----end of grammar----
  • src/Parser/parser.yy

    r04cdd9b re85a8631  
    21052105        // empty
    21062106        | ASM '(' string_literal_list ')' attribute_list_opt
     2107                { delete $3; }
    21072108        ;
    21082109
     
    21342135        | any_word
    21352136        | any_word '(' comma_expression_opt ')'
     2137                { delete $3; }
    21362138        ;
    21372139
    21382140any_word:                                                                                               // GCC
    2139         identifier_or_type_name {}
    2140         | storage_class {}
    2141         | basic_type_name {}
    2142         | type_qualifier {}
     2141        identifier_or_type_name { delete $1; }
     2142        | storage_class { delete $1; }
     2143        | basic_type_name { delete $1; }
     2144        | type_qualifier { delete $1; }
    21432145        ;
    21442146
  • src/SynTree/Expression.cc

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

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

    r04cdd9b re85a8631  
    159159        delete condition;
    160160        // destroy statements
     161        deleteAll( statements );
    161162}
    162163
     
    187188CaseStmt::~CaseStmt() {
    188189        delete condition;
     190        deleteAll( stmts );
    189191}
    190192
     
    220222WhileStmt::~WhileStmt() {
    221223        delete body;
     224        delete condition;
    222225}
    223226
     
    294297TryStmt::~TryStmt() {
    295298        delete block;
     299        deleteAll( handlers );
     300        delete finallyBlock;
    296301}
    297302
  • src/include/assert.h

    r04cdd9b re85a8631  
    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 //
     14//
     15
     16#pragma once
    1517
    1618#include_next <assert.h>
     
    2224void __assert_fail_f( const char *assertion, const char *file, unsigned int line, const char *function, const char *fmt, ... );
    2325
     26template<typename T, typename U>
     27static inline T safe_dynamic_cast(const U& src) {
     28        T ret = dynamic_cast<T>(src);
     29        assert(ret);
     30        return ret;
     31}
     32
    2433// Local Variables: //
    2534// tab-width: 4 //
  • src/main.cc

    r04cdd9b re85a8631  
    1010// Created On       : Fri May 15 23:12:02 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Aug 19 08:31:22 2016
    13 // Update Count     : 350
     12// Last Modified On : Sat Aug 20 12:52:22 2016
     13// Update Count     : 403
    1414//
    1515
    1616#include <iostream>
    1717#include <fstream>
    18 #include <getopt.h>
     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
     23using namespace std;
     24
    1925#include "Parser/lex.h"
    2026#include "Parser/parser.h"
     
    3541#include "InitTweak/FixInit.h"
    3642#include "Common/UnimplementedError.h"
    37 
    3843#include "../config.h"
    3944
    4045using namespace std;
    4146
    42 #define OPTPRINT(x) if ( errorp ) std::cerr << x << std::endl;
     47#define OPTPRINT(x) if ( errorp ) cerr << x << endl;
    4348
    4449
     
    6873static void parse_cmdline( int argc, char *argv[], const char *& filename );
    6974static void parse( FILE * input, LinkageSpec::Spec linkage, bool shouldExit = false );
    70 static void dump( std::list< Declaration * > & translationUnit, std::ostream & out = std::cout );
     75static void dump( list< Declaration * > & translationUnit, ostream & out = cout );
     76
     77void 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
    71126
    72127int main( int argc, char * argv[] ) {
    73128        FILE * input;                                                                           // use FILE rather than istream because yyin is FILE
    74         std::ostream *output = & std::cout;
    75         std::list< Declaration * > translationUnit;
     129        ostream *output = & cout;
    76130        const char *filename = nullptr;
     131        list< Declaration * > translationUnit;
     132
     133        signal( SIGSEGV, sigSegvBusHandler );
     134        signal( SIGBUS, sigSegvBusHandler );
    77135
    78136        parse_cmdline( argc, argv, filename );                          // process command-line arguments
     
    122180
    123181                if ( parsep ) {
    124                         parseTree->printList( std::cout );
     182                        parseTree->printList( cout );
    125183                        delete parseTree;
    126184                        return 0;
     
    144202
    145203                if ( expraltp ) {
    146                         ResolvExpr::AlternativePrinter printer( std::cout );
     204                        ResolvExpr::AlternativePrinter printer( cout );
    147205                        acceptAll( translationUnit, printer );
    148206                        return 0;
     
    210268                CodeGen::generate( translationUnit, *output, ! noprotop );
    211269
    212                 if ( output != &std::cout ) {
     270                if ( output != &cout ) {
    213271                        delete output;
    214272                } // if
    215273        } catch ( SemanticError &e ) {
    216274                if ( errorp ) {
    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 ) {
     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 ) {
    223281                        delete output;
    224282                } // if
    225283                return 1;
    226284        } catch ( UnimplementedError &e ) {
    227                 std::cout << "Sorry, " << e.get_what() << " is not currently implemented" << std::endl;
    228                 if ( output != &std::cout ) {
     285                cout << "Sorry, " << e.get_what() << " is not currently implemented" << endl;
     286                if ( output != &cout ) {
    229287                        delete output;
    230288                } // if
    231289                return 1;
    232290        } catch ( CompilerError &e ) {
    233                 std::cerr << "Compiler Error: " << e.get_what() << std::endl;
    234                 std::cerr << "(please report bugs to " << std::endl;
    235                 if ( output != &std::cout ) {
     291                cerr << "Compiler Error: " << e.get_what() << endl;
     292                cerr << "(please report bugs to " << endl;
     293                if ( output != &cout ) {
    236294                        delete output;
    237295                } // if
     
    369427} // notPrelude
    370428
    371 static void dump( std::list< Declaration * > & translationUnit, std::ostream & out ) {
    372         std::list< Declaration * > decls;
     429static void dump( list< Declaration * > & translationUnit, ostream & out ) {
     430        list< Declaration * > decls;
    373431
    374432        if ( noprotop ) {
    375                 filter( translationUnit.begin(), translationUnit.end(), std::back_inserter( decls ), notPrelude );
     433                filter( translationUnit.begin(), translationUnit.end(), back_inserter( decls ), notPrelude );
    376434        } else {
    377435                decls = translationUnit;
Note: See TracChangeset for help on using the changeset viewer.