CBMC
load_method_by_regex.cpp File Reference
#include "load_method_by_regex.h"
#include <util/prefix.h>
#include <util/symbol_table_base.h>
#include <regex>
+ Include dependency graph for load_method_by_regex.cpp:

Go to the source code of this file.

Functions

static std::regex build_regex_from_pattern (const std::string &pattern)
 For a given user provided pattern, return a regex, having dealt with the cases where the user has not prefixed with java:: or suffixed with the descriptor. More...
 
bool does_pattern_miss_descriptor (const std::string &pattern)
 Identify if a parameter includes a part that will match a descriptor. More...
 
std::function< std::vector< irep_idt >const symbol_table_baset &symbol_table)> build_load_method_by_regex (const std::string &pattern)
 Create a lambda that returns the symbols that the given pattern should be loaded.If the pattern doesn't include a colon for matching the descriptor, append a :(. More...
 

Function Documentation

◆ build_load_method_by_regex()

std::function<std::vector<irep_idt>const symbol_table_baset &symbol_table)> build_load_method_by_regex ( const std::string &  pattern)

Create a lambda that returns the symbols that the given pattern should be loaded.If the pattern doesn't include a colon for matching the descriptor, append a :(.

*).* to the regex. Note this will mean all overloaded methods will be marked as extra entry points for CI lazy loading. If the pattern doesn't include the java:: prefix, prefix that

Parameters
patternThe user provided pattern
Returns
The lambda to execute.

Definition at line 58 of file load_method_by_regex.cpp.

◆ build_regex_from_pattern()

static std::regex build_regex_from_pattern ( const std::string &  pattern)
static

For a given user provided pattern, return a regex, having dealt with the cases where the user has not prefixed with java:: or suffixed with the descriptor.

Parameters
patternThe user provided pattern
Returns
The regex to match with

Definition at line 22 of file load_method_by_regex.cpp.

◆ does_pattern_miss_descriptor()

bool does_pattern_miss_descriptor ( const std::string &  pattern)

Identify if a parameter includes a part that will match a descriptor.

That is, does it have a colon separtor.

Parameters
patternThe user provided pattern
Returns
True if no descriptor is found (that is, the only : relates to the java:: prefix.

Definition at line 39 of file load_method_by_regex.cpp.