Supporting multiple input syntaxes

luser droog <mijoryx@yahoo.com.dmarc.email>
Wed, 12 Aug 2020 15:20:35 -0700 (PDT)

          From comp.compilers

Related articles
Supporting multiple input syntaxes mijoryx@yahoo.com.dmarc.email (luser droog) (2020-08-12)
Re: Supporting multiple input syntaxes 793-849-0957@kylheku.com (Kaz Kylheku) (2020-08-13)
Re: Supporting multiple input syntaxes DrDiettrich1@netscape.net (Hans-Peter Diettrich) (2020-08-13)
Re: Supporting multiple input syntaxes minforth@arcor.de (2020-08-13)
Re: Supporting multiple input syntaxes mijoryx@yahoo.com.dmarc.email (luser droog) (2020-08-13)
Re: Supporting multiple input syntaxes mijoryx@yahoo.com.dmarc.email (luser droog) (2020-08-13)
RE: Supporting mulitple input syntaxes christopher.f.clark@compiler-resources.com (Christopher F Clark) (2020-08-14)
[14 later articles]
| List of all articles for this month |

From: luser droog <mijoryx@yahoo.com.dmarc.email>
Newsgroups: comp.compilers
Date: Wed, 12 Aug 2020 15:20:35 -0700 (PDT)
Organization: Compilers Central
Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="97063"; mail-complaints-to="abuse@iecc.com"
Keywords: yacc, design, question, comment
Posted-Date: 12 Aug 2020 18:32:54 EDT

I've got my project successfully parsing the circa-1975 C syntax
from that old manual. I'd like to add parsers for K&R1 and c90
syntaxes.


How separate should these be? Should they be complete
separate grammars, or more piecewise selection?


My feeling is that separating them will be less headache, but maybe
there's some advantage to changing out smaller pieces of the grammar
in that it might be easier to make sure that they produce the same
structure compatible with the backend.


Any guidance in this area?


https://github.com/luser-dr00g/pcomb/blob/master/pc9syn.c


[Really, it's up to you. My inclination would be to make them
separate but use some sort of macro setup so you can insert
common pieces into each of the grammars. -John]


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.