As suggested by particle++, I added a vtable to the parser in
compilers/pirc.
Now, it's very easy to output PIR /or/ PAST :-) from the parser, without
too much extra code in the parser.
However, as I've only just begun, only very simple stuff will be output.
Changing the flag when creating the parser (in pirmain.c) will change
the output. See pirparser.h for output types.
Another idea: I heard on #parrot that 'bcg' is a project to create an
api for emitting bytecode. Maybe it's an idea to have a look at how good
it would fit compilers/pirc?
regards,
kjs
Seems like a sensible path to explore.
Allison