[antlr-interest] VB If elseif end if?

Anthony Youngman Anthony.Youngman at ECA-International.com
Wed Apr 28 01:29:59 PDT 2004


The way I've handled it is NOT to have "_ttype = Token.SKIP;" in the
lexer.
 
However, this means I end up with an NL token in the parser that I have
to explicitly handle.
 
I chose that route because I have syntax like "ELSE statements newline"
and
 
"
ELSE
   one or several lines of statements
END
"
 
so the newline is syntactically significant.
 
Oh - a quick tip if you do that - have an EOL token in the parser that
eats multiple NLs, and then the other parser rules just process EOLs.
That way you don't have to worry about blank lines :-)
 
Cheers,
Wol

________________________________

From: ronald.petty at milliman.com [mailto:ronald.petty at milliman.com] 
Sent: 27 April 2004 18:45
To: antlr-interest at yahoogroups.com
Subject: [antlr-interest] VB If elseif end if?




And for newlines in the lexer 

NL 
        : 
        (       ("\r\n") => "\r\n" 
        |       '\r' 
        |       '\n' 
        )+ 
        { newline(); _ttype = Token.SKIP; } 
        ; 


This is because in VB the newline after y means your done.  However I
eat all newlines in the lexer.  What are the possible ways around this? 

Thanks for the pointers. 
Ron 
************************************************************************
**************
This communication is intended solely for the addressee and is
confidential. If you are not the intended recipient, any disclosure, 
copying, distribution or any action taken or omitted to be taken in
reliance on it, is prohibited and may be unlawful. Unless indicated
to the contrary: it does not constitute professional advice or 
opinions upon which reliance may be made by the addressee or any
other party, and it should be considered to be a work in progress.
************************************************************************
**************


________________________________

Yahoo! Groups Links


*	To visit your group on the web, go to:
	http://groups.yahoo.com/group/antlr-interest/
	  
*	To unsubscribe from this group, send an email to:
	antlr-interest-unsubscribe at yahoogroups.com
<mailto:antlr-interest-unsubscribe at yahoogroups.com?subject=Unsubscribe> 	  
*	Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service <http://docs.yahoo.com/info/terms/> . 




****************************************************************************

This transmission is intended for the named recipient only. It may contain private and confidential information. If this has come to you in error you must not act on anything disclosed in it, nor must you copy it, modify it, disseminate it in any way, or show it to anyone. Please e-mail the sender to inform us of the transmission error or telephone ECA International immediately and delete the e-mail from your information system.

Telephone numbers for ECA International offices are: Sydney +61 (0)2 9911 7799, Hong Kong + 852 2121 2388, London +44 (0)20 7351 5000 and New York +1 212 582 2333.

****************************************************************************

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20040428/672f015b/attachment.html


More information about the antlr-interest mailing list