473,830 Members | 2,040 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Parsers for C

Hi,

I was interested in knowing of there are parsers in C than can parse C
code in some form of Data Structures and then after some user
manuplation, write back the code in a file.

A commercial tool which can do that would be the best ...

Thanks,

Nikhil

May 3 '06 #1
7 2099
On 3 May 2006 13:53:21 -0700, "Nikhil" <n.********@gma il.com> wrote in
comp.lang.c:
Hi,

I was interested in knowing of there are parsers in C than can parse C
code in some form of Data Structures and then after some user
manuplation, write back the code in a file.

A commercial tool which can do that would be the best ...

Thanks,

Nikhil


Look at http://www.google.com

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.l earn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
May 4 '06 #2
Try Lex & Yacc

May 4 '06 #3
"Nikhil" wrote:
I was interested in knowing of there are parsers in C than can parse C
code in some form of Data Structures and then after some user
manuplation, write back the code in a file.
A commercial tool which can do that would be the best ...
The following is Rod Pemberton's reply to a similar question:

"Rod Pemberton" wrote:

> For a research project, we're looking for a reliable parser for C
> that will take an ANSI C program and yield a tree representation of
> the program (as a Java or C++ object). ...

I don't know which if any of these may fulfill your needs, but they may be
worth a look. I also noticed some of the links are bad as I posted, but
they may still help you to track them down.

CIL - C Intermediate Language - C to C transformation
http://manju.cs.berkeley.edu/cil/

WCC - A C Subset Compiler (DECUS ftp links now appear to be dead...sorry)
http://www.decus.org/libcatalog/desc...ml/v00281.html
ftp://ftp.encompassus.org/lib/

npath - C Source Complexity Measures
http://www.geonius.com/software/tools/npath.html

Check: A unit test framework for C
http://check.sourceforge.net/

CTool Library (call-graph generator, source transformations )
http://ctool.sourceforge.net/

Cproto automatically generates C function prototypes
http://cproto.sourceforge.net/

JSCPP - a C preprocessor + parser with special modes
http://www.die-schoens.de/prg/

CXREF C language cross referencing program
in volume1 of comp.sources.un ix:
http://ftp.sunet.se/pub/usenet/ftp.u....sources.unix/

CSur Le projet Csur (in French)
An analyzer of code C to detect common program execution errors
http://www.lsv.ens-cachan.fr/~goubault/Csur/csur.html

Chico State Mini-C Compiler (CSMCC) is a student training load-and-go
compiler (incomplete, teaching tool)
http://www.ecst.csuchico.edu/~sameerg/compproj.html
http://www.ecst.csuchico.edu/~hilzer/csci250/proj/

Edward Willink's C++ grammars:
http://www.computing.surrey.ac.uk/research/dsrg/fog/
(some of the links have an extra text '/v' in them, just delete)

ISO C/C++ grammars version 1.2 (c-c++-grammars-1.2.tar.gz)
http://www.sigala.it/sandro/download.php

A C99 Parser, a recursive decent parser
http://www.mazumdar.demon.co.uk/c_parser.html

Ctags generates an index (or tag) file of language objects
http://ctags.sourceforge.net/

Cdecl English<->C translator for C declarations
cdecl in volume6 of comp.sources.un ix:
cdecl2 in volume14 of comp.sources.un ix:
http://ftp.sunet.se/pub/usenet/ftp.u....sources.unix/


These additional links may be of some use. ASTRÉE appears to be great
but I don't see any code release...

CCURED memory safe C transformations (for CIL)
http://manju.cs.berkeley.edu/ccured/

C Code Checker (for CIL)
http://www.drugphish.ch/~jonny/cca.html

PScan Scan C files for format string overflows
http://www.striker.ottawa.on.ca/~aland/pscan/

CQUAL C checking through extended type qualifiers
http://www.cs.umd.edu/~jfoster/cqual/

Smatch - Source Matcher, C source checker for Linux Kernel
http://smatch.sourceforge.net/

SPLint Secure Programming Lint error detection
http://www.splint.org

BOON Buffer Overrun detectiON
http://www.cs.berkeley.edu/~daw/boon/

CZECH, project pedantic error detection
http://pedantic.sourceforge.net/

Flawfinder for C (in Python)
http://www.dwheeler.com/flawfinder/

ASTRÉE determines absence of runtime errors (in OCAML)
http://www.astree.ens.fr/
"In Nov. 2003, ASTRÉE was able to prove completely automatically the absence
of any RTE in the primary flight control software of the Airbus A340
fly-by-wire system, a program of 132,000 lines of C"

May 4 '06 #4
"ciju" <ci**********@g mail.com> writes:
Try Lex & Yacc


The question, which you failed to quote, was:

"Nikhil" <n.********@gma il.com> writes:
| I was interested in knowing of there are parsers in C than can parse C
| code in some form of Data Structures and then after some user
| manuplation, write back the code in a file.
|
| A commercial tool which can do that would be the best ...

Please read <http://cfaj.freeshell. org/google/>.

As it turns out, typedefs make C very difficult to parse with just the
usual tools. (I speak from painful experience.) The preprocessor
makes it nearly impossible, unless you parse the code *after* it's
been preprocessed (or implement your own preprocessor as part of your
parser).

A Google search for "C parser" is undoubtedly the best first step.
You can reinvent this particular wheel if you like, but making it
round is going to be harder than you think.

--
Keith Thompson (The_Other_Keit h) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
May 4 '06 #5
Nikhil a écrit :
Hi,

I was interested in knowing of there are parsers in C than can parse C
code in some form of Data Structures and then after some user
manuplation, write back the code in a file.

A commercial tool which can do that would be the best ...

Thanks,

Nikhil


We distribute the lcc-win32 compiler.

We can do exactly what you want and tailor the compiler to parse C in
the form you want and write back the code as you specify.

Please send your specifications indicating what exactly you want to do
to me or to Q software solutions.

http://www.q-software-solutions.de

jacob
May 4 '06 #6

"Roberto Waltman" <us****@rwaltma n.net> wrote in message
news:pp******** *************** *********@4ax.c om...
"Nikhil" wrote:
I was interested in knowing of there are parsers in C than can parse C
code in some form of Data Structures and then after some user
manuplation, write back the code in a file.
A commercial tool which can do that would be the best ...


The following is Rod Pemberton's reply to a similar question:


Thanks Walt. I've posted a more complete list to alt.os.developm ent.

The short google link:
http://groups.google.com/group/alt.o...2981cca7?hl=en
Rod Pemberton
May 5 '06 #7

"Nikhil" <n.********@gma il.com> wrote in message
news:11******** **************@ y43g2000cwc.goo glegroups.com.. .
Hi,

I was interested in knowing of there are parsers in C than can parse C
code in some form of Data Structures and then after some user
manuplation, write back the code in a file.

A commercial tool which can do that would be the best ...


http://www.semanticdesigns.com/Produ...CFrontEnd.html

Meets all of your requirements.

--
Ira Baxter, CTO
www.semanticdesigns.com
May 15 '06 #8

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

Similar topics

1
6066
by: Will Stuyvesant | last post by:
There seems to be no XML parser that can do validation in the Python Standard Libraries. And I am stuck with Python 2.1.1. until my web master upgrades (I use Python for CGI). I know pyXML has validating parsers, but I can not compile things on the (unix) webserver. And even if I could, the compiler I have access to would be different than what was used to compile python for CGI. I need to write a CGI script that does XML validation...
0
1888
by: Magnus Lie Hetland | last post by:
I'm working on a project where I have to create parsers on the fly, based on input to my program. I think Spark seems like a good candidate for the parser generation part, but it seems very geared toward hard-coded parsers. I could, I suppose, set the docstrings of the objects to contain the generated grammars, but that seems sort of like a misuse. Does anyone have any experience with "manually" constructing parsers with Spark, i.e....
2
3942
by: Thomas Guettler | last post by:
Hi! What are the difference between xml.parsers.expat and xml.sax? Up to now I used xml.sax.make_parser and subclass from ContentHandler. I think xml.sax.make_parser uses expat as default. Why should I want to use xml.parsers.expat?
0
1469
by: dagurp | last post by:
I have this code: import xml.parsers.expat parser = xml.parsers.expat.ParserCreate(encoding="UTF-8") text = unicode("<div>þórður</div>",'UTF-8') print parser.Parse(text,1) And this is what I get: UnicodeEncodeError: 'ascii' codec can't encode characters in position 5-6: ordinal not in range(128)
1
1559
by: bloon | last post by:
I know there are three most popular open-source XML parsers. They are expat, libxml, and Xerces. All three are cross-platform. Does anybody test these three parsers? Which one is the fastest when loading and parsing large XML files? Thanks.
2
1574
by: Rick | last post by:
Hi.. I've got some code I wrote in PHP that will generate an HTML page with embedded javascript which in turn creates a new argument string for the browser, but the xhtml parser in Firefox and Opera both complain about my use of &var=value pairs in the generated URL. Below is my code that generates the string, and is part of an embedded HTML page (generated on the fly by a PHP script): function InvokeURL(url_to_forward_to) {
2
1489
by: Dale Strickland-Clark | last post by:
A few days ago there was a discussion about which XML parser to use with Python. However, the discussion didn't cover validating parsers, at least, not w3.org XML Schemas. I looked into all the parsers that came up in the discussion but found no mention of w3.org schemas. It seems there are a few DTD validating parsers but that's all.
2
3744
by: dwelch91 | last post by:
Hi, c.l.p.'ers- I am having a problem with the import of xml.parsers.expat that has gotten me completely stumped. I have two programs, one a PyQt program and one a command line (text) program that both eventually call the same code that imports xml.parsers.expat. Both give me different results... The code that gets called is (print statements have been added for debugging):
0
3195
by: JosAH | last post by:
Greetings, welcome back at the sequel of the parsers article chapter. This part is dedicated to the ExpressionParser, the largest parser class for our little language. This class parses a complete expression and just like the other parser classes calls the Generator on the fly. When the parse has completed successfully, the generated code is returned. Otherwise the parse is aborted and an exception is thrown telling the reason of the...
0
3383
by: JosAH | last post by:
Greetings, this week's article part discusses the parsers used for our little language. We will implement the parsers according to the grammar rules we defined in the second part of this article. As you will see shortly, the implementation of the parsers is an almost one-to-one translation of those grammar rules. Recursive descent parsing The grammar rules are highly recursive, i.e. one rule mentions another rule
0
10769
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10476
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10520
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6940
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5615
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5775
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4408
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3956
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3070
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.