help-bison
[Top][All Lists]
Advanced

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

RE: Bison 1.50 question: Can it support Auto-Complete?


From: Chris Hundhausen
Subject: RE: Bison 1.50 question: Can it support Auto-Complete?
Date: Tue, 29 Oct 2002 13:27:39 -1000

Nils,

Thanks again for your invaluable help. I think I'm close to getting your
solution to work. I've followed all of your directions through step 2. I
think that the following syntax errors have to do with my failure to do
step 3 in your directions:

Compiling...
salsa.tab.cpp
C:\Cygwin2\Alvis7-6-02\salsa.tab.cpp(2658) : error C2065: 'YYFLAG' :
undeclared identifier
C:\Cygwin2\Alvis7-6-02\salsa.tab.cpp(2679) : error C2065: 'YYNTBASE' :
undeclared identifier
Error executing cl.exe.

Are these the "metatokens" that you talk about in step 3? Where should
they be defined, and what should they be defined as?

I've attached my bison file (salsa.y), my originally-generated file
(salsa.tab.c), and my modified file (salsa.tab.cpp), in which I've made
the modifications you describe in steps 1 and 2.

Note that I hand-inserted your expect() function into my salsa.tab.cpp
file, and that I had to comment out all of the '#line' declarations in
order to get things to compile.

Thanks in advance,

:-)Chris

> -----Original Message-----
> From: Nils Hasler [mailto:address@hidden
> Sent: Sunday, October 27, 2002 10:57 PM
> To: Chris Hundhausen
> Cc: help-bison
> Subject: Re: Bison 1.50 question: Can it support Auto-Complete?
>
>
> Hi Chris.
>
> Sorry, this took a few days...
>
> I attached a simple calculator-grammar, which supports the expect()
> function. After bisoning it I changed the calc.tab.c according to the
> calc.diff.
>
> Incremental parsing is possible with bison too, but *.tab.c has to be
> changed a lot more.
> 1. yyparse() has to be seperated into 2 functions. a start-function
> which only does the initialization of all those local variables. the
> other one yycontinue() does all the parsing.
> 2. the stacks have to be allocated from the heap instead of
> the stack,
> since yycontinue() may return without being finished.
> 3. a metatoken has to be defined, which means that the cursor was hit
> and yycontinue() is supposed to return with some return-code
> (!error &&
> !success).
> if the cursor advances yycontinue() can simply be called
> again and will
> continue parsing where it left off.
> expect() or a similar function can be used at anytime to
> figure out what
> valid tokens can follow the current state.
>
> Nils
>
>

Attachment: salsa.y
Description: Binary data

Attachment: salsa.tab.cpp
Description: Binary data

Attachment: salsa.tab.c
Description: Binary data


reply via email to

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