aboutsummaryrefslogtreecommitdiff
path: root/src/Markdown/markdown.bnf
diff options
context:
space:
mode:
authorIlya Ryzhenkov <orangy@jetbrains.com>2014-09-25 22:20:58 +0400
committerIlya Ryzhenkov <orangy@jetbrains.com>2014-09-25 22:20:58 +0400
commitf7bab78839cea5674658a6a0298f88ef5ccca019 (patch)
tree51d17c02f8f935b26a9c9d85905fc33c18ebd6a1 /src/Markdown/markdown.bnf
parenta070217e942a16ed7b5ee63e98a4183788c8e660 (diff)
downloaddokka-f7bab78839cea5674658a6a0298f88ef5ccca019.tar.gz
dokka-f7bab78839cea5674658a6a0298f88ef5ccca019.tar.bz2
dokka-f7bab78839cea5674658a6a0298f88ef5ccca019.zip
Markdown, sections, styles and lots more.
Diffstat (limited to 'src/Markdown/markdown.bnf')
-rw-r--r--src/Markdown/markdown.bnf83
1 files changed, 83 insertions, 0 deletions
diff --git a/src/Markdown/markdown.bnf b/src/Markdown/markdown.bnf
new file mode 100644
index 00000000..b0a3ede6
--- /dev/null
+++ b/src/Markdown/markdown.bnf
@@ -0,0 +1,83 @@
+{
+ psiPackage = 'org.jetbrains.markdown'
+ psiImplPackage = 'org.jetbrains.markdown.impl'
+
+ parserClass="org.jetbrains.markdown.MarkdownParser"
+ parserUtilClass="org.jetbrains.dokka.Markdown.GeneratedParserUtilBase"
+ elementTypeHolderClass = 'org.jetbrains.markdown.MarkdownElementTypes'
+
+ tokenTypeClass = 'org.jetbrains.dokka.Markdown.MarkdownTokenType'
+
+ tokens=[
+ LINE_WS='regexp:[\ \t\f]'
+ EOL='"\r"|"\n"|"\r\n"'
+ BOM = '\357\273\277'
+ number='regexp:\d+(\.\d*)?'
+ String='regexp:[^~\*_`&\[\]()<!#\\ \t\n\r]+'
+ AnyChar='regexp:.'
+ ]
+}
+
+Document ::= BOM? ( Block )*
+
+OptionalSpace ::= Spacechar*
+RequiredSpace ::= Spacechar+
+NonindentSpace ::= (" " | " " | " ")?
+
+BlankLine ::= OptionalSpace Newline
+
+Whitespace ::= Spacechar | Newline
+EndLine ::= LineBreak | TerminalEndline | NormalEndline
+NormalEndline ::= OptionalSpace Newline !BlankLine
+TerminalEndline ::= OptionalSpace Newline <<eof>>
+LineBreak ::= " " NormalEndline
+Indent ::= "\t" | " "
+
+// ---- BLOCKS ----
+Block ::= BlankLine* (
+ Para
+ | Plain
+ | OrderedList
+ | BulletList
+ )
+
+Para ::= NonindentSpace Inlines (BlankLine+ | TerminalEndline)
+Plain ::= Inlines
+
+HorizontalRule ::= NonindentSpace
+ ( '*' OptionalSpace '*' OptionalSpace '*' (OptionalSpace '*')*
+ | '-' OptionalSpace '-' OptionalSpace '-' (OptionalSpace '-')*
+ | '_' OptionalSpace '_' OptionalSpace '_' (OptionalSpace '_')*)
+ OptionalSpace Newline BlankLine+
+
+Bullet ::= !HorizontalRule NonindentSpace ('+' | '*' | '-') Spacechar+
+Enumerator ::= NonindentSpace number '.' Spacechar+
+
+BulletList ::= &Bullet List
+OrderedList ::= &Enumerator List
+
+List ::= (ListItem BlankLine*)+
+ListItem ::= (Bullet | Enumerator) ListBlock ( ListContinuationBlock )*
+
+ListBlock ::= !BlankLine Plain ( ListBlockLine )*
+ListBlockLine ::= !BlankLine !(Indent? (Bullet | Enumerator)) !HorizontalRule Indent? Plain
+
+ListContinuationBlock ::= BlankLine* (Indent ListBlock)+
+
+
+// ---- INLINES ----
+Inlines ::= (!EndLine Inline | EndLine &Inline )+ EndLine?
+Inline ::= String | EndLine | RequiredSpace | Strong | Emph | Link
+
+Emph ::= EmphStar | EmphUnderscore
+EmphStar ::= '*' !Whitespace (!'*' Inline)+ '*'
+EmphUnderscore ::= '_' !Whitespace (!'_' Inline)+ '_'
+
+Strong ::= StrongStar | StrongUnderscore
+StrongStar ::= '**' !Whitespace (!'**' Inline)+ '**'
+StrongUnderscore ::= '__' !Whitespace (!'__' Inline)+ '__'
+
+Link ::= ReferenceLink
+ReferenceLink ::= ReferenceLinkSingle
+ReferenceLinkSingle ::= '[' Target ']'
+Target ::= String \ No newline at end of file