Open timjroberts opened 1 year ago
The challenge of building a good semantic highlighter is that it should be architecture-aware, meaning that things like:
should be properly highlighted. All this information can be gleaned by analyzing the architecture-specific include files, such as tna.p4, psa.p4, etc.
In addition to that, the highlighter should also be target-aware so that it can properly highlight:
Unfortunately, there is no standard method to retrieve those. Intel's Tofino compiler allows one to dump all Tofino-specific annotations, but there is no way to dump Tofino-specific table attributes (fortunately, there are not that many).
Semantic highlighter for Emacs supports all the above (@timjroberts -- ask me for the latest version), but only for TNA and T2NA, because all those definitions are hard-coded inside (and I do even update them periodically).
p4analyzer should definitely do better than that.
Discussed in https://github.com/p4lang/p4analyzer/discussions/23