-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
Greetings,
Python I am using:
vhdl_file_path = "C:\\projects\\auto_wapper\\example\\demo.vhd"
# 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)) When run on this .vhd file, everything works fine:
entity demo is
port (
a : in std_logic;
-- b : out std_logic_vector( 15 downto 0 );
c : out std_logic
);
end entity demo;But when I uncomment the line with the std_logic_vector as shown below, I receive the following error.
entity demo is
port (
a : in std_logic;
b : out std_logic_vector( 15 downto 0 );
c : out std_logic
);
end entity demo;pydev debugger: starting (pid: 18620)
[StartOfDocumentBlock]
[LinebreakBlock at (line: 1, col: 1) .. (line: 1, col: 1)]
[Entity.NameBlock 'entity demo is' at (line: 2, col: 1) .. (line: 2, col: 15)]
[LinebreakBlock at (line: 2, col: 15) .. (line: 2, col: 15)]
[IndentationBlock length=4 (4) at (line: 3, col: 1) .. (line: 3, col: 4)]
[PortList.OpenBlock 'port (' at (line: 3, col: 5) .. (line: 3, col: 10)]
[LinebreakBlock at (line: 3, col: 11) .. (line: 3, col: 11)]
[IndentationBlock length=8 (8) at (line: 4, col: 1) .. (line: 4, col: 8)]
[PortList.PortListInterfaceSignalBlock 'a : in std_logic' at (line: 4, col: 9) .. (line: 4, col: 29)]
[PortList.DelimiterBlock ';' at (line: 4, col: 29) .. (line: 4, col: 29)]
[LinebreakBlock at (line: 4, col: 30) .. (line: 4, col: 30)]
[IndentationBlock length=8 (8) at (line: 5, col: 1) .. (line: 5, col: 8)]
ERROR: Expected ';', ':=' or whitespace after subtype indication.
Am I doing something wrong? Any recomendations on how I should proceed? Any and all assistance is greatly appreciated! :)
Metadata
Metadata
Assignees
Labels
No labels