Swimming with the Razorfishes

Monday, August 15, 2005

Here is one for the geeks.

If someone walked up to you and said, "I need you to write a parser ASAP in Java that can parse basic RTF files," what would you do?

What libraries / frameworks / tools would you use? Assume you just had to separate header (stylesheet) from body, and parse out basic tags like bold and italic, as well as some "special" RTF characters (just numeric values for things like curly quotes).

I just did it by hand, but is seems like javacc or something could make this easier.

2 Comments:

  • JavaCC would make it pretty easy, esp. since you could find a grammer for HTML online.

    http://www.cobase.cs.ucla.edu/pub/javacc/

    -

    By Anonymous Anonymous, at 8:06 PM  

  • s/HTML/RTF/g;

    By Anonymous Anonymous, at 8:08 PM  

Post a Comment

<< Home