forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From je...@apache.org
Subject cvs commit: xml-forrest/src/resources/grammars wiki.grm wiki.xgrm wiki.xlex
Date Sun, 27 Apr 2003 06:05:58 GMT
jefft       2003/04/26 23:05:58

  Modified:    src/resources/grammars wiki.grm wiki.xgrm wiki.xlex
  Log:
  o Upgrade to the Wiki grammar in Cocoon CVS
  o Fix a grammar bug where spaces after links were lost, by making the following
    change:
  
  -%token text  "([^\ \t\n\r\[\{\}\|\*\\\-_!#'] | _[^_\n\r] | \{[^\{\n\r] | \}[^\}\n\r] |
'[^'\n\r]
  +%token text  "([^\t\n\r\[\{\}\|\*\\\-_!#'] | _[^_\n\r] | \{[^\{\n\r] | \}[^\}\n\r] | '[^'\n\r]
  
  Revision  Changes    Path
  1.2       +57 -9     xml-forrest/src/resources/grammars/wiki.grm
  
  Index: wiki.grm
  ===================================================================
  RCS file: /home/cvs/xml-forrest/src/resources/grammars/wiki.grm,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- wiki.grm	26 Apr 2003 12:23:15 -0000	1.1
  +++ wiki.grm	27 Apr 2003 06:05:58 -0000	1.2
  @@ -1,5 +1,5 @@
   
  -%token line "\-\-\-\- (\-+)";
  +%token line "\-\-\-\- (\-*)";
   
   %token bulleteditem "\*+";
   
  @@ -10,7 +10,9 @@
   %token tabletitleitem  "\|\|";
   %token tablecolumnitem "\|";
   
  -%token titleitem "!+";
  +%token titleitem "!!!";
  +%token subtitleitem "!!";
  +%token subsubtitleitem "!";
   
   %token emitem "''";
   
  @@ -25,11 +27,15 @@
   
   %token link   "\[( [^\[\|\]]* \| )?   [^\[\|\]]* \]";
   
  -%token text  "([^\ \t\n\r\[\{\}\|\*_!#'] | _[^_] | \{[^\{] | \}[^\}] | '[^'] | \[\[)
  -              ([^    \n\r\[\{\}\|_']     | _[^_] | \{[^\{] | \}[^\}] | '[^'] | \[\[ | \|[^\|\
\t])*";
  +%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)+";
   
   %ignore "[\ \t]+";
  @@ -49,11 +55,55 @@
     | 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 
  @@ -134,15 +184,13 @@
     : tablecolumnitem textblock
     ;
     
  -title 
  -  : titleitem textsequence
  -  ;
  -
   textsequence 
     : textsequence textblock softbreak
     | textsequence textblock 
     | textblock softbreak  
  -  | textblock           
  +  | textblock
  +  | textsequence textblock break
  +  | textblock break
     ; 
   
   textblock 
  
  
  
  1.2       +111 -8    xml-forrest/src/resources/grammars/wiki.xgrm
  
  Index: wiki.xgrm
  ===================================================================
  RCS file: /home/cvs/xml-forrest/src/resources/grammars/wiki.xgrm,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- wiki.xgrm	26 Apr 2003 12:23:15 -0000	1.1
  +++ wiki.xgrm	27 Apr 2003 06:05:58 -0000	1.2
  @@ -1,6 +1,6 @@
  -<?xml version="1.0" encoding="UTF-8"?>
  +<?xml version="1.0" encoding="ISO-8859-1"?>
   <grammar xmlns="http://chaperon.sourceforge.net/schema/grammar/1.0">
  -  <!--This file was generated! Don't edit!-->
  +<!--This file was generated! Don't edit!-->
     <priority>
       <terminal symbol="line"/>
       <terminal symbol="bulleteditem"/>
  @@ -10,6 +10,8 @@
       <terminal symbol="tabletitleitem"/>
       <terminal symbol="tablecolumnitem"/>
       <terminal symbol="titleitem"/>
  +    <terminal symbol="subtitleitem"/>
  +    <terminal symbol="subsubtitleitem"/>
       <terminal symbol="emitem"/>
       <terminal symbol="codeopenitem"/>
       <terminal symbol="codecloseitem"/>
  @@ -19,10 +21,12 @@
       <terminal symbol="link"/>
       <terminal symbol="text"/>
       <terminal symbol="softbreak"/>
  +    <terminal symbol="break"/>
       <terminal symbol="hardbreak"/>
     </priority>
  -  <associativity symbol="softbreak" type="right"/>
  -  <associativity symbol="hardbreak" type="right"/>
  +  <associativity type="right" symbol="softbreak"/>
  +  <associativity type="right" symbol="break"/>
  +  <associativity type="right" symbol="hardbreak"/>
     <production symbol="document">
       <nonterminal symbol="document"/>
       <nonterminal symbol="section"/>
  @@ -42,6 +46,10 @@
       <terminal symbol="hardbreak"/>
       <nonterminal symbol="paragraphs"/>
     </production>
  +  <production symbol="title">
  +    <terminal symbol="titleitem"/>
  +    <nonterminal symbol="textsequence"/>
  +  </production>
     <production symbol="paragraphs">
       <nonterminal symbol="paragraphs"/>
       <nonterminal symbol="paragraph"/>
  @@ -58,6 +66,96 @@
     <production symbol="paragraphs">
       <nonterminal symbol="paragraph"/>
     </production>
  +  <production symbol="paragraphs">
  +    <nonterminal symbol="paragraphs"/>
  +    <nonterminal symbol="subsection"/>
  +    <terminal symbol="hardbreak"/>
  +  </production>
  +  <production symbol="paragraphs">
  +    <nonterminal symbol="paragraphs"/>
  +    <nonterminal symbol="subsection"/>
  +  </production>
  +  <production symbol="paragraphs">
  +    <nonterminal symbol="subsection"/>
  +    <terminal symbol="hardbreak"/>
  +  </production>
  +  <production symbol="paragraphs">
  +    <nonterminal symbol="subsection"/>
  +  </production>
  +  <production symbol="subsection">
  +    <nonterminal symbol="subtitle"/>
  +    <nonterminal symbol="subparagraphs"/>
  +  </production>
  +  <production symbol="subsection">
  +    <nonterminal symbol="subtitle"/>
  +    <terminal symbol="hardbreak"/>
  +    <nonterminal symbol="subparagraphs"/>
  +  </production>
  +  <production symbol="subtitle">
  +    <terminal symbol="subtitleitem"/>
  +    <nonterminal symbol="textsequence"/>
  +  </production>
  +  <production symbol="subparagraphs">
  +    <nonterminal symbol="subparagraphs"/>
  +    <nonterminal symbol="paragraph"/>
  +    <terminal symbol="hardbreak"/>
  +  </production>
  +  <production symbol="subparagraphs">
  +    <nonterminal symbol="subparagraphs"/>
  +    <nonterminal symbol="paragraph"/>
  +  </production>
  +  <production symbol="subparagraphs">
  +    <nonterminal symbol="paragraph"/>
  +    <terminal symbol="hardbreak"/>
  +  </production>
  +  <production symbol="subparagraphs">
  +    <nonterminal symbol="paragraph"/>
  +  </production>
  +  <production symbol="subparagraphs">
  +    <nonterminal symbol="subparagraphs"/>
  +    <nonterminal symbol="subsubsection"/>
  +    <terminal symbol="hardbreak"/>
  +  </production>
  +  <production symbol="subparagraphs">
  +    <nonterminal symbol="subparagraphs"/>
  +    <nonterminal symbol="subsubsection"/>
  +  </production>
  +  <production symbol="subparagraphs">
  +    <nonterminal symbol="subsubsection"/>
  +    <terminal symbol="hardbreak"/>
  +  </production>
  +  <production symbol="subparagraphs">
  +    <nonterminal symbol="subsubsection"/>
  +  </production>
  +  <production symbol="subsubsection">
  +    <nonterminal symbol="subsubtitle"/>
  +    <nonterminal symbol="subsubparagraphs"/>
  +  </production>
  +  <production symbol="subsubsection">
  +    <nonterminal symbol="subsubtitle"/>
  +    <terminal symbol="hardbreak"/>
  +    <nonterminal symbol="subsubparagraphs"/>
  +  </production>
  +  <production symbol="subsubtitle">
  +    <terminal symbol="subsubtitleitem"/>
  +    <nonterminal symbol="textsequence"/>
  +  </production>
  +  <production symbol="subsubparagraphs">
  +    <nonterminal symbol="subsubparagraphs"/>
  +    <nonterminal symbol="paragraph"/>
  +    <terminal symbol="hardbreak"/>
  +  </production>
  +  <production symbol="subsubparagraphs">
  +    <nonterminal symbol="subsubparagraphs"/>
  +    <nonterminal symbol="paragraph"/>
  +  </production>
  +  <production symbol="subsubparagraphs">
  +    <nonterminal symbol="paragraph"/>
  +    <terminal symbol="hardbreak"/>
  +  </production>
  +  <production symbol="subsubparagraphs">
  +    <nonterminal symbol="paragraph"/>
  +  </production>
     <production symbol="paragraph">
       <nonterminal symbol="bulletedlist"/>
     </production>
  @@ -179,10 +277,6 @@
       <terminal symbol="tablecolumnitem"/>
       <nonterminal symbol="textblock"/>
     </production>
  -  <production symbol="title">
  -    <terminal symbol="titleitem"/>
  -    <nonterminal symbol="textsequence"/>
  -  </production>
     <production symbol="textsequence">
       <nonterminal symbol="textsequence"/>
       <nonterminal symbol="textblock"/>
  @@ -198,6 +292,15 @@
     </production>
     <production symbol="textsequence">
       <nonterminal symbol="textblock"/>
  +  </production>
  +  <production symbol="textsequence">
  +    <nonterminal symbol="textsequence"/>
  +    <nonterminal symbol="textblock"/>
  +    <terminal symbol="break"/>
  +  </production>
  +  <production symbol="textsequence">
  +    <nonterminal symbol="textblock"/>
  +    <terminal symbol="break"/>
     </production>
     <production symbol="textblock">
       <terminal symbol="link"/>
  
  
  
  1.2       +95 -19    xml-forrest/src/resources/grammars/wiki.xlex
  
  Index: wiki.xlex
  ===================================================================
  RCS file: /home/cvs/xml-forrest/src/resources/grammars/wiki.xlex,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- wiki.xlex	26 Apr 2003 12:23:15 -0000	1.1
  +++ wiki.xlex	27 Apr 2003 06:05:58 -0000	1.2
  @@ -1,19 +1,19 @@
  -<?xml version="1.0" encoding="UTF-8"?>
  +<?xml version="1.0" encoding="ISO-8859-1"?>
   <lexicon xmlns="http://chaperon.sourceforge.net/schema/lexicon/1.0">
  -  <!--This file was generated! Don't edit!-->
  +<!--This file was generated! Don't edit!-->
     <lexeme symbol="line">
       <concat>
         <cstring content="-"/>
         <cstring content="-"/>
         <cstring content="-"/>
         <cstring content="-"/>
  -      <concat minOccurs="1" maxOccurs="*">
  +      <concat maxOccurs="*" minOccurs="0">
           <cstring content="-"/>
         </concat>
       </concat>
     </lexeme>
     <lexeme symbol="bulleteditem">
  -    <concat minOccurs="1" maxOccurs="*">
  +    <concat maxOccurs="*" minOccurs="1">
         <cstring content="*"/>
       </concat>
     </lexeme>
  @@ -43,10 +43,21 @@
       <cstring content="|"/>
     </lexeme>
     <lexeme symbol="titleitem">
  -    <concat minOccurs="1" maxOccurs="*">
  +    <concat>
  +      <cstring content="!"/>
  +      <cstring content="!"/>
  +      <cstring content="!"/>
  +    </concat>
  +  </lexeme>
  +  <lexeme symbol="subtitleitem">
  +    <concat>
  +      <cstring content="!"/>
         <cstring content="!"/>
       </concat>
     </lexeme>
  +  <lexeme symbol="subsubtitleitem">
  +    <cstring content="!"/>
  +  </lexeme>
     <lexeme symbol="emitem">
       <concat>
         <cstring content="'"/>
  @@ -76,7 +87,7 @@
         <cstring content="{"/>
         <cstring content="{"/>
         <cstring content="{"/>
  -      <concat minOccurs="0" maxOccurs="*">
  +      <concat maxOccurs="*" minOccurs="0">
           <concat>
             <concat minOccurs="0" maxOccurs="2">
               <cstring content="}"/>
  @@ -94,9 +105,9 @@
     <lexeme symbol="anchor">
       <concat>
         <cstring content="["/>
  -      <concat minOccurs="0" maxOccurs="1">
  +      <concat maxOccurs="1" minOccurs="0">
           <concat>
  -          <concat minOccurs="0" maxOccurs="*">
  +          <concat maxOccurs="*" minOccurs="0">
               <cclass exclusive="true">
                 <cset content="["/>
                 <cset content="|"/>
  @@ -107,7 +118,7 @@
           </concat>
         </concat>
         <cstring content="#"/>
  -      <concat minOccurs="0" maxOccurs="*">
  +      <concat maxOccurs="*" minOccurs="0">
           <cclass exclusive="true">
             <cset content="["/>
             <cset content="|"/>
  @@ -120,9 +131,9 @@
     <lexeme symbol="link">
       <concat>
         <cstring content="["/>
  -      <concat minOccurs="0" maxOccurs="1">
  +      <concat maxOccurs="1" minOccurs="0">
           <concat>
  -          <concat minOccurs="0" maxOccurs="*">
  +          <concat maxOccurs="*" minOccurs="0">
               <cclass exclusive="true">
                 <cset content="["/>
                 <cset content="|"/>
  @@ -132,7 +143,7 @@
             <cstring content="|"/>
           </concat>
         </concat>
  -      <concat minOccurs="0" maxOccurs="*">
  +      <concat maxOccurs="*" minOccurs="0">
           <cclass exclusive="true">
             <cset content="["/>
             <cset content="|"/>
  @@ -146,7 +157,6 @@
       <concat>
         <alt>
           <cclass exclusive="true">
  -          <cset content=" "/>
             <cset code="9"/>
             <cset code="10"/>
             <cset code="13"/>
  @@ -155,6 +165,8 @@
             <cset content="}"/>
             <cset content="|"/>
             <cset content="*"/>
  +          <cset content="\"/>
  +          <cset content="-"/>
             <cset content="_"/>
             <cset content="!"/>
             <cset content="#"/>
  @@ -164,32 +176,60 @@
             <cstring content="_"/>
             <cclass exclusive="true">
               <cset content="_"/>
  +            <cset code="10"/>
  +            <cset code="13"/>
             </cclass>
           </concat>
           <concat>
             <cstring content="{"/>
             <cclass exclusive="true">
               <cset content="{"/>
  +            <cset code="10"/>
  +            <cset code="13"/>
             </cclass>
           </concat>
           <concat>
             <cstring content="}"/>
             <cclass exclusive="true">
               <cset content="}"/>
  +            <cset code="10"/>
  +            <cset code="13"/>
             </cclass>
           </concat>
           <concat>
             <cstring content="'"/>
             <cclass exclusive="true">
               <cset content="'"/>
  +            <cset code="10"/>
  +            <cset code="13"/>
             </cclass>
           </concat>
           <concat>
             <cstring content="["/>
             <cstring content="["/>
           </concat>
  +        <concat>
  +          <cstring content="\"/>
  +          <cclass exclusive="true">
  +            <cset content="\"/>
  +            <cset code="10"/>
  +            <cset code="13"/>
  +          </cclass>
  +        </concat>
  +        <concat>
  +          <concat minOccurs="1" maxOccurs="3">
  +            <cstring content="-"/>
  +          </concat>
  +          <concat maxOccurs="1" minOccurs="0">
  +            <cclass exclusive="true">
  +              <cset content="-"/>
  +              <cset code="10"/>
  +              <cset code="13"/>
  +            </cclass>
  +          </concat>
  +        </concat>
         </alt>
  -      <concat minOccurs="0" maxOccurs="*">
  +      <concat maxOccurs="*" minOccurs="0">
           <alt>
             <cclass exclusive="true">
               <cset code="10"/>
  @@ -198,6 +238,8 @@
               <cset content="{"/>
               <cset content="}"/>
               <cset content="|"/>
  +            <cset content="\"/>
  +            <cset content="-"/>
               <cset content="_"/>
               <cset content="'"/>
             </cclass>
  @@ -205,24 +247,32 @@
               <cstring content="_"/>
               <cclass exclusive="true">
                 <cset content="_"/>
  +              <cset code="10"/>
  +              <cset code="13"/>
               </cclass>
             </concat>
             <concat>
               <cstring content="{"/>
               <cclass exclusive="true">
                 <cset content="{"/>
  +              <cset code="10"/>
  +              <cset code="13"/>
               </cclass>
             </concat>
             <concat>
               <cstring content="}"/>
               <cclass exclusive="true">
                 <cset content="}"/>
  +              <cset code="10"/>
  +              <cset code="13"/>
               </cclass>
             </concat>
             <concat>
               <cstring content="'"/>
               <cclass exclusive="true">
                 <cset content="'"/>
  +              <cset code="10"/>
  +              <cset code="13"/>
               </cclass>
             </concat>
             <concat>
  @@ -230,6 +280,26 @@
               <cstring content="["/>
             </concat>
             <concat>
  +            <cstring content="\"/>
  +            <cclass exclusive="true">
  +              <cset content="\"/>
  +              <cset code="10"/>
  +              <cset code="13"/>
  +            </cclass>
  +          </concat>
  +          <concat>
  +            <concat minOccurs="1" maxOccurs="3">
  +              <cstring content="-"/>
  +            </concat>
  +            <concat maxOccurs="1" minOccurs="0">
  +              <cclass exclusive="true">
  +                <cset content="-"/>
  +                <cset code="10"/>
  +                <cset code="13"/>
  +              </cclass>
  +            </concat>
  +          </concat>
  +          <concat>
               <cstring content="|"/>
               <cclass exclusive="true">
                 <cset content="|"/>
  @@ -245,29 +315,35 @@
       <alt>
         <concat>
           <cstring code="13"/>
  -        <concat minOccurs="0" maxOccurs="1">
  +        <concat maxOccurs="1" minOccurs="0">
             <cstring code="10"/>
           </concat>
         </concat>
         <cstring code="10"/>
       </alt>
     </lexeme>
  +  <lexeme symbol="break" assoc="right">
  +    <concat>
  +      <cstring content="\"/>
  +      <cstring content="\"/>
  +    </concat>
  +  </lexeme>
     <lexeme symbol="hardbreak" assoc="right">
       <concat>
         <alt>
           <concat>
             <cstring code="13"/>
  -          <concat minOccurs="0" maxOccurs="1">
  +          <concat maxOccurs="1" minOccurs="0">
               <cstring code="10"/>
             </concat>
           </concat>
           <cstring code="10"/>
         </alt>
  -      <concat minOccurs="1" maxOccurs="*">
  +      <concat maxOccurs="*" minOccurs="1">
           <alt>
             <concat>
               <cstring code="13"/>
  -            <concat minOccurs="0" maxOccurs="1">
  +            <concat maxOccurs="1" minOccurs="0">
                 <cstring code="10"/>
               </concat>
             </concat>
  @@ -277,7 +353,7 @@
       </concat>
     </lexeme>
     <lexeme>
  -    <concat minOccurs="1" maxOccurs="*">
  +    <concat maxOccurs="*" minOccurs="1">
         <cclass>
           <cset content=" "/>
           <cset code="9"/>
  
  
  

Mime
View raw message