jlp/doc/grammar.rst
Jonathan Bernard 557feaeb83 Worked on documentation, parser.
* Added planning documentation regrding the process.
* Updated grammer.
* Refactored the test code a bit.
* Added sample input file from vbs-suite
* Refactored the AST node structure created by the parser.
2011-08-29 09:44:05 -05:00

30 lines
595 B
ReStructuredText

SourceFile -> (DocBlock / CodeBlock)*
DocBlock -> (DirectiveBlock / MarkdownBlock)+
Code Block -> ((!DOC_START RemainingLine) / EmptyLine)+
DirectiveBlock -> DOC_START DIRECTIVE_START (LongDirective / LineDirective)
MarkdownBlock -> MarkdownLine+
LongDirective ->
(AUTHOR_DIR / DOC_DIR / EXAMPLE_DIR) RemainingLine MarkdownBlock?
LineDirective -> ORG_DIR RemainingLine
MarkdownLine -> DOC_START !DIRECTIVE_START RemainingLine
RemainingLine -> (!EOL)+ (EOL / EOI)
EmptyLine -> EOL
Tokens
------
DOC_START -> "%% "
EOL -> "\n"
DIRECTIVE_START -> "@"