Open ccatrett opened 3 weeks ago
Hi @ccatrett,
Tokens associated with the preprocessor directives are stored in a separate channel. If the input only consists of directives, the default channel will contain nothing (except the EOF
token) and you will see an empty syntax tree. You need to specify the directives channel by its ID when creating a token stream and pass it to a SystemVerilogPreParser
instance.
Minimal examples Consider the following
.svh
files:Both files result in the following AST:
(source_text <EOF>)
This should not be the case for either of these two files.
I believe from viewing the .g4 files, it seems like there is support for preprocessor definitions.
Here is the Python script I am running to generate this output:
I would appreciate any help to get these cases working. Thank you.