diff --git a/lib/lorina/lorina/aiger.hpp b/lib/lorina/lorina/aiger.hpp index 2d0019d0f..c7b60c9d3 100644 --- a/lib/lorina/lorina/aiger.hpp +++ b/lib/lorina/lorina/aiger.hpp @@ -427,15 +427,15 @@ class ascii_aiger_pretty_printer : public aiger_reader namespace aig_regex { -static std::regex header( R"(^aig (\d+) (\d+) (\d+) (\d+) (\d+)( \d+)?( \d+)?( \d+)?( \d+)?$)" ); -static std::regex ascii_header( R"(^aag (\d+) (\d+) (\d+) (\d+) (\d+)( \d+)?( \d+)?( \d+)?( \d+)?$)" ); -static std::regex input( R"(^i(\d+) (.*)$)" ); -static std::regex latch( R"(^l(\d+) (.*)$)" ); -static std::regex output( R"(^o(\d+) (.*)$)" ); -static std::regex bad_state( R"(^b(\d+) (.*)$)" ); -static std::regex constraint( R"(^c(\d+) (.*)$)" ); -static std::regex justice( R"(^j(\d+) (.*)$)" ); -static std::regex fairness( R"(^f(\d+) (.*)$)" ); +inline const std::regex header( R"(^aig (\d+) (\d+) (\d+) (\d+) (\d+)( \d+)?( \d+)?( \d+)?( \d+)?$)" ); +inline const std::regex ascii_header( R"(^aag (\d+) (\d+) (\d+) (\d+) (\d+)( \d+)?( \d+)?( \d+)?( \d+)?$)" ); +inline const std::regex input( R"(^i(\d+) (.*)$)" ); +inline const std::regex latch( R"(^l(\d+) (.*)$)" ); +inline const std::regex output( R"(^o(\d+) (.*)$)" ); +inline const std::regex bad_state( R"(^b(\d+) (.*)$)" ); +inline const std::regex constraint( R"(^c(\d+) (.*)$)" ); +inline const std::regex justice( R"(^j(\d+) (.*)$)" ); +inline const std::regex fairness( R"(^f(\d+) (.*)$)" ); } // namespace aig_regex /*! \brief Reader function for ASCII AIGER format. diff --git a/lib/lorina/lorina/bench.hpp b/lib/lorina/lorina/bench.hpp index 7236e7d75..fff8e8834 100644 --- a/lib/lorina/lorina/bench.hpp +++ b/lib/lorina/lorina/bench.hpp @@ -155,12 +155,12 @@ class bench_pretty_printer : public bench_reader namespace bench_regex { -static std::regex input( R"(INPUT\((.*)\))" ); -static std::regex output( R"(OUTPUT\((.*)\))" ); -static std::regex gate( R"((.*)\s+=\s+(.*)\((.*)\))" ); -static std::regex dff( R"((.*)\s+=\s+DFF\((.+)\))" ); -static std::regex lut( R"((.*)\s+=\s+LUT\s+(.*)\((.*)\))" ); -static std::regex gate_asgn( R"((.*)\s+=\s+(.*))" ); +inline const std::regex input( R"(INPUT\((.*)\))" ); +inline const std::regex output( R"(OUTPUT\((.*)\))" ); +inline const std::regex gate( R"((.*)\s+=\s+(.*)\((.*)\))" ); +inline const std::regex dff( R"((.*)\s+=\s+DFF\((.+)\))" ); +inline const std::regex lut( R"((.*)\s+=\s+LUT\s+(.*)\((.*)\))" ); +inline const std::regex gate_asgn( R"((.*)\s+=\s+(.*))" ); } // namespace bench_regex /*! \brief Reader function for the BENCH format. diff --git a/lib/lorina/lorina/blif.hpp b/lib/lorina/lorina/blif.hpp index be4969547..fa403a7f8 100644 --- a/lib/lorina/lorina/blif.hpp +++ b/lib/lorina/lorina/blif.hpp @@ -258,10 +258,10 @@ class blif_pretty_printer : public blif_reader namespace blif_regex { -static std::regex model( R"(.model\s+(.*))" ); -static std::regex names( R"(.names\s+(.*))" ); -static std::regex line_of_truthtable( R"(([01\-]*)\s*([01\-]))" ); -static std::regex end( R"(.end)" ); +inline const std::regex model( R"(.model\s+(.*))" ); +inline const std::regex names( R"(.names\s+(.*))" ); +inline const std::regex line_of_truthtable( R"(([01\-]*)\s*([01\-]))" ); +inline const std::regex end( R"(.end)" ); } // namespace blif_regex /*! \brief Reader function for the BLIF format. diff --git a/lib/lorina/lorina/dimacs.hpp b/lib/lorina/lorina/dimacs.hpp index dc44b9a19..cf40c2ef6 100644 --- a/lib/lorina/lorina/dimacs.hpp +++ b/lib/lorina/lorina/dimacs.hpp @@ -98,8 +98,8 @@ class dimacs_reader namespace dimacs_regex { -static std::regex problem_spec( R"(^p\s+([cd]nf)\s+([0-9]+)\s+([0-9]+)$)" ); -static std::regex clause( R"(((-?[1-9]+)+ +)+0)" ); +inline const std::regex problem_spec( R"(^p\s+([cd]nf)\s+([0-9]+)\s+([0-9]+)$)" ); +inline const std::regex clause( R"(((-?[1-9]+)+ +)+0)" ); } // namespace dimacs_regex diff --git a/lib/lorina/lorina/pla.hpp b/lib/lorina/lorina/pla.hpp index c8a96565f..5cd89a66e 100644 --- a/lib/lorina/lorina/pla.hpp +++ b/lib/lorina/lorina/pla.hpp @@ -236,8 +236,8 @@ class pla_pretty_printer : public pla_reader namespace pla_regex { -static std::regex keyword( R"(^\.([^\s]*)(?:\s+(.+))?$)" ); -static std::regex term( R"(^([01\-]+)\s+([01\-]+)$)" ); +inline const std::regex keyword( R"(^\.([^\s]*)(?:\s+(.+))?$)" ); +inline const std::regex term( R"(^([01\-]+)\s+([01\-]+)$)" ); } // namespace pla_regex diff --git a/lib/lorina/lorina/verilog_regex.hpp b/lib/lorina/lorina/verilog_regex.hpp index 19347130d..b8f5e53c1 100644 --- a/lib/lorina/lorina/verilog_regex.hpp +++ b/lib/lorina/lorina/verilog_regex.hpp @@ -40,12 +40,12 @@ namespace lorina namespace verilog_regex { -static std::regex immediate_assign( R"(^(~)?\(?([[:alnum:]\[\]_']+)\)?$)" ); -static std::regex binary_expression( R"(^(~)?([[:alnum:]\[\]_']+)([&|^])(~)?([[:alnum:]\[\]_']+)$)" ); -static std::regex ternary_expression( R"(^(~)?([[:alnum:]\[\]_']+)([&|^?])(~)?([[:alnum:]\[\]_']+)([&|^:])(~)?([[:alnum:]\[\]_']+)$)" ); -static std::regex maj3_expression( R"(^\((~)?([[:alnum:]\[\]_']+)&(~)?([[:alnum:]\[\]_']+)\)\|\((~)?([[:alnum:]\[\]_']+)&(~)?([[:alnum:]\[\]_']+)\)\|\((~)?([[:alnum:]\[\]_']+)&(~)?([[:alnum:]\[\]_']+)\)$)" ); -static std::regex negated_binary_expression( R"(^~\((~)?([[:alnum:]\[\]_']+)([&|^])(~)?([[:alnum:]\[\]_']+)\)$)" ); -static std::regex const_size_range( R"(^(\d+):(\d+)$)" ); +inline const std::regex immediate_assign( R"(^(~)?\(?([[:alnum:]\[\]_']+)\)?$)" ); +inline const std::regex binary_expression( R"(^(~)?([[:alnum:]\[\]_']+)([&|^])(~)?([[:alnum:]\[\]_']+)$)" ); +inline const std::regex ternary_expression( R"(^(~)?([[:alnum:]\[\]_']+)([&|^?])(~)?([[:alnum:]\[\]_']+)([&|^:])(~)?([[:alnum:]\[\]_']+)$)" ); +inline const std::regex maj3_expression( R"(^\((~)?([[:alnum:]\[\]_']+)&(~)?([[:alnum:]\[\]_']+)\)\|\((~)?([[:alnum:]\[\]_']+)&(~)?([[:alnum:]\[\]_']+)\)\|\((~)?([[:alnum:]\[\]_']+)&(~)?([[:alnum:]\[\]_']+)\)$)" ); +inline const std::regex negated_binary_expression( R"(^~\((~)?([[:alnum:]\[\]_']+)([&|^])(~)?([[:alnum:]\[\]_']+)\)$)" ); +inline const std::regex const_size_range( R"(^(\d+):(\d+)$)" ); } // namespace verilog_regex } // namespace lorina \ No newline at end of file