From: Ken A. <kan...@bb...> - 2004-07-02 21:19:14
|
Geoffrey sent me an article on ANTLR, a Java/C++ parser generator. I normally avoid such tools because their manual doesn't fit in my head long enough between uses. Many common parsing problems are little more the lexing, such as tab delimited, fixed with fields, and i have good lexing technology in my head. The problem is i don't have a good parsing approach yet, and i've been waiting a long time. I'd like to use parser combinators but i've never worked on it enough to get a real example working. I have used Mitch Wand's LL1 generator to parse CORBA IDL. But ANTLR got me thinking... 1. What if we could show some examples of using ANTLR and JScheme to get quick little mini languages, or Scheme like languages with alternative syntax, as Tim has been talking about. 2. We could use ANTLR's lexer to generate a llexer and use JScheme to provide the little be more that you need than lexing to your data organized. 3. Use Jscheme lexer in the above item. We aught to be able to take a specification like: Here's a tab separated file. The first line describes the fields. The fields can be int, double, or String, you figure out which. Write me a Java bean that describes each row. Write me a reader that will read such a file and return a Vector of objects. k |