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: Akim Demaille
Subject: Re: Bison 1.50 question: Can it support Auto-Complete?
Date: 24 Oct 2002 11:26:35 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Honest Recruiter)

Please, no private messages on public stuff.

| Akim,
| Thanks for the suggestion. If I understand you right, your patch works
| in all cases except the case in which the Bison grammar is executed on a
| blank line--that is, the rule that applies is the start rule. Is that
| right?

I probably don't understand what you mean.  My patch had Bison stop
referring to $default, but list all the tokens it ``summarized´´ as
$default. 


| I'm going to experiment with using your patch with my Bison interpreter.
| The problem is that, although my Bison file compiles cleanly with Bison
| 1.35, it does not compile properly with Bison 1.50. I get the following
| errors:
| 
| $ /usr/src/bison-1.50/src/bison.exe salsa.y
| salsa.y:265.16-272.62: type clash (`' `ival') on default action
| salsa.y:274.13-281.36: type clash (`' `ival') on default action
| salsa.y:283.14-290.37: type clash (`' `ival') on default action
| salsa.y:418.7-424.41: type clash (`' `ival') on default action
| salsa.y:425.6-432.41: type clash (`' `ival') on default action
| salsa.y:433.6-440.41: type clash (`' `ival') on default action
| salsa.y:441.6-448.41: type clash (`' `ival') on default action
| salsa.y:450.8-456.24: type clash (`' `ival') on default action
| salsa.y:765.6: parse error, unexpected "|"
| salsa.y:767.6-43: invalid value: $3
| 
| So my question is: Will your patch work with Bison 1.35? If not, do you
| have any idea how I can get rid of the above errors? I've attached the
| flex and bison files for my language.

Thanks I don't need them :)  This is a known issue, and you want to
upgrade to 1.75.  As for `salsa.y:765.6: parse error, unexpected "|"'
there is probably a spurious `;' there.  But I suppose you already
looked at the lines reported as errors.  These changes are fine with
1.35.


| P.S. As an aside, I want to say it would *very useful* to have a tool
| that (a) supplies a list of valid completions at any point in the parse,
| and that (b) works with a bison grammar. I've looked at past postings to
| comp.compilers, and it appears that this is a problem that many, many
| people need to solve. It is especially important for those who build
| interactive development environments. I'm surprised by the lack of tools
| available for this purpose. I don't really want to build my own tool,
| but if bison can't be hacked to do the job, I'm thinking of building my
| own custom tool that takes a bison grammar as input, and builds a state
| machine that can be walked to produce lists of valid next tokens.

Bison can certainly provide this service, please submit patches :).
OTOH, Bison is not a good tool for incremental parsing, so I'm not
sure I understand how people can use it for interactive development
environments :(




reply via email to

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