Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/ENCRYPTO_utils/parse_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* @param str the string to tokenize
* @param tokens the result vector of wire id
*/
void tokenize_verilog(const std::string& str, std::vector<uint32_t>& tokens, const std::string& delimiters) {
void tokenize_verilog(const std::string& str, std::vector<int>& tokens, const std::string& delimiters) {

tokens.clear();

Expand All @@ -38,7 +38,7 @@ void tokenize_verilog(const std::string& str, std::vector<uint32_t>& tokens, con

while (std::string::npos != pos || std::string::npos != lastPos) {
// Found a token, add it to the vector.
tokens.push_back(atoi(str.substr(lastPos, pos - lastPos).c_str()));
tokens.push_back(stoi(str.substr(lastPos, pos - lastPos)));
// Skip delimiters. Note the "not_of"
lastPos = str.find_first_not_of(delimiters, pos);
// Find next "non-delimiter"
Expand All @@ -64,7 +64,7 @@ void tokenize(const std::string& str, std::vector<uint32_t>& tokens, const std::

while (std::string::npos != pos || std::string::npos != lastPos) {
// Found a token, add it to the vector.
tokens.push_back(atoi(str.substr(lastPos, pos - lastPos).c_str()));
tokens.push_back(stoi(str.substr(lastPos, pos - lastPos)));
// Skip delimiters. Note the "not_of"
lastPos = str.find_first_not_of(delimiters, pos);
// Find next "non-delimiter"
Expand Down
2 changes: 1 addition & 1 deletion src/ENCRYPTO_utils/parse_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,6 @@ int32_t parse_options(int32_t* argcp, char*** argvp, parsing_ctx* options, uint3
*/
void print_usage(std::string progname, parsing_ctx* options, uint32_t nops);
void tokenize(const std::string& str, std::vector<uint32_t>& tokens, const std::string& delimiters = "| \t");
void tokenize_verilog(const std::string& str, std::vector<uint32_t>& tokens, const std::string& delimiters = " \t");
void tokenize_verilog(const std::string& str, std::vector<int>& tokens, const std::string& delimiters = " \t");

#endif /* PARSE_OPTIONS_H_ */