473,473 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

code completion

Hi,

Can someone give some hint how to build a code completion parser in C++

John
Dec 10 '06 #1
2 1190

Bruintje Beer wrote:
Hi,

Can someone give some hint how to build a code completion parser in C++

John
Hehe, that is not a simple task, because it has two solutions, both are
bad:

- implement "correct" parser, basically a C++ frontend. This has
significant disadvantage that you will have to wait a couple of seconds
before completion list opens

- implement "heurestic" (read "cheating") parser. Disadvantage is that
it will not be 100% correct

The main purpose of "cheating" is to somehow avoid #include directives,
because this is what makes it slow. Of course, another purpose is to
make the parser simpler, you will want to skip the code you do not
need, e.g. expressions.

Well, enough theory, we implemented one for U++ (www.ultimatepp.org).
In the end, it is quite simple, about 2000 lines. It uses global symbol
database to avoid #include problem. If you are interested, download
U++, open uppsrc/ide project and see CppBase package. Current drawback
is that it does not expand macros, something to fix in next release.

Also, Eclipse and KDevelop contain parsers, you can most likely see
what is going on there as well.

Another project is here
http://www.cs.berkeley.edu/~smcpeak/elkhound/
and it also contains many links to related sites.

Mirek

Dec 10 '06 #2

Bruintje Beer wrote:
Hi,

Can someone give some hint how to build a code completion parser in C++

John
It is a difficult task. I found KDevelop's version to be bug ridden
(although I like the IDE). Microsoft's version in Visual Studio 2005
is pretty good.

Dec 11 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: John | last post by:
Hi, Could you give your opinions on the best code completion in Python IDEs. My only complaint with PythonWin has been that the code completion support is incomplete. The interactive mode has...
1
by: John | last post by:
Hello, I'm working with Dreamweaver MX and we started to develop our website with Javascript too. However, unlike "Eclipse" for Java developement I don't have the support for Javascript code...
67
by: Steven T. Hatton | last post by:
Some people have suggested the desire for code completion and refined edit-time error detection are an indication of incompetence on the part of the programmer who wants such features. ...
5
by: Sarir Khamsi | last post by:
I have a class (Command) that derives from cmd.Cmd and I want to add methods to it dynamically. I've added a do_alias() method and it would be nice if I could turn an alias command into a real...
4
by: D Witherspoon | last post by:
Sometimes if I build the app I will get intellisense, undo, and code completion (automatic completion of if stataments etc), but after a few lines of code this stops. I lose any code completion...
0
by: Nadav | last post by:
Hi, Usage of FileStream ( and other stream related objects ) internally use an IO Completion port, Now, Taking that in mind, does all of the stream object of a certain process use a single IO...
4
by: Let_Me_Be | last post by:
Currently I write most of the code in Vim, mainly because I can write my code remotely using ssh, the problem is that I sometimes find myself lost in the code, and for this I need good code...
9
by: Lukasz Mierzejewski | last post by:
Hi, I need help with pydev code completion... Let's assume that we have something like this: class One: def fun(self): return 1 class Two: li =
16
by: =?ISO-8859-1?Q?Ali_Servet_D=F6nmez?= | last post by:
I don't want to be so mean here, but how hard it could be be writing a freesoftware which would automatically/intelligently auto complete Python code? (I mean something that really does the job,...
9
by: Chris Ahmsi | last post by:
I have been tasked to create a 'simple' form in Access providing managers to input necessary changes. I have 2 command buttons on the form and a check box. Command button 1 updates my table for...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.