Hans Aberg said the following:
On 4 Feb 2009, at 03:40, José Alburquerque wrote:
Hi. I'm not subscribed to this list, but I'm hoping someone here can
still help me. I'm attempting to develop a small front-end to
dvdauthor in C++ to logically create DVD's to be played in standard
DVD players. I would like to include "command completion"
functionality in an area of the GUI for accepting low level commands
to the DVD player based on a very simple language, already specified
for this purpose by the dvdauthor developers (if I'm not
mistaken)[1]. All I'm really asking for, if possible, is
clarification on whether bison can be used to create a parser for the
simple language and then somehow use the parser to tell what might
come after certain keywords. If so, is it straight forward?
Finally, I've looked a bit at bisonc++ and am wondering if it can be
used instead of bison for the same purposes (I'd rather have C++
classes, if possible). Please, any clarification would be greatly
appreciated.
You can use the .output file that Bison generates to get a set of
possible tokens for each state. The look at the top of the state stack
in the parser that Bison generates, and present that. Not in any
automated fashion, though, as far as I know.
I'm guessing that bisonc++ also generates a .output file. Would you or
anyone else know?
One problem is that the LALR(1) parsing algorithm that Bison uses
makes state compaction which may admit some reductions before a state
where the error/lookahead tokens appears. So this method may note be
correct - strictly speaking, one should use LR(1). But the problem may
not be too severe.
Are there other tools that work with LR(1)? Maybe I can look into those
if they exist. Thanks for your answers. Really appreciate it.
Hans
--
José Alburquerque
jaalburquer...@cox.net
_______________________________________________
help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison