Introduce a common statement-handler interface and a shared DBC parsing context.
Extract handlers for BO_, SG_, and CM_.
Register and instantiate handlers using TypeFactory, then reuse them throughout parsing.
Keep file reading, line tracking, and error reporting in DbcParser.
Preserve frame validation, parsed metadata, CAN ID normalization, and existing behavior for unsupported constructs.
Update README with the handler architecture and registration workflow.
Add tests for dispatch, handler reuse, and unrecognized keywords.
Do not modify generated docs.
Design constraints:
Create handlers once per parser instance or parsing session, rather than once per line.
Keep mutable parsing state in the context so successive file parses remain independent.
Register full statement keywords; distinguish BO_ from BO_TX_BU_.
Introduce a separate format-level factory when a second format is implemented.
Acceptance criteria:
BO_, SG_, and CM_ are dispatched through registered handlers.
Existing parser and decoder regression tests pass.
Parsing multiple files does not retain state from previous files.
Error messages retain file paths and line numbers.
README explains how to register an additional handler.
The project builds without warnings using -Wall -Wextra -Wpedantic -Werror.
Scope:
- Introduce a common statement-handler interface and a shared DBC parsing context.
- Extract handlers for BO_, SG_, and CM_.
- Register and instantiate handlers using TypeFactory, then reuse them throughout parsing.
- Keep file reading, line tracking, and error reporting in DbcParser.
- Preserve frame validation, parsed metadata, CAN ID normalization, and existing behavior for unsupported constructs.
- Update README with the handler architecture and registration workflow.
- Add tests for dispatch, handler reuse, and unrecognized keywords.
- Do not modify generated docs.
Design constraints:
- Create handlers once per parser instance or parsing session, rather than once per line.
- Keep mutable parsing state in the context so successive file parses remain independent.
- Register full statement keywords; distinguish BO_ from BO_TX_BU_.
- Introduce a separate format-level factory when a second format is implemented.
Acceptance criteria:
- BO_, SG_, and CM_ are dispatched through registered handlers.
- Existing parser and decoder regression tests pass.
- Parsing multiple files does not retain state from previous files.
- Error messages retain file paths and line numbers.
- README explains how to register an additional handler.
- The project builds without warnings using -Wall -Wextra -Wpedantic -Werror.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Scope:
Design constraints:
Acceptance criteria: