Parsing with DSL

Martin Fowler has a very interesting article on DSL.In particular, parsing in Domain Specific languages. There's a comparison to parsing with XML. As the blog indicate, validating a XML is surely not the hard thing, but extracting the data required from a DOM tree consumes a lot a code and time. Yes, it is true, I've done a lot of xml parsing I've felt it to be true. One of the very interesting points made was the use of ANTLR. Though initial understanding of the syntax may a be a little complex, I think achieving the end result is far easier using ANTLR. I have tried some basics of ANTLR while parsing some ENBF parsing for one of the protocols. Its easier, as in, parse the tokens and populate your objects directly. After reading through the blogs, there's a greater motivation to dig into more of ANTLR :-).

No comments: