Re: C preprocessor

Ervin Hegedüs <[email protected]>
Newsgroups gmane.comp.parsers.bison.general
Message-ID <[email protected]>
Hi Giacinto,


may be this will not the exact answer what you're waiting for,
but perhaps will help... :)

On Thu, Aug 13, 2020 at 07:49:52AM +0200, Giacinto Cifelli wrote:
> Hi all,
> 
> I am wondering if it is possible to interpret a c-preprocessor (the second
> preprocessor, not the one expanding trigrams and removing "\\\n") or an m4
> grammar through bison, and in case if it has already been done.

There is a very old project, called mccp:

http://mcpp.sourceforge.net/

I'm afraid that's not active but may be useful. Eg. that has a
very good background documentation:

https://kumisystems.dl.sourceforge.net/project/mcpp/mcpp/V.2.7.2/mcpp-summary-272.pdf

Note that IMHO it doesn't use any LR or LALR parser, but I
didn't jumped into the source...

The another project - just found now - which could be interest
for you is this:

https://github.com/facebookarchive/warp

It was written in D, but there is a lexer, which can helps you.


Hope this helps.



a.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.