[antlr-interest] Looking for a very simple example

Erik Forbes erikforbes at gmail.com
Wed Apr 12 17:16:37 PDT 2006


Greetings all,

I've been messing with ANTLR for two weeks now, and I'm just not getting it.
I don't know why, but I can't wrap my head around the concept behind ANTLR.
I'm starting to think I'm deficient in some way! :(

What I'm trying to do is create for myself a very, VERY simple example for
parsing something like wiki markup. Say, something that can handle
horizontal rule markup, bold and/or italic text, headings, and multiline
centered blocks.

I've seen TML, and I've seen JustWiki's grammar, but they're both extremely
complex and I don't understand them at all. Very intimidating. I've read the
ANTLR manual cover to cover (printed it out...) at least 3 times, and while
I am intensely interested in this sort of thing, I just can't seem to
understand it.

In case anyone is thinking of helping me out, here's the specs I'm looking
for for the simple example.

Horizontal rules should be a line with nothing but this: ----
Bold text should be surrounded with **
Italic text should be surrounded with //
Bold or Italic cannot span multiple lines, but they can nest inside
eachother.
Headings should be a line that starts with 1 or more !, then a space, then
any unformatted text (no bold or italic here)
Centered blocks can be multiline, and are surrounded with triple-colons :::

I've tried to approach this problem from at least 5 angles, and I keep
running into trouble. I just don't understand what I'm trying to do.

Can anyone help?

Thanks,
Erik

--
Support your local gravity testers -- Skydive!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20060412/ee8d6321/attachment.html


More information about the antlr-interest mailing list