|
DBC Framework
DBC parsing and CAN signal decoding framework
|
Minimal DBC parser. More...
#include <dbc_parser.h>
Public Member Functions | |
| DbcParser (DbcParserOptions options={}) | |
| Create a parser with explicit extended-frame interpretation options. | |
| DbcDatabase | ParseFile (const std::string &filePath) const |
| Parse DBC file. | |
| DbcParseResult | ParseFileWithDiagnostics (const std::string &filePath) const |
| Parse with warnings and a structured first error instead of throwing. | |
Minimal DBC parser.
Supports:
Frame/signal comments support multiline quoted text and deferred references.
Reports unsupported statements as warnings, except SG_MUL_VAL_ which is an error. VERSION, NS_, BS_, BU_ and NS_ symbol declarations stay quiet.
Definition at line 41 of file dbc_parser.h.
|
inlineexplicit |
Create a parser with explicit extended-frame interpretation options.
Definition at line 44 of file dbc_parser.h.
| DbcDatabase DbcParser::ParseFile | ( | const std::string & | filePath | ) | const |
Parse DBC file.
| filePath | Path to input file. |
| std::runtime_error | on file or parse errors. Line parse errors include the file path and one-based line number. Duplicate normalized CAN IDs of the same frame type and duplicate signal names within a frame are rejected at the repeated definition's line. |
Definition at line 61 of file dbc_parser.cpp.
References DbcParseResult::database, DbcParseResult::diagnostics, and ParseFileWithDiagnostics().
Referenced by main().
| DbcParseResult DbcParser::ParseFileWithDiagnostics | ( | const std::string & | filePath | ) | const |
Parse with warnings and a structured first error instead of throwing.
Definition at line 74 of file dbc_parser.cpp.
References DbcParseResult::database, DbcDiagnosticError::diagnostic, DbcParseResult::diagnostics, DbcStatementDispatcher::Dispatch(), and DbcParserOptions::enableJ1939.
Referenced by ParseFile().