[antlr-interest] Followed by (PEG style predicates)

Petteri Räty betelgeuse at gentoo.org
Sun Apr 26 02:47:30 PDT 2009


andreas.meyer at smartshift.de wrote:
> I'm not 100% sure why ANTLR did not generate code for the syntactic predicate, but it seems that you wanted to do things in the lexer, that are now done in the parser: probably you wanted all those pn_start, name_part etc rules to be lexer rules. If so, you have to start them with a capital letter (that's the rule in ANTLR to distinguish lexer from parser rules) Also, you might need to declare "name_part" as a fragment rule, to not interfere with the other tokens.
> 
> Best,
> Andreas
> 

Well I am for whatever gets the job done at this point but if you read
the grammar with thought you will notice that there are other similar
rules to pn like category and slot_name. I could of course use a single
token but I would still need separate parser rules for all those in
order the validate that they use the proper subset of the characters. If
you can show me how to do it with lexer rules then it would be much
appreciated, I could not figure a way yet.

Regards,
Petteri

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: OpenPGP digital signature
Url : http://www.antlr.org/pipermail/antlr-interest/attachments/20090426/ebeca3af/attachment.bin 


More information about the antlr-interest mailing list