help-bison
[Top][All Lists]
Advanced

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

Autocomplete with bison?


From: Adam Smalin
Subject: Autocomplete with bison?
Date: Sat, 22 Dec 2012 19:45:15 -0500

Heres some mock up syntax

class A { int var }
A a
function() {
Z&a.ImHere

I'd like a way to get some kind of autocomplete at the ImHere point. I have
no idea how i might so lets hear what you guys think.

First off the grammar is incomplete. The function doesnt have a end curly
brace and that line itself may be invalid. The line may be invalid too.
Actually if its C++ and Z &a meant we are defining a reference then .imHere
is incorrect. However if Z is a var then .ImHere would be a member.

The next problem is I need to be able to parse what I have so far to create
a guess even if the syntax of the line is incorrect. I think the error
keyword in bison will help??

But theres also ambiguity problems. Like i said Z&a could be a reference
type or a bitwise and. Not that my grammar is ambigious but there are a few
places where it must shift/reduce because it needs a few more tokens to
figure out what rule is wanted.

I'm sure most of the work is figuring out where in code i am via
line/column #. Is all I have to do with bison is figure a way to not get
bison to go crazy using the error keyword and parse as much valid (and
invalid) syntax as I can??


reply via email to

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