Code Monkey home page Code Monkey logo

dbc-language-syntax's People

Contributors

dependabot[bot] avatar lharri73 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

dbc-language-syntax's Issues

Attribute and comment definitions that wrap lines are not recognized

This is caused by the 'end' environment being keyed on the end of line character rather than the semicolon. The problem then becomes dealing with strings that are also able to wrap lines, but currently would have to be covered under the '(.*)' pattern which only matches a single line.

[Bug] Inline File Comments

So this issue is going to be really nit-picky and is certainly not a must-have for this project. But if you have bandwidth to tackle it, it might be beneficial to have.

File only, single line comments are technically supported in DBC files. These comments are typically not parsed by most commercial applications and more so for documentation purposes inside the DBC file. They are C style comments, so as an example:


// This is a file only comment
BO_ 1234 CANMessage: 8 Node0
    SG_ Signal0 : 0|32@1- (1,0) [0|0] "" Node1 Node2
    SG_ Signal1 : 32|32@1+ (100,0) [0|100] "%" Node1 Node2

BO_ 4321 CANMultiplexed: 2 Node0
    SG_ Multiplexer M : 0|8@1+ (1,0) [0|0] "" Node1
    SG_ Value0 m0 : 8|8@1+ (1,0) [0|0] "" Node1 // I can even do comments after definitions
    SG_ Value1 m1 : 8|8@1+ (1,0) [0|0] "" Node1

CM_ "DBC Template with multiline description";
CM_ BU_ Node0 "The 0th Node";
CM_ BO_ 4321 "Multiplexed CAN-Message";
CM_ SG_ 1234 Signal0 "First signal in this message";

To be very clear when I say 'supported', I mean in an undocumented way. The official Vector DBC specifications don't really outline that file only inline comments are a thing. However, when loading DBC files into Vector's own tool (CANdb++), it will ignore those inline comments and not throw any parsing errors. If you've ever tried to load a malformed DBC into CANdb++, you'll know that it's extremely picky about how items in the file are formatted. Even a minor typo will prevent the file from being parsed and loaded. This leads me to believe that inline comments are intended to be supported for this file format. (note that while // is a supported comment /* is not */

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.