12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091(**************************************************************************)(* *)(* This file is part of WP plug-in of Frama-C. *)(* *)(* Copyright (C) 2007-2023 *)(* CEA (Commissariat a l'energie atomique et aux energies *)(* alternatives) *)(* *)(* you can redistribute it and/or modify it under the terms of the GNU *)(* Lesser General Public License as published by the Free Software *)(* Foundation, version 2.1. *)(* *)(* It 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 Lesser General Public License for more details. *)(* *)(* See the GNU Lesser General Public License version 2.1 *)(* for more details (enclosed in the file licenses/LGPLv2.1). *)(* *)(**************************************************************************)(* -------------------------------------------------------------------------- *)(* --- Normalized C-labels --- *)(* -------------------------------------------------------------------------- *)openCil_typestypec_label=stringletcompare=String.compareletequal(a:string)(b:string)=(a=b)moduleT=structtypet=c_labelletcompare=compareendmoduleLabelMap=Datatype.String.MapmoduleLabelSet=Datatype.String.Setletinit="wp:init"lethere="wp:here"letnext="wp:next"letpre="wp:pre"letpost="wp:post"letexit="wp:exit"letbreak="wp:break"letcontinue="wp:continue"letdefault="wp:default"letloopcurrent="wp:loopcurrent"letloopentry="wp:loopentry"letformala=aletpretty=Format.pp_print_stringletis_hereh=(h=here)letmemllbl=List.memllblletcasen="wp:case"^Int64.to_stringnletstmts="wp:sid"^string_of_ints.sidletstmt_posts="wp:sid:post:"^string_of_ints.sidletloop_entrys=stmts(* same point *)letloop_currents="wp:head"^string_of_ints.sidletto_logica=FormalLabelaletof_logic=function|BuiltinLabelHere->here|BuiltinLabelInit->init|BuiltinLabelPre->pre|BuiltinLabelPost->post|FormalLabelname->name|BuiltinLabelOld->"wp:old"|BuiltinLabelLoopCurrent->loopcurrent|BuiltinLabelLoopEntry->loopentry|StmtLabels->stmt!sletis_post=function|BuiltinLabelPost->true|FormalLabela->a=post||a=exit|_->falseletname=functionFormalLabela->a|_->""letlookuplabelsa=tryList.find(fun(l,_)->namel=a)labels|>sndwithNot_found->Wp_parameters.fatal"Unbound label parameter '%s' in predicate or function call"a(* -------------------------------------------------------------------------- *)