Frama-C:
Plug-ins:
Libraries:

Frama-C API - Syntactic_search

val self : State.t
val find_in_scope : ?strict:bool -> string -> Cil_types.syntactic_scope -> Cil_types.varinfo option

find_in_scope orig_name scope finds a variable from its orig_name, according to the syntactic scope in which it should be searched.

  • parameter strict

    indicates whether the symbol should be searched only in the exact scope that it is given. It defaults to false, meaning that the search will look for enclosing scopes, according to C lookup rules. More precisely, non-strict lookup will proceed according to the following order: Block_scope will move across all enclosing blocks up to the function body (or all locals will be searched directly in case of Whole_function). Then, Formal will be considered, followed by Translation_unit (for the file where the function is defined), then Program.

  • returns

    None if there are no variables orig_name in scope.

  • returns

    Some vi otherwise, with vi the varinfo associated to orig_name in scope (or an enclosing scope when strict is false).

  • since Chlorine-20180501
  • before 27.0-Cobalt

    strict parameter did not exist, symbol was always searched according to C lookup rules.