flat assembler
Message board for the users of flat assembler.

Index > High Level Languages > parser for c written in c or c++ language

Author
Thread Post new topic Reply to topic
mos7you



Joined: 11 Oct 2004
Posts: 4
mos7you 19 Jul 2005, 12:46
I need to make some transformation on c files. To do so i need to create an ast from the givven c file.

1) Are there builtin functions in the visual c++ that enable to parse a c file and create the appropriate AST and also to print the new AST as a c file after some transformations.

2) Does anyone have or know a very simple parser(with lex) for c language which is also wtritten in c or c++ which creates an AST from a givven c file and can print the AST as a c source file and as a tree. I know all the parsers of gcc and lcc and some others, however, i want something very small which would be easy to use.

Thanks in advance.
Post 19 Jul 2005, 12:46
View user's profile Send private message Reply with quote
Chewy509



Joined: 19 Jun 2003
Posts: 297
Location: Bris-vegas, Australia
Chewy509 19 Jul 2005, 23:00
I personally don't know of any sources/links that may be appropriate for you, however these types of questions get asked on news://comp.compilers all the time. I suggest you try using google to search the NG for some solid answers.

However for a small C compiler, there's otcc and tcc by Fabrice Bellard. In addition to small C.

http://fabrice.bellard.free.fr/otcc/
http://fabrice.bellard.free.fr/tcc/
http://www.cpm.z80.de/small_c.html
Post 19 Jul 2005, 23:00
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.