123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354(**************************************************************************)(* *)(* This file is part of Frama-C. *)(* *)(* Copyright (C) 2007-2025 *)(* CEA (Commissariat à l'énergie atomique et aux énergies *)(* 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). *)(* *)(**************************************************************************)openServerletpackage=Package.package~plugin:"impact"~name:"impact"~title:"Impact"()(* Convert the result of the impact analysis into a list of localizables. *)letimpact_to_localizable_listimpact=letadd_kf_nodeskfnodesacc=letstmts=Compute_impact.nodes_to_stmtsnodesinletto_localizablestmt=Printer_tag.PStmtStart(kf,stmt)in(* Try to list statements in their order in the source code, as it is
more natural for the user. *)List.mapto_localizablestmts@accinKernel_function.Map.foldadd_kf_nodesimpact[]letimpact_statementstmt=letkf=Kernel_function.find_englobing_kfstmtinletskip=Compute_impact.skip()inletreason=Options.Reason.get()inletrestrict=Locations.Zone.topinletimpact,_initial,_reason=Compute_impact.nodes_impacted_by_stmts~skip~restrict~reasonkf[stmt]inimpact_to_localizable_listimpactlet()=Request.register~package~kind:`GET~name:"impactStatement"~descr:(Markdown.plain"Compute the impact of a statement")~input:(moduleKernel_ast.Stmt)~output:(moduleData.Jlist(Kernel_ast.Marker))impact_statement