Clearly, it's been a massive pain manually regex'ing my way through Verilog source code and it only works for simplistic codebases that are pretty idealistic.
Instead, further research is required in order to figure out how to parse the complete set of syntactic grammar structures allowed by the Verilog/SystemVerilog LRM. Utilising an already existing library in C++ that performs the task of recognising the structure of a language (provided a comprehensive set of grammars) will allow verilogtree to be scalable, which in its current form is simply not the case.
This ticket simply tracks my research of the choices I have available to me for this task. Once I settle on a solution, I'll create a refactoring ticket that shall integrate that change.
Note: Given Verilog/SystemVerilog parsing is a very useful tool in general, once a solution is found, it'd be worth creating a separate repo for that project so that it can be instantiated in separate projects independently from verilogtree. It could then be instantiated here as a submodule.
Usecase candidates:
- Lex + Yacc (Unix utils)
- Search Github for a C++ equivalent
Clearly, it's been a massive pain manually regex'ing my way through Verilog source code and it only works for simplistic codebases that are pretty idealistic.
Instead, further research is required in order to figure out how to parse the complete set of syntactic grammar structures allowed by the Verilog/SystemVerilog LRM. Utilising an already existing library in C++ that performs the task of recognising the structure of a language (provided a comprehensive set of grammars) will allow verilogtree to be scalable, which in its current form is simply not the case.
This ticket simply tracks my research of the choices I have available to me for this task. Once I settle on a solution, I'll create a refactoring ticket that shall integrate that change.
Note: Given Verilog/SystemVerilog parsing is a very useful tool in general, once a solution is found, it'd be worth creating a separate repo for that project so that it can be instantiated in separate projects independently from verilogtree. It could then be instantiated here as a submodule.
Usecase candidates: