NAME ^

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

AUTHOR ^

kjs

DESCRIPTION ^

pirc/new is a fresh implementation of the PIR language. Maintaining the current default implementation (IMCC) is a bit of a pain, and it contains a lot of "XXX" and "TODO" and other kludge alerts. Eventually, this should be fixed.

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

Note that pirc/new refers to a Lex/Yacc based implementation, while 'pirc' refers to the hand-written recursive-descent implementation, to be found in pirc/src directory.

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

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

NOTES ^

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.

http://sourceforge.net/project/downloading.php?groupname=flex&filename=flex-2.5.33.tar.gz&use_mirror=belnet

Just do:

 $ ./configure
 $ make

Then make sure to overwrite the supplied flex binary.

BUGS ^

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

REPLACING IMCC WITH PIRC ^

Eventually, either IMCC needs to be fixed rigorously, or, rewritten altogether. PIRC is an attempt to do the latter. The following things need to be considered when replacing IMCC with PIRC:

SEE ALSO ^

See also:


parrot