1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192(**************************************************************************)(* *)(* This file is part of Frama-C. *)(* *)(* Copyright (C) 2007-2024 *)(* 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). *)(* *)(**************************************************************************)openPrinter_tagopenGtk_helperopenCil_typesmoduleMake_HighlighterState(Info:sigvalname:stringend)=State_builder.List_ref(Cil_datatype.Stmt)(structletname=Info.nameletdependencies=[Ast.self]end)moduleForwardHighlighterState=Make_HighlighterState(structletname="Security_gui.Forward"end)moduleIndirectBackwardHighlighterState=Make_HighlighterState(structletname="Security_gui.Indirectb"end)moduleDirectHighlighterState=Make_HighlighterState(structletname="Security_gui.Direct"end)letsecurity_highlighterbufferloc~start~stop=letbuffer=buffer#bufferinmatchlocwith|PStmt(_,s)->letf=ForwardHighlighterState.get()inifList.exists(funk->k.sid=s.sid)fthenbeginlettag=make_tagbuffer~name:"forward"[`BACKGROUND"orange"]inapply_tagbuffertagstartstopend;leti=IndirectBackwardHighlighterState.get()inifList.exists(funk->k.sid=s.sid)ithenbeginlettag=make_tagbuffer~name:"indirect_backward"[`BACKGROUND"cyan"]inapply_tagbuffertagstartstopend;letd=DirectHighlighterState.get()inifList.exists(funk->k.sid=s.sid)dthenbeginlettag=make_tagbuffer~name:"direct"[`BACKGROUND"green"]inapply_tagbuffertagstartstopend|PStmtStart_|PExp_|PVDecl_|PTermLval_|PLval_|PGlobal_|PIP_|PType_->()letsecurity_selector(popup_factory:GMenu.menuGMenu.factory)main_ui~buttonlocalizable=ifbutton=3&&Security_slicing_parameters.Slicing.get()thenmatchlocalizablewith|PStmt(_kf,ki)->ignore(popup_factory#add_item"_Security component"~callback:(fun()->ForwardHighlighterState.set(Components.get_forward_componentki);IndirectBackwardHighlighterState.set(Components.get_indirect_backward_componentki);DirectHighlighterState.set(Components.get_direct_componentki);main_ui#rehighlight()))|_->()letmainmain_ui=main_ui#register_source_selectorsecurity_selector;main_ui#register_source_highlightersecurity_highlighterlet()=Design.register_extensionmain(*
Local Variables:
compile-command: "make -C ../../.."
End:
*)