Giter VIP home page Giter VIP logo

Comments (1)

howerj avatar howerj commented on June 29, 2024 1

Thanks for opening this issue, ideally they'd all be like this one, well documented and reasoned out.

I seem to recall the reason it was removed is that the grammar was causing problems with some DBC files for reasons I cannot remember and will have to remind myself of, and seeing as the program was not using the enum values, the offending bit in the grammar was removed. Development in this project is mainly driven by "why does this not work with my DBC file?".

To answer your questions:

I would probably handle duplicate enum values with your second option, by prefixing the enum with the enum name. It does generate long names, but I think it is sensible to do by default. A command line option could be given to surpress that behaviour, but I would only add that if someone actually asked for it.

You could use the grammar to detect valid C identifiers, the "ident" type encodes most of the rules that detemines whether an id is valid (as both a C id and a DBC one). By adding the suffix "_e" to the generated enumeration values as well then you could avoid having to detect whether or not an enum if a keyword as well.

Looking at the commit you've made, there's still more to do, but it's a good start, and it does not seem to break anything. It might be worth developing a branch "feature/enum" before merging into master. I'd like to add bounds checking and printing before merging.

from dbcc.

Related Issues (20)

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.