manually rebase from antlr/master
include preliminary changes for Python target