Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.compilers > #1844
| From | mail <mail@slkpg.com> |
|---|---|
| Newsgroups | comp.compilers |
| Subject | Re: Parsing partial sentences |
| Date | 2017-04-07 14:37 -0800 |
| Organization | Compilers Central |
| Message-ID | <17-04-005@comp.compilers> (permalink) |
I think the short answer is "no there is not an easy way to handle C #defines," it is fairly hard. Easiest is to get an open source preprocessor and use it to convert the C file to preprocessed C. Then use your converter on that. I have one that kind of almost works posted on my site that you can look at to see one stab at the problem from a formal parsing approach. I think most real preprocessors are less parsers and more just a program. They do need to be able to parse the C constant expression grammar though. The SLK Parser Generator: http://www.slkpg.com
Back to comp.compilers | Previous | Next | Find similar | Unroll thread
Re: Parsing partial sentences mail <mail@slkpg.com> - 2017-04-07 14:37 -0800
csiph-web