Code Completion
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Sandip_Chitale
Posted On:   Thursday, April 26, 2001 12:47 AM

What are general techniques for implementing code completion (aka intellisense) like features ? How could one use ANTLR to develop such a mechanism ? Is it possible to come up with a code completion code given a grammer ?

Re: Re: Code Completion

Posted By:   Sandip_Chitale  
Posted On:   Saturday, April 28, 2001 11:39 PM

Where can I find it "HTML output code generator for ANTLR".

Re: Code Completion

Posted By:   Terence_Parr  
Posted On:   Saturday, April 28, 2001 01:32 PM

Do you mean token completion or sentence completion? Either is a solvable problem. For both tokens and sentences, ANTLR computes (statically before parser execution) the next set of k characters or tokens that could match given the current point in the parse.



I believe the (incomplete) HTML output code generator for ANTLR would be a good start. I think I set it up to dump out FIRST sets (at least for the start of rules). You would have to modify this to ask ANTLR to figure out what can come next at every point in the grammar. Should be fast enough...roughly linear in size of grammar and k. :)
About | Sitemap | Contact