Closes #33
This commit is contained in:
1 parent
f60faea2e7
commit
f03882d3f4
86 files changed
+3539
-2688
No files matched your search
@@ -639,6 +639,7 @@ if (!result.HasErrors()) {
|
||||
| `Error` / `InvalidValueDescription` | Invalid `VAL_` syntax, duplicate value, or unresolved reference |
|
||||
| `Error` / `InvalidMultiplexing` | Selector, branch range, or signal overlap validation failed |
|
||||
| `Warning` / `UnsupportedStatement` | Unregistered statement skipped; decoding or metadata may be incomplete |
|
||||
| `Error` / `UnsupportedSignalType` | `SIG_VALTYPE_` declaration rejected to prevent incorrect integer decoding |
|
||||
| `Error` / `InvalidMultiplexing` | Invalid `SG_MUL_VAL_` syntax, references, ranges, or cycles |
|
||||
|
||||
Parsing stops at the first error and returns an empty database, together with
|
||||
@@ -646,11 +647,20 @@ any preceding warnings and the error. Deferred comment, `VAL_`, and multiplexing
|
||||
retain their original source lines. Invalid signal markers use `InvalidStatement`.
|
||||
`HasErrors()` checks severity; warnings alone do not make a parse fail.
|
||||
|
||||
Unknown statements are reported conservatively, including `SIG_VALTYPE_`,
|
||||
attribute relation forms (`BA_REL_`, `BA_DEF_REL_`), signal types/references,
|
||||
environment variables, named `VAL_TABLE_` tables, and vendor extensions. For
|
||||
example, ignoring `SIG_VALTYPE_` may decode a floating-point signal as an integer.
|
||||
The parser does not implement the warned features; consumers should review warnings.
|
||||
All `SIG_VALTYPE_` declarations are rejected with `Error / UnsupportedSignalType`.
|
||||
This includes float32 (type 1), float64 (type 2), type 0, unknown types, and
|
||||
malformed declarations: the operator itself is not implemented. `ParseFile()`
|
||||
throws a source-located error; `ParseFileWithDiagnostics()` returns an empty
|
||||
database with the error and any preceding warnings. There is no permissive mode.
|
||||
This prevents IEEE 754 payload bits from being interpreted as a valid integer
|
||||
signal. Integer signals defined with `SG_` without this operator are unchanged.
|
||||
A bare `SIG_VALTYPE_` symbol inside an `NS_` symbol list remains quiet header
|
||||
metadata, rather than a value-type declaration.
|
||||
|
||||
Other unknown statements are reported conservatively, including attribute
|
||||
relation forms (`BA_REL_`, `BA_DEF_REL_`), signal types/references, environment
|
||||
variables, named `VAL_TABLE_` tables, and vendor extensions. The parser does not
|
||||
implement the warned features; consumers should review warnings.
|
||||
|
||||
### Attributes and frame metadata
|
||||
|
||||
@@ -1205,7 +1215,9 @@ Registration creates one handler; replacing a registration replaces that instanc
|
||||
Register during initialization before dispatching. A line is routed using its
|
||||
full first whitespace-delimited keyword, so `BO_TX_BU_` cannot match `BO_`.
|
||||
Unregistered keywords produce `UnsupportedStatement` warnings through
|
||||
`ParseFileWithDiagnostics`. `SG_` and `CM_` accept spaces and tabs after their keywords.
|
||||
`ParseFileWithDiagnostics`. A registered rejection handler for `SIG_VALTYPE_`
|
||||
produces `UnsupportedSignalType` errors instead of skipping the declaration.
|
||||
`SG_` and `CM_` accept spaces and tabs after their keywords.
|
||||
|
||||
This factory handles statements inside DBC files. A separate format-level
|
||||
factory can be introduced when another file format is implemented. The decoder
|
||||
@@ -1280,7 +1292,7 @@ Not supported yet:
|
||||
- multiple parent selectors for one signal
|
||||
- named `VAL_TABLE_` tables and environment-variable value descriptions
|
||||
- attribute relation forms (`BA_REL_`, `BA_DEF_REL_`)
|
||||
- `SIG_VALTYPE_` floating-point signal types
|
||||
- explicit `SIG_VALTYPE_` signal value types (declarations are rejected with an error)
|
||||
- signal types/references (`SGTYPE_`, `SIG_TYPE_REF_`) and environment variables
|
||||
- advanced comment handling
|
||||
- full DBC grammar coverage
|
||||
@@ -1523,6 +1535,10 @@ The demo prints the parsed tree and decodes eight zero bytes using the first
|
||||
frame definition. Replace that sample payload in `examples/main.cpp` to feed
|
||||
live CAN data or trace records.
|
||||
|
||||
The demo prints all parser diagnostics, including severity and source location,
|
||||
and exits with code 2 before building or decoding when parsing reports an error.
|
||||
Warnings remain visible when parsing succeeds.
|
||||
|
||||
### Generate API documentation
|
||||
|
||||
With Doxygen installed, run from the repository root:
|
||||
|
||||
Reference in new issue
Block a user