-
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
Error replicating example from the docs #10
Comments
Can you please attache the error message and stacktrace? This would help a lot. What Python version are you using? |
error trace
the python version is 3.8.1 I have also checked if it works with the code you have in the documentatino and it produces the same error |
I have tried in a linux machine and the result is the same, just FYI |
I´ve got the same error. When inserting the following code block to the code of https://pyvhdlparser.readthedocs.io/en/latest/BlockStream/Usage.html (before the try-block) it runs.
It is copied from unit/__init__.py where the comment says:
So I think this has to be done to run the code without the above mentioned code block, i.e. to solve this issue in a clean way. By the way. It runs but throws an other error after some blocks:
Which belongs to #9 . |
I think that the syntax error is because you are not using python 3.8 version |
I don´t think so as I´m using python 3.8.2 version. |
I had the same issue, just for anyone else, this is what worked for me: vhdl_file_path = "RELATIVE_PATH_TO_YOUR_VHDL_FILE"
# Open a source file
with open(vhdl_file_path, 'r') as fileHandle:
content = fileHandle.read()
from pyVHDLParser.Token.Parser import Tokenizer
from pyVHDLParser.Blocks import TokenToBlockParser
from pyVHDLParser.Base import ParserException
# get a token generator
tokenStream = Tokenizer.GetVHDLTokenizer(content)
# get a block generator
blockStream = TokenToBlockParser.Transform(tokenStream)
from pyVHDLParser.Blocks import MetaBlock
for block in MetaBlock.BLOCKS:
try:
block.__cls_init__()
except AttributeError:
pass
try:
for block in blockStream:
print("{block!s}".format(block=block))
for token in block:
print(" {token!s}".format(token=token))
except ParserException as ex:
print("ERROR: {0!s}".format(ex))
except NotImplementedError as ex:
print("NotImplementedError: {0!s}".format(ex)) |
This tool is still in alpha state. I want to implement the 2 missing main features in my Christmas holidays. |
@Paebbels Thank you very much for your support! |
The project contains now >250 test cases and reaches circa 48% branch coverage. More tests are coming ... When this works, I can add issue testcases, this means an minimal failing example can added to the test suite for regression testing. |
I am trying to run the example from the docs https://pyvhdlparser.readthedocs.io/en/latest/BlockStream/Usage.html
And I get an NoneType is not iterable error.
here is my code
and you can see the vhdl file I am using to test this attetched (just change the extension to vhd, stupid github issue woudltn let me upload .vhd files.....)
strobe_analyzer.txt
The text was updated successfully, but these errors were encountered: