From 48eee1ca43f8069ab1ac2bd76ea664ade023551d Mon Sep 17 00:00:00 2001 From: Jonathan Bernard Date: Thu, 25 Aug 2011 07:13:39 -0500 Subject: [PATCH] Finished basic grammar outline. --- README.md | 6 +++++- doc/grammar.rst | 30 +++++++++++++++++++++++------- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 80cb69b..5748a07 100644 --- a/README.md +++ b/README.md @@ -3,4 +3,8 @@ Jonathan's Literate Programming This project grew out of a desire for a documentation system that: -* +* generates all documentation from source-code comments, +* is capable of facilitating both JavaDoc-style API documentation as well as + literate programming style of documentation, +* has pluggable formatting (default to Markdown), + diff --git a/doc/grammar.rst b/doc/grammar.rst index b1021a4..bbf532e 100644 --- a/doc/grammar.rst +++ b/doc/grammar.rst @@ -1,9 +1,25 @@ -DocBlock -> Directive | MarkdownBlock +CodePage -> CodeBlock | DocBlock | CodePage -Directive -> - "@author" MarkdownBlock | - "@doc" MarkdownBlock | - "@example" MarkdownBlock | - "@org" LiteralString +// lookahead 2 needed here +DocBlock -> DirectiveBlock | MarkdownBlock | DocBlock -MarkdownBlock -> +DirectiveBlock -> + "author" RemainingLine EOL MarkdownBlock? | + "doc" RemainingLine EOL MarkdownBlock? | + "example" RemainingLine EOL MarkdownBlock? | + "org" OrgString EOL + +MarkdownBlock -> MarkdownLine+ + +MarkdownLine -> + NOT_DIRECTIVE_START RemainingLine + +RemainingLine -> NOT_EOL* +Tokens +------ + +DOC_START -> "%%" +EOL -> "\n" +NOT_EOL -> ~"\n" +DIRECTIVE_START -> "@" +NOT_DIRECTIVE_START -> ~"@"