ANTLR instead of Perl?
Author: Sriram Srinivasan (http://www.jguru.com/guru/viewbio.jsp?EID=546826), Nov 24, 2001 ANTLR is a tool, Perl is a language. There are two parser generator utilities available for Perl programmers. byacc (berkeley yacc) has bene ported to take perl actions and output perl code. Also, take a look at the Parse::RecDescent module. It generates top-down recursive descent parsers from a yacc-like spec. You can get further information on both from www.cpan.org. For a given parsing job, I prefer to write Perl code if the grammar is simple (analyzing a web log, for example) or building a calculator. If you have to analyze a piece of java code in some detail, for example, I’d use a tool. On the other hand, Perl comes in really useful for approximate matching jobs, where the match doesn’t have to be absolutely precise. For example, it is not too difficult to extract method signatures from a piece of java code without having to encode the entire grammar. You can make use of a lot of other info