[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.tmf] Re: Lookahead value of xtext grammar

Hi Erol,

If you use the ANTLR parser with Xtext you get an ANTLR v3 parser which uses an LL(*) parsing algorithm -- i.e. arbitrary lookahead -- so you shouldn't have to restrict the lookahead. But if you want you can do this by specifying a nested <options> element to the XtextAntlrGeneratorFragment in your MWE workflow (in this example I've also enabled backtracking with memoization):

<fragment class="de.itemis.xtext.antlr.XtextAntlrGeneratorFragment">
<options k="4" backtrack="true" memoize="true"/>
</fragment>


Hope that helps,

--knut

Erol Akarsu wrote:

I am stress testing tmf xtext with a little large grammar.
I have to parse it with lookahead value 4 bceause lookahead =1 is not enough for the nature of grammar.

How can I specify the lookahead value?

Regards

Erol Akarsu