This commit is contained in:
deeaitch committed 2026-10-23 20:28:55 -04:00
1 parent a702cffd93
commit 8d06165979
18 files changed
+611 -215

No files matched your search

+15 -2
View File
@@ -46,6 +46,16 @@ struct PendingAttribute {
std::size_t lineNumber; /**< One-based physical statement line. */
};
/** @brief Deferred extended multiplexing condition and source location. */
struct PendingMultiplexing {
std::uint32_t canId;
bool isExtended;
std::string signalName;
std::string selectorName;
std::vector<MultiplexRange> ranges;
std::size_t lineNumber;
};
/** Mutable state belonging to one file parse. Handlers do not retain it. */
struct DbcParseContext {
DbcDatabase &database; /**< Parsed metadata under construction. */
@@ -54,6 +64,9 @@ struct DbcParseContext {
std::size_t lineNumber = 0U; /**< Physical line of the current statement. */
std::vector<PendingValueDescriptions> pendingValues = {}; /**< Unresolved raw value descriptions. */
std::vector<PendingMultiplexing> pendingMultiplexing = {};
void ResolveMultiplexing(const std::string &filePath);
std::vector<std::vector<std::size_t>> signalLines = {}; /**< Signal definition lines grouped by frame. */
/** @brief Validate selectors, branch ranges, and signal overlap. */
void ValidateMultiplexing(const std::string &filePath) const;
@@ -114,8 +127,8 @@ public:
void Handle(const std::string &line, DbcParseContext &context) const override;
};
/** @brief Reject unsupported extended multiplexing statements. */
class DbcUnsupportedMultiplexingHandler : public DbcStatementHandler {
/** @brief Parse extended multiplexing conditions for deferred resolution. */
class DbcMultiplexingHandler : public DbcStatementHandler {
public:
void Handle(const std::string &line, DbcParseContext &context) const override;
};