123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960(**************************************************************************)(* *)(* SPDX-License-Identifier LGPL-2.1 *)(* Copyright (C) *)(* CEA (Commissariat à l'énergie atomique et aux énergies alternatives) *)(* *)(**************************************************************************)letdisable_other_analyzers()=ifOptions.Run.get()thenletselection=State_selection.diff(Parameter_state.get_selection())(State_selection.union(State_selection.of_list(Kernel.CodeOutput.self::Options.states))(* The command-line options that govern the creation of the AST
must be preserved *)(State_selection.with_codependenciesAst.self))inProject.clear~selection()let()=Cmdline.run_after_configuring_stagedisable_other_analyzersletforce_run()=ifnot(Dictionary.is_computed())thenbeginletold_printer=Printer.current_printer()inObfuscate.obfuscate();ifOptions.Dictionary.is_default()thenLog.print_delayedDictionary.prettyelsebeginletfile=Options.Dictionary.get()intryletcout=open_outfileinletfmt=Format.formatter_of_out_channelcoutinDictionary.prettyfmtwithSys_error_asexn->Options.error"@[cannot generate the dictionary into file `%s':@ %s@]"file(Printexc.to_stringexn)end;File.pretty_ast();Printer.set_printerold_printerendletforce_run=Dynamic.register~plugin:"Obfuscator""force_run"(Datatype.funcDatatype.unitDatatype.unit)force_runletrun()=ifOptions.Run.get()thenbeginforce_run();Cmdline.bail_out()(* stop Frama-C as specified by the -help message
and by the discussion in Gitlab issue #491 *)endlet()=Boot.Main.extendrun