I am developing some lexers, and I wrote a custom formatter to help in the development process. Basically, these formatters print out:
Token.Keyword import Token.Text Token.Name.Namespace java.lang.* Token.Operator ; Token.Text
so you can see what is matching what. I have added them to terminal.py. One prints ansi-formatted colour and the other prints plain text. Basically, I copied and modified the Terminal formatter as best I could with my very limited python.