|type definitions firstname.lastname@example.org (Justin Hibbits) (2003-05-18)|
|Re: type definitions email@example.com (2003-05-23)|
|Re: type definitions firstname.lastname@example.org (Justin Hibbits) (2003-05-24)|
|Re: type definitions email@example.com (Chris F Clark) (2003-05-29)|
|From:||Justin Hibbits <firstname.lastname@example.org>|
|Date:||18 May 2003 23:49:20 -0400|
|Organization:||Case Western Reserve University, Cleveland, OH, USA|
|Posted-Date:||18 May 2003 23:49:20 EDT|
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).
Return to the
Search the comp.compilers archives again.