[antlr-interest] Modifying token text - is it possible?

Vaclav Barta vbar at comp.cz
Tue Nov 20 04:52:35 PST 2007


On Tuesday 20 November 2007 13:30:06 Steve Bennett wrote:
> According to
> http://www.cs.usfca.edu/~parrt/course/652/lectures/antlr-lexers.html it
> ought to be possible to modify a token's text two ways:
>
> FOO: '<'! ... ; // '<' does not become part of the token
>
> FOO: '<' ...{ $setText (...); // $setText manually overrides the matched
> text.
Plain setText works for me (in Java), but note that the syntax is 
target-dependent.

	Bye
		Vasek
--
Open Source integration
http://www.mangrove.cz


More information about the antlr-interest mailing list