[antlr-interest] Re: upgrade question
Terence Parr
parrt at jguru.com
Sun Feb 17 14:42:01 PST 2002
On Sunday, February 17, 2002, at 01:38 PM, nagii5 wrote:
> Thanks, Terrence
> had another question on similar lines.
> with 2.7.0 the following grammer would work
>
> protected SAMPLE: ( {!(LA(1) == '<' && LA(2) == '/' LA(3) == 'f'
> && LA(4) == 'o' && LA(5) == 'o' && LA(6) == '>' } ? NL_CTR )* ;
>
> with 2.7.1, i changed the above to look like
>
> protected SAMPLE: ( options{greedy=false;} : NL_CTR )* ;
>
> protected NL_CTR: c:. {if(c=='\n') newline();} ;
>
> and the generated code looks exactly as the documentation says
> k = 3 isnt enough for such a rule.
>
> what do you suggest i should do in this case.
> meaning should i increase my look ahead to the maximum needed
> i.e. in this case k = 6.
> or should i rather use some other way to deal with such rules.
> which say everything but </foo>
Hmm...i'd increase the max lookahead and see what happens :) It should
only use k=6 when it needs to :)
Ter
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list