home *** CD-ROM | disk | FTP | other *** search
- /*
- * Copyright 2002-2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
- %token line "\-\-\-\- (\-*)";
-
- %token tabletitleitem "\|\|";
- %token tablecolumnitem "\|";
-
- %token titleitem "!!!";
- %token subtitleitem "!!";
- %token subsubtitleitem "!";
-
- %token emitem "''";
-
- %token codeopenitem "\{\{";
- %token codecloseitem "\}\}";
-
- %token strongitem "__";
-
- %token source "\{\{\{ (\}{0,2}[^\}])* \}\}\}";
-
- %token anchor "\[( [^\[\|\]]* \| )? # [^\[\|\]]* \]";
-
- %token link "\[( [^\[\|\]]* \| )? [^\[\|\]]* \]";
-
- %token text "([^\ \t\n\r\[\{\}\|\*\\\-_!#'] | _[^_\n\r] | \{[^\{\n\r] | \}[^\}\n\r] | '[^'\n\r]
- | \[\[ | \\[^\\\n\r] | \-{1,3}[^\-\n\r]?)
- ([^ \n\r\[\{\}\|\\\-_'] | _[^_\n\r] | \{[^\{\n\r] | \}[^\}\n\r] | '[^'\n\r]
- | \[\[ | \\[^\\\n\r] | \-{1,3}[^\-\n\r]? | \|[^\|\ \t])*";
-
- %right softbreak "\r(\n?) | \n";
-
- %right break "\\\\";
-
- %right hardbreak "(\r(\n?) | \n) (\r(\n?) | \n)+";
-
- %token bulleteditem "\*+";
-
- %token numbered1item "#";
- %token numbered2item "##";
- %token numbered3item "###";
-
- %ignore "[\ \t]+";
-
- %start document;
-
- %%
-
- document
- : document section
- | section
- | paragraphs
- ;
-
- section
- : title paragraphs
- | title hardbreak paragraphs
- ;
-
- title
- : titleitem textsequence
- ;
-
- paragraphs
- : paragraphs paragraph hardbreak
- | paragraphs paragraph
- | paragraph hardbreak
- | paragraph
- | paragraphs subsection hardbreak
- | paragraphs subsection
- | subsection hardbreak
- | subsection
- ;
-
- subsection
- : subtitle subparagraphs
- | subtitle hardbreak subparagraphs
- ;
-
- subtitle
- : subtitleitem textsequence
- ;
-
- subparagraphs
- : subparagraphs paragraph hardbreak
- | subparagraphs paragraph
- | paragraph hardbreak
- | paragraph
- | subparagraphs subsubsection hardbreak
- | subparagraphs subsubsection
- | subsubsection hardbreak
- | subsubsection
- ;
-
- subsubsection
- : subsubtitle subsubparagraphs
- | subsubtitle hardbreak subsubparagraphs
- ;
-
- subsubtitle
- : subsubtitleitem textsequence
- ;
-
- subsubparagraphs
- : subsubparagraphs paragraph hardbreak
- | subsubparagraphs paragraph
- | paragraph hardbreak
- | paragraph
- ;
-
- paragraph
- : bulletedlist
- | numberedlist1
- | textsequence
- | line
- | source %prec softbreak
- | source softbreak
- | table
- ;
-
- bulletedlist
- : bulletedlist bulletedlistitem
- | bulletedlistitem
- ;
-
- bulletedlistitem
- : bulleteditem textsequence
- ;
-
- numberedlist1
- : numberedlist1 numberedlistitem1
- | numberedlistitem1
- | numberedlist1 numberedlist2
- | numberedlist2
- ;
-
- numberedlistitem1
- : numbered1item textsequence
- ;
-
- numberedlist2
- : numberedlist2 numberedlistitem2
- | numberedlistitem2
- | numberedlist2 numberedlist3
- | numberedlist3
- ;
-
- numberedlistitem2
- : numbered2item textsequence
- ;
-
- numberedlist3
- : numberedlist3 numberedlistitem3
- | numberedlistitem3
- ;
-
- numberedlistitem3
- : numbered3item textsequence
- ;
-
- table
- : tablehead softbreak tablerows
- | tablehead softbreak tablerows softbreak
- ;
-
- tablehead
- : tablehead tabletitle
- | tabletitle
- ;
-
- tabletitle
- : tabletitleitem textblock
- ;
-
- tablerows
- : tablerows softbreak tablecolumns
- | tablecolumns
- ;
-
- tablecolumns
- : tablecolumns tablecolumn
- | tablecolumn
- ;
-
- tablecolumn
- : tablecolumnitem textblock
- ;
-
- textsequence
- : textsequence textblock softbreak
- | textsequence textblock
- | textblock softbreak
- | textblock
- | textsequence textblock break
- | textblock break
- ;
-
- textblock
- : link
- | anchor
- | strongblock
- | emblock
- | text
- | codeblock
- ;
-
- emblock
- : emitem text emitem
- ;
-
- strongblock
- : strongitem text strongitem
- ;
-
- codeblock
- : codeopenitem text codecloseitem
- ;
-