Typical applications of ANTLR would be in parsing domain. My first interaction with ANTLR was for a data generation application. We had this system which consume huge xml streams. The schema types were defined via xsi and testing the code for all conditions was inhumane! Even coming up with data for functional flows was painful. So the solution was to comeup with a template of the xml (using schema) and another template for possible datatypes. Parse the template, create a inmemory tree and walk the tree several times (using custom java code). We picked up a random domain value for substitution for each walk and ended up having a comprehensive data sets. There were certain correlation problems though and it was a different story.
I am writing this as I became a bit nostalgic seeing http://blog.centuryminds.com/2008/09/antlr-tutorial-dependency-injection-language/. Err when was the last time I learned something new!?
You might also want to look at vtd-xml, the next generation XML processing model that is far more powerful than DOM and SAX
ReplyDeletehttp://vtd-xml.sf.net