in reply to Parse::RecDescent grammar for RTF

How's your C knowledge?

You can find the RTF specification at http://www.wotsit.org/ (like you can most any file format a programmer might need help with), and it includes a sample c reader (Appendix A).

It doesn't look like it'd be too hard to develop a grammar, although it looks like it'd be lots easier to just develop a parser ;)

Anybody looking for a project this smells like a good one.

update:

If you're looking for strategy, try looking at a Latex parser, cause LateX and RTF look very similar if you ask me.

I'm suprised there isn't a opensource library already out there to do this (i know there is a non-free one that looks like it'd be useful).

____________________________________________________
** The Third rule of perl club is a statement of fact: pod is sexy.

Replies are listed 'Best First'.
Re: Re: Parse::RecDescent grammar for RTF
by Willard B. Trophy (Hermit) on Nov 02, 2002 at 21:43 UTC
    I'd revise your statement:

    > Anybody looking for a project this smells like a good one

    to:

    Anybody looking for a project, this smells.

    RTF is an unpleasant format. The basic spec might be okay for creating a writer, but creating a reader that will handle arbitrary RTF is quite hard.

    Thus speaks someone who has just spent the last five months dealing with RTF parsing.

    --
    $,="\n";foreach(split('',"\3\3\3c>\0>c\177cc\0~c~``\0cc\177cc")) {$a++;$_=unpack('B8',$_);tr,01,\40#,;$b[$a%6].=$_};print@b,"\n"

Re: Re: Parse::RecDescent grammar for RTF
by Courage (Parson) on Nov 03, 2002 at 09:47 UTC
    Thank you for a very interesting link, I'll save it for a future.

    As it looks like ready-to-use grammar currently does not exists, I'll try writing one by myself and will show it on this site.
    However, I expect it to be extremely slow on parsing.

    I'll let you know about my further results.

    Courage, the Cowardly Dog