[antlr-interest] Short circuit of the lexer
Terence Parr
parrt at jguru.com
Fri Jan 17 22:34:04 PST 2003
On Friday, January 17, 2003, at 02:24 PM, Xavier Decoret wrote:
> I have a grammar with arrays of int defined as follow:
>
> [ 12, 12, 4, 5, 6 ]
>
> The number of numbers in an array can be quite large (several
> thousands)
> and I found that antlr (though it is *really* a cool stuff that
> simplified my life so much) is pretty slow at this. What I would like
> to
> do is entering a special loop when the parser figures out it has
> started
> a list. It would then consume by itself the int to read using fast code
> reading directly the flow of char until it finds a closing bracket
> which
> has to be put back in the flow.
Hi. First, can you give us the simple rules that matched the array?
There may be a more efficient way to specify the language.
Terence
--
Co-founder, http://www.jguru.com
Creator, ANTLR Parser Generator: http://www.antlr.org
Lecturer in Comp. Sci., University of San Francisco
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list