1 /* translation of file "parse.k" */
5 #define KC_FUNCTIONS_parse_
14 // The Termprocessor Kimwitu++
16 // Copyright (C) 1991 University of Twente, Dept TIOS.
17 // Copyright (C) 1998-2003 Humboldt-University of Berlin, Institute of Informatics
18 // All rights reserved.
20 // Kimwitu++ is free software; you can redistribute it and/or modify
21 // it under the terms of the GNU General Public License as published by
22 // the Free Software Foundation; either version 2 of the License, or
23 // (at your option) any later version.
25 // Kimwitu++ is distributed in the hope that it will be useful,
26 // but WITHOUT ANY WARRANTY; without even the implied warranty of
27 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 // GNU General Public License for more details.
30 // You should have received a copy of the GNU General Public License
31 // along with Kimwitu++; if not, write to the Free Software
32 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
35 static char parse_kAccesSid
[] = "@(#)$Id$";
37 int pg_lineno
= 1; /* global line # */
38 int pg_column
= 0; /* global column # */
39 int pg_charpos
= 0; /* global charpos # */
40 casestring pg_filename
; /* global file name */
41 int pg_no_of_arguments
; /* no_of_arguments */
42 phylumdeclarations Thephylumdeclarations
; /* global phylumdecls */
43 rwdeclarations Therwdeclarations
; /* global rw-decls */
44 fndeclarations Thefndeclarations
; /* fn-decls for the file being parsed */
45 fnfiles Thefnfiles
; /* global fn-decls */
46 includefiles Theincludefiles
; /* global incl-decls */
47 unparsedeclarations Theunparsedeclarations
; /* global unp-decls */
48 argsnumbers Theargsnumbers
; /* global list of argsnumbers */
49 viewnames Theuviewnames
; /* global list of u-viewnames */
50 viewnames Therviewnames
; /* global list of r-viewnames */
51 storageclasses Thestorageclasses
; /* global list of storageclasses */
52 languagenames Thelanguages
; /* global list of used languages */
53 baseclass_declarations Thebaseclasses
; /* global list of defined baseclasses */
54 bool pg_uviewshavebeendefined
; /* global indication */
55 bool pg_rviewshavebeendefined
; /* global indication */
56 bool pg_storageclasseshavebeendefined
; /* global indication */
57 bool pg_languageshavebeendefined
; /* global indication */
59 static long language_text_nr
=0;
60 static bool language_text_nr_used
=false;
64 /* end included stuff */
69 #ifndef KC_TRACE_PROVIDED
70 #define KC_TRACE_PROVIDED(COND,FILE,LINE,NODE) COND
73 static ID
f_ID_of_direct_decl (ac_direct_declarator d
);
74 static int f_stars_of_ac_pointer_option (ac_pointer_option d
);
75 static int f_stars_of_ac_pointer (ac_pointer d
);
76 static bool f_is_member_fn (ac_declarator dec
);
77 static bool f_static_in_ac_decl_spec (ac_declaration_specifier ds
);
78 static bool f_static_in_ac_stor_class (ac_storage_class_specifier sc
);
79 static ID
f_ID_of_ac_declaration_specifier (ac_declaration_specifier d
);
80 static ID
f_ID_of_ac_type_specifier (ac_type_specifier d
);
81 phylumdeclarations
mergephylumdeclarations(phylumdeclaration pd
, phylumdeclarations pds
)
83 phylumdeclaration kc_selvar_0_1
= phylum_cast
<phylumdeclaration
>(pd
);
84 if ((kc_selvar_0_1
->prod_sel() == sel_PhylumDeclaration
)) {
85 const ID pd_id
= phylum_cast
<const impl_phylumdeclaration_PhylumDeclaration
*>(kc_selvar_0_1
)->ID_1
;
86 const storageoption pd_stopt
= phylum_cast
<const impl_phylumdeclaration_PhylumDeclaration
*>(kc_selvar_0_1
)->storageoption_1
;
87 const productionblock pd_pb
= phylum_cast
<const impl_phylumdeclaration_PhylumDeclaration
*>(kc_selvar_0_1
)->productionblock_1
;
88 const Ccode_option pd_ccopt
= phylum_cast
<const impl_phylumdeclaration_PhylumDeclaration
*>(kc_selvar_0_1
)->Ccode_option_1
;
90 phylumdeclaration fpd
= f_lookupuserdecl( pd_id
);
93 return Consphylumdeclarations( pd
, pds
);
94 } else if ( pd
== fpd
) {
95 if ( f_added( pd_id
) ) {
99 return Consphylumdeclarations( pd
, pds
);
104 phylumdeclaration kc_selvar_1_1
= phylum_cast
<phylumdeclaration
>( fpd
);
105 if ((kc_selvar_1_1
->prod_sel() == sel_PhylumDeclaration
)) {
106 const ID fpd_id
= phylum_cast
<const impl_phylumdeclaration_PhylumDeclaration
*>(kc_selvar_1_1
)->ID_1
;
107 const storageoption fpd_stopt
= phylum_cast
<const impl_phylumdeclaration_PhylumDeclaration
*>(kc_selvar_1_1
)->storageoption_1
;
108 const productionblock fpd_pb
= phylum_cast
<const impl_phylumdeclaration_PhylumDeclaration
*>(kc_selvar_1_1
)->productionblock_1
;
109 const Ccode_option fpd_ccopt
= phylum_cast
<const impl_phylumdeclaration_PhylumDeclaration
*>(kc_selvar_1_1
)->Ccode_option_1
;
112 storageoption kc_selvar_2_1
= phylum_cast
<storageoption
>( pd_stopt
);
113 storageoption kc_selvar_2_2
= phylum_cast
<storageoption
>( fpd_stopt
);
114 if ((kc_selvar_2_1
->prod_sel() == sel_PositiveStorageOption
) && (kc_selvar_2_2
->prod_sel() == sel_NegativeStorageOption
) && (phylum_cast
<const impl_storageoption_NegativeStorageOption
*>(kc_selvar_2_2
)->ID_1
->eq(phylum_cast
<const impl_storageoption_PositiveStorageOption
*>(kc_selvar_2_1
)->ID_1
))) {
115 const ID id
= phylum_cast
<const impl_storageoption_PositiveStorageOption
*>(kc_selvar_2_1
)->ID_1
;
117 v_report(NonFatal( FileLine( id
->file
, id
->line
), Problem1S1storageoption1S1ID( "storage option mismatch ( declared as ", fpd_stopt
, ") for phylum", fpd_id
)));
120 if ((kc_selvar_2_1
->prod_sel() == sel_NegativeStorageOption
) && (kc_selvar_2_2
->prod_sel() == sel_PositiveStorageOption
) && (phylum_cast
<const impl_storageoption_PositiveStorageOption
*>(kc_selvar_2_2
)->ID_1
->eq(phylum_cast
<const impl_storageoption_NegativeStorageOption
*>(kc_selvar_2_1
)->ID_1
))) {
121 const ID id
= phylum_cast
<const impl_storageoption_NegativeStorageOption
*>(kc_selvar_2_1
)->ID_1
;
123 v_report(NonFatal( FileLine( id
->file
, id
->line
), Problem1S1storageoption1S1ID( "storage option mismatch ( declared as ", fpd_stopt
, ") for phylum", fpd_id
)));
126 if ((kc_selvar_2_1
->prod_sel() == sel_PositiveStorageOption
) && (kc_selvar_2_2
->prod_sel() == sel_PositiveStorageOption
) && (phylum_cast
<const impl_storageoption_PositiveStorageOption
*>(kc_selvar_2_2
)->ID_1
->eq(phylum_cast
<const impl_storageoption_PositiveStorageOption
*>(kc_selvar_2_1
)->ID_1
))) {
127 const ID id
= phylum_cast
<const impl_storageoption_PositiveStorageOption
*>(kc_selvar_2_1
)->ID_1
;
130 if ((kc_selvar_2_1
->prod_sel() == sel_NegativeStorageOption
) && (kc_selvar_2_2
->prod_sel() == sel_NegativeStorageOption
) && (phylum_cast
<const impl_storageoption_NegativeStorageOption
*>(kc_selvar_2_2
)->ID_1
->eq(phylum_cast
<const impl_storageoption_NegativeStorageOption
*>(kc_selvar_2_1
)->ID_1
))) {
131 const ID id
= phylum_cast
<const impl_storageoption_NegativeStorageOption
*>(kc_selvar_2_1
)->ID_1
;
134 if ((kc_selvar_2_1
->prod_sel() == sel_NoStorageOption
)) {
137 if ((kc_selvar_2_2
->prod_sel() == sel_NoStorageOption
)) {
138 static_cast<impl_phylumdeclaration_PhylumDeclaration
*>(fpd
)->storageoption_1
= pd_stopt
;
145 v_report(NonFatal( FileLine( pd_id
->file
, pd_id
->line
), Problem1S1storageoption1S1ID( "storage option mismatch ( declared as ", fpd_stopt
, ") for phylum", fpd_id
)));
150 productionblock kc_selvar_2_1
= phylum_cast
<productionblock
>( pd_pb
);
151 productionblock kc_selvar_2_2
= phylum_cast
<productionblock
>( fpd_pb
);
152 if ((kc_selvar_2_1
->prod_sel() == sel_NonlistAlternatives
) && (kc_selvar_2_2
->prod_sel() == sel_NonlistAlternatives
)) {
153 const alternatives pd_pb_a
= phylum_cast
<const impl_productionblock_NonlistAlternatives
*>(kc_selvar_2_1
)->alternatives_1
;
154 const alternatives fpd_pb_a
= phylum_cast
<const impl_productionblock_NonlistAlternatives
*>(kc_selvar_2_2
)->alternatives_1
;
156 static_cast<impl_productionblock_NonlistAlternatives
*>(fpd_pb
)->alternatives_1
= concat(pd_pb_a
, fpd_pb_a
);
159 if ((kc_selvar_2_1
->prod_sel() == sel_NonlistAlternatives
) && (kc_selvar_2_2
->prod_sel() == sel_Emptyproductionblock
)) {
160 static_cast<impl_phylumdeclaration_PhylumDeclaration
*>(fpd
)->productionblock_1
= pd_pb
;
162 if ((kc_selvar_2_1
->prod_sel() == sel_PredefinedAlternatives
) && (kc_selvar_2_2
->prod_sel() == sel_Emptyproductionblock
)) {
163 static_cast<impl_phylumdeclaration_PhylumDeclaration
*>(fpd
)->productionblock_1
= pd_pb
;
165 if ((kc_selvar_2_1
->prod_sel() == sel_ListAlternatives
) && (kc_selvar_2_2
->prod_sel() == sel_Emptyproductionblock
)) {
166 static_cast<impl_phylumdeclaration_PhylumDeclaration
*>(fpd
)->productionblock_1
= pd_pb
;
168 if ((kc_selvar_2_1
->prod_sel() == sel_Emptyproductionblock
) && (kc_selvar_2_2
->prod_sel() == sel_Emptyproductionblock
)) {
171 if ((kc_selvar_2_1
->prod_sel() == sel_NonlistAlternatives
)) {
173 v_report(NonFatal( FileLine( pd_id
->file
, pd_id
->line
), Problem1S1ID( "production block mismatch: trying to extend phylum", pd_id
)));
176 if ((kc_selvar_2_1
->prod_sel() == sel_PredefinedAlternatives
)) {
178 v_report(NonFatal( FileLine( pd_id
->file
, pd_id
->line
), Problem1S1ID( "production block mismatch: trying to predefine phylum", pd_id
)));
181 if ((kc_selvar_2_1
->prod_sel() == sel_ListAlternatives
)) {
183 v_report(NonFatal( FileLine( pd_id
->file
, pd_id
->line
), Problem1S1ID( "production block mismatch: trying to redefine list phylum", pd_id
)));
186 if ((kc_selvar_2_1
->prod_sel() == sel_Emptyproductionblock
)) {
189 { kc_no_default_in_with( "mergephylumdeclarations", __LINE__
, __FILE__
);
190 return static_cast<phylumdeclarations
>(0); }
193 Ccode_option kc_selvar_2_1
= phylum_cast
<Ccode_option
>( pd_ccopt
);
194 Ccode_option kc_selvar_2_2
= phylum_cast
<Ccode_option
>( fpd_ccopt
);
195 if ((kc_selvar_2_1
->prod_sel() == sel_CcodeOption
) && (kc_selvar_2_2
->prod_sel() == sel_CcodeOption
)) {
196 const attributes pd_ccopt_attr
= phylum_cast
<const impl_Ccode_option_CcodeOption
*>(kc_selvar_2_1
)->attributes_1
;
197 const Ctexts pd_ccopt_ct
= phylum_cast
<const impl_Ccode_option_CcodeOption
*>(kc_selvar_2_1
)->Ctexts_1
;
198 const attributes fpd_ccopt_attr
= phylum_cast
<const impl_Ccode_option_CcodeOption
*>(kc_selvar_2_2
)->attributes_1
;
199 const Ctexts fpd_ccopt_ct
= phylum_cast
<const impl_Ccode_option_CcodeOption
*>(kc_selvar_2_2
)->Ctexts_1
;
201 static_cast<impl_phylumdeclaration_PhylumDeclaration
*>(fpd
)->Ccode_option_1
= CcodeOption( concat(pd_ccopt_attr
, fpd_ccopt_attr
), concat(pd_ccopt_ct
, fpd_ccopt_ct
));
204 { kc_no_default_in_with( "mergephylumdeclarations", __LINE__
, __FILE__
);
205 return static_cast<phylumdeclarations
>(0); }
209 { kc_no_default_in_with( "mergephylumdeclarations", __LINE__
, __FILE__
);
210 return static_cast<phylumdeclarations
>(0); }
215 { kc_no_default_in_with( "mergephylumdeclarations", __LINE__
, __FILE__
);
216 return static_cast<phylumdeclarations
>(0); }
221 alternatives
makeListAlternatives(ID listphylum
, ID elementphylum
)
224 alternative Nil_alternative
, Cons_alternative
;
225 Nil_id
= Id( Str( mkcasestring((string("Nil")+f_strofID(listphylum
)).c_str())));
226 Cons_id
= Id( Str( mkcasestring((string("Cons")+f_strofID(listphylum
)).c_str())));
227 Nil_id
->line
= elementphylum
->line
;
228 Nil_id
->file
= elementphylum
->file
;
229 Cons_id
->line
= elementphylum
->line
;
230 Cons_id
->file
= elementphylum
->file
;
231 Nil_alternative
= Alternative( Nil_id
, Nilarguments() );
232 Cons_alternative
= Alternative( Cons_id
, Consarguments( listphylum
, Consarguments( elementphylum
, Nilarguments() ) ) );
233 v_extendoccur( Nil_id
, ITUserOperator( Nil_alternative
, listphylum
) );
234 v_extendoccur( Cons_id
, ITUserOperator( Cons_alternative
, listphylum
) );
235 return Consalternatives( Cons_alternative
, Consalternatives( Nil_alternative
, Nilalternatives() ) );
239 const char *f_strofID(ID id
)
241 ID kc_selvar_0_1
= phylum_cast
<ID
>(id
);
242 if ((kc_selvar_0_1
->prod_sel() == sel_Id
) && (phylum_cast
<const impl_ID_Id
*>(kc_selvar_0_1
)->uniqID_1
->prod_sel() == sel_Str
)) {
243 const casestring cs
= phylum_cast
<const impl_uniqID_Str
*>(phylum_cast
<const impl_ID_Id
*>(kc_selvar_0_1
)->uniqID_1
)->casestring_1
;
246 { kc_no_default_in_with( "f_strofID", __LINE__
, __FILE__
);
247 return static_cast<char*>(0); }
252 phylumdeclaration
f_lookupuserdecl(ID id
)
254 ID kc_selvar_0_1
= phylum_cast
<ID
>(id
);
255 if ((kc_selvar_0_1
->prod_sel() == sel_Id
)) {
256 const uniqID uid
= phylum_cast
<const impl_ID_Id
*>(kc_selvar_0_1
)->uniqID_1
;
259 IDtype kc_selvar_1_1
= phylum_cast
<IDtype
>( uid
->type
);
260 if ((kc_selvar_1_1
->prod_sel() == sel_ITUserFunction
)) {
262 v_report(NonFatal( FileLine( id
->file
, id
->line
), Problem1S1ID( "expected user-defined phylum instead of user-defined function:", id
)));
266 if ((kc_selvar_1_1
->prod_sel() == sel_ITUserRView
)) {
268 v_report(NonFatal( FileLine( id
->file
, id
->line
), Problem1S1ID( "expected user-defined phylum instead of user-defined rewrite view:", id
)));
272 if ((kc_selvar_1_1
->prod_sel() == sel_ITPredefinedRView
)) {
274 v_report(NonFatal( FileLine( id
->file
, id
->line
), Problem1S1ID( "expected user-defined phylum instead of predefined rewrite view:", id
)));
278 if ((kc_selvar_1_1
->prod_sel() == sel_ITUserUView
)) {
280 v_report(NonFatal( FileLine( id
->file
, id
->line
), Problem1S1ID( "expected user-defined phylum instead of user-defined unparse view:", id
)));
284 if ((kc_selvar_1_1
->prod_sel() == sel_ITPredefinedUView
)) {
286 v_report(NonFatal( FileLine( id
->file
, id
->line
), Problem1S1ID( "expected user-defined phylum instead of predefined unparse view:", id
)));
290 if ((kc_selvar_1_1
->prod_sel() == sel_ITStorageClass
)) {
292 v_report(NonFatal( FileLine( id
->file
, id
->line
), Problem1S1ID( "expected user-defined phylum instead of user-defined storage class:", id
)));
296 if ((kc_selvar_1_1
->prod_sel() == sel_ITPredefinedStorageClass
)) {
298 v_report(NonFatal( FileLine( id
->file
, id
->line
), Problem1S1ID( "expected user-defined phylum instead of predefined storage class:", id
)));
302 if ((kc_selvar_1_1
->prod_sel() == sel_ITUserOperator
)) {
304 v_report(NonFatal( FileLine( id
->file
, id
->line
), Problem1S1ID( "expected user-defined phylum instead of user-defined operator:", id
)));
308 if ((kc_selvar_1_1
->prod_sel() == sel_ITPredefinedOperator
)) {
310 v_report(NonFatal( FileLine( id
->file
, id
->line
), Problem1S1ID( "expected user-defined phylum instead of predefined operator:", id
)));
314 if ((kc_selvar_1_1
->prod_sel() == sel_ITUserPhylum
)) {
315 const phylumdeclaration pd
= phylum_cast
<const impl_IDtype_ITUserPhylum
*>(kc_selvar_1_1
)->phylumdeclaration_1
;
318 if ((kc_selvar_1_1
->prod_sel() == sel_ITPredefinedPhylum
)) {
320 v_report(NonFatal( FileLine( id
->file
, id
->line
), Problem1S1ID( "expected user-defined phylum instead of predefined phylum:", id
)));
324 if ((kc_selvar_1_1
->prod_sel() == sel_ITUnknown
)) {
326 v_report(NonFatal( FileLine( id
->file
, id
->line
), Problem1S1ID( "undefined phylum:", id
)));
330 { kc_no_default_in_with( "f_lookupuserdecl", __LINE__
, __FILE__
);
331 return static_cast<phylumdeclaration
>(0); }
335 { kc_no_default_in_with( "f_lookupuserdecl", __LINE__
, __FILE__
);
336 return static_cast<phylumdeclaration
>(0); }
341 phylumdeclaration
f_lookupdecl(ID id
)
343 ID kc_selvar_0_1
= phylum_cast
<ID
>(id
);
344 if ((kc_selvar_0_1
->prod_sel() == sel_Id
)) {
345 const uniqID uid
= phylum_cast
<const impl_ID_Id
*>(kc_selvar_0_1
)->uniqID_1
;
348 IDtype kc_selvar_1_1
= phylum_cast
<IDtype
>( uid
->type
);
349 if ((kc_selvar_1_1
->prod_sel() == sel_ITUserFunction
)) {
351 v_report(NonFatal( FileLine( id
->file
, id
->line
), Problem1S1ID( "expected user-defined phylum instead of user-defined function:", id
)));
355 if ((kc_selvar_1_1
->prod_sel() == sel_ITUserRView
)) {
357 v_report(NonFatal( FileLine( id
->file
, id
->line
), Problem1S1ID( "expected user-defined phylum instead of user-defined rewrite view:", id
)));
361 if ((kc_selvar_1_1
->prod_sel() == sel_ITPredefinedRView
)) {
363 v_report(NonFatal( FileLine( id
->file
, id
->line
), Problem1S1ID( "expected user-defined phylum instead of predefined rewrite view:", id
)));
367 if ((kc_selvar_1_1
->prod_sel() == sel_ITUserUView
)) {
369 v_report(NonFatal( FileLine( id
->file
, id
->line
), Problem1S1ID( "expected user-defined phylum instead of user-defined unparse view:", id
)));
373 if ((kc_selvar_1_1
->prod_sel() == sel_ITPredefinedUView
)) {
375 v_report(NonFatal( FileLine( id
->file
, id
->line
), Problem1S1ID( "expected user-defined phylum instead of predefined unparse view:", id
)));
379 if ((kc_selvar_1_1
->prod_sel() == sel_ITStorageClass
)) {
381 v_report(NonFatal( FileLine( id
->file
, id
->line
), Problem1S1ID( "expected user-defined phylum instead of user-defined storage class:", id
)));
385 if ((kc_selvar_1_1
->prod_sel() == sel_ITPredefinedStorageClass
)) {
387 v_report(NonFatal( FileLine( id
->file
, id
->line
), Problem1S1ID( "expected user-defined phylum instead of predefined storage class:", id
)));
391 if ((kc_selvar_1_1
->prod_sel() == sel_ITUserOperator
)) {
393 v_report(NonFatal( FileLine( id
->file
, id
->line
), Problem1S1ID( "expected user-defined phylum instead of user-defined operator:", id
)));
397 if ((kc_selvar_1_1
->prod_sel() == sel_ITPredefinedOperator
)) {
399 v_report(NonFatal( FileLine( id
->file
, id
->line
), Problem1S1ID( "expected user-defined phylum instead of predefined operator:", id
)));
403 if ((kc_selvar_1_1
->prod_sel() == sel_ITUserPhylum
)) {
404 const phylumdeclaration pd
= phylum_cast
<const impl_IDtype_ITUserPhylum
*>(kc_selvar_1_1
)->phylumdeclaration_1
;
407 if ((kc_selvar_1_1
->prod_sel() == sel_ITPredefinedPhylum
)) {
408 const phylumdeclaration pd
= phylum_cast
<const impl_IDtype_ITPredefinedPhylum
*>(kc_selvar_1_1
)->phylumdeclaration_1
;
411 if ((kc_selvar_1_1
->prod_sel() == sel_ITUnknown
)) {
413 v_report(NonFatal( FileLine( id
->file
, id
->line
), Problem1S1ID( "undefined phylum:", id
)));
417 { kc_no_default_in_with( "f_lookupdecl", __LINE__
, __FILE__
);
418 return static_cast<phylumdeclaration
>(0); }
422 { kc_no_default_in_with( "f_lookupdecl", __LINE__
, __FILE__
);
423 return static_cast<phylumdeclaration
>(0); }
428 argsnumbers
insert_in_argsnumbers(int i
, argsnumbers a
)
430 argsnumbers kc_selvar_0_1
= phylum_cast
<argsnumbers
>(a
);
431 if ((kc_selvar_0_1
->prod_sel() == sel_Consargsnumbers
)) {
432 const integer j
= (kc_selvar_0_1
)->integer_1
;
433 const argsnumbers ra
= (kc_selvar_0_1
)->argsnumbers_1
;
436 return Consargsnumbers( mkinteger(i
), a
);
437 else if ( i
== j
->value
)
440 return Consargsnumbers( j
, insert_in_argsnumbers( i
, ra
));
443 if ((kc_selvar_0_1
->prod_sel() == sel_Nilargsnumbers
)) {
444 return Consargsnumbers( mkinteger(i
), a
);
446 { kc_no_default_in_with( "insert_in_argsnumbers", __LINE__
, __FILE__
);
447 return static_cast<argsnumbers
>(0); }
452 void set_includefiles(includefiles ifs
, includedeclaration i
)
455 includefiles kc_fe_selvar_1
= ifs
;
458 kc_fe_selvar_1
->prod_sel() == sel_Consincludefiles
460 includefile kc_selvar_0_1
= kc_fe_selvar_1
->includefile_1
;
464 const includefile pl_includefile
= kc_selvar_0_1
;
466 assertCond((pl_includefile
->inc_type
== include_file
) || (pl_includefile
->inc_type
== include_header
));
467 pl_includefile
->inc
[pl_includefile
->inc_type
] =
468 Consincludedeclarations( i
, pl_includefile
->inc
[pl_includefile
->inc_type
] );
474 kc_fe_selvar_1
= kc_fe_selvar_1
->includefiles_1
;
481 languagenames
merge_languagenames(languagenames names
, languagenames name_list
)
483 languagenames res
=name_list
;
485 languagenames kc_fe_selvar_1
= names
;
488 kc_fe_selvar_1
->prod_sel() == sel_Conslanguagenames
490 ID kc_selvar_0_1
= kc_fe_selvar_1
->ID_1
;
493 if ((kc_selvar_0_1
->prod_sel() == sel_Id
)) {
494 const ID id
= kc_selvar_0_1
;
495 const uniqID u_id
= phylum_cast
<const impl_ID_Id
*>(kc_selvar_0_1
)->uniqID_1
;
497 if(u_id
->type
->eq(ITUnknown())) {
498 res
=Conslanguagenames(id
,res
);
499 u_id
->type
=ITLanguageName(
500 mkinteger(res
->length()-1));
504 {/* EMPTY */ /*skip: no matching pattern in foreach patterns*/}
508 kc_fe_selvar_1
= kc_fe_selvar_1
->languagenames_1
;
518 language_text_nr_used
=true;
519 return language_text_nr
;
525 if(language_text_nr_used
) {
527 language_text_nr_used
=false;
534 if(language_text_nr_used
)
535 return language_text_nr
;
537 return language_text_nr
-1;
541 ID
f_ID_of_declarator(ac_declarator d
)
543 ac_declarator kc_selvar_0_1
= phylum_cast
<ac_declarator
>(d
);
544 if ((kc_selvar_0_1
->prod_sel() == sel_AcDeclarator
)) {
545 const ac_direct_declarator dd
= phylum_cast
<const impl_ac_declarator_AcDeclarator
*>(kc_selvar_0_1
)->ac_direct_declarator_1
;
547 return f_ID_of_direct_decl( dd
);
550 { kc_no_default_in_with( "f_ID_of_declarator", __LINE__
, __FILE__
);
551 return static_cast<ID
>(0); }
556 ID
f_ID_of_fn_declarator(ac_declarator d
, fnclass fnc
)
558 ac_declarator kc_selvar_0_1
= phylum_cast
<ac_declarator
>(d
);
559 if ((kc_selvar_0_1
->prod_sel() == sel_AcDeclarator
)) {
560 const ac_direct_declarator dd
= phylum_cast
<const impl_ac_declarator_AcDeclarator
*>(kc_selvar_0_1
)->ac_direct_declarator_1
;
562 ID id
=f_ID_of_direct_decl( dd
);
564 fnclass kc_selvar_1_1
= phylum_cast
<fnclass
>(fnc
);
565 if ((kc_selvar_1_1
->prod_sel() == sel_DestructorFn
)) {
567 static int dtor_nr
=0;
569 sprintf(buf
,"destructor_%d",++dtor_nr
);
570 ID new_id
=Id(Str(mkcasestring(buf
)));
571 new_id
->file
=id
->file
;
572 new_id
->line
=id
->line
;
576 if ((kc_selvar_1_1
->prod_sel() == sel_ConstructorFn
)) {
578 static int ctor_nr
=0;
580 sprintf(buf
,"constructor_%d",++ctor_nr
);
581 ID new_id
=Id(Str(mkcasestring(buf
)));
582 new_id
->file
=id
->file
;
583 new_id
->line
=id
->line
;
593 { kc_no_default_in_with( "f_ID_of_fn_declarator", __LINE__
, __FILE__
);
594 return static_cast<ID
>(0); }
599 static ID
f_ID_of_direct_decl(ac_direct_declarator d
)
601 ac_direct_declarator kc_selvar_0_1
= phylum_cast
<ac_direct_declarator
>(d
);
602 if ((kc_selvar_0_1
->prod_sel() == sel_AcQualifiedDeclProto
)) {
603 const ac_direct_declarator a_d
= phylum_cast
<const impl_ac_direct_declarator_AcQualifiedDeclProto
*>(kc_selvar_0_1
)->ac_direct_declarator_1
;
604 return f_ID_of_direct_decl( a_d
);
606 if ((kc_selvar_0_1
->prod_sel() == sel_AcDirectDeclProto
)) {
607 const ac_direct_declarator a_d
= phylum_cast
<const impl_ac_direct_declarator_AcDirectDeclProto
*>(kc_selvar_0_1
)->ac_direct_declarator_1
;
608 return f_ID_of_direct_decl( a_d
);
610 if ((kc_selvar_0_1
->prod_sel() == sel_AcDirectDeclArray
)) {
611 const ac_direct_declarator a_d
= phylum_cast
<const impl_ac_direct_declarator_AcDirectDeclArray
*>(kc_selvar_0_1
)->ac_direct_declarator_1
;
612 return f_ID_of_direct_decl( a_d
);
614 if ((kc_selvar_0_1
->prod_sel() == sel_AcDirectDeclPack
)) {
615 const ac_declarator a_d
= phylum_cast
<const impl_ac_direct_declarator_AcDirectDeclPack
*>(kc_selvar_0_1
)->ac_declarator_1
;
616 return f_ID_of_declarator( a_d
);
618 if ((kc_selvar_0_1
->prod_sel() == sel_AcDirectDeclId
)) {
619 const ID i
= phylum_cast
<const impl_ac_direct_declarator_AcDirectDeclId
*>(kc_selvar_0_1
)->ID_1
;
629 int f_stars_of_declarator(ac_declarator d
)
631 ac_declarator kc_selvar_0_1
= phylum_cast
<ac_declarator
>(d
);
632 if ((kc_selvar_0_1
->prod_sel() == sel_AcDeclarator
)) {
633 const ac_pointer_option po
= phylum_cast
<const impl_ac_declarator_AcDeclarator
*>(kc_selvar_0_1
)->ac_pointer_option_1
;
634 return f_stars_of_ac_pointer_option( po
);
643 static int f_stars_of_ac_pointer_option(ac_pointer_option d
)
645 ac_pointer_option kc_selvar_0_1
= phylum_cast
<ac_pointer_option
>(d
);
646 if ((kc_selvar_0_1
->prod_sel() == sel_Yespointer
)) {
647 const ac_pointer p
= phylum_cast
<const impl_ac_pointer_option_Yespointer
*>(kc_selvar_0_1
)->ac_pointer_1
;
648 return f_stars_of_ac_pointer( p
);
657 static int f_stars_of_ac_pointer(ac_pointer d
)
659 ac_pointer kc_selvar_0_1
= phylum_cast
<ac_pointer
>(d
);
660 if ((kc_selvar_0_1
->prod_sel() == sel_AcPointerCons
)) {
661 const ac_pointer p
= phylum_cast
<const impl_ac_pointer_AcPointerCons
*>(kc_selvar_0_1
)->ac_pointer_1
;
662 return 1 + f_stars_of_ac_pointer( p
);
671 static bool f_is_member_fn(ac_declarator dec
)
673 ac_declarator kc_selvar_0_1
= phylum_cast
<ac_declarator
>(dec
);
674 if ((kc_selvar_0_1
->prod_sel() == sel_AcDeclarator
) && (phylum_cast
<const impl_ac_declarator_AcDeclarator
*>(kc_selvar_0_1
)->ac_direct_declarator_1
->prod_sel() == sel_AcQualifiedDeclProto
) && (phylum_cast
<const impl_ac_direct_declarator_AcQualifiedDeclProto
*>(phylum_cast
<const impl_ac_declarator_AcDeclarator
*>(kc_selvar_0_1
)->ac_direct_declarator_1
)->ac_class_qualifier_list_1
->prod_sel() == sel_Consac_class_qualifier_list
)) {
684 fnclass
f_fnclass_info(ac_declaration_specifiers ds
, casestring fn
, ac_declarator dec
)
686 ac_declaration_specifiers kc_selvar_0_1
= phylum_cast
<ac_declaration_specifiers
>(ds
);
687 if ((kc_selvar_0_1
->prod_sel() == sel_Consac_declaration_specifiers
)) {
688 const ac_declaration_specifier h
= (kc_selvar_0_1
)->ac_declaration_specifier_1
;
689 const ac_declaration_specifiers t
= (kc_selvar_0_1
)->ac_declaration_specifiers_1
;
691 if (f_static_in_ac_decl_spec( h
)) {
692 return StaticFn( fn
);
694 return f_is_member_fn(dec
)?MemberFn():f_fnclass_info( t
, fn
, dec
);
698 if ((kc_selvar_0_1
->prod_sel() == sel_Nilac_declaration_specifiers
)) {
700 assertCond(!f_is_member_fn(dec
));
705 { kc_no_default_in_with( "f_fnclass_info", __LINE__
, __FILE__
);
706 return static_cast<fnclass
>(0); }
711 fnclass
f_member_class_info(ac_declaration_specifiers ds
, casestring fn
)
713 ac_declaration_specifiers kc_selvar_0_1
= phylum_cast
<ac_declaration_specifiers
>(ds
);
714 if ((kc_selvar_0_1
->prod_sel() == sel_Consac_declaration_specifiers
)) {
715 const ac_declaration_specifier h
= (kc_selvar_0_1
)->ac_declaration_specifier_1
;
716 const ac_declaration_specifiers t
= (kc_selvar_0_1
)->ac_declaration_specifiers_1
;
718 if (f_static_in_ac_decl_spec( h
)) {
719 return StaticFn( fn
);
721 return f_member_class_info( t
, fn
);
725 if ((kc_selvar_0_1
->prod_sel() == sel_Nilac_declaration_specifiers
)) {
728 { kc_no_default_in_with( "f_member_class_info", __LINE__
, __FILE__
);
729 return static_cast<fnclass
>(0); }
734 bool f_static_in_ac_decl_specs(ac_declaration_specifiers ds
)
736 ac_declaration_specifiers kc_selvar_0_1
= phylum_cast
<ac_declaration_specifiers
>(ds
);
737 if ((kc_selvar_0_1
->prod_sel() == sel_Nilac_declaration_specifiers
)) {
740 if ((kc_selvar_0_1
->prod_sel() == sel_Consac_declaration_specifiers
)) {
741 const ac_declaration_specifier head
= (kc_selvar_0_1
)->ac_declaration_specifier_1
;
742 const ac_declaration_specifiers tail
= (kc_selvar_0_1
)->ac_declaration_specifiers_1
;
744 return f_static_in_ac_decl_spec(head
) || f_static_in_ac_decl_specs(tail
);
747 { kc_no_default_in_with( "f_static_in_ac_decl_specs", __LINE__
, __FILE__
);
748 return static_cast<bool>(0); }
753 static bool f_static_in_ac_decl_spec(ac_declaration_specifier ds
)
755 ac_declaration_specifier kc_selvar_0_1
= phylum_cast
<ac_declaration_specifier
>(ds
);
756 if ((kc_selvar_0_1
->prod_sel() == sel_AcDeclSpecTypeQual
)) {
759 if ((kc_selvar_0_1
->prod_sel() == sel_AcDeclSpecTypeSpec
)) {
762 if ((kc_selvar_0_1
->prod_sel() == sel_AcDeclSpecStorageSpec
)) {
763 const ac_storage_class_specifier a_sc
= phylum_cast
<const impl_ac_declaration_specifier_AcDeclSpecStorageSpec
*>(kc_selvar_0_1
)->ac_storage_class_specifier_1
;
764 return f_static_in_ac_stor_class( a_sc
);
766 { kc_no_default_in_with( "f_static_in_ac_decl_spec", __LINE__
, __FILE__
);
767 return static_cast<bool>(0); }
772 static bool f_static_in_ac_stor_class(ac_storage_class_specifier sc
)
774 ac_storage_class_specifier kc_selvar_0_1
= phylum_cast
<ac_storage_class_specifier
>(sc
);
775 if ((kc_selvar_0_1
->prod_sel() == sel_AcTypedef
)) {
778 if ((kc_selvar_0_1
->prod_sel() == sel_AcExtern
)) {
781 if ((kc_selvar_0_1
->prod_sel() == sel_AcStatic
)) {
784 if ((kc_selvar_0_1
->prod_sel() == sel_AcRegister
)) {
787 if ((kc_selvar_0_1
->prod_sel() == sel_AcAuto
)) {
790 { kc_no_default_in_with( "f_static_in_ac_stor_class", __LINE__
, __FILE__
);
791 return static_cast<bool>(0); }
796 ID
f_ID_of_ac_declaration_specifiers(ac_declaration_specifiers d
)
798 ac_declaration_specifiers kc_selvar_0_1
= phylum_cast
<ac_declaration_specifiers
>(d
);
799 if ((kc_selvar_0_1
->prod_sel() == sel_Consac_declaration_specifiers
)) {
800 const ac_declaration_specifier h
= (kc_selvar_0_1
)->ac_declaration_specifier_1
;
801 const ac_declaration_specifiers t
= (kc_selvar_0_1
)->ac_declaration_specifiers_1
;
803 ID tmp
= f_ID_of_ac_declaration_specifier( h
);
807 return f_ID_of_ac_declaration_specifiers( t
);
810 if ((kc_selvar_0_1
->prod_sel() == sel_Nilac_declaration_specifiers
)) {
813 { kc_no_default_in_with( "f_ID_of_ac_declaration_specifiers", __LINE__
, __FILE__
);
814 return static_cast<ID
>(0); }
819 static ID
f_ID_of_ac_declaration_specifier(ac_declaration_specifier d
)
821 ac_declaration_specifier kc_selvar_0_1
= phylum_cast
<ac_declaration_specifier
>(d
);
822 if ((kc_selvar_0_1
->prod_sel() == sel_AcDeclSpecTypeSpec
)) {
823 const ac_type_specifier t
= phylum_cast
<const impl_ac_declaration_specifier_AcDeclSpecTypeSpec
*>(kc_selvar_0_1
)->ac_type_specifier_1
;
825 return f_ID_of_ac_type_specifier( t
);
828 if ((kc_selvar_0_1
->prod_sel() == sel_AcDeclSpecTypeQual
)) {
831 if ((kc_selvar_0_1
->prod_sel() == sel_AcDeclSpecStorageSpec
)) {
834 { kc_no_default_in_with( "f_ID_of_ac_declaration_specifier", __LINE__
, __FILE__
);
835 return static_cast<ID
>(0); }
840 static ID
f_ID_of_ac_type_specifier(ac_type_specifier d
)
842 ac_type_specifier kc_selvar_0_1
= phylum_cast
<ac_type_specifier
>(d
);
843 if ((kc_selvar_0_1
->prod_sel() == sel_AcTypeSpec
)) {
844 const ID i
= phylum_cast
<const impl_ac_type_specifier_AcTypeSpec
*>(kc_selvar_0_1
)->ID_1
;
847 { kc_no_default_in_with( "f_ID_of_ac_type_specifier", __LINE__
, __FILE__
);
848 return static_cast<ID
>(0); }
853 void check_no_patternchaingroup_in_patternchain(casestring f
, int l
, patternchain a_patternchain
, const char *ctxt
)
855 patternchain kc_selvar_0_1
= phylum_cast
<patternchain
>(a_patternchain
);
856 if ((kc_selvar_0_1
->prod_sel() == sel_Nilpatternchain
)) {
859 if ((kc_selvar_0_1
->prod_sel() == sel_Conspatternchain
)) {
860 const patternchainitem h
= (kc_selvar_0_1
)->patternchainitem_1
;
861 const patternchain t
= (kc_selvar_0_1
)->patternchain_1
;
863 check_no_patternchaingroup_in_patternchain( f
, l
, t
, ctxt
);
865 patternchainitem kc_selvar_1_1
= phylum_cast
<patternchainitem
>( h
);
866 if ((kc_selvar_1_1
->prod_sel() == sel_PatternchainitemGroup
)) {
868 v_report(NonFatal( FileLine( f
, l
), Problem3S( "no pattern grouping () allowed in", ctxt
, "context." )));
871 if ((kc_selvar_1_1
->prod_sel() == sel_PatternchainitemDollarid
)) {
874 if ((kc_selvar_1_1
->prod_sel() == sel_PatternchainitemOutmost
)) {
877 kc_no_default_in_with( "check_no_patternchaingroup_in_patternchain", __LINE__
, __FILE__
);
881 kc_no_default_in_with( "check_no_patternchaingroup_in_patternchain", __LINE__
, __FILE__
);
886 void check_no_patternchaingroup_in_patternchains(casestring f
, int l
, patternchains a_patternchains
, const char *ctxt
)
888 patternchains kc_selvar_0_1
= phylum_cast
<patternchains
>(a_patternchains
);
889 if ((kc_selvar_0_1
->prod_sel() == sel_Nilpatternchains
)) {
892 if ((kc_selvar_0_1
->prod_sel() == sel_Conspatternchains
)) {
893 const patternchain h
= (kc_selvar_0_1
)->patternchain_1
;
894 const patternchains t
= (kc_selvar_0_1
)->patternchains_1
;
896 check_no_patternchaingroup_in_patternchains( f
, l
, t
, ctxt
);
897 check_no_patternchaingroup_in_patternchain( f
, l
, h
, ctxt
);
900 kc_no_default_in_with( "check_no_patternchaingroup_in_patternchains", __LINE__
, __FILE__
);
905 void check_no_patternchaingroup_or_pattern_in_patternchain(casestring f
, int l
, patternchain a_patternchain
, const char *ctxt
)
907 patternchain kc_selvar_0_1
= phylum_cast
<patternchain
>(a_patternchain
);
908 if ((kc_selvar_0_1
->prod_sel() == sel_Nilpatternchain
)) {
911 if ((kc_selvar_0_1
->prod_sel() == sel_Conspatternchain
)) {
912 const patternchainitem h
= (kc_selvar_0_1
)->patternchainitem_1
;
913 const patternchain t
= (kc_selvar_0_1
)->patternchain_1
;
915 check_no_patternchaingroup_or_pattern_in_patternchain( f
, l
, t
, ctxt
);
917 patternchainitem kc_selvar_1_1
= phylum_cast
<patternchainitem
>( h
);
918 if ((kc_selvar_1_1
->prod_sel() == sel_PatternchainitemGroup
)) {
920 v_report(NonFatal( FileLine( f
, l
), Problem3S( "no pattern grouping () allowed in", ctxt
, "context." )));
923 if ((kc_selvar_1_1
->prod_sel() == sel_PatternchainitemDollarid
)) {
926 if ((kc_selvar_1_1
->prod_sel() == sel_PatternchainitemOutmost
)) {
927 const outmostpattern op
= phylum_cast
<const impl_patternchainitem_PatternchainitemOutmost
*>(kc_selvar_1_1
)->outmostpattern_1
;
932 kc_no_default_in_with( "check_no_patternchaingroup_or_pattern_in_patternchain", __LINE__
, __FILE__
);
936 kc_no_default_in_with( "check_no_patternchaingroup_or_pattern_in_patternchain", __LINE__
, __FILE__
);
941 void check_no_patternchaingroup_or_pattern_in_patternchains(casestring f
, int l
, patternchains a_patternchains
, const char *ctxt
)
943 patternchains kc_selvar_0_1
= phylum_cast
<patternchains
>(a_patternchains
);
944 if ((kc_selvar_0_1
->prod_sel() == sel_Nilpatternchains
)) {
947 if ((kc_selvar_0_1
->prod_sel() == sel_Conspatternchains
)) {
948 const patternchain h
= (kc_selvar_0_1
)->patternchain_1
;
949 const patternchains t
= (kc_selvar_0_1
)->patternchains_1
;
951 check_no_patternchaingroup_or_pattern_in_patternchains( f
, l
, t
, ctxt
);
952 check_no_patternchaingroup_or_pattern_in_patternchain( f
, l
, h
, ctxt
);
955 kc_no_default_in_with( "check_no_patternchaingroup_or_pattern_in_patternchains", __LINE__
, __FILE__
);
960 patternchains
syn_patternchains_fileline(patternchains a_patternchains
, casestring a_file
, int a_line
)
962 patternchains kc_selvar_0_1
= phylum_cast
<patternchains
>(a_patternchains
);
963 if ((kc_selvar_0_1
->prod_sel() == sel_Nilpatternchains
)) {
965 kc_selvar_0_1
->file
= a_file
;
966 kc_selvar_0_1
->line
= a_line
;
967 return a_patternchains
;
970 if ((kc_selvar_0_1
->prod_sel() == sel_Conspatternchains
)) {
971 const patternchain h
= (kc_selvar_0_1
)->patternchain_1
;
972 const patternchains t
= (kc_selvar_0_1
)->patternchains_1
;
974 syn_patternchains_fileline( t
, a_file
, a_line
);
975 syn_patternchain_fileline( h
, t
->file
, t
->line
);
976 kc_selvar_0_1
->file
= h
->file
;
977 kc_selvar_0_1
->line
= h
->line
;
978 return a_patternchains
;
981 { kc_no_default_in_with( "syn_patternchains_fileline", __LINE__
, __FILE__
);
982 return static_cast<patternchains
>(0); }
987 patternchain
syn_patternchain_fileline(patternchain a_patternchain
, casestring a_file
, int a_line
)
989 patternchain kc_selvar_0_1
= phylum_cast
<patternchain
>(a_patternchain
);
990 if ((kc_selvar_0_1
->prod_sel() == sel_Nilpatternchain
)) {
992 kc_selvar_0_1
->file
= a_file
;
993 kc_selvar_0_1
->line
= a_line
;
994 return a_patternchain
;
997 if ((kc_selvar_0_1
->prod_sel() == sel_Conspatternchain
)) {
998 const patternchainitem h
= (kc_selvar_0_1
)->patternchainitem_1
;
999 const patternchain t
= (kc_selvar_0_1
)->patternchain_1
;
1001 syn_patternchain_fileline( t
, a_file
, a_line
);
1002 kc_selvar_0_1
->file
= h
->file
;
1003 kc_selvar_0_1
->line
= h
->line
;
1004 return a_patternchain
;
1007 { kc_no_default_in_with( "syn_patternchain_fileline", __LINE__
, __FILE__
);
1008 return static_cast<patternchain
>(0); }
1013 withexpressions
pf_gen_foreachwith_vars(idCexpressions a_idCexpressions
)
1015 static int nrof_foreach_occ
= 0;
1017 return t_pf_gen_foreachwith_vars(a_idCexpressions
, nrof_foreach_occ
, a_idCexpressions
->length(), false);
1021 withexpressions
pf_gen_foreachwith_listvars(idCexpressions a_idCexpressions
)
1023 static int nrof_foreach_occ
= 0;
1025 return t_pf_gen_foreachwith_vars(a_idCexpressions
, nrof_foreach_occ
, a_idCexpressions
->length(), true);
1029 withexpressions
t_pf_gen_foreachwith_vars(idCexpressions a_idCexpressions
, int occ
, int nr
, bool listvars
)
1031 idCexpressions kc_selvar_0_1
= phylum_cast
<idCexpressions
>(a_idCexpressions
);
1032 if ((kc_selvar_0_1
->prod_sel() == sel_ConsidCexpressions
) && ((kc_selvar_0_1
)->idCexpression_1
->prod_sel() == sel_IdCexpression
)) {
1033 const idCexpression ice
= (kc_selvar_0_1
)->idCexpression_1
;
1034 const ID id
= phylum_cast
<const impl_idCexpression_IdCexpression
*>((kc_selvar_0_1
)->idCexpression_1
)->ID_1
;
1035 const Cexpression ce
= phylum_cast
<const impl_idCexpression_IdCexpression
*>((kc_selvar_0_1
)->idCexpression_1
)->Cexpression_1
;
1036 const idCexpressions t
= (kc_selvar_0_1
)->idCexpressions_1
;
1043 sprintf(tmp
, "kc_fe_withlistvar_%d_%d", occ
, nr
);
1045 sprintf(tmp
, "kc_fe_withvar_%d_%d", occ
, nr
);
1046 w_id
= Id(Str(mkcasestring(tmp
)));
1047 w
= WEVariable(w_id
);
1048 w
->type
= (listvars
? id
: f_listelementphylum(id
));
1052 ws
= Conswithexpressions(
1054 t_pf_gen_foreachwith_vars( t
, occ
, nr
-1, listvars
));
1060 if ((kc_selvar_0_1
->prod_sel() == sel_NilidCexpressions
)) {
1061 return Nilwithexpressions();
1063 { kc_no_default_in_with( "t_pf_gen_foreachwith_vars", __LINE__
, __FILE__
);
1064 return static_cast<withexpressions
>(0); }
1069 ac_class_qualifier_list
f_check_build_qualifier_tail(ac_class_qualifier_help_list qh_list
)
1071 ac_class_qualifier_help_list kc_selvar_0_1
= phylum_cast
<ac_class_qualifier_help_list
>(qh_list
);
1072 if ((kc_selvar_0_1
->prod_sel() == sel_Consac_class_qualifier_help_list
) && ((kc_selvar_0_1
)->ac_direct_declarator_1
->prod_sel() == sel_AcOperatorDeclId
) && (phylum_cast
<const impl_ac_direct_declarator_AcOperatorDeclId
*>((kc_selvar_0_1
)->ac_direct_declarator_1
)->ac_operator_name_1
->prod_sel() == sel_AcOperatorName
)) {
1073 const ac_operator_name op
= phylum_cast
<const impl_ac_direct_declarator_AcOperatorDeclId
*>((kc_selvar_0_1
)->ac_direct_declarator_1
)->ac_operator_name_1
;
1074 const casestring str
= phylum_cast
<const impl_ac_operator_name_AcOperatorName
*>(phylum_cast
<const impl_ac_direct_declarator_AcOperatorDeclId
*>((kc_selvar_0_1
)->ac_direct_declarator_1
)->ac_operator_name_1
)->casestring_1
;
1076 v_report(NonFatal( FileLine( op
->file
, op
->line
), Problem3S( "operator ",str
->name
, "is not a type name" )));
1077 return Nilac_class_qualifier_list();
1080 if ((kc_selvar_0_1
->prod_sel() == sel_Consac_class_qualifier_help_list
) && ((kc_selvar_0_1
)->ac_direct_declarator_1
->prod_sel() == sel_AcDirectDeclId
)) {
1081 const ID id
= phylum_cast
<const impl_ac_direct_declarator_AcDirectDeclId
*>((kc_selvar_0_1
)->ac_direct_declarator_1
)->ID_1
;
1082 const ac_class_qualifier_help_list tail
= (kc_selvar_0_1
)->ac_class_qualifier_help_list_1
;
1084 return Consac_class_qualifier_list(id
,f_check_build_qualifier_tail(tail
));
1087 if ((kc_selvar_0_1
->prod_sel() == sel_Nilac_class_qualifier_help_list
)) {
1088 return Nilac_class_qualifier_list();
1090 { kc_no_default_in_with( "f_check_build_qualifier_tail", __LINE__
, __FILE__
);
1091 return static_cast<ac_class_qualifier_list
>(0); }
1096 ac_class_qualifier_list
f_check_build_qualifier(ac_class_qualifier_help_list qh_list
, ac_direct_declarator
&decl
)
1098 ac_class_qualifier_help_list kc_selvar_0_1
= phylum_cast
<ac_class_qualifier_help_list
>(qh_list
);
1099 if ((kc_selvar_0_1
->prod_sel() == sel_Consac_class_qualifier_help_list
)) {
1100 const ac_direct_declarator dd
= (kc_selvar_0_1
)->ac_direct_declarator_1
;
1101 const ac_class_qualifier_help_list tail
= (kc_selvar_0_1
)->ac_class_qualifier_help_list_1
;
1104 return f_check_build_qualifier_tail(tail
);
1108 assertCond(false); return NULL
;
1114 ID
subst_name(ID n
, casestring oldname
, casestring newname
)
1116 ID kc_selvar_0_1
= phylum_cast
<ID
>(n
);
1117 if ((kc_selvar_0_1
->prod_sel() == sel_Id
) && (phylum_cast
<const impl_ID_Id
*>(kc_selvar_0_1
)->uniqID_1
->prod_sel() == sel_Str
)) {
1118 const casestring s
= phylum_cast
<const impl_uniqID_Str
*>(phylum_cast
<const impl_ID_Id
*>(kc_selvar_0_1
)->uniqID_1
)->casestring_1
;
1120 if (s
->eq(oldname
)) {
1121 ID tmp
= Id(Str(newname
));
1122 tmp
->file
= n
->file
;
1123 tmp
->line
= n
->line
;
1129 { kc_no_default_in_with( "subst_name", __LINE__
, __FILE__
);
1130 return static_cast<ID
>(0); }