jlp/doc/grammar.rst

30 lines
595 B
ReStructuredText
Raw Normal View History

SourceFile -> (DocBlock / CodeBlock)*
2011-08-23 21:26:02 +00:00
DocBlock -> (DirectiveBlock / MarkdownBlock)+
2011-08-23 21:26:02 +00:00
Code Block -> ((!DOC_START RemainingLine) / EmptyLine)+
DirectiveBlock -> DOC_START DIRECTIVE_START (LongDirective / LineDirective)
2011-08-25 12:13:39 +00:00
MarkdownBlock -> MarkdownLine+
LongDirective ->
(AUTHOR_DIR / DOC_DIR / EXAMPLE_DIR) RemainingLine MarkdownBlock?
LineDirective -> ORG_DIR RemainingLine
2011-08-25 12:13:39 +00:00
MarkdownLine -> DOC_START !DIRECTIVE_START RemainingLine
RemainingLine -> (!EOL)+ (EOL / EOI)
EmptyLine -> EOL
2011-08-25 12:13:39 +00:00
Tokens
------
DOC_START -> "%% "
EOL -> "\n"
DIRECTIVE_START -> "@"