type definitions

Justin Hibbits <hibbits@cme.nist.gov>
18 May 2003 23:49:20 -0400

          From comp.compilers

Related articles
type definitions hibbits@cme.nist.gov (Justin Hibbits) (2003-05-18)
Re: type definitions bear@sonic.net (2003-05-23)
Re: type definitions hibbits@cme.nist.gov (Justin Hibbits) (2003-05-24)
Re: type definitions cfc@world.std.com (Chris F Clark) (2003-05-29)
| List of all articles for this month |
From: Justin Hibbits <hibbits@cme.nist.gov>
Newsgroups: comp.compilers
Date: 18 May 2003 23:49:20 -0400
Organization: Case Western Reserve University, Cleveland, OH, USA
Keywords: parse, types
Posted-Date: 18 May 2003 23:49:20 EDT

Hi,


I'm working on a compiler library, and extensions to yacc to allow
people to easily write language definitions, and build compilers with
very little C code in the definition/grammar. But, I'm stuck, and
can't figure out how to cleanly represent type definitions using a
yacc-like syntax, so that one only has to write "set_type( TYPE_NAME )"
in order to set the type, and perform sanity checking (making sure
types don't conflict, types aren't specified more than allowed, etc).
Almost everything else that the frontend library needs to handle is
already implemented, so this is more or less the final step in
creating the parse tree. I had some working code before, but it was
very dirty, and doesn't fit exactly how I want to do things (was using
bit masks and a custom set_type function for every compiler).


If anyone has a good idea, please let me know. I want to make my
compiler as source-language independant as possible (not tied to be a
specific language compiler, but can be used to write a compiler for
several languages with relative ease).


Thanks,


Justin Hibbits


Post a followup to this message

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