Skip to content

Error replicating example from the docs #10

@jagjordi

Description

@jagjordi

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

from pyVHDLParser.Token.Parser      import Tokenizer
from pyVHDLParser.Blocks            import TokenToBlockParser
from pyVHDLParser.Base              import ParserException


# Open a source file
with open('strobe_analyzer.vhd', 'r') as fileHandle:
  content = fileHandle.read()


# get a token generator
tokenStream = Tokenizer.GetVHDLTokenizer(content)
# get a block generator
blockStream = TokenToBlockParser.Transform(tokenStream)

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))

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

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions