help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

syntactic completion


From: Murray Hayes
Subject: syntactic completion
Date: 28 Jul 2004 15:15:05 -0700

I am trying to write a completion generator function for the gnu
readline library that uses an existing grammar file to generate
suggestions based on the syntax that has already been entered.

I have gone through the help archives and found some very helpful
articles that contain source code for listing all the possible
satisfying rules:

http://lists.gnu.org/archive/html/help-bison/2002-11/msg00006.html


I have put these code snippets into a complete working program to
experiment with but I am still having some problems getting the
information I need.

The code referenced above places the expect function in the debug
section which doesn't seem to be run unless there is a problem.  The
information that I will be getting from readline is a text string that
holds the line as it has so far been entered and two integers start and
end which represent where the word to be completed start and end in the
string.

>From what I have read in the bison manual, it looks like I will have to
implement an action in every rule to call expect() to extract the rules
that can satisfy the grammar at the arbitrary point indicated by start. 
Is this true or is there an easier way to interrupt the parsing process
at a specified point (perhaps with the lexical analyzer)?

I can supply more information including the program I have that
implements the expect() function I copied from the archives.  Also, here
is a link to the relevant manual section on readline:

http://cnswww.cns.cwru.edu/~chet/readline/readline.html#SEC44


TIA for any help you can offer.


-- 
address@hidden





reply via email to

[Prev in Thread] Current Thread [Next in Thread]