|Using BTYACC to write C compiler J.R.Hall@dcs.warwick.ac.uk (Jules) (1996-05-08)|
|Re: Using BTYACC to write C compiler Scott.Nicol@infoadvn.com (1996-05-10)|
|Re: Using BTYACC to write C compiler firstname.lastname@example.org (1996-05-19)|
|Date:||8 May 1996 00:24:31 -0400|
|Keywords:||C, question, comment|
I am relatively new to compiler writing, and after reading this
newsgroup for a while decided that a good place to start would be by
learning the how to use the BTYACC utility, which is apparently highly
I have a requirement to have a working [ANSI] C compiler, that
produces output in a format recognisable by a particular assembler,
and which is capable of compiling both itself and that assembler (for
an operating system project I am involved in).
I have started work with the ``ansiC.y'' and ``ansiC2.y'' grammars
that were included in the BTYACC package, and wrote a lexical analyser
for these using FLEX. My problem is that while trying to parse my
assembler (which is an almost correct ANSI C program, and at least
accepted as syntactically correct by every C compiler I've tried it
on), the grammar freezes after a certain point, and I am unsure why.
Do you have any advice on techniques I could use to work on this
problem, or are there any known bugs in the ansiC.y and ansiC2.y
specifications (the same happens whichever of these I use), or in
BTYACC itself that could cause this?
I must confess to being completely stumped.
The sources for the program I am attempting to parse are a little too
large to include here, if you would like to have a look at my code,
email me and I'll send you a copy by mail.
Thanks in advance for your help,
Julian R Hall preferred --->> email@example.com
THE NETWIDE ASSEMBLER PROJECT: http://www.dcs.warwick.ac.uk/~jules/nasm1.html
[I'd start with lcc. There's a lot more to a C compiler than the parser.
Return to the
Search the comp.compilers archives again.