Log in

No account? Create an account
January 27th, 2008 - Adventures in Engineering — LiveJournal
The wanderings of a modern ronin.

Ben Cantrick
  Date: 2008-01-27 22:54
  Subject:   What are the best options to create language parsers?
  Mood:der uber-nerd
  Tags:  notes to self, programming, reddit

Interesting article on Reddit.

There's the standard "use lex/flex and yacc/bison" advice, naturally. A few people advocating writing your own recursive descent parsers. Some people saying "use ML or OCAML". But there were also a couple of newer and much more interesting options as well:

http://www.antlr.org/ - A recursive descent parser generator that will output in several popular languages.

http://treetop.rubyforge.org/ - A PEG library for Ruby.

There's even the interesting revelation that Perl's extended regular expression can match balanced sets of parens, so you could in theory write your parser in perl too - i.e..

For the purists, BNF Converter looks like a nice meta-tool.
2 Comments | Post A Comment | | Link

May 2015