Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [imp-dev] Next token possibilties

Hi Andy,

Certainly the parser tables contain the information you're looking for, but I don't think the LPG APIs expose it to clients.

This is really a question for the LPG forums (at SourceForge), but I'll forward it to Philippe Charles (Mr. LPG) and see what he says.

On Sep 2, 2009, at 11:43 AM, Crapo, Andrew (GE, Research) wrote:

I think I've tried to ask this question of Stan before, but I'm going to try again here …

In the language that I am developing with IMP/LPG, there is, as in Java, the concept of a statement and a delimiter that indicates the end of a statement. Given a partially specified statement with some set of tokens {t1, t2, t3} for example, all of the information is present in the language definition to be able to answer the question "What are the set of tokens that are legal next tokens in a legal statement at the end of this incomplete string of tokens?" The answer to this question would be ever so useful in terms of providing completion help to the user. Is there some way to ask this question of the generated parser?

Any help in moving in this direction would be greatly appreciated!

Andy


--
Cheers,
  - Bob
-------------------------------------------------
Robert M. Fuhrer
Research Staff Member
Programming Technologies Dept.
IBM T.J. Watson Research Center

IMP Project Lead (http://www.eclipse.org/imp)
X10: Productivity for High-Performance Parallel Programming (http://x10.sf.net)


Back to the top