Re: Looking for RC parser (Jacob Navia)
16 Aug 1997 00:22:36 -0400

          From comp.compilers

Related articles
Looking for RC parser (Mojmir Strhan) (1997-08-07)
Re: Looking for RC parser (1997-08-12)
Re: Looking for RC parser (1997-08-16)
Re: Looking for RC parser (1997-08-16)
Re: Looking for RC parser (Bret D Weinraub) (1997-08-20)
| List of all articles for this month |

From: (Jacob Navia)
Newsgroups: comp.compilers
Date: 16 Aug 1997 00:22:36 -0400
Organization: Compilers Central
References: 97-08-024 97-08-042
Keywords: parse, Windows

Mojmir Strhan <> writes:
> > I am looking for PCCTS or YACC/LEX based parser for Windows
> > Resource (.RC) files. Parser should be able to parse .RC files
> > produced by Visual C++ 4.x and 5.0.

I have written a resource compiler for my compiler system 'lcc-win32'.
I didn't use yacc/lex because of the following problem:

Many of the keywords in the resource language accept *optional*
arguments. This means within this lex/yacc framework, that you have to write
a rule for each possible option. Many of the optional arguments are classes
of keywords further complicating this problem. The number of rules
exploses, and you get incomplete but enormous parsers that are very

I found that a recursive descent parser was much more appropiate for the
task at hand. I have used this technique that has been discussed (for instance)
in depth in the book of lcc, written by Fraser and Hanson.(1)

I have implemented all resource types but the FONT resource. This type of
resource is only used in the case you want to use a special font within
your program, without installing it in the system.

What Visual C++ (4.0 or 5.0) concerns, it follows (as it should) the specifi-
cations failry close, because it *must* be compatible with Microsoft's
resource compiler 'rc'.

You can find the binary of my resource compiler (for free) in:

Source code licenses/OEM agreements are possible.

(1) A retargetable C Compiler: Design and Implementation. Benjamin Cummings
        publisher 1995: pages 102 ff
Jacob Navia Logiciels/Informatique
41 rue Maurice Ravel Tel (1)
93430 Villetaneuse Fax (1)

Post a followup to this message

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