[antlr-interest] Changing whitespace significance in the gram mar

mzukowski at yci.com mzukowski at yci.com
Mon Nov 4 07:46:01 PST 2002


>There doesn't seem to be an option for a grammar rule about controling
significance of whitespace.

That's right, the parser can't communicate back to the lexer.  I would
recommend that your lexer enforce the white space rules for html tags.  Look
into lexer states/lexer multiplexing in the documentation.

Monty

-----Original Message-----
From: Paul J. Lucas [mailto:dude at darkfigure.org]
Sent: Sunday, November 03, 2002 11:11 PM
To: antlr-interest at yahoogroups.com
Subject: [antlr-interest] Changing whitespace significance in the
grammar


I read about ignoring whitespace in the lexer, but it's not what I need.  If
I have a language where whitespace is permitted most places, e.g., between
keywords, before and after parentheses, etc., but NOT in a select few
places, e.g., between the "</" and the element name in an HTML close-tag,
how can I express this in the grammar (not the lexer) without having to put
(WS)? peppered all over the grammar except where whitespace is not
permitted?

There doesn't seem to be an option for a grammar rule about controling
significance of whitespace.

- Paul


 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 


 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



More information about the antlr-interest mailing list