Correct!
I just drawing attention that while implementing the whois server,
we've also checked some rpsl parsers, and most of them failed the sanity
checks, even for parsing.
As for interpreting
the mp-export/import lines, those have a grammar that is also included
in the rpsl parser in whois server, although only used for evaluating
syntactic correctness. I think they also could form the basis of a more
complex software.
By the way, at this point a
generic solution becomes impossible as everyone wants to use the
resulting expression tree differently, so it's always a custom work from
the grammar upwards.
Cheers,
Agoston