The Artima Developer Community
Sponsored Link

Heron-Centric: Ruminations of a Language Designer
No More YACC and LEX
by Christopher Diggins
December 24, 2004
My answer to YACC and Lex, the YARD parser version 1.0, is now online at


Due to my distaste for parser generation tools like YACC and Lex and being such a completely unreasonable guy, I decided to write my own recursive descent parser. I first did it in Delphi, then I did it in Heron. Now I just finished version 1.0 of the YARD parser for C++ and I've posted it to

The YARD parser is a data-type agnostic CFG parser tool written using template metaprogramming techniques in C++. The YARD parser was designed to be as compact and flexible as possible.

The YARD parser has a significantly different design than its closest cousin, the boost::spirit library, because the grammar productions are defined directly as meta-functions, and there is no funky operator overloading. Semantic actions are defined as template specializations. See my earlier post on Static versus Dynamic Event Handlers in C++.

The YARD parser source code comes with a XML parser as way of a demonstration, of the ease of use etc. There is also a very simple built-in tokenizer for those who might want to use YARD as a powerful lexical analyzer.

Talk Back!

Have an opinion? Readers have already posted 5 comments about this weblog entry. Why not add yours?

RSS Feed

If you'd like to be notified whenever Christopher Diggins adds a new entry to his weblog, subscribe to his RSS feed.

About the Blogger

Christopher Diggins is a software developer and freelance writer. Christopher loves programming, but is eternally frustrated by the shortcomings of modern programming languages. As would any reasonable person in his shoes, he decided to quit his day job to write his own ( ). Christopher is the co-author of the C++ Cookbook from O'Reilly. Christopher can be reached through his home page at

This weblog entry is Copyright © 2004 Christopher Diggins. All rights reserved.

Sponsored Links


Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use