[antlr-interest] ANTLR lexer for Python?
Rodrigo B. de Oliveira
rbo at acm.org
Sat Sep 11 11:34:41 PDT 2004
Hi Mark!
You might want to take a look at how I solved that problem for boo[1]
which also happens to use syntactically significant whitespace.
The trick lies in using a token stream filter[2] to transform whitespace
tokens in virtual INDENT/DEDENT tokens (antlr rules!).
If you need more details just let me know.
Cheers,
Rodrigo
[1] http://boo.codehaus.org/
[2]
http://svn.boo.codehaus.org/trunk/src/Boo.AntlrParser/Util/IndentTokenStreamFilter.cs?rev=796&view=auto
Em Sáb, 2004-09-11 às 15:15, mhahndeqo escreveu:
> I'm trying to implement a lexer for Python's indentation scheme and
> I'm beginning to believe it's impossible. I need to detect
> indentation levels and emit indent and dedent tokens. ANTLR seems to
> have no way for me to tell line position.
>
> Has anyone done anything like this? Anyone got any ideas?
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
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