Support for predefined 'locals'

Hi,
extension to fix #43, see:
https://theantlrguy.atlassian.net/wiki/display/ANTLR4/Actions+and+Attributes
although not yet documented $parser was added as per #770
Eric