/* translation of file "../parse.k" */ /* generated by: * @(#)$Author: Kimwitu version: V4_6 (c) 1990-1996 University of Twente $ */ #define KC_FUNCTIONS_parse #define KIMW_FUNCTIONS_parse /* for backwards compatibility */ /* define our own macro if we have a 'standard' (ansi) C(++) compiler */ #ifndef KC_NO_STDC # if defined(__STDC__) || defined(__cplusplus) || defined(_WIN32) # define KC_STDC # endif #endif #include #ifdef KC_STDC # include #endif #include "k.h" /* included stuff */ #line 2 "../parse.k" /* * The Termprocessor Kimwitu * * Copyright (c) 1991 University of Twente, Dept TIOS. * All rights reserved. * */ #line 29 "parse.c" #line 14 "../parse.k" #if ! (defined(lint) || defined(SABER) || defined(CODECENTER)) static char parse_kAccesSid[] = "@(#)$Id: parse.k,v 1.18 1998/01/27 16:57:25 belinfan Rel $"; #endif #line 35 "parse.c" #line 43 "../parse.k" int pg_lineno = 1; /* global line # */ int pg_column = 0; /* global column # */ int pg_charpos = 0; /* global charpos # */ casestring pg_filename; /* global file name */ int pg_no_of_arguments; /* no_of_arguments */ phylumdeclarations Thephylumdeclarations; /* global phylumdecls */ rwdeclarations Therwdeclarations; /* global rw-decls */ fndeclarations Thefndeclarations; /* fn-decls for the file being parsed */ fnfiles Thefnfiles; /* global fn-decls */ includefiles Theincludefiles; /* global incl-decls */ unparsedeclarations Theunparsedeclarations; /* global unp-decls */ argsnumbers Theargsnumbers; /* global list of argsnumbers */ viewnames Theuviewnames; /* global list of u-viewnames */ viewnames Therviewnames; /* global list of r-viewnames */ storageclasses Thestorageclasses; /* global list of storageclasses */ boolean pg_uviewshavebeendefined; /* global indication */ boolean pg_rviewshavebeendefined; /* global indication */ boolean pg_storageclasseshavebeendefined; /* global indication */ #line 56 "parse.c" #line 66 "../parse.k" #include "util.h" #line 60 "parse.c" #line 146 "../parse.k" #include "extocc.h" #line 64 "parse.c" #line 151 "../parse.k" #ifndef MALLOC # define MALLOC emalloc #endif #ifndef kc_str_conc2 # include # define kc_str_conc2(a,b) (char*)strcat(strcpy((char *) MALLOC((kc_size_t)(strlen(a) + strlen(b) +1)), a), b) #endif #line 74 "parse.c" /* end included stuff */ #include "parse.h" static ID f_ID_of_direct_decl KC__P((ac_direct_declarator d)); static int f_stars_of_ac_pointer_option KC__P((ac_pointer_option d)); static int f_stars_of_ac_pointer KC__P((ac_pointer d)); static boolean f_static_in_ac_decl_spec KC__P((ac_declaration_specifier ds)); static boolean f_static_in_ac_stor_class KC__P((ac_storage_class_specifier sc)); static ID f_ID_of_ac_declaration_specifier KC__P((ac_declaration_specifier d)); static ID f_ID_of_ac_type_specifier KC__P((ac_type_specifier d)); phylumdeclarations mergephylumdeclarations #ifdef KC_USE_PROTOTYPES (phylumdeclaration pd, phylumdeclarations pds) #else (pd, pds) phylumdeclaration pd; phylumdeclarations pds; #endif #line 71 "../parse.k" { two_phyla tp; { #line 73 "../parse.k" phylumdeclaration kc_selvar_0_1 = pd ; #line 73 "../parse.k" /*SUPPRESS 622*/ assert_phylumdeclaration(kc_selvar_0_1, "with_expression (1)"); #line 104 "parse.c" if (( kc_selvar_0_1->prod_sel == sel_PhylumDeclaration)) { #line 74 "../parse.k" ID pd_id = kc_selvar_0_1->u.PhylumDeclaration.ID_1; #line 74 "../parse.k" storageoption pd_stopt = kc_selvar_0_1->u.PhylumDeclaration.storageoption_1; #line 74 "../parse.k" productionblock pd_pb = kc_selvar_0_1->u.PhylumDeclaration.productionblock_1; #line 74 "../parse.k" Ccode_option pd_ccopt = kc_selvar_0_1->u.PhylumDeclaration.Ccode_option_1; #line 74 "../parse.k" phylumdeclaration fpd = f_lookupuserdecl( pd_id ); if (!fpd) { v_add( pd_id ); return Consphylumdeclarations( pd, pds ); } else if ( pd == fpd ) { if ( f_added( pd_id ) ) { return pds; } else { v_add( pd_id ); return Consphylumdeclarations( pd, pds ); } } else { { #line 87 "../parse.k" phylumdeclaration kc_selvar_1_1 = fpd ; #line 87 "../parse.k" /*SUPPRESS 622*/ assert_phylumdeclaration(kc_selvar_1_1, "with_expression (1)"); #line 137 "parse.c" if (( kc_selvar_1_1->prod_sel == sel_PhylumDeclaration)) { #line 88 "../parse.k" ID fpd_id = kc_selvar_1_1->u.PhylumDeclaration.ID_1; #line 88 "../parse.k" storageoption fpd_stopt = kc_selvar_1_1->u.PhylumDeclaration.storageoption_1; #line 88 "../parse.k" productionblock fpd_pb = kc_selvar_1_1->u.PhylumDeclaration.productionblock_1; #line 88 "../parse.k" Ccode_option fpd_ccopt = kc_selvar_1_1->u.PhylumDeclaration.Ccode_option_1; #line 88 "../parse.k" { #line 89 "../parse.k" two_phyla kc_selvar_2_1 = tp = TwoStorageoption( pd_stopt, fpd_stopt ) ; #line 89 "../parse.k" /*SUPPRESS 622*/ assert_two_phyla(kc_selvar_2_1, "with_expression (1)"); #line 158 "parse.c" if (( kc_selvar_2_1->prod_sel == sel_TwoStorageoption) && ( kc_selvar_2_1->u.TwoStorageoption.storageoption_1->prod_sel == sel_PositiveStorageOption) && ( kc_selvar_2_1->u.TwoStorageoption.storageoption_2->prod_sel == sel_NegativeStorageOption) && (eq_ID( kc_selvar_2_1->u.TwoStorageoption.storageoption_2->u.NegativeStorageOption.ID_1, kc_selvar_2_1->u.TwoStorageoption.storageoption_1->u.PositiveStorageOption.ID_1))) { #line 97 "../parse.k" ID id = kc_selvar_2_1->u.TwoStorageoption.storageoption_1->u.PositiveStorageOption.ID_1; #line 97 "../parse.k" v_report(NonFatal( FileLine( id->file, id->line ), Problem1S1storageoption1S1ID( "storage option mismatch ( declared as ", fpd_stopt, ") for phylum", fpd_id ))); #line 166 "parse.c" } else if (( kc_selvar_2_1->prod_sel == sel_TwoStorageoption) && ( kc_selvar_2_1->u.TwoStorageoption.storageoption_1->prod_sel == sel_NegativeStorageOption) && ( kc_selvar_2_1->u.TwoStorageoption.storageoption_2->prod_sel == sel_PositiveStorageOption) && (eq_ID( kc_selvar_2_1->u.TwoStorageoption.storageoption_2->u.PositiveStorageOption.ID_1, kc_selvar_2_1->u.TwoStorageoption.storageoption_1->u.NegativeStorageOption.ID_1))) { #line 94 "../parse.k" ID id = kc_selvar_2_1->u.TwoStorageoption.storageoption_1->u.NegativeStorageOption.ID_1; #line 94 "../parse.k" v_report(NonFatal( FileLine( id->file, id->line ), Problem1S1storageoption1S1ID( "storage option mismatch ( declared as ", fpd_stopt, ") for phylum", fpd_id ))); #line 175 "parse.c" } else if (( kc_selvar_2_1->prod_sel == sel_TwoStorageoption) && ( kc_selvar_2_1->u.TwoStorageoption.storageoption_1->prod_sel == sel_PositiveStorageOption) && ( kc_selvar_2_1->u.TwoStorageoption.storageoption_2->prod_sel == sel_PositiveStorageOption) && (eq_ID( kc_selvar_2_1->u.TwoStorageoption.storageoption_2->u.PositiveStorageOption.ID_1, kc_selvar_2_1->u.TwoStorageoption.storageoption_1->u.PositiveStorageOption.ID_1))) { #line 93 "../parse.k" ID id = kc_selvar_2_1->u.TwoStorageoption.storageoption_1->u.PositiveStorageOption.ID_1; #line 93 "../parse.k" KC_LINTUSE(id); #line 182 "parse.c" } else if (( kc_selvar_2_1->prod_sel == sel_TwoStorageoption) && ( kc_selvar_2_1->u.TwoStorageoption.storageoption_1->prod_sel == sel_NegativeStorageOption) && ( kc_selvar_2_1->u.TwoStorageoption.storageoption_2->prod_sel == sel_NegativeStorageOption) && (eq_ID( kc_selvar_2_1->u.TwoStorageoption.storageoption_2->u.NegativeStorageOption.ID_1, kc_selvar_2_1->u.TwoStorageoption.storageoption_1->u.NegativeStorageOption.ID_1))) { #line 92 "../parse.k" ID id = kc_selvar_2_1->u.TwoStorageoption.storageoption_1->u.NegativeStorageOption.ID_1; #line 92 "../parse.k" KC_LINTUSE(id); #line 189 "parse.c" } else if (( kc_selvar_2_1->prod_sel == sel_TwoStorageoption) && ( kc_selvar_2_1->u.TwoStorageoption.storageoption_1->prod_sel == sel_NoStorageOption)) { #line 91 "../parse.k" /*EMPTY*/ #line 194 "parse.c" } else if (( kc_selvar_2_1->prod_sel == sel_TwoStorageoption) && ( kc_selvar_2_1->u.TwoStorageoption.storageoption_2->prod_sel == sel_NoStorageOption)) { #line 90 "../parse.k" fpd->u.PhylumDeclaration.storageoption_1 = pd_stopt; #line 199 "parse.c" } else if (( kc_selvar_2_1->prod_sel == sel_TwoStorageoption)) { #line 100 "../parse.k" v_report(NonFatal( FileLine( pd_id->file, pd_id->line ), Problem1S1storageoption1S1ID( "storage option mismatch ( declared as ", fpd_stopt, ") for phylum", fpd_id ))); #line 209 "parse.c" } else { kc_no_default_in_with( "mergephylumdeclarations", __LINE__, __FILE__ ); return (phylumdeclarations)0; } } #line 107 "../parse.k" free_two_phyla( tp, False ); { #line 108 "../parse.k" two_phyla kc_selvar_2_1 = tp = TwoProductionblock( pd_pb, fpd_pb ) ; #line 108 "../parse.k" /*SUPPRESS 622*/ assert_two_phyla(kc_selvar_2_1, "with_expression (1)"); #line 225 "parse.c" if (( kc_selvar_2_1->prod_sel == sel_TwoProductionblock) && ( kc_selvar_2_1->u.TwoProductionblock.productionblock_1->prod_sel == sel_NonlistAlternatives) && ( kc_selvar_2_1->u.TwoProductionblock.productionblock_2->prod_sel == sel_NonlistAlternatives)) { #line 120 "../parse.k" alternatives pd_pb_a = kc_selvar_2_1->u.TwoProductionblock.productionblock_1->u.NonlistAlternatives.alternatives_1; #line 120 "../parse.k" alternatives fpd_pb_a = kc_selvar_2_1->u.TwoProductionblock.productionblock_2->u.NonlistAlternatives.alternatives_1; #line 120 "../parse.k" fpd_pb->u.NonlistAlternatives.alternatives_1 = concat_alternatives( pd_pb_a, fpd_pb_a ); #line 235 "parse.c" } else if (( kc_selvar_2_1->prod_sel == sel_TwoProductionblock) && ( kc_selvar_2_1->u.TwoProductionblock.productionblock_1->prod_sel == sel_NonlistAlternatives) && ( kc_selvar_2_1->u.TwoProductionblock.productionblock_2->prod_sel == sel_Emptyproductionblock)) { #line 119 "../parse.k" fpd->u.PhylumDeclaration.productionblock_1 = pd_pb; #line 240 "parse.c" } else if (( kc_selvar_2_1->prod_sel == sel_TwoProductionblock) && ( kc_selvar_2_1->u.TwoProductionblock.productionblock_1->prod_sel == sel_PredefinedAlternatives) && ( kc_selvar_2_1->u.TwoProductionblock.productionblock_2->prod_sel == sel_Emptyproductionblock)) { #line 115 "../parse.k" fpd->u.PhylumDeclaration.productionblock_1 = pd_pb; #line 245 "parse.c" } else if (( kc_selvar_2_1->prod_sel == sel_TwoProductionblock) && ( kc_selvar_2_1->u.TwoProductionblock.productionblock_1->prod_sel == sel_ListAlternatives) && ( kc_selvar_2_1->u.TwoProductionblock.productionblock_2->prod_sel == sel_Emptyproductionblock)) { #line 111 "../parse.k" fpd->u.PhylumDeclaration.productionblock_1 = pd_pb; #line 250 "parse.c" } else if (( kc_selvar_2_1->prod_sel == sel_TwoProductionblock) && ( kc_selvar_2_1->u.TwoProductionblock.productionblock_1->prod_sel == sel_Emptyproductionblock) && ( kc_selvar_2_1->u.TwoProductionblock.productionblock_2->prod_sel == sel_Emptyproductionblock)) { #line 109 "../parse.k" /*EMPTY*/ #line 255 "parse.c" } else if (( kc_selvar_2_1->prod_sel == sel_TwoProductionblock) && ( kc_selvar_2_1->u.TwoProductionblock.productionblock_1->prod_sel == sel_NonlistAlternatives)) { #line 123 "../parse.k" v_report(NonFatal( FileLine( pd_id->file, pd_id->line ), Problem1S1ID( "production block mismatch: trying to extend phylum", pd_id ))); #line 262 "parse.c" } else if (( kc_selvar_2_1->prod_sel == sel_TwoProductionblock) && ( kc_selvar_2_1->u.TwoProductionblock.productionblock_1->prod_sel == sel_PredefinedAlternatives)) { #line 116 "../parse.k" v_report(NonFatal( FileLine( pd_id->file, pd_id->line ), Problem1S1ID( "production block mismatch: trying to predefine phylum", pd_id ))); #line 269 "parse.c" } else if (( kc_selvar_2_1->prod_sel == sel_TwoProductionblock) && ( kc_selvar_2_1->u.TwoProductionblock.productionblock_1->prod_sel == sel_ListAlternatives)) { #line 112 "../parse.k" v_report(NonFatal( FileLine( pd_id->file, pd_id->line ), Problem1S1ID( "production block mismatch: trying to redefine list phylum", pd_id ))); #line 276 "parse.c" } else if (( kc_selvar_2_1->prod_sel == sel_TwoProductionblock) && ( kc_selvar_2_1->u.TwoProductionblock.productionblock_1->prod_sel == sel_Emptyproductionblock)) { #line 110 "../parse.k" /*EMPTY*/ #line 281 "parse.c" } else { kc_no_default_in_with( "mergephylumdeclarations", __LINE__, __FILE__ ); return (phylumdeclarations)0; } } #line 127 "../parse.k" free_two_phyla( tp, False ); { #line 128 "../parse.k" two_phyla kc_selvar_2_1 = tp = TwoCcode_option( pd_ccopt, fpd_ccopt ) ; #line 128 "../parse.k" /*SUPPRESS 622*/ assert_two_phyla(kc_selvar_2_1, "with_expression (1)"); #line 297 "parse.c" if (( kc_selvar_2_1->prod_sel == sel_TwoCcode_option) && ( kc_selvar_2_1->u.TwoCcode_option.Ccode_option_1->prod_sel == sel_CcodeOption) && ( kc_selvar_2_1->u.TwoCcode_option.Ccode_option_2->prod_sel == sel_CcodeOption)) { #line 129 "../parse.k" attributes pd_ccopt_attr = kc_selvar_2_1->u.TwoCcode_option.Ccode_option_1->u.CcodeOption.attributes_1; #line 129 "../parse.k" Ctexts pd_ccopt_ct = kc_selvar_2_1->u.TwoCcode_option.Ccode_option_1->u.CcodeOption.Ctexts_1; #line 129 "../parse.k" attributes fpd_ccopt_attr = kc_selvar_2_1->u.TwoCcode_option.Ccode_option_2->u.CcodeOption.attributes_1; #line 129 "../parse.k" Ctexts fpd_ccopt_ct = kc_selvar_2_1->u.TwoCcode_option.Ccode_option_2->u.CcodeOption.Ctexts_1; #line 129 "../parse.k" fpd->u.PhylumDeclaration.Ccode_option_1 = CcodeOption( concat_attributes( pd_ccopt_attr, fpd_ccopt_attr), concat_Ctexts( pd_ccopt_ct, fpd_ccopt_ct )); #line 311 "parse.c" } else { kc_no_default_in_with( "mergephylumdeclarations", __LINE__, __FILE__ ); return (phylumdeclarations)0; } } #line 133 "../parse.k" free_two_phyla( tp, False ); #line 319 "parse.c" } else { kc_no_default_in_with( "mergephylumdeclarations", __LINE__, __FILE__ ); return (phylumdeclarations)0; } } #line 136 "../parse.k" return pds; } #line 327 "parse.c" } else { kc_no_default_in_with( "mergephylumdeclarations", __LINE__, __FILE__ ); return (phylumdeclarations)0; } } #line 137 "../parse.k" #line 137 "../parse.k" } #line 336 "parse.c" alternatives makeListAlternatives #ifdef KC_USE_PROTOTYPES (ID listphylum, ID elementphylum) #else (listphylum, elementphylum) ID listphylum; ID elementphylum; #endif #line 166 "../parse.k" { ID Nil_id, Cons_id; alternative Nil_alternative, Cons_alternative; Nil_id = Id( Str( mkcasestring( kc_str_conc2("Nil",f_strofID(listphylum))))); Cons_id = Id( Str( mkcasestring( kc_str_conc2("Cons",f_strofID(listphylum))))); Nil_id->line = elementphylum->line; Nil_id->file = elementphylum->file; Cons_id->line = elementphylum->line; Cons_id->file = elementphylum->file; Nil_alternative = Alternative( Nil_id, Nilarguments() ); Cons_alternative = Alternative( Cons_id, Consarguments( listphylum, Consarguments( elementphylum, Nilarguments() ) ) ); v_extendoccur( Nil_id, ITUserOperator( Nil_alternative, listphylum ) ); v_extendoccur( Cons_id, ITUserOperator( Cons_alternative, listphylum ) ); return Consalternatives( Cons_alternative, Consalternatives( Nil_alternative, Nilalternatives() ) ); #line 180 "../parse.k" } #line 363 "parse.c" char *f_strofID #ifdef KC_USE_PROTOTYPES (ID id) #else (id) ID id; #endif #line 185 "../parse.k" { { #line 186 "../parse.k" ID kc_selvar_0_1 = id ; #line 186 "../parse.k" /*SUPPRESS 622*/ assert_ID(kc_selvar_0_1, "with_expression (1)"); #line 382 "parse.c" if (( kc_selvar_0_1->prod_sel == sel_Id) && ( kc_selvar_0_1->u.Id.uniqID_1->prod_sel == sel_Str)) { #line 187 "../parse.k" casestring cs = kc_selvar_0_1->u.Id.uniqID_1->u.Str.casestring_1; #line 187 "../parse.k" return cs->name; #line 388 "parse.c" } else { kc_no_default_in_with( "f_strofID", __LINE__, __FILE__ ); return (char*)0; } } #line 189 "../parse.k" #line 189 "../parse.k" } #line 397 "parse.c" phylumdeclaration f_lookupuserdecl #ifdef KC_USE_PROTOTYPES (ID id) #else (id) ID id; #endif #line 194 "../parse.k" { { #line 195 "../parse.k" ID kc_selvar_0_1 = id ; #line 195 "../parse.k" /*SUPPRESS 622*/ assert_ID(kc_selvar_0_1, "with_expression (1)"); #line 416 "parse.c" if (( kc_selvar_0_1->prod_sel == sel_Id)) { #line 196 "../parse.k" uniqID uid = kc_selvar_0_1->u.Id.uniqID_1; #line 196 "../parse.k" { #line 197 "../parse.k" IDtype kc_selvar_1_1 = uid->type ; #line 197 "../parse.k" /*SUPPRESS 622*/ assert_IDtype(kc_selvar_1_1, "with_expression (1)"); #line 431 "parse.c" if (( kc_selvar_1_1->prod_sel == sel_ITUserFunction)) { #line 240 "../parse.k" v_report(NonFatal( FileLine( id->file, id->line ), Problem1S1ID( "expected user-defined phylum instead of user-defined function:", id ))); return 0; #line 438 "parse.c" } else if (( kc_selvar_1_1->prod_sel == sel_ITUserRView)) { #line 236 "../parse.k" v_report(NonFatal( FileLine( id->file, id->line ), Problem1S1ID( "expected user-defined phylum instead of user-defined rewrite view:", id ))); return 0; #line 446 "parse.c" } else if (( kc_selvar_1_1->prod_sel == sel_ITPredefinedRView)) { #line 232 "../parse.k" v_report(NonFatal( FileLine( id->file, id->line ), Problem1S1ID( "expected user-defined phylum instead of predefined rewrite view:", id ))); return 0; #line 454 "parse.c" } else if (( kc_selvar_1_1->prod_sel == sel_ITUserUView)) { #line 228 "../parse.k" v_report(NonFatal( FileLine( id->file, id->line ), Problem1S1ID( "expected user-defined phylum instead of user-defined unparse view:", id ))); return 0; #line 462 "parse.c" } else if (( kc_selvar_1_1->prod_sel == sel_ITPredefinedUView)) { #line 224 "../parse.k" v_report(NonFatal( FileLine( id->file, id->line ), Problem1S1ID( "expected user-defined phylum instead of predefined unparse view:", id ))); return 0; #line 470 "parse.c" } else if (( kc_selvar_1_1->prod_sel == sel_ITStorageClass)) { #line 220 "../parse.k" v_report(NonFatal( FileLine( id->file, id->line ), Problem1S1ID( "expected user-defined phylum instead of user-defined storage class:", id ))); return 0; #line 478 "parse.c" } else if (( kc_selvar_1_1->prod_sel == sel_ITPredefinedStorageClass)) { #line 216 "../parse.k" v_report(NonFatal( FileLine( id->file, id->line ), Problem1S1ID( "expected user-defined phylum instead of predefined storage class:", id ))); return 0; #line 486 "parse.c" } else if (( kc_selvar_1_1->prod_sel == sel_ITUserOperator)) { #line 212 "../parse.k" v_report(NonFatal( FileLine( id->file, id->line ), Problem1S1ID( "expected user-defined phylum instead of user-defined operator:", id ))); return 0; #line 494 "parse.c" } else if (( kc_selvar_1_1->prod_sel == sel_ITPredefinedOperator)) { #line 208 "../parse.k" v_report(NonFatal( FileLine( id->file, id->line ), Problem1S1ID( "expected user-defined phylum instead of predefined operator:", id ))); return 0; #line 502 "parse.c" } else if (( kc_selvar_1_1->prod_sel == sel_ITUserPhylum)) { #line 207 "../parse.k" phylumdeclaration pd = kc_selvar_1_1->u.ITUserPhylum.phylumdeclaration_1; #line 207 "../parse.k" return pd; #line 509 "parse.c" } else if (( kc_selvar_1_1->prod_sel == sel_ITPredefinedPhylum)) { #line 203 "../parse.k" v_report(NonFatal( FileLine( id->file, id->line ), Problem1S1ID( "expected user-defined phylum instead of predefined phylum:", id ))); return 0; #line 517 "parse.c" } else if (( kc_selvar_1_1->prod_sel == sel_ITPredefinedBigatomPhylum)) { #line 203 "../parse.k" v_report(NonFatal( FileLine( id->file, id->line ), Problem1S1ID( "expected user-defined phylum instead of predefined phylum:", id ))); return 0; #line 525 "parse.c" } else if (( kc_selvar_1_1->prod_sel == sel_ITUnknown)) { #line 198 "../parse.k" v_report(NonFatal( FileLine( id->file, id->line ), Problem1S1ID( "undefined phylum:", id ))); return 0; #line 533 "parse.c" } else { kc_no_default_in_with( "f_lookupuserdecl", __LINE__, __FILE__ ); return (phylumdeclaration)0; } } #line 244 "../parse.k" #line 540 "parse.c" } else { kc_no_default_in_with( "f_lookupuserdecl", __LINE__, __FILE__ ); return (phylumdeclaration)0; } } #line 244 "../parse.k" #line 244 "../parse.k" } #line 549 "parse.c" phylumdeclaration f_lookupdecl #ifdef KC_USE_PROTOTYPES (ID id) #else (id) ID id; #endif #line 247 "../parse.k" { { #line 248 "../parse.k" ID kc_selvar_0_1 = id ; #line 248 "../parse.k" /*SUPPRESS 622*/ assert_ID(kc_selvar_0_1, "with_expression (1)"); #line 568 "parse.c" if (( kc_selvar_0_1->prod_sel == sel_Id)) { #line 249 "../parse.k" uniqID uid = kc_selvar_0_1->u.Id.uniqID_1; #line 249 "../parse.k" { #line 250 "../parse.k" IDtype kc_selvar_1_1 = uid->type ; #line 250 "../parse.k" /*SUPPRESS 622*/ assert_IDtype(kc_selvar_1_1, "with_expression (1)"); #line 583 "parse.c" if (( kc_selvar_1_1->prod_sel == sel_ITUserFunction)) { #line 290 "../parse.k" v_report(NonFatal( FileLine( id->file, id->line ), Problem1S1ID( "expected user-defined phylum instead of user-defined function:", id ))); return 0; #line 590 "parse.c" } else if (( kc_selvar_1_1->prod_sel == sel_ITUserRView)) { #line 286 "../parse.k" v_report(NonFatal( FileLine( id->file, id->line ), Problem1S1ID( "expected user-defined phylum instead of user-defined rewrite view:", id ))); return 0; #line 598 "parse.c" } else if (( kc_selvar_1_1->prod_sel == sel_ITPredefinedRView)) { #line 282 "../parse.k" v_report(NonFatal( FileLine( id->file, id->line ), Problem1S1ID( "expected user-defined phylum instead of predefined rewrite view:", id ))); return 0; #line 606 "parse.c" } else if (( kc_selvar_1_1->prod_sel == sel_ITUserUView)) { #line 278 "../parse.k" v_report(NonFatal( FileLine( id->file, id->line ), Problem1S1ID( "expected user-defined phylum instead of user-defined unparse view:", id ))); return 0; #line 614 "parse.c" } else if (( kc_selvar_1_1->prod_sel == sel_ITPredefinedUView)) { #line 274 "../parse.k" v_report(NonFatal( FileLine( id->file, id->line ), Problem1S1ID( "expected user-defined phylum instead of predefined unparse view:", id ))); return 0; #line 622 "parse.c" } else if (( kc_selvar_1_1->prod_sel == sel_ITStorageClass)) { #line 270 "../parse.k" v_report(NonFatal( FileLine( id->file, id->line ), Problem1S1ID( "expected user-defined phylum instead of user-defined storage class:", id ))); return 0; #line 630 "parse.c" } else if (( kc_selvar_1_1->prod_sel == sel_ITPredefinedStorageClass)) { #line 266 "../parse.k" v_report(NonFatal( FileLine( id->file, id->line ), Problem1S1ID( "expected user-defined phylum instead of predefined storage class:", id ))); return 0; #line 638 "parse.c" } else if (( kc_selvar_1_1->prod_sel == sel_ITUserOperator)) { #line 262 "../parse.k" v_report(NonFatal( FileLine( id->file, id->line ), Problem1S1ID( "expected user-defined phylum instead of user-defined operator:", id ))); return 0; #line 646 "parse.c" } else if (( kc_selvar_1_1->prod_sel == sel_ITPredefinedOperator)) { #line 258 "../parse.k" v_report(NonFatal( FileLine( id->file, id->line ), Problem1S1ID( "expected user-defined phylum instead of predefined operator:", id ))); return 0; #line 654 "parse.c" } else if (( kc_selvar_1_1->prod_sel == sel_ITUserPhylum)) { #line 257 "../parse.k" phylumdeclaration pd = kc_selvar_1_1->u.ITUserPhylum.phylumdeclaration_1; #line 257 "../parse.k" return pd; #line 661 "parse.c" } else if (( kc_selvar_1_1->prod_sel == sel_ITPredefinedPhylum)) { #line 256 "../parse.k" phylumdeclaration pd = kc_selvar_1_1->u.ITPredefinedPhylum.phylumdeclaration_1; #line 256 "../parse.k" return pd; #line 668 "parse.c" } else if (( kc_selvar_1_1->prod_sel == sel_ITPredefinedBigatomPhylum)) { #line 255 "../parse.k" phylumdeclaration pd = kc_selvar_1_1->u.ITPredefinedBigatomPhylum.phylumdeclaration_1; #line 256 "../parse.k" return pd; #line 675 "parse.c" } else if (( kc_selvar_1_1->prod_sel == sel_ITUnknown)) { #line 251 "../parse.k" v_report(NonFatal( FileLine( id->file, id->line ), Problem1S1ID( "undefined phylum:", id ))); return 0; #line 683 "parse.c" } else { kc_no_default_in_with( "f_lookupdecl", __LINE__, __FILE__ ); return (phylumdeclaration)0; } } #line 294 "../parse.k" #line 690 "parse.c" } else { kc_no_default_in_with( "f_lookupdecl", __LINE__, __FILE__ ); return (phylumdeclaration)0; } } #line 294 "../parse.k" #line 294 "../parse.k" } #line 699 "parse.c" argsnumbers insert_in_argsnumbers #ifdef KC_USE_PROTOTYPES (int i, argsnumbers a) #else (i, a) int i; argsnumbers a; #endif #line 298 "../parse.k" { { #line 299 "../parse.k" argsnumbers kc_selvar_0_1 = a ; #line 299 "../parse.k" /*SUPPRESS 622*/ assert_argsnumbers(kc_selvar_0_1, "with_expression (1)"); #line 719 "parse.c" if (( kc_selvar_0_1->prod_sel == sel_Consargsnumbers)) { #line 301 "../parse.k" int j = kc_selvar_0_1->u.Consargsnumbers.int_1; #line 301 "../parse.k" argsnumbers ra = kc_selvar_0_1->u.Consargsnumbers.argsnumbers_1; #line 301 "../parse.k" if ( i < j ) { return Consargsnumbers( i, a ); } else if ( i == j ) { return a; } else { return Consargsnumbers( j, insert_in_argsnumbers( i, ra )); } #line 734 "parse.c" } else if (( kc_selvar_0_1->prod_sel == sel_Nilargsnumbers)) { #line 300 "../parse.k" return Consargsnumbers( i, a ); #line 739 "parse.c" } else { kc_no_default_in_with( "insert_in_argsnumbers", __LINE__, __FILE__ ); return (argsnumbers)0; } } #line 308 "../parse.k" #line 308 "../parse.k" } #line 748 "parse.c" void set_includefiles #ifdef KC_USE_PROTOTYPES (includefiles ifs, includedeclaration i) #else (ifs, i) includefiles ifs; includedeclaration i; #endif #line 311 "../parse.k" { { #line 312 "../parse.k" includefiles kc_fe_selvar_1 = ifs ; #line 312 "../parse.k" /*SUPPRESS 622*/ assert_includefiles(kc_fe_selvar_1, "foreach_list_expression"); #line 766 "parse.c" while( kc_fe_selvar_1->prod_sel == sel_Consincludefiles ) { includefile kc_selvar_0_1 = kc_fe_selvar_1->u.Consincludefiles.includefile_1; { #line 312 "../parse.k" { #line 312 "../parse.k" /*SUPPRESS 622*/ assert_includefile(kc_selvar_0_1, "with_expression (1)"); #line 778 "parse.c" { #line 312 "../parse.k" includefile pl_includefile = kc_selvar_0_1; #line 312 "../parse.k" /* SUPPRESS 622 */ assert((pl_includefile->inc_type == include_file) || (pl_includefile->inc_type == include_header)); pl_includefile->inc[(int)pl_includefile->inc_type] = Consincludedeclarations( i, pl_includefile->inc[(int)pl_includefile->inc_type] ); #line 789 "parse.c" } } #line 793 "parse.c" } kc_fe_selvar_1 = kc_fe_selvar_1->u.Consincludefiles.includefiles_1; #line 312 "../parse.k" /*SUPPRESS 622*/ assert_includefiles(kc_fe_selvar_1, "sublist_of_foreach_list_expression"); #line 800 "parse.c" } } #line 317 "../parse.k" #line 317 "../parse.k" } #line 807 "parse.c" ID f_ID_of_declarator #ifdef KC_USE_PROTOTYPES (ac_declarator d) #else (d) ac_declarator d; #endif #line 324 "../parse.k" {{ #line 323 "../parse.k" ac_declarator kc_selvar_0_1 = d; #line 323 "../parse.k" /*SUPPRESS 622*/ assert_ac_declarator(kc_selvar_0_1, "with_expression (1)"); #line 823 "parse.c" if (( kc_selvar_0_1->prod_sel == sel_AcDeclarator)) { #line 325 "../parse.k" ac_direct_declarator dd = kc_selvar_0_1->u.AcDeclarator.ac_direct_declarator_1; #line 325 "../parse.k" return f_ID_of_direct_decl( dd ); #line 829 "parse.c" } else { kc_no_default_in_with( "f_ID_of_declarator", __LINE__, __FILE__ ); return (ID)0; } } #line 326 "../parse.k" } #line 837 "parse.c" static ID f_ID_of_direct_decl #ifdef KC_USE_PROTOTYPES (ac_direct_declarator d) #else (d) ac_direct_declarator d; #endif #line 329 "../parse.k" {{ #line 328 "../parse.k" ac_direct_declarator kc_selvar_0_1 = d; #line 328 "../parse.k" /*SUPPRESS 622*/ assert_ac_direct_declarator(kc_selvar_0_1, "with_expression (1)"); #line 853 "parse.c" if (( kc_selvar_0_1->prod_sel == sel_AcDirectDeclKandR)) { #line 334 "../parse.k" ac_direct_declarator a_d = kc_selvar_0_1->u.AcDirectDeclKandR.ac_direct_declarator_1; #line 334 "../parse.k" return f_ID_of_direct_decl( a_d ); #line 859 "parse.c" } else if (( kc_selvar_0_1->prod_sel == sel_AcDirectDeclProto)) { #line 333 "../parse.k" ac_direct_declarator a_d = kc_selvar_0_1->u.AcDirectDeclProto.ac_direct_declarator_1; #line 333 "../parse.k" return f_ID_of_direct_decl( a_d ); #line 866 "parse.c" } else if (( kc_selvar_0_1->prod_sel == sel_AcDirectDeclArray)) { #line 332 "../parse.k" ac_direct_declarator a_d = kc_selvar_0_1->u.AcDirectDeclArray.ac_direct_declarator_1; #line 332 "../parse.k" return f_ID_of_direct_decl( a_d ); #line 873 "parse.c" } else if (( kc_selvar_0_1->prod_sel == sel_AcDirectDeclPack)) { #line 331 "../parse.k" ac_declarator a_d = kc_selvar_0_1->u.AcDirectDeclPack.ac_declarator_1; #line 331 "../parse.k" return f_ID_of_declarator( a_d ); #line 880 "parse.c" } else if (( kc_selvar_0_1->prod_sel == sel_AcDirectDeclId)) { #line 330 "../parse.k" ID i = kc_selvar_0_1->u.AcDirectDeclId.ID_1; #line 330 "../parse.k" return i; #line 887 "parse.c" } else { kc_no_default_in_with( "f_ID_of_direct_decl", __LINE__, __FILE__ ); return (ID)0; } } #line 335 "../parse.k" } #line 895 "parse.c" int f_stars_of_declarator #ifdef KC_USE_PROTOTYPES (ac_declarator d) #else (d) ac_declarator d; #endif #line 340 "../parse.k" {{ #line 339 "../parse.k" ac_declarator kc_selvar_0_1 = d; #line 339 "../parse.k" /*SUPPRESS 622*/ assert_ac_declarator(kc_selvar_0_1, "with_expression (1)"); #line 911 "parse.c" if (( kc_selvar_0_1->prod_sel == sel_AcDeclarator)) { #line 341 "../parse.k" ac_pointer_option po = kc_selvar_0_1->u.AcDeclarator.ac_pointer_option_1; #line 341 "../parse.k" return f_stars_of_ac_pointer_option( po ); #line 917 "parse.c" } else { kc_no_default_in_with( "f_stars_of_declarator", __LINE__, __FILE__ ); return (int)0; } } #line 342 "../parse.k" } #line 925 "parse.c" static int f_stars_of_ac_pointer_option #ifdef KC_USE_PROTOTYPES (ac_pointer_option d) #else (d) ac_pointer_option d; #endif #line 345 "../parse.k" {{ #line 344 "../parse.k" ac_pointer_option kc_selvar_0_1 = d; #line 344 "../parse.k" /*SUPPRESS 622*/ assert_ac_pointer_option(kc_selvar_0_1, "with_expression (1)"); #line 941 "parse.c" if (( kc_selvar_0_1->prod_sel == sel_Yespointer)) { #line 347 "../parse.k" ac_pointer p = kc_selvar_0_1->u.Yespointer.ac_pointer_1; #line 347 "../parse.k" return f_stars_of_ac_pointer( p ); #line 947 "parse.c" } else if (( kc_selvar_0_1->prod_sel == sel_Nopointer)) { #line 346 "../parse.k" return 0; #line 952 "parse.c" } else { kc_no_default_in_with( "f_stars_of_ac_pointer_option", __LINE__, __FILE__ ); return (int)0; } } #line 348 "../parse.k" } #line 960 "parse.c" static int f_stars_of_ac_pointer #ifdef KC_USE_PROTOTYPES (ac_pointer d) #else (d) ac_pointer d; #endif #line 351 "../parse.k" {{ #line 350 "../parse.k" ac_pointer kc_selvar_0_1 = d; #line 350 "../parse.k" /*SUPPRESS 622*/ assert_ac_pointer(kc_selvar_0_1, "with_expression (1)"); #line 976 "parse.c" if (( kc_selvar_0_1->prod_sel == sel_AcPointerCons)) { #line 353 "../parse.k" ac_pointer p = kc_selvar_0_1->u.AcPointerCons.ac_pointer_1; #line 353 "../parse.k" return 1 + f_stars_of_ac_pointer( p ); #line 982 "parse.c" } else if (( kc_selvar_0_1->prod_sel == sel_AcPointerNil)) { #line 352 "../parse.k" return 1; #line 987 "parse.c" } else { kc_no_default_in_with( "f_stars_of_ac_pointer", __LINE__, __FILE__ ); return (int)0; } } #line 354 "../parse.k" } #line 995 "parse.c" fnclass f_fnclass_info #ifdef KC_USE_PROTOTYPES (ac_declaration_specifiers ds, casestring fn) #else (ds, fn) ac_declaration_specifiers ds; casestring fn; #endif #line 359 "../parse.k" {{ #line 358 "../parse.k" ac_declaration_specifiers kc_selvar_0_1 = ds; #line 358 "../parse.k" /*SUPPRESS 622*/ assert_ac_declaration_specifiers(kc_selvar_0_1, "with_expression (1)"); #line 1012 "parse.c" if (( kc_selvar_0_1->prod_sel == sel_Consac_declaration_specifiers)) { #line 361 "../parse.k" ac_declaration_specifier h = kc_selvar_0_1->u.Consac_declaration_specifiers.ac_declaration_specifier_1; #line 361 "../parse.k" ac_declaration_specifiers t = kc_selvar_0_1->u.Consac_declaration_specifiers.ac_declaration_specifiers_1; #line 361 "../parse.k" if (f_static_in_ac_decl_spec( h )) { return LocalFn( fn ); } else { return f_fnclass_info( t, fn ); } #line 1026 "parse.c" } else if (( kc_selvar_0_1->prod_sel == sel_Nilac_declaration_specifiers)) { #line 360 "../parse.k" return GlobalFn(); #line 1031 "parse.c" } else { kc_no_default_in_with( "f_fnclass_info", __LINE__, __FILE__ ); return (fnclass)0; } } #line 368 "../parse.k" } #line 1039 "parse.c" static boolean f_static_in_ac_decl_spec #ifdef KC_USE_PROTOTYPES (ac_declaration_specifier ds) #else (ds) ac_declaration_specifier ds; #endif #line 371 "../parse.k" {{ #line 370 "../parse.k" ac_declaration_specifier kc_selvar_0_1 = ds; #line 370 "../parse.k" /*SUPPRESS 622*/ assert_ac_declaration_specifier(kc_selvar_0_1, "with_expression (1)"); #line 1055 "parse.c" if (( kc_selvar_0_1->prod_sel == sel_AcDeclSpecTypeQual)) { #line 374 "../parse.k" return False; #line 1059 "parse.c" } else if (( kc_selvar_0_1->prod_sel == sel_AcDeclSpecTypeSpec)) { #line 373 "../parse.k" return False; #line 1064 "parse.c" } else if (( kc_selvar_0_1->prod_sel == sel_AcDeclSpecStorageSpec)) { #line 372 "../parse.k" ac_storage_class_specifier a_sc = kc_selvar_0_1->u.AcDeclSpecStorageSpec.ac_storage_class_specifier_1; #line 372 "../parse.k" return f_static_in_ac_stor_class( a_sc ); #line 1071 "parse.c" } else { kc_no_default_in_with( "f_static_in_ac_decl_spec", __LINE__, __FILE__ ); return (boolean)0; } } #line 375 "../parse.k" } #line 1079 "parse.c" static boolean f_static_in_ac_stor_class #ifdef KC_USE_PROTOTYPES (ac_storage_class_specifier sc) #else (sc) ac_storage_class_specifier sc; #endif #line 378 "../parse.k" {{ #line 377 "../parse.k" ac_storage_class_specifier kc_selvar_0_1 = sc; #line 377 "../parse.k" /*SUPPRESS 622*/ assert_ac_storage_class_specifier(kc_selvar_0_1, "with_expression (1)"); #line 1095 "parse.c" if (( kc_selvar_0_1->prod_sel == sel_AcTypedef)) { #line 383 "../parse.k" return False; #line 1099 "parse.c" } else if (( kc_selvar_0_1->prod_sel == sel_AcExtern)) { #line 382 "../parse.k" return False; #line 1104 "parse.c" } else if (( kc_selvar_0_1->prod_sel == sel_AcStatic)) { #line 381 "../parse.k" return True; #line 1109 "parse.c" } else if (( kc_selvar_0_1->prod_sel == sel_AcRegister)) { #line 380 "../parse.k" return False; #line 1114 "parse.c" } else if (( kc_selvar_0_1->prod_sel == sel_AcAuto)) { #line 379 "../parse.k" return False; #line 1119 "parse.c" } else { kc_no_default_in_with( "f_static_in_ac_stor_class", __LINE__, __FILE__ ); return (boolean)0; } } #line 384 "../parse.k" } #line 1127 "parse.c" ID f_ID_of_ac_declaration_specifiers #ifdef KC_USE_PROTOTYPES (ac_declaration_specifiers d) #else (d) ac_declaration_specifiers d; #endif #line 389 "../parse.k" {{ #line 388 "../parse.k" ac_declaration_specifiers kc_selvar_0_1 = d; #line 388 "../parse.k" /*SUPPRESS 622*/ assert_ac_declaration_specifiers(kc_selvar_0_1, "with_expression (1)"); #line 1143 "parse.c" if (( kc_selvar_0_1->prod_sel == sel_Consac_declaration_specifiers)) { #line 391 "../parse.k" ac_declaration_specifier h = kc_selvar_0_1->u.Consac_declaration_specifiers.ac_declaration_specifier_1; #line 391 "../parse.k" ac_declaration_specifiers t = kc_selvar_0_1->u.Consac_declaration_specifiers.ac_declaration_specifiers_1; #line 391 "../parse.k" ID tmp = f_ID_of_ac_declaration_specifier( h ); if (tmp) { return tmp; } else { return f_ID_of_ac_declaration_specifiers( t ); } #line 1158 "parse.c" } else if (( kc_selvar_0_1->prod_sel == sel_Nilac_declaration_specifiers)) { #line 390 "../parse.k" return 0; #line 1163 "parse.c" } else { kc_no_default_in_with( "f_ID_of_ac_declaration_specifiers", __LINE__, __FILE__ ); return (ID)0; } } #line 399 "../parse.k" } #line 1171 "parse.c" static ID f_ID_of_ac_declaration_specifier #ifdef KC_USE_PROTOTYPES (ac_declaration_specifier d) #else (d) ac_declaration_specifier d; #endif #line 402 "../parse.k" {{ #line 401 "../parse.k" ac_declaration_specifier kc_selvar_0_1 = d; #line 401 "../parse.k" /*SUPPRESS 622*/ assert_ac_declaration_specifier(kc_selvar_0_1, "with_expression (1)"); #line 1187 "parse.c" if (( kc_selvar_0_1->prod_sel == sel_AcDeclSpecTypeSpec)) { #line 405 "../parse.k" ac_type_specifier t = kc_selvar_0_1->u.AcDeclSpecTypeSpec.ac_type_specifier_1; #line 405 "../parse.k" return f_ID_of_ac_type_specifier( t ); #line 1195 "parse.c" } else if (( kc_selvar_0_1->prod_sel == sel_AcDeclSpecTypeQual)) { #line 404 "../parse.k" return 0; #line 1200 "parse.c" } else if (( kc_selvar_0_1->prod_sel == sel_AcDeclSpecStorageSpec)) { #line 404 "../parse.k" return 0; #line 1205 "parse.c" } else { kc_no_default_in_with( "f_ID_of_ac_declaration_specifier", __LINE__, __FILE__ ); return (ID)0; } } #line 408 "../parse.k" } #line 1213 "parse.c" static ID f_ID_of_ac_type_specifier #ifdef KC_USE_PROTOTYPES (ac_type_specifier d) #else (d) ac_type_specifier d; #endif #line 411 "../parse.k" {{ #line 410 "../parse.k" ac_type_specifier kc_selvar_0_1 = d; #line 410 "../parse.k" /*SUPPRESS 622*/ assert_ac_type_specifier(kc_selvar_0_1, "with_expression (1)"); #line 1229 "parse.c" if (( kc_selvar_0_1->prod_sel == sel_AcTypeSpec)) { #line 412 "../parse.k" ID i = kc_selvar_0_1->u.AcTypeSpec.ID_1; #line 412 "../parse.k" return i; #line 1235 "parse.c" } else { kc_no_default_in_with( "f_ID_of_ac_type_specifier", __LINE__, __FILE__ ); return (ID)0; } } #line 413 "../parse.k" } #line 1243 "parse.c" void check_proto_ac_parameter_declaration #ifdef KC_USE_PROTOTYPES (casestring f, int l, ac_declaration_list C_vardecls, ac_declarator decl) #else (f, l, C_vardecls, decl) casestring f; int l; ac_declaration_list C_vardecls; ac_declarator decl; #endif #line 418 "../parse.k" {{ #line 417 "../parse.k" ac_declarator kc_selvar_0_1 = decl; #line 417 "../parse.k" /*SUPPRESS 622*/ assert_ac_declarator(kc_selvar_0_1, "with_expression (1)"); #line 1262 "parse.c" if (( kc_selvar_0_1->prod_sel == sel_AcDeclarator)) { #line 419 "../parse.k" ac_direct_declarator add = kc_selvar_0_1->u.AcDeclarator.ac_direct_declarator_1; #line 419 "../parse.k" { #line 420 "../parse.k" ac_direct_declarator kc_selvar_1_1 = add ; #line 420 "../parse.k" /*SUPPRESS 622*/ assert_ac_direct_declarator(kc_selvar_1_1, "with_expression (1)"); #line 1277 "parse.c" if (( kc_selvar_1_1->prod_sel == sel_AcDirectDeclKandR) && ( kc_selvar_1_1->u.AcDirectDeclKandR.ac_identifier_list_1->prod_sel == sel_Consac_identifier_list) && ( kc_selvar_1_1->u.AcDirectDeclKandR.ac_identifier_list_1->u.Consac_identifier_list.ID_1->prod_sel == sel_Id) && ( kc_selvar_1_1->u.AcDirectDeclKandR.ac_identifier_list_1->u.Consac_identifier_list.ID_1->u.Id.uniqID_1->prod_sel == sel_Str) && (strcmp( kc_selvar_1_1->u.AcDirectDeclKandR.ac_identifier_list_1->u.Consac_identifier_list.ID_1->u.Id.uniqID_1->u.Str.casestring_1->name, "void")==0) && ( kc_selvar_1_1->u.AcDirectDeclKandR.ac_identifier_list_1->u.Consac_identifier_list.ac_identifier_list_1->prod_sel == sel_Nilac_identifier_list)) { #line 426 "../parse.k" { #line 427 "../parse.k" ac_declaration_list kc_selvar_2_1 = C_vardecls ; #line 427 "../parse.k" /*SUPPRESS 622*/ assert_ac_declaration_list(kc_selvar_2_1, "with_expression (1)"); #line 1290 "parse.c" if (( kc_selvar_2_1->prod_sel == sel_Consac_declaration_list)) { #line 429 "../parse.k" v_report(Warning( FileLine( f, l ), Problem1S( "unexpected mix of non-ansi (old style) and ansi (prototype) function argument declaration" ))); #line 1296 "parse.c" } else if (( kc_selvar_2_1->prod_sel == sel_Nilac_declaration_list)) { #line 428 "../parse.k" /*EMPTY*/ #line 1301 "parse.c" } else kc_no_default_in_with( "check_proto_ac_parameter_declaration", __LINE__, __FILE__ ); } #line 433 "../parse.k" #line 1307 "parse.c" } else if (( kc_selvar_1_1->prod_sel == sel_AcDirectDeclProto)) { #line 426 "../parse.k" { #line 427 "../parse.k" ac_declaration_list kc_selvar_2_1 = C_vardecls ; #line 427 "../parse.k" /*SUPPRESS 622*/ assert_ac_declaration_list(kc_selvar_2_1, "with_expression (1)"); #line 1321 "parse.c" if (( kc_selvar_2_1->prod_sel == sel_Consac_declaration_list)) { #line 429 "../parse.k" v_report(Warning( FileLine( f, l ), Problem1S( "unexpected mix of non-ansi (old style) and ansi (prototype) function argument declaration" ))); #line 1327 "parse.c" } else if (( kc_selvar_2_1->prod_sel == sel_Nilac_declaration_list)) { #line 428 "../parse.k" /*EMPTY*/ #line 1332 "parse.c" } else kc_no_default_in_with( "check_proto_ac_parameter_declaration", __LINE__, __FILE__ ); } #line 433 "../parse.k" #line 1338 "parse.c" } else if (( kc_selvar_1_1->prod_sel == sel_AcDirectDeclKandR)) { #line 424 "../parse.k" /*EMPTY*/ #line 1343 "parse.c" } else if (( kc_selvar_1_1->prod_sel == sel_AcDirectDeclArray)) { #line 424 "../parse.k" /*EMPTY*/ #line 1348 "parse.c" } else if (( kc_selvar_1_1->prod_sel == sel_AcDirectDeclPack)) { #line 424 "../parse.k" /*EMPTY*/ #line 1353 "parse.c" } else if (( kc_selvar_1_1->prod_sel == sel_AcDirectDeclId)) { #line 424 "../parse.k" /*EMPTY*/ #line 1358 "parse.c" } else kc_no_default_in_with( "check_proto_ac_parameter_declaration", __LINE__, __FILE__ ); } #line 435 "../parse.k" #line 1364 "parse.c" } else kc_no_default_in_with( "check_proto_ac_parameter_declaration", __LINE__, __FILE__ ); } #line 436 "../parse.k" } #line 1371 "parse.c" void check_no_patternchaingroup_in_patternchain #ifdef KC_USE_PROTOTYPES (casestring f, int l, patternchain a_patternchain, char *ctxt) #else (f, l, a_patternchain, ctxt) casestring f; int l; patternchain a_patternchain; char *ctxt; #endif #line 441 "../parse.k" {{ #line 440 "../parse.k" patternchain kc_selvar_0_1 = a_patternchain; #line 440 "../parse.k" /*SUPPRESS 622*/ assert_patternchain(kc_selvar_0_1, "with_expression (1)"); #line 1390 "parse.c" if (( kc_selvar_0_1->prod_sel == sel_Nilpatternchain)) { #line 452 "../parse.k" /*EMPTY*/ #line 1394 "parse.c" } else if (( kc_selvar_0_1->prod_sel == sel_Conspatternchain)) { #line 442 "../parse.k" patternchainitem h = kc_selvar_0_1->u.Conspatternchain.patternchainitem_1; #line 442 "../parse.k" patternchain t = kc_selvar_0_1->u.Conspatternchain.patternchain_1; #line 442 "../parse.k" check_no_patternchaingroup_in_patternchain( f, l, t, ctxt ); { #line 444 "../parse.k" patternchainitem kc_selvar_1_1 = h ; #line 444 "../parse.k" /*SUPPRESS 622*/ assert_patternchainitem(kc_selvar_1_1, "with_expression (1)"); #line 1413 "parse.c" if (( kc_selvar_1_1->prod_sel == sel_PatternchainitemGroup)) { #line 447 "../parse.k" v_report(NonFatal( FileLine( f, l ), Problem3S( "no pattern grouping () allowed in", ctxt, "context." ))); #line 1419 "parse.c" } else if (( kc_selvar_1_1->prod_sel == sel_PatternchainitemDollarid)) { #line 446 "../parse.k" /*EMPTY*/ #line 1424 "parse.c" } else if (( kc_selvar_1_1->prod_sel == sel_PatternchainitemOutmost)) { #line 446 "../parse.k" /*EMPTY*/ #line 1429 "parse.c" } else kc_no_default_in_with( "check_no_patternchaingroup_in_patternchain", __LINE__, __FILE__ ); } #line 451 "../parse.k" #line 1435 "parse.c" } else kc_no_default_in_with( "check_no_patternchaingroup_in_patternchain", __LINE__, __FILE__ ); } #line 453 "../parse.k" } #line 1442 "parse.c" void check_no_patternchaingroup_in_patternchains #ifdef KC_USE_PROTOTYPES (casestring f, int l, patternchains a_patternchains, char *ctxt) #else (f, l, a_patternchains, ctxt) casestring f; int l; patternchains a_patternchains; char *ctxt; #endif #line 456 "../parse.k" {{ #line 455 "../parse.k" patternchains kc_selvar_0_1 = a_patternchains; #line 455 "../parse.k" /*SUPPRESS 622*/ assert_patternchains(kc_selvar_0_1, "with_expression (1)"); #line 1461 "parse.c" if (( kc_selvar_0_1->prod_sel == sel_Nilpatternchains)) { #line 461 "../parse.k" /*EMPTY*/ #line 1465 "parse.c" } else if (( kc_selvar_0_1->prod_sel == sel_Conspatternchains)) { #line 457 "../parse.k" patternchain h = kc_selvar_0_1->u.Conspatternchains.patternchain_1; #line 457 "../parse.k" patternchains t = kc_selvar_0_1->u.Conspatternchains.patternchains_1; #line 457 "../parse.k" check_no_patternchaingroup_in_patternchains( f, l, t, ctxt ); check_no_patternchaingroup_in_patternchain( f, l, h, ctxt ); #line 1477 "parse.c" } else kc_no_default_in_with( "check_no_patternchaingroup_in_patternchains", __LINE__, __FILE__ ); } #line 462 "../parse.k" } #line 1484 "parse.c" void check_no_patternchaingroup_or_pattern_in_patternchain #ifdef KC_USE_PROTOTYPES (casestring f, int l, patternchain a_patternchain, char *ctxt) #else (f, l, a_patternchain, ctxt) casestring f; int l; patternchain a_patternchain; char *ctxt; #endif #line 467 "../parse.k" {{ #line 466 "../parse.k" patternchain kc_selvar_0_1 = a_patternchain; #line 466 "../parse.k" /*SUPPRESS 622*/ assert_patternchain(kc_selvar_0_1, "with_expression (1)"); #line 1503 "parse.c" if (( kc_selvar_0_1->prod_sel == sel_Nilpatternchain)) { #line 480 "../parse.k" /*EMPTY*/ #line 1507 "parse.c" } else if (( kc_selvar_0_1->prod_sel == sel_Conspatternchain)) { #line 468 "../parse.k" patternchainitem h = kc_selvar_0_1->u.Conspatternchain.patternchainitem_1; #line 468 "../parse.k" patternchain t = kc_selvar_0_1->u.Conspatternchain.patternchain_1; #line 468 "../parse.k" check_no_patternchaingroup_or_pattern_in_patternchain( f, l, t, ctxt ); { #line 470 "../parse.k" patternchainitem kc_selvar_1_1 = h ; #line 470 "../parse.k" /*SUPPRESS 622*/ assert_patternchainitem(kc_selvar_1_1, "with_expression (1)"); #line 1526 "parse.c" if (( kc_selvar_1_1->prod_sel == sel_PatternchainitemGroup)) { #line 475 "../parse.k" v_report(NonFatal( FileLine( f, l ), Problem3S( "no pattern grouping () allowed in", ctxt, "context." ))); #line 1532 "parse.c" } else if (( kc_selvar_1_1->prod_sel == sel_PatternchainitemDollarid)) { #line 474 "../parse.k" /*EMPTY*/ #line 1537 "parse.c" } else if (( kc_selvar_1_1->prod_sel == sel_PatternchainitemOutmost)) { #line 471 "../parse.k" outmostpattern op = kc_selvar_1_1->u.PatternchainitemOutmost.outmostpattern_1; #line 471 "../parse.k" #line 1546 "parse.c" } else kc_no_default_in_with( "check_no_patternchaingroup_or_pattern_in_patternchain", __LINE__, __FILE__ ); } #line 479 "../parse.k" #line 1552 "parse.c" } else kc_no_default_in_with( "check_no_patternchaingroup_or_pattern_in_patternchain", __LINE__, __FILE__ ); } #line 481 "../parse.k" } #line 1559 "parse.c" void check_no_patternchaingroup_or_pattern_in_patternchains #ifdef KC_USE_PROTOTYPES (casestring f, int l, patternchains a_patternchains, char *ctxt) #else (f, l, a_patternchains, ctxt) casestring f; int l; patternchains a_patternchains; char *ctxt; #endif #line 484 "../parse.k" {{ #line 483 "../parse.k" patternchains kc_selvar_0_1 = a_patternchains; #line 483 "../parse.k" /*SUPPRESS 622*/ assert_patternchains(kc_selvar_0_1, "with_expression (1)"); #line 1578 "parse.c" if (( kc_selvar_0_1->prod_sel == sel_Nilpatternchains)) { #line 489 "../parse.k" /*EMPTY*/ #line 1582 "parse.c" } else if (( kc_selvar_0_1->prod_sel == sel_Conspatternchains)) { #line 485 "../parse.k" patternchain h = kc_selvar_0_1->u.Conspatternchains.patternchain_1; #line 485 "../parse.k" patternchains t = kc_selvar_0_1->u.Conspatternchains.patternchains_1; #line 485 "../parse.k" check_no_patternchaingroup_or_pattern_in_patternchains( f, l, t, ctxt ); check_no_patternchaingroup_or_pattern_in_patternchain( f, l, h, ctxt ); #line 1594 "parse.c" } else kc_no_default_in_with( "check_no_patternchaingroup_or_pattern_in_patternchains", __LINE__, __FILE__ ); } #line 490 "../parse.k" } #line 1601 "parse.c" patternchains syn_patternchains_fileline #ifdef KC_USE_PROTOTYPES (patternchains a_patternchains, casestring a_file, int a_line) #else (a_patternchains, a_file, a_line) patternchains a_patternchains; casestring a_file; int a_line; #endif #line 495 "../parse.k" {{ #line 494 "../parse.k" patternchains kc_selvar_0_1 = a_patternchains; #line 494 "../parse.k" /*SUPPRESS 622*/ assert_patternchains(kc_selvar_0_1, "with_expression (1)"); #line 1619 "parse.c" if (( kc_selvar_0_1->prod_sel == sel_Nilpatternchains)) { #line 503 "../parse.k" kc_selvar_0_1->file = a_file; kc_selvar_0_1->line = a_line; return a_patternchains; #line 1627 "parse.c" } else if (( kc_selvar_0_1->prod_sel == sel_Conspatternchains)) { #line 496 "../parse.k" patternchain h = kc_selvar_0_1->u.Conspatternchains.patternchain_1; #line 496 "../parse.k" patternchains t = kc_selvar_0_1->u.Conspatternchains.patternchains_1; #line 496 "../parse.k" (void)syn_patternchains_fileline( t, a_file, a_line ); (void)syn_patternchain_fileline( h, t->file, t->line ); kc_selvar_0_1->file = h->file; kc_selvar_0_1->line = h->line; return a_patternchains; #line 1642 "parse.c" } else { kc_no_default_in_with( "syn_patternchains_fileline", __LINE__, __FILE__ ); return (patternchains)0; } } #line 508 "../parse.k" } #line 1650 "parse.c" patternchain syn_patternchain_fileline #ifdef KC_USE_PROTOTYPES (patternchain a_patternchain, casestring a_file, int a_line) #else (a_patternchain, a_file, a_line) patternchain a_patternchain; casestring a_file; int a_line; #endif #line 510 "../parse.k" {{ #line 509 "../parse.k" patternchain kc_selvar_0_1 = a_patternchain; #line 509 "../parse.k" /*SUPPRESS 622*/ assert_patternchain(kc_selvar_0_1, "with_expression (1)"); #line 1668 "parse.c" if (( kc_selvar_0_1->prod_sel == sel_Nilpatternchain)) { #line 517 "../parse.k" kc_selvar_0_1->file = a_file; kc_selvar_0_1->line = a_line; return a_patternchain; #line 1676 "parse.c" } else if (( kc_selvar_0_1->prod_sel == sel_Conspatternchain)) { #line 511 "../parse.k" patternchainitem h = kc_selvar_0_1->u.Conspatternchain.patternchainitem_1; #line 511 "../parse.k" patternchain t = kc_selvar_0_1->u.Conspatternchain.patternchain_1; #line 511 "../parse.k" (void)syn_patternchain_fileline( t, a_file, a_line ); kc_selvar_0_1->file = h->file; kc_selvar_0_1->line = h->line; return a_patternchain; #line 1690 "parse.c" } else { kc_no_default_in_with( "syn_patternchain_fileline", __LINE__, __FILE__ ); return (patternchain)0; } } #line 522 "../parse.k" } #line 1698 "parse.c" withexpressions pf_gen_foreachwith_vars #ifdef KC_USE_PROTOTYPES (idCexpressions a_idCexpressions) #else (a_idCexpressions) idCexpressions a_idCexpressions; #endif #line 530 "../parse.k" { static int nrof_foreach_occ = 0; nrof_foreach_occ++; return t_pf_gen_foreachwith_vars(a_idCexpressions, nrof_foreach_occ, length_idCexpressions(a_idCexpressions), False); #line 534 "../parse.k" } #line 1714 "parse.c" withexpressions pf_gen_foreachwith_listvars #ifdef KC_USE_PROTOTYPES (idCexpressions a_idCexpressions) #else (a_idCexpressions) idCexpressions a_idCexpressions; #endif #line 537 "../parse.k" { static int nrof_foreach_occ = 0; nrof_foreach_occ++; return t_pf_gen_foreachwith_vars(a_idCexpressions, nrof_foreach_occ, length_idCexpressions(a_idCexpressions), True); #line 541 "../parse.k" } #line 1730 "parse.c" withexpressions t_pf_gen_foreachwith_vars #ifdef KC_USE_PROTOTYPES (idCexpressions a_idCexpressions, int occ, int nr, boolean listvars) #else (a_idCexpressions, occ, nr, listvars) idCexpressions a_idCexpressions; int occ; int nr; boolean listvars; #endif #line 544 "../parse.k" {{ #line 543 "../parse.k" idCexpressions kc_selvar_0_1 = a_idCexpressions; #line 543 "../parse.k" /*SUPPRESS 622*/ assert_idCexpressions(kc_selvar_0_1, "with_expression (1)"); #line 1749 "parse.c" if (( kc_selvar_0_1->prod_sel == sel_ConsidCexpressions) && ( kc_selvar_0_1->u.ConsidCexpressions.idCexpression_1->prod_sel == sel_IdCexpression)) { #line 545 "../parse.k" idCexpression ice = kc_selvar_0_1->u.ConsidCexpressions.idCexpression_1; #line 545 "../parse.k" ID id = kc_selvar_0_1->u.ConsidCexpressions.idCexpression_1->u.IdCexpression.ID_1; #line 545 "../parse.k" Cexpression ce = kc_selvar_0_1->u.ConsidCexpressions.idCexpression_1->u.IdCexpression.Cexpression_1; #line 545 "../parse.k" idCexpressions t = kc_selvar_0_1->u.ConsidCexpressions.idCexpressions_1; #line 545 "../parse.k" char tmp[BUFSIZ]; withexpression w; withexpressions ws; ID w_id; if (listvars) { sprintf(tmp, "kc_fe_withlistvar_%d_%d", occ, nr); } else { sprintf(tmp, "kc_fe_withvar_%d_%d", occ, nr); } w_id = Id(Str(mkcasestring(tmp))); w = WEVariable(w_id); w->type = (listvars ? id : f_listelementphylum(id)); w->file = ce->file; w->line = ce->line; ice->id = w_id; ws = Conswithexpressions( w, t_pf_gen_foreachwith_vars( t, occ, nr-1, listvars)); ws->file = w->file; ws->line = w->line; return ws; #line 1783 "parse.c" } else if (( kc_selvar_0_1->prod_sel == sel_NilidCexpressions)) { #line 568 "../parse.k" return Nilwithexpressions(); #line 1788 "parse.c" } else { kc_no_default_in_with( "t_pf_gen_foreachwith_vars", __LINE__, __FILE__ ); return (withexpressions)0; } } #line 569 "../parse.k" } #line 1796 "parse.c" ID subst_name #ifdef KC_USE_PROTOTYPES (ID n, casestring oldname, casestring newname) #else (n, oldname, newname) ID n; casestring oldname; casestring newname; #endif #line 575 "../parse.k" {{ #line 574 "../parse.k" ID kc_selvar_0_1 = n; #line 574 "../parse.k" /*SUPPRESS 622*/ assert_ID(kc_selvar_0_1, "with_expression (1)"); #line 1814 "parse.c" if (( kc_selvar_0_1->prod_sel == sel_Id) && ( kc_selvar_0_1->u.Id.uniqID_1->prod_sel == sel_Str)) { #line 576 "../parse.k" casestring s = kc_selvar_0_1->u.Id.uniqID_1->u.Str.casestring_1; #line 576 "../parse.k" if (eq_casestring( s, oldname)) { ID tmp = Id(Str(newname)); tmp->file = n->file; tmp->line = n->line; return tmp; } else { return n; } #line 1829 "parse.c" } else { kc_no_default_in_with( "subst_name", __LINE__, __FILE__ ); return (ID)0; } } #line 586 "../parse.k" } #line 1837 "parse.c"