in reply to Translating from one programming language to another automated

Parse::RecDescent has been mentioned by other posters. Parse::RecDescent can certainly do the job, but will it be fast enough? There are two reasons why Parse::RecDescent is slow. First, it's written in pure Perl, and that loses on speed compared to tools written in C. Second, Parse::RecDescent is a tool for parsing recursive descent grammars. And that's a pretty broad class of grammars; any context insensitive grammar can be parsed with a recursive descent parser. Parse::RecDescent generates trial-and-error parsers, all branches will be tested, until either a parse has been found, or all options have been tried. This could mean the parser consumes the entire string, figures out it cannot match, backtracks to the beginning of the string, and tries again with another rule.

Yacc based grammars don't backtrack (or backtrack at most one token). By looking ahead just a single token, they can decide which rule to apply, and then they do not have to try another rule, even if the choosen rule turned out to lead to a mismatch. Subclasses of the class of context free grammars, like LL(k), LR(k), LALR(k), etc can decide which rule is needed by looking ahead a fixed number of tokens.

Another thing to consider is that Parse::RecDescent does not have a tokenizer. It generaters combined lexer/parsers.

Conclusion, Parse::RecDescent will very likely do the job. But it might not give the performance you are seeking. I've never worked with Parse::YAPP, so I will not comment on it.

Abigail