[antlr-interest] Q re use of Semantic Predicates

John D. Mitchell johnm-antlr at non.net
Mon Jun 6 08:54:06 PDT 2005


>>>>> "Gerald" == Gerald B Rosenberg <gbr at newtechlaw.com> writes:
[...]

> XMLTAG: '<' { this.inXmlTag = true; } WORD WS ATTR ('/')?  '>' {
> this.inXmlTag = false; }
> ;

> WORD: ( {this.inXmlTag}? ( LETTERS | PUNCT1 ) ) | ( LETTERS | NUMBERS |
> PUNCT2 )
> ;

Is there some reason why you can just have two different rules?  I.e.,
WORD and TAGWORD, or somesuch?

Have fun,
	John


More information about the antlr-interest mailing list