2011-08-25 12:47:01 +00:00
|
|
|
CodePage -> (CodeBlock | DocBlock)*
|
2011-08-23 21:26:02 +00:00
|
|
|
|
2011-08-25 12:13:39 +00:00
|
|
|
// lookahead 2 needed here
|
2011-08-25 12:47:01 +00:00
|
|
|
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*
|
2011-08-25 12:47:01 +00:00
|
|
|
|
|
|
|
OrgString ->
|
|
|
|
(<ORG_ID> <SLASH>)* <ORG_ID> <SLASH>?
|
|
|
|
|
2011-08-25 12:13:39 +00:00
|
|
|
Tokens
|
|
|
|
------
|
|
|
|
|
2011-08-25 12:47:01 +00:00
|
|
|
DOC_START -> "%% "
|
|
|
|
EOL -> "\n"
|
|
|
|
NOT_EOL -> ~"\n"
|
|
|
|
DIRECTIVE_START -> "@"
|
2011-08-25 12:13:39 +00:00
|
|
|
NOT_DIRECTIVE_START -> ~"@"
|
2011-08-25 12:47:01 +00:00
|
|
|
SLASH -> "/"
|
|
|
|
ORG_ID -> ~"[/\n]"
|