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

Terence Parr parrt at cs.usfca.edu
Tue Nov 23 09:29:42 PST 2004



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

<*> 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