[antlr-interest] "back to the future" (merged lexer / parser spec)

Anthony Youngman Anthony.Youngman at ECA-International.com
Wed Nov 24 02:06:19 PST 2004


Ask Monty ... "List<List<int>>" is only too legal in AREV (and similar) BASICs.

I don't know how good a filter would be at parsing that, but it might well help - especially as the original language was *defined* using a state transition table ...

Oh - Jens also missed the possibility that either or both the "<"s could be the "less than" operator :-) that's the trap AREV has to watch out for :-)

Cheers,
Wol

-----Original Message-----
From: Terence Parr [mailto:parrt at cs.usfca.edu] 
Sent: 23 November 2004 17:30
To: antlr-interest at yahoogroups.com
Subject: Re: [antlr-interest] "back to the future" (merged lexer / parser spec)



On Nov 23, 2004, at 4:21 AM, Jens Theeß wrote:

>
>
> Terence Parr wrote:
>
>> With this merged spec, ultimately I would like to do context-sensitive
>> (goal-oriented) lexing so we could handle things like the C++ nested
>> template lexing issue.  With input "List<List<int>>" you don't know in
>> the lexer w/o context if the final ">>" is two '>' or one '>>' 
>> (shift).
>>
> I don't know if it's come up before, but "list<list<int>>" actually
> isn't legal in c++. Haven't got the ANSI spec here but at least g++
> 3.3.3 complains with an "error: `>>' should be `> >' in template class
> name". You have to write "list<list<int> >" instead, which should be
> lexable without context. Don't know how it's with the java generics 
> though.

I'm pretty sure java allows >> and makes the lexer track context to get 
the correct answer.

> Anyway, context-sensitive lexing is a feature I'd like to see. When I

Me too!

> find the time (next year or decade), I intend to write a parser for
> Wiki-text using antlr, and I think that this new lexing could come in
> handy there.

Have you seen my TML?  It's wiki-inspired (though I like it better 
<wink>).

http://www.antlr.org/TML/index.tml

Ter
--
CS Professor & Grad Director, University of San Francisco
Creator, ANTLR Parser Generator, http://www.antlr.org
Cofounder, http://www.jguru.com
Cofounder, http://www.knowspam.net enjoy email again!





 
Yahoo! Groups Links



 





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

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 8272 5300, Hong Kong + 852 2121 2388, London +44 (0)20 7351 5000 and New York +1 212 582 2333.

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



 
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

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





More information about the antlr-interest mailing list