/* translation of file "gen.k" */ /* generated by: * @(#)$Author: Kimwitu++ version 2.3.8 (C) 1998-2003 Humboldt-University of Berlin $ */ #define KC_FUNCTIONS_gen_ #include #include "k.h" #include "gen.h" namespace kc { } using namespace kc; /* included stuff */ // // The Termprocessor Kimwitu++ // // Copyright (C) 1991 University of Twente, Dept TIOS. // Copyright (C) 1998-2003 Humboldt-University of Berlin, Institute of Informatics // All rights reserved. // // Kimwitu++ is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // Kimwitu++ is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Kimwitu++; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // static char gen_kAccesSid[] = "@(#)$Id: gen.k,v 1.148 2003/10/27 15:23:15 piefel Exp $"; /* end included stuff */ namespace kc { #ifndef KC_TRACE_PROVIDED #define KC_TRACE_PROVIDED(COND,FILE,LINE,NODE) COND #endif enum_operators f_selofoperator(ID oid) { int kc_i, kc_end = one_before_first_operator; kc_i=kc_end; { phylumdeclarations kc_fe_selvar_1 = Thephylumdeclarations ; while( kc_fe_selvar_1->prod_sel() == sel_Consphylumdeclarations ) { phylumdeclaration kc_selvar_0_1 = kc_fe_selvar_1->phylumdeclaration_1; { { { const phylumdeclaration p = kc_selvar_0_1; { phylumdeclaration kc_selvar_1_1 = phylum_cast(p); if ((kc_selvar_1_1->prod_sel() == sel_PhylumDeclaration) && (phylum_cast(kc_selvar_1_1)->productionblock_1->prod_sel() == sel_ListAlternatives)) { const alternatives alts = phylum_cast(phylum_cast(kc_selvar_1_1)->productionblock_1)->alternatives_1; { alternatives kc_fe_selvar_1 = alts ; while( kc_fe_selvar_1->prod_sel() == sel_Consalternatives ) { alternative kc_selvar_2_1 = kc_fe_selvar_1->alternative_1; { { if ((kc_selvar_2_1->prod_sel() == sel_Alternative)) { const ID id = phylum_cast(kc_selvar_2_1)->ID_1; kc_end++; if (oid->eq(id)) kc_i=kc_end; } else {/* EMPTY */ /*skip: no matching pattern in foreach patterns*/} } } kc_fe_selvar_1 = kc_fe_selvar_1->alternatives_1; } } } else if ((kc_selvar_1_1->prod_sel() == sel_PhylumDeclaration) && (phylum_cast(kc_selvar_1_1)->productionblock_1->prod_sel() == sel_NonlistAlternatives)) { const alternatives alts = phylum_cast(phylum_cast(kc_selvar_1_1)->productionblock_1)->alternatives_1; { alternatives kc_fe_selvar_1 = alts ; while( kc_fe_selvar_1->prod_sel() == sel_Consalternatives ) { alternative kc_selvar_2_1 = kc_fe_selvar_1->alternative_1; { { if ((kc_selvar_2_1->prod_sel() == sel_Alternative)) { const ID id = phylum_cast(kc_selvar_2_1)->ID_1; kc_end++; if (oid->eq(id)) kc_i=kc_end; } else {/* EMPTY */ /*skip: no matching pattern in foreach patterns*/} } } kc_fe_selvar_1 = kc_fe_selvar_1->alternatives_1; } } } else if ((kc_selvar_1_1->prod_sel() == sel_PhylumDeclaration) && (phylum_cast(kc_selvar_1_1)->productionblock_1->prod_sel() == sel_PredefinedAlternatives)) { const alternatives alts = phylum_cast(phylum_cast(kc_selvar_1_1)->productionblock_1)->alternatives_1; { alternatives kc_fe_selvar_1 = alts ; while( kc_fe_selvar_1->prod_sel() == sel_Consalternatives ) { alternative kc_selvar_2_1 = kc_fe_selvar_1->alternative_1; { { if ((kc_selvar_2_1->prod_sel() == sel_Alternative)) { const ID id = phylum_cast(kc_selvar_2_1)->ID_1; kc_end++; if (oid->eq(id)) kc_i=kc_end; } else {/* EMPTY */ /*skip: no matching pattern in foreach patterns*/} } } kc_fe_selvar_1 = kc_fe_selvar_1->alternatives_1; } } } else { kc_no_default_in_with( "f_selofoperator", __LINE__, __FILE__ ); return static_cast(0); } } } } } kc_fe_selvar_1 = kc_fe_selvar_1->phylumdeclarations_1; } } return static_cast(kc_end-kc_i+1); } void freespineandelements(unparseviewsinfo a_unparseviewsinfo) { abstract_phylum kc_p = a_unparseviewsinfo; while(kc_p) { if (kc_p->subphylum(0)) kc_p->subphylum(0)->free(false); kc_p = kc_p->subphylum(1); }; a_unparseviewsinfo->freelist(); } void freespineandelements(rewriteviewsinfo a_rewriteviewsinfo) { abstract_phylum kc_p = a_rewriteviewsinfo; while(kc_p) { if (kc_p->subphylum(0)) kc_p->subphylum(0)->free(false); kc_p = kc_p->subphylum(1); }; a_rewriteviewsinfo->freelist(); } } // namespace kc