Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VHDL: proper tests for comment parsing #148

Open
Nic30 opened this issue Jan 22, 2021 · 0 comments
Open

VHDL: proper tests for comment parsing #148

Nic30 opened this issue Jan 22, 2021 · 0 comments

Comments

@Nic30
Copy link
Owner

Nic30 commented Jan 22, 2021

The hdlConvertor rules for parsing of the comments are following.

  • All comments directly before current object are interpreted as a doc of an object
  • The comments after an object on the same line as the start of the object are appended to a doc of the object.
  • Each comment is added to a doc of any object once at most.
  • The doc which does not satisfy any previous condition is omitted from the doc. This involves comments inside of an expressions and other object which can have newline in body.

(Note that it is not possible to infer what object the comment belongs in general, because the comment is not something which is tied to some language object like docstring in python. The hdlConvertor tries the best effort. )

There are objects which can store a comment. The doc string is stored in doc property of the parsed object. Classes of doc capable objects do inherit from

  1. The current problem is that there is not a complete test of all possible VHDL object and for some objects the doc is not parsed or converted back to VHDL.
  2. In order to solve this we need an example VHDL code which will demonstrate a comments which should be converted to a doc for every existing object.
  3. Then we will be able to fix missing https://github.com/Nic30/hdlConvertor/blob/master/include/hdlConvertor/vhdlConvertor/commentParser.h#L15 calls in C++ antlr parser.

@andrasm62

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant