jlp/doc/grammar.rst

32 lines
819 B
ReStructuredText
Raw Normal View History

CodePage -> (CodeBlock | DocBlock)*
2011-08-23 21:26:02 +00:00
2011-08-25 12:13:39 +00:00
// lookahead 2 needed here
DocBlock -> (DirectiveBlock | MarkdownBlock)+
2011-08-23 21:26:02 +00:00
2011-08-25 12:13:39 +00:00
DirectiveBlock ->
<DOC_START> <DIRECTIVE_START> "author" RemainingLine EOL MarkdownBlock? |
<DOC_START> <DIRECTIVE_START> "doc" RemainingLine EOL MarkdownBlock? |
<DOC_START> <DIRECTIVE_START> "example" RemainingLine EOL MarkdownBlock? |
<DOC_START> <DIRECTIVE_START> "org" OrgString EOL
MarkdownBlock -> MarkdownLine+
MarkdownLine ->
<DOC_START> NOT_DIRECTIVE_START RemainingLine <EOL>
RemainingLine -> NOT_EOL*
OrgString ->
(<ORG_ID> <SLASH>)* <ORG_ID> <SLASH>?
2011-08-25 12:13:39 +00:00
Tokens
------
DOC_START -> "%% "
EOL -> "\n"
NOT_EOL -> ~"\n"
DIRECTIVE_START -> "@"
2011-08-25 12:13:39 +00:00
NOT_DIRECTIVE_START -> ~"@"
SLASH -> "/"
ORG_ID -> ~"[/\n]"