[antlr-interest] ANTLR grammar for reStructuredText

Robin diabeteman at gmail.com
Fri May 27 17:34:30 PDT 2011


I just re-read my email and I may have been a little bit vague in my
questions :-) So I'll start with some more specific ones :

1/ How do I match a line of text?
Since RST is a documentation markup language, there are no limitations in
the characters allowed. How can I match a sequence of words (sentence)
without overlapping with specific RST markup ? (such as comments or
directives)

2/ How do I match RST section titles?
http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#sections
How can I have the parser "remember" the current section number (depth) and
emit an error if the markup is inconsistent with the previous section
titles?

3/ How do I match RST comments?
http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#comments
Since indentation matters, is there another way to do it than the python
parser ? (with a custom TokenStream)

Thanks in advance !

Robin


More information about the antlr-interest mailing list