Skip to content

Commit 956fa64

Browse files
author
Avi SZYCHTER
committed
More robust DBC parsing
1 parent 9004af1 commit 956fa64

File tree

6 files changed

+265
-223
lines changed

6 files changed

+265
-223
lines changed

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ set(CPPPARSER_INCLUDE_DIRECTORY
1212
set(CPPPARSER_SRC_FILES
1313
src/models/CANDatabase.cpp
1414
src/models/CANFrame.cpp
15-
src/models/CANSignal.cpp
15+
src/models/CANSignal.cpp
1616
src/parsing/DBCParser.cpp
17+
src/parsing/ParsingUtils.cpp
1718
src/parsing/Tokenizer.cpp
1819
src/analysis/CANFrameAnalysis.cpp)
1920

include/ParsingUtils.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,8 @@ bool is_token(Tokenizer& tokenizer, const std::string& token);
3131

3232
bool is_token(Tokenizer& tokenizer, Token::Type token);
3333

34+
bool peek_token(Tokenizer& tokenizer, Token::Type type);
35+
36+
bool peek_token(Tokenizer& tokenizer, const std::string& token);
37+
3438
#endif

include/Tokenizer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class Tokenizer {
1717
void skipLine();
1818
void skipUntil(const std::string& token);
1919
void saveToken(const Token& token);
20+
void saveTokenIfNotEof(const Token& token);
2021

2122
unsigned long long charCount() const;
2223
unsigned long long lineCount() const;

0 commit comments

Comments
 (0)