Parse error in field BU_:
Hello,
I am trying to parse a dbc file with your example code. In line 21 (ifs >> network;) I get this error:
Parse error at 8.5-15: syntax error, unexpected VECTOR_XXX, expecting DBC_IDENTIFIER or EOL
Here is the beginning of my dbc file:
VERSION ""
NS_ :
BS_:
BU_: Vector__XXX
BO_ 267 Sout: 8 Vector__XXX
BO_ 257 Status1: 8 Vector__XXX
SG_ Status1String : 24|8@1+ (1,0) [0|255] "" Vector__XXX
SG_ Status1Init : 8|8@1+ (1,0) [0|255] "" Vector__XXX
SG_ Status1State : 0|8@1+ (1,0) [0|255] "" Vector__XXX
...
The first thing I noticed is, that I can’t find the string “VECTOR_XXX“ from the error message in my file. There are always two underscores between VECTOR and XXX, never one.
Your parser does not like the CAN-Node name “Vector__XXX”. If I change it to “Vector_XXX”, “Vector__XXXX” or “testnode“ the parser seems to work as intended without any problems.
Is this a problem with your parser or is the node name “Vector__XXX” not allowed in the dbc file format?
Unfortunately, I did not create the dbc file and can’t easily change the node name.
Thanks!
Comments (8)
-
repo owner -
repo owner - changed status to open
-
repo owner My understanding is that the node name “Vector__XXX” is not allowed in the DBC file format, as it’s a reserved keyword for “null” entries.
So the only proper handling with the DBC you provided is for the parser to read an empty node (BU_) list. This is what Vector__XXX stands for here.
-
reporter Thanks for the quick reply.
For me it would be totally fine if the parser would just ignore the node entry Vector__XXX and return an empty node list in this case.
-
repo owner I provided a fix for the issue here: https://bitbucket.org/tobylorenz/vector_dbc/branch/fix/issue-15
Can you check, if this solves the issue also on your side?
-
reporter Yes, this seems to fix the issue, thanks!
Would it be possible that you add a tag to the commit when you merge the fix into the master branch? My current build system mainly uses tags to determine the version of libraries to include.
-
repo owner Yes, I will release this as 2.0.6. So, I’ll update the branches master and v2.0. And will add a tag v2.0.6.
The newer compiler version showed me some warning, which I will also fix in this release.
-
repo owner - changed status to resolved
Fixed with the release of v2.0.6.
- Log in to comment
Hello queue14,
the reason is that the “BU_:” shows no nodes and Vector__XXX as the “null” entry isn’t expected here. This is something I can fix in the parser.
Bye
Tobias