[antlr-interest] "back to the future" (merged lexer / parser
spec)
Jens Theeß
j.theess at tu-bs.de
Tue Nov 23 04:21:15 PST 2004
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.
Anyway, context-sensitive lexing is a feature I'd like to see. When I
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.
Greetings,
Jens
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