-
Notifications
You must be signed in to change notification settings - Fork 15
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
Attribute single quote mark errors as "Ambiguous syntax" #11
Comments
pyVHDLParser/Token/Parser.py : 363-365
So buffer[0] is the single quote... doesn't seem like any attribute access will survive this. Am I missing something? |
I changed line 362 to
from
|
Hi, sorry for the wrong issue link in the error message. It's a Parsing attributes is very complex in VHDL and by nature ambiguous. Some parser (to be exact lexers/tokenizers) protect them selves by allowing only attribute names longer then 1 character, otherwise it might get mixed up with character literals Examples:
|
Okay, nice! Only character literals have single quotes, (I believe for longer literals double quotes are required) right? If not one could exhaust the attribute list. Otherwise, perhaps the following is helpful in achieving that definition?
It would catch a chain of attributes as a single compound-attribute, which may be quite neat. The chain will extend until there is a character literal. It'd have to be used recursively if one wants the full tree of literal-attribute accesses. It doesn't care if there are literals before an attribute:
Is ☝️ an issue? |
The list of attributes is not limited. Users can define own attributes, thus comparing against such a list doesn't work. Moreover, a tokenizer doesn't know these details. I just splits the input file into a stream of tokens and tries it's best to figure out what kind of token it is. The Tokenizer in pyVHDLParser already creates more token types then any other parser I know. A literal is a class of base element in a language:
Thus, |
I extensively edited my last comment, primarily because I thought to research literals. Thanks for exhaustively listing them. I think, though, that you weren't answering the meat of what I was querying... I think that, from the get-go, none of the conversation has moved towards a solution:
I am trying to share that the tokeniser failed on my file which used attributes, and I am looking commit the fix. I think 2. may be more immediate and I was looking to see if that was your original intention. I feel that this repo is on hold, so I don't mind if your head is not in the right space to fully consider any fix whatsoever. Just say. |
@RocketRoss yes development here is currently very slow due to other activities. The repo has now >250 test cases and reaches 48% branch coverage. I'm working on improving test coverage and also documentation. While doing so, some bugs where discovered and fixed. Your issue is not yet investigated. For a regexp solution: The My plan is to work more in Christmas holidays on this project. |
Quite excited to see what I can make of the pyVHDLparser. In using it on a simple enough file, I encounter the following:
This seems to be triggered by the access of
'length
... I'll be diving into the Parser.py file to see if I can rectify.Thanks!
The text was updated successfully, but these errors were encountered: