[antlr-interest] Parsing RTF to Braille

Daniel Warner dwarner at uni-paderborn.de
Tue Jun 26 06:02:55 PDT 2007


Hi Salva,

thanks a lot for the link! I will have a look at your library and the docs. I'm sure there is some information in there, that's useful for me.

Kind regards
Daniel

-----Original Message-----
From: Salvador Gomez [mailto:sgoantlr at gmail.com]
Sent: Tuesday, June 26, 2007 10:48 AM
To: antlr-interest at antlr.org
Cc: Daniel Warner
Subject: Re: [antlr-interest] Parsing RTF to Braille


Hi Daniel,

you can try out my library JRtfTree (port of NRtfTree in C#). It parses an RTF document and generates a DOM-like tree. It's not ANTLR but can be useful. 

You can find docs, examples and downloads in:

(Sourceforge) http://nrtftree.sourceforge.net/     (in english)
(My web) JRtfTree: http://www.sgoliver.net/jrtftree.html   (in spanish)
              NRtfTree: http://www.sgoliver.net/nrtftree.html   (in spanish)


Salva.



On 25/06/07, Daniel Warner < dwarner at uni-paderborn.de> wrote:
Hello,

I'm studying computer sciences and mathematics in Paderborn, and currently I'm working on a university project with the goal to transform RTF-documents into a text-based representation of braille, called HBS. 

The output format HBS is already specified, although there is no grammar (it is all in an existing application and I have to reengineer). Lots of information in a RTF-document is of course irrelevant for blind people and will therefore have to be eliminated. HBS codes a lot of structural information but far less layout information, so I will also be faced with problems such as: What do I do with footnotes, how should I represent text that is colored red (maybe even inconsistently), how can I map layout to structure appropriately, etc. just to mention a few. 

As I want to implement the RTF-HBS-Parser in Java, I naturally looked for parser generators for this language. To me ANTLR v3 seems to be the most promising approach in this area, and I really appreciate Prof. Parr for publishing his tool under the BSD License. 

I already baught his book "The Definitive ANTLR Reference" (and PDF) and have a question concerning the "big picture" for my project:

The RTF specification 1.9 from Microsoft is huge. What approach would you suggest in parsing RTF with ANTLR to the mentioned text-based representation of braille (HBS)? 

1) Use actions in the grammar rules?
2) Create an AST from the RTF input and a tree grammar for the AST that outputs HBS?
3) Use templates?
4) Other suggestions?

Thanks a lot in advance for some hints that help me starting off with my work, 

Daniel Warner

No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.476 / Virus Database: 269.9.6/865 - Release Date: 24.06.2007 08:33
No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.476 / Virus Database: 269.9.8/869 - Release Date: 25.06.2007 17:32



More information about the antlr-interest mailing list