help-bison
[Top][All Lists]
Advanced

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

Re: Sharing grammar between bison and readline for completion


From: Hans Aberg
Subject: Re: Sharing grammar between bison and readline for completion
Date: Sun, 8 Aug 2004 16:19:38 +0200

There was a discussion recently here about that, in the thread "syntactic
completion". -- Check the Help-Bison archive.

The suggestion is this: When you are inputting the next token, completions
will be given by the lexer. When a token just has been input, one uses as
completions the parsing valid 1-lookahead tokens. This can roughly be
obtained from the parsing tables, modulo that the compaction algorithms
used by Bison may in a reduce label an error token as a valid token, until
discovered by a shift move.

At 14:09 +0200 2004/08/08, Thomas Graf wrote:
>Hi
>
>I'm writing a quite complex CLI shell for network configuration and
>thought about using bison to implement the grammer and readline for
>input and character manipulation. So far no problem, however I do
>get into troubles when trying to share the grammar between bison and
>readline for completion. My current approach is to read a complete
>line using readline and then pass it to yyparse for validation and
>processing. In order to implement completion I must share the
>grammar while reading the line which I don't have any idea how to do
>so.
>
>This topic must have been discussed already but all I found was a small
>C++ project which implements completion with bison and yacc but
>implements the grammar twice.
>
>Thanks for any pointers.
>
>--
>Thomas GRAF
>
>
>_______________________________________________
>address@hidden http://lists.gnu.org/mailman/listinfo/help-bison







reply via email to

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