[antlr-interest] Calculating valid tokens for content assist
Lars von Wedel
lars.vonwedel at gmail.com
Sat May 7 06:15:37 PDT 2011
Did you have a look at Xtext ? It does what you want and uses Antlr under the hood. Therefore, converting your existing grammar might be feasible.
Lars
Am 07.05.2011 um 13:17 schrieb Balint Torok <12toba at gmail.com>:
> Hello!
>
> I have a project in Eclipse where I have an editor for a custom
> language. I am using ANTLR to generate the compiler for it. What I
> need is to add content assist to the editor.
>
> The input is a source code in the custom language, and the position of
> the character where the user requested content assist. The source code
> is most of time incomplete as the user can ask for content assist any
> time. What I need is to calculate the list of possible tokens that are
> valid for the given position.
>
> It is possible to write a custom code to do the calculation, but that
> code would have to be manually kept in sync with the grammar. I
> figured the parser is doing something similar. It has to be able to
> determine at a given context what are the acceptable tokens. Is it
> possible to "reuse" that? What is the best practice in creating
> content assist anyway?
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address
More information about the antlr-interest
mailing list