[antlr-interest] Lookbehind and other regex features
Monty Zukowski
monty at codetransform.com
Wed Jul 14 09:51:06 PDT 2004
\On Jul 14, 2004, at 5:08 AM, Eric Mahurin wrote:
> Is there any way to accomplish lookbehind in the lexer or parser? This
> is the main thing that I don't immediately see how to do in ANTLR that
> I could in Perl's regex's.
You could implement this with your own actions in ANTLR if you wanted
to. Override match() to keep a lookbehind buffer. Then just check
against that with semantic predicates.
I'm not familiar with lookbehind, can you point to some examples of its
usefulness? I believe using lexer states serves a similar purpose for
lexers.
Monty
ANTLR & Java Consultant -- http://www.codetransform.com
ANSI C/GCC transformation toolkit --
http://www.codetransform.com/gcc.html
Embrace the Decay -- http://www.codetransform.com/EmbraceDecay.html
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