Discussion:
C grammar for Coco?
(too old to reply)
Chris Burrows
2009-06-21 04:42:58 UTC
Permalink
re my earlier post today, another possibility for implementing a C to Oberon
converter is to use the compiler generator Coco as a starting point.

Is there a good Coco 'atg' file available for the C language? A subset
containing the most commonly used features might be sufficient.

--
Chris Burrows
CFB Software
Armaide: ARM Oberon-07 Development System
http://www.cfbsoftware.com/armaide
strictly noreply
2009-06-23 10:39:33 UTC
Permalink
Post by Chris Burrows
re my earlier post today, another possibility for implementing a C to Oberon
converter is to use the compiler generator Coco as a starting point.
Is there a good Coco 'atg' file available for the C language? A subset
containing the most commonly used features might be sufficient.
I have been using Coco in a former life but more recently I got into
using ANTLR, in particular via ANTLRworks (a graphical IDE on top of
ANTLR). If you want to rig a translator using a parser generator, I
would definitely recommend using ANTLR over Coco.

Also, somebody made an Oberon back-end for ANTLR, it may well be
whoever did this might also have done some work on an attributed ANTLR
grammar for Oberon. You might want to ask on the ANTLR mailing list,
or check out the back end section on the ANTLR website to see if there
is any contact info for the Oberon back end implementor/maintainer.

--
The email address used for this post is only used for posting,
incoming mail is automatically discarded. Any responses or inquiries
should always be sent to the list where the post appeared.
strictly noreply
2009-06-23 11:16:13 UTC
Permalink
Sorry I wasn't thinking straight when I wrote the second paragraph,
obviously you'd want an attributed C grammar. There is a complete C to
C translator (incl.AST) for ANTLR on the ANTLR website, you could
probably retarget that to generate Oberon instead of C. As I
understand it, the translator supports GCC extensions, too.

http://antlr.org/grammar/cgram
Chris Burrows
2009-06-23 12:56:03 UTC
Permalink
Post by strictly noreply
Sorry I wasn't thinking straight when I wrote the second paragraph,
obviously you'd want an attributed C grammar. There is a complete C to
C translator (incl.AST) for ANTLR on the ANTLR website, you could
probably retarget that to generate Oberon instead of C. As I
understand it, the translator supports GCC extensions, too.
http://antlr.org/grammar/cgram
Thanks for the info. I'm more than happy with Coco's facilities and a major
bonus is that there is a version available that can be used within the
BlackBox Component Builder development environment, so I do not need a
different tool. However, a quick look at the included grammars indicates
they may indeed contain useful information.

--
Chris Burrows
CFB Software
Armaide v2.0: ARM Oberon-07 Development System
http://www.cfbsoftware.com/armaide

Continue reading on narkive:
Loading...