I think that as much as can be done with Python rather than using external code like Antlr, the better. Who cares if it is slow? I could imagine a 2-pass approach where the internal Python parser is used to construct a parse tree which is then checked for certain errors. I wrote something like this to check for mismatched numbers of '%' values and arguments in string-formatting operations (see http://home.fnal.gov/~cgw/python/check_pct.html if you are interested). Only sections of code which cannot be parsed by Python's internal parser would then need to be checked by the "stage 2" checker, which could afford to give up speed for accuracy. This is the part I think should be done in Python... for all the reasons we like Python; flexibility, maintainabilty, etc.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4