README.txt - Readme file for pirc/new compiler, a fresh implementation of the PIR language using Bison and Flex.




pirc/new is a fresh implementation of the PIR language. Maintaining the current default implementation (IMCC) is a bit of a pain, and I wanted to see how far I could come with a fresh implementation. A lot of ugly things could be removed.

Of course, it is not finished yet. A lot of work is needed on the back-end before it can generate Parrot Byte Code files (PBC).

The current set-up is a three-phase compiler:

The new implementation also has some unique features with respect to IMCC:


Usage ^

Currently the different compilers/pre-processors are located in different directories. The different pre-processors are invoked from the main driver in pirc.c. The latter assumes all three processors are compiled, as the following executables:

 heredoc pre-processor: hdocprep
 macro pre-processor:   macroparser

Running a file through the whole PIR compiler is then done as follows:

 $ ./pirc test.pir

When you want to run the heredoc pre-processor only, do this:

 $ ./pirc -H test.pir

When you want to pre-process the file only (heredoc + macro parsing), do this:

 $ ./pirc -E test.pir

Cygwin processable lexer spec. ^

The file pir.l from which the lexer is generated is not processable by Cygwin's default version of Flex. In order to make a reentrant lexer, a newer version is needed, which can be downloaded from the link below.

Just do:

 $ ./configure
 $ make

Then make sure to overwrite the supplied flex binary.


Having a look at this implementation would be greatly appreciated, and any resulting feedback even more :-)


See also: