Neither of those seems right to me. The first keys off of the position
of the binary, which could be anywhere with respect to the library module you're in; the second is relative to whatever the current directory is while you're running the script. I would think that something like
use File::Basename qw(dirname); use lib dirname($INC{"P6C/Parser.pm"})."/../../../../lib";
(untested and probably not quite the right path) would be better. Or perhaps it should be ripped out entirely, and any script using P6C::Parser should be required to set the lib path correctly? It partly depends on whether we want to ensure that P6C::Parser preferentially uses the Parse::RecDescent from parrot/lib rather than a system-provided one. Which probably is not the case?
The Parse::RecDescent in parrot/lib is a hacked version that removes a bunch of stuff (tracing code, iirc) from the outputted grammer so that it runs many orders faster than the regular version. Or, to put it another way, it increases P6C's runspeed from "infuriating" to "slow" :)
- Joe