cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From step...@apache.org
Subject cvs commit: xml-cocoon2/src/webapp/WEB-INF web.xml
Date Mon, 03 Feb 2003 19:15:37 GMT
stephan     2003/02/03 11:15:36

  Modified:    lib      jars.xml
               src/blocks/chaperon/samples sitemap.xmap
               src/blocks/chaperon/samples/grammars wiki.grm
               src/blocks/chaperon/samples/misc java.css mathexp.xsp
                        samples.xml wiki.xsp
               src/blocks/chaperon/samples/stylesheets java2html.xsl
                        mathexp2html.xsl wiki2html.xsl
               src/webapp/WEB-INF web.xml
  Added:       lib/optional chaperon-20030203.jar
               src/blocks/chaperon/conf chaperon-transformator.xmap
                        chaperon-xmlizer.xconf chaperon-xmlizer.xroles
               src/blocks/chaperon/java/org/apache/cocoon/transformation
                        LexicalTransformer.java ParserTransformer.java
                        PatternTransformer.java
               src/blocks/chaperon/java/org/apache/cocoon/xml
                        TextXMLizer.java
               src/blocks/chaperon/samples/grammars grammar-v20.dtd
                        grm.xgrm grm.xlex java.xgrm java.xlex javadoc.xgrm
                        javadoc.xlex lexicon-v20.dtd mathexp.xgrm
                        mathexp.xlex regex.xgrm regex.xlex
               src/blocks/chaperon/samples/misc/test Grammar.java
                        PatternProcessor.java
               src/blocks/chaperon/samples/stylesheets class2html.xsl
                        grm2xgrm.xsl grm2xlex.xsl index4java.xsl
                        mathexp.xsl package2html.xsl remove4class.xsl
                        text4javadoc.xsl text4javadoc2.xsl text4regex.xsl
  Removed:     lib/optional chaperon-1.3-dev.jar
               src/blocks/chaperon/conf chaperon.generator.xmap
                        chaperon.transformator.xmap
               src/blocks/chaperon/java/org/apache/cocoon/generation
                        TextParserGenerator.java
               src/blocks/chaperon/java/org/apache/cocoon/transformation
                        TextFragmentParserTransformer.java
               src/blocks/chaperon/samples/grammars java.rgrm mathexp.grm
                        rgrm.grm wiki.rgrm
               src/blocks/chaperon/samples/misc test1.java test2.java
               src/blocks/chaperon/samples/stylesheets parsefragment.xsl
                        rgrm2grm.xsl
  Log:
  Add new version of the chaperon text parser components.
  
  Revision  Changes    Path
  1.73      +2 -2      xml-cocoon2/lib/jars.xml
  
  Index: jars.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/lib/jars.xml,v
  retrieving revision 1.72
  retrieving revision 1.73
  diff -u -r1.72 -r1.73
  --- jars.xml	2 Feb 2003 04:34:33 -0000	1.72
  +++ jars.xml	3 Feb 2003 19:15:32 -0000	1.73
  @@ -494,8 +494,8 @@
     <description>chaperon is parser which could parse text files, and convert those
           to XML files.
     </description>
  -  <used-by>TextParserGenerator and TextFragmentParserTransformer</used-by>
  -  <lib>optional/chaperon-1.3-dev.jar</lib>
  +  <used-by>Chaperon block</used-by>
  +  <lib>optional/chaperon-20030203.jar</lib>
     <homepage>http://chaperon.sourceforge.net</homepage>
    </file>
   
  
  
  
  1.1                  xml-cocoon2/lib/optional/chaperon-20030203.jar
  
  	<<Binary file>>
  
  
  1.1                  xml-cocoon2/src/blocks/chaperon/conf/chaperon-transformator.xmap
  
  Index: chaperon-transformator.xmap
  ===================================================================
  <?xml version="1.0"?>
  <xmap xpath="/sitemap/components/transformers" unless="transformer[@name='lexer']">
      <map:transformer logger="sitemap.transformer.lexer" name="lexer"
                       src="org.apache.cocoon.transformation.LexicalTransformer"/>
      <map:transformer logger="sitemap.transformer.lexer" name="parser"
                       src="org.apache.cocoon.transformation.ParserTransformer"/>
      <map:transformer logger="sitemap.transformer.lexer" name="pattern"
                       src="org.apache.cocoon.transformation.PatternTransformer"/>
  </xmap>
  
  
  
  1.1                  xml-cocoon2/src/blocks/chaperon/conf/chaperon-xmlizer.xconf
  
  Index: chaperon-xmlizer.xconf
  ===================================================================
  <?xml version="1.0"?>
  <xconf xpath="/cocoon/xmlizer" unless="parser[@mime-type='text/plain']">
        <parser role="org.apache.excalibur.xml.sax.SAXParser/Text" mime-type="text/plain"/>
  </xconf>
  
  
  
  1.1                  xml-cocoon2/src/blocks/chaperon/conf/chaperon-xmlizer.xroles
  
  Index: chaperon-xmlizer.xroles
  ===================================================================
  <?xml version="1.0"?>
  <xroles xpath="/role-list" unless="role[@name='org.apache.excalibur.xml.sax.SAXParser/Text']">
  
    <role name="org.apache.excalibur.xml.sax.SAXParser/Text"
          shorthand="text-parser"
          default-class="org.apache.cocoon.xml.TextXMLizer"/>
  </xroles>
  
  
  
  1.1                  xml-cocoon2/src/blocks/chaperon/java/org/apache/cocoon/transformation/LexicalTransformer.java
  
  Index: LexicalTransformer.java
  ===================================================================
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  
   Redistribution and use in source and binary forms, with or without modifica-
   tion, are permitted provided that the following conditions are met:
  
   1. Redistributions of  source code must  retain the above copyright  notice,
      this list of conditions and the following disclaimer.
  
   2. Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
  
   3. The end-user documentation included with the redistribution, if any, must
      include  the following  acknowledgment:   "This product includes software
      developed  by the  Apache Software Foundation  (http://www.apache.org/)."
      Alternately, this  acknowledgment may  appear in the software itself,  if
      and wherever such third-party acknowledgments normally appear.
  
   4. The names "Apache Cocoon" and  "Apache Software Foundation" must  not  be
      used to  endorse or promote  products derived from  this software without
      prior written permission. For written permission, please contact
      apache@apache.org.
  
   5. Products  derived from this software may not  be called "Apache", nor may
      "Apache" appear  in their name,  without prior written permission  of the
      Apache Software Foundation.
  
   THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
   FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
   APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
   INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
   DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
   OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
   ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
   (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
   THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  
   This software  consists of voluntary contributions made  by many individuals
   on  behalf of the Apache Software  Foundation and was  originally created by
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.transformation;
  
  import org.apache.avalon.excalibur.pool.Recyclable;
  
  import org.apache.avalon.framework.activity.Disposable;
  import org.apache.avalon.framework.component.Component;
  import org.apache.avalon.framework.component.ComponentException;
  import org.apache.avalon.framework.component.ComponentManager;
  import org.apache.avalon.framework.component.Composable;
  import org.apache.avalon.framework.configuration.Configuration;
  import org.apache.avalon.framework.configuration.ConfigurationException;
  import org.apache.avalon.framework.configuration.SAXConfigurationHandler;
  import org.apache.avalon.framework.logger.LogEnabled;
  import org.apache.avalon.framework.logger.Logger;
  import org.apache.avalon.framework.parameters.ParameterException;
  import org.apache.avalon.framework.parameters.Parameters;
  
  import org.apache.cocoon.ProcessingException;
  import org.apache.cocoon.caching.CacheableProcessingComponent;
  import org.apache.cocoon.components.source.SourceUtil;
  import org.apache.cocoon.environment.SourceResolver;
  import org.apache.cocoon.transformation.Transformer;
  import org.apache.cocoon.xml.EmbeddedXMLPipe;
  import org.apache.cocoon.xml.XMLConsumer;
  
  import org.apache.excalibur.source.Source;
  import org.apache.excalibur.source.SourceException;
  import org.apache.excalibur.source.SourceValidity;
  import org.apache.excalibur.store.Store;
  
  import org.xml.sax.Attributes;
  import org.xml.sax.InputSource;
  import org.xml.sax.SAXException;
  import org.xml.sax.ContentHandler;
  import org.xml.sax.helpers.AttributesImpl;
  
  import java.io.IOException;
  import java.io.Serializable;
  import java.util.Map;
  
  import net.sourceforge.chaperon.adapter.avalon.LexiconFactory;
  import net.sourceforge.chaperon.adapter.sax.LexicalHandlerAdapter;
  import net.sourceforge.chaperon.adapter.sax.LexicalProcessorAdapter;
  import net.sourceforge.chaperon.build.LexicalAutomatonBuilder;
  import net.sourceforge.chaperon.model.lexicon.Lexicon;
  import net.sourceforge.chaperon.process.LexicalAutomaton;
  import net.sourceforge.chaperon.process.LexicalProcessor;
  
  /**
   * This transfomer transforms special mark text part of a XML
   * file into lexemes by using a lexicon file.
   *
   * <p>Input:</p>
   * <pre>
   * &lt;text xmlns="http://chaperon.sourceforge.net/schema/text/1.0"&gt;
   *  Text 123 bla
   * &lt;/text&gt;
   * </pre>
   *
   * <p>were transform into the following output:</p>
   * <pre>
   * &lt;lexemes xmlns="http://chaperon.sourceforge.net/schema/lexemes/1.0"&gt;
   *  &lt;lexeme symbol="word" text="Text"/&gt;
   *  &lt;lexeme symbol="number" text="123"/&gt;
   *  &lt;lexeme symbol="word" text="bla"/&gt;
   * &lt;/lexemes&gt;
   * </pre>
   *
   * @author <a href="mailto:stephan@apache.org">Stephan Michels </a>
   * @version CVS $Id: LexicalTransformer.java,v 1.1 2003/02/03 19:15:33 stephan Exp $
   */
  public class LexicalTransformer extends LexicalProcessorAdapter
    implements Transformer, LogEnabled, Composable, Recyclable, Disposable,
               CacheableProcessingComponent {
  
      /** Namespace for the SAX events. */
  /*    public final static String NS = "http://apache.org/cocoon/lexemes/1.0";*/
  
      private XMLConsumer consumer = null;
  
      private String lexicon = null;
      private Source lexiconSource = null;
  
      private Logger logger = null;
      private ComponentManager manager = null;
      private SourceResolver resolver = null;
  
      private LexicalAutomaton automaton = null;
      private LexicalHandlerAdapter adapter = new LexicalHandlerAdapter(true);
  
      /**
       * Provide component with a logger.
       *
       * @param logger the logger
       */
      public void enableLogging(Logger logger) {
          this.logger = logger;
      }
  
      /**
       * Pass the ComponentManager to the composer. The Composable
       * implementation should use the specified ComponentManager
       * to acquire the components it needs for execution.
       *
       * @param manager The ComponentManager which this Composable uses.
       */
      public void compose(ComponentManager manager) {
          this.manager = manager;
      }
  
      /**
       * Set the <code>XMLConsumer</code> that will receive XML data.
       *
       * @param consumer
       */
      public void setConsumer(XMLConsumer consumer) {
          this.consumer = consumer;
  
          setContentHandler(consumer);
          setLexicalHandler(consumer);
  
          adapter.setContentHandler(consumer);
  //        adapter.setNamespace(NS);
      }
  
      /**
       * Set the SourceResolver, objectModel Map, the source and sitemap
       * Parameters used to process the request.
       *
       * @param resolver Source resolver
       * @param objectmodel Object model
       * @param src Source
       * @param parameters Parameters
       *
       * @throws IOException
       * @throws ProcessingException
       * @throws SAXException
       */
      public void setup(SourceResolver resolver, Map objectmodel, String src,
                        Parameters parameters)
                          throws ProcessingException, SAXException,
                                 IOException {
  
          this.resolver = resolver;
          Store store = null;
  
          try {
              this.lexicon = src;
  
              this.lexiconSource = resolver.resolveURI(this.lexicon);
  
              // Retrieve the parser table from the transient store
              store = (Store) this.manager.lookup(Store.TRANSIENT_STORE);
              LexicalAutomatonEntry entry = (LexicalAutomatonEntry) store.get(this.lexiconSource.getURI());
  
              // If the parser table has changed, rebuild the parser table
  
              /*if (entry!=null)
                      System.out.println("entry.getValidity()="+entry.getValidity());
              System.out.println("this.lexiconSource.getValidity()="+this.lexiconSource.getValidity()+" of
        "+this.lexiconSource.getURI());*/
              if ((entry==null) || (entry.getValidity()==null) ||
                  (entry.getValidity().isValid(this.lexiconSource.getValidity())<=
                   0)) {
                  /* (!entry.getValidity().isValid(this.lexiconSource.getValidity()))) { */
  
                  this.logger.info("(Re)building the automaton from '"+
                                   this.lexiconSource.getURI()+"'");
  
                  SAXConfigurationHandler confighandler = new SAXConfigurationHandler();
  
                  if (this.lexiconSource.getInputStream()==null) {
                      throw new ProcessingException("Source '"+
                                                    this.lexiconSource.getURI()+
                                                    "' not found");
                  }
                  SourceUtil.toSAX(this.lexiconSource, confighandler,
                                   this.manager);
  
                  Configuration config = confighandler.getConfiguration();
                  Lexicon lexicon = LexiconFactory.createLexicon(config);
  
                  LexicalAutomatonBuilder builder = new LexicalAutomatonBuilder(lexicon,
                                                        this.logger);
  
                  this.automaton = builder.getLexicalAutomaton();
  
                  this.logger.info("Store automaton into store for '"+
                                   this.lexiconSource.getURI()+"'");
                  store.store(this.lexiconSource.getURI(),
                              new LexicalAutomatonEntry(this.automaton,
                                                        this.lexiconSource.getValidity()));
              } else {
                  this.logger.info("Getting automaton from store for '"+
                                   this.lexiconSource.getURI()+"'");
                  this.automaton = entry.getLexicalAutomaton();
              }
  
              if (getLexicalProcessor()==null) {
                  LexicalProcessor processor = new LexicalProcessor();
  
                  processor.setLexicalHandler(this.adapter);
                  processor.setLogger(this.logger);
                  setLexicalProcessor(processor);
              }
  
              getLexicalProcessor().setLexicalAutomaton(this.automaton);
  
          } catch (ConfigurationException confige) {
              throw new ProcessingException("Error during retrieving the lexicon",
                                            confige);
          } catch (SourceException se) {
              throw new ProcessingException("Error during resolving of '"+src+
                                            "'.", se);
          } catch (ComponentException ce) {
              throw new ProcessingException("Could not lookup for component",
                                            ce);
          } finally {
              if (store!=null) {
                  this.manager.release(store);
              }
          }
      }
  
      /**
       * Generate the unique key.
       * This key must be unique inside the space of this component.
       *
       * @return The generated key hashes the src
       */
      public Serializable generateKey() {
          return this.lexiconSource.getURI();
      }
  
      /**
       * Generate the validity object.
       *
       * @return The generated validity object or <code>null</code> if the
       *         component is currently not cacheable.
       */
      public SourceValidity generateValidity() {
          return this.lexiconSource.getValidity();
      }
  
      /**
       * Recycle this component.
       * All instance variables are set to <code>null</code>.
       */
      public void recycle() {
          if ((this.resolver!=null) && (this.lexiconSource!=null)) {
              this.resolver.release(this.lexiconSource);
              this.lexiconSource = null;
          }
  
          this.automaton = null;
      }
  
      /**
       * The dispose operation is called at the end of a
       * components lifecycle.
       */
      public void dispose() {
          if ((this.resolver!=null) && (this.lexiconSource!=null)) {
              this.resolver.release(this.lexiconSource);
              this.lexiconSource = null;
          }
  
          this.manager = null;
      }
  
      /**
       * This class represent a entry in a store to cache the lexical automaton.
       */
      public class LexicalAutomatonEntry implements Serializable {
          private SourceValidity validity = null;
          private LexicalAutomaton automaton = null;
  
          /**
           * Create a new entry.
           *
           * @param automaton Lexical automaton.
           * @param validity Validity of the lexicon file.
           */
          public LexicalAutomatonEntry(LexicalAutomaton automaton,
                                       SourceValidity validity) {
              this.automaton = automaton;
              this.validity = validity;
          }
  
          /**
           * Return the validity of the lexicon file.
           *
           * @return Validity of the lexicon file.
           */
          public SourceValidity getValidity() {
              return this.validity;
          }
  
          /**
           * Return the lexical automaton.
           *
           * @return Lexical automaton.
           */
          public LexicalAutomaton getLexicalAutomaton() {
              return this.automaton;
          }
      }
  }
  
  
  
  1.1                  xml-cocoon2/src/blocks/chaperon/java/org/apache/cocoon/transformation/ParserTransformer.java
  
  Index: ParserTransformer.java
  ===================================================================
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  
   Redistribution and use in source and binary forms, with or without modifica-
   tion, are permitted provided that the following conditions are met:
  
   1. Redistributions of  source code must  retain the above copyright  notice,
      this list of conditions and the following disclaimer.
  
   2. Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
  
   3. The end-user documentation included with the redistribution, if any, must
      include  the following  acknowledgment:   "This product includes software
      developed  by the  Apache Software Foundation  (http://www.apache.org/)."
      Alternately, this  acknowledgment may  appear in the software itself,  if
      and wherever such third-party acknowledgments normally appear.
  
   4. The names "Apache Cocoon" and  "Apache Software Foundation" must  not  be
      used to  endorse or promote  products derived from  this software without
      prior written permission. For written permission, please contact
      apache@apache.org.
  
   5. Products  derived from this software may not  be called "Apache", nor may
      "Apache" appear  in their name,  without prior written permission  of the
      Apache Software Foundation.
  
   THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
   FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
   APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
   INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
   DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
   OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
   ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
   (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
   THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  
   This software  consists of voluntary contributions made  by many individuals
   on  behalf of the Apache Software  Foundation and was  originally created by
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.transformation;
  
  import org.apache.avalon.excalibur.pool.Recyclable;
  
  import org.apache.avalon.framework.activity.Disposable;
  import org.apache.avalon.framework.component.Component;
  import org.apache.avalon.framework.component.ComponentException;
  import org.apache.avalon.framework.component.ComponentManager;
  import org.apache.avalon.framework.component.Composable;
  import org.apache.avalon.framework.configuration.Configuration;
  import org.apache.avalon.framework.configuration.ConfigurationException;
  import org.apache.avalon.framework.configuration.SAXConfigurationHandler;
  import org.apache.avalon.framework.logger.LogEnabled;
  import org.apache.avalon.framework.logger.Logger;
  import org.apache.avalon.framework.parameters.ParameterException;
  import org.apache.avalon.framework.parameters.Parameterizable;
  import org.apache.avalon.framework.parameters.Parameters;
  
  import org.apache.cocoon.ProcessingException;
  import org.apache.cocoon.caching.CacheableProcessingComponent;
  import org.apache.cocoon.components.source.SourceUtil;
  import org.apache.cocoon.environment.SourceResolver;
  import org.apache.cocoon.transformation.Transformer;
  import org.apache.cocoon.xml.EmbeddedXMLPipe;
  import org.apache.cocoon.xml.XMLConsumer;
  
  import org.apache.excalibur.source.Source;
  import org.apache.excalibur.source.SourceException;
  import org.apache.excalibur.source.SourceValidity;
  import org.apache.excalibur.store.Store;
  
  import org.xml.sax.Attributes;
  import org.xml.sax.InputSource;
  import org.xml.sax.SAXException;
  import org.xml.sax.ContentHandler;
  import org.xml.sax.helpers.AttributesImpl;
  
  import java.io.IOException;
  import java.io.Serializable;
  import java.util.Map;
  
  import net.sourceforge.chaperon.adapter.avalon.GrammarFactory;
  import net.sourceforge.chaperon.adapter.sax.ParserHandlerAdapter;
  import net.sourceforge.chaperon.adapter.sax.ParserProcessorAdapter;
  import net.sourceforge.chaperon.build.ParserAutomatonBuilder;
  import net.sourceforge.chaperon.model.grammar.Grammar;
  import net.sourceforge.chaperon.process.ParserAutomaton;
  import net.sourceforge.chaperon.process.ParserProcessor;
  
  /**
   * This transfomer transforms lexical tokens in a XML
   * file into a XML hirachy by using a grammar file.
   *
   * <p>Input:</p>
   * <pre>
   * &lt;lexemes xmlns="http://chaperon.sourceforge.net/schema/lexemes/1.0"&gt;
   *  &lt;lexeme symbol="word" text="Text"/&gt;
   *  &lt;lexeme symbol="number" text="123"/&gt;
   *  &lt;lexeme symbol="word" text="bla"/&gt;
   * &lt;/lexemes&gt;
   * </pre>
   *
   * <p>were transform into the following output:</p>
   * <pre>
   * &lt;sentence xmlns="http://chaperon.sourceforge.net/schema/syntaxtree/1.0"&gt;
   *  &lt;word&gt;Text&lt;/word&gt;
   *  &lt;number&gt;123&lt;/number&gt;
   *  &lt;word&gt;bla&lt;/word&gt;
   * &lt;/sentence&gt;
   * </pre>
   *
   * @author <a href="mailto:stephan@apache.org">Stephan Michels </a>
   * @version CVS $Id: ParserTransformer.java,v 1.1 2003/02/03 19:15:33 stephan Exp $
   */
  public class ParserTransformer extends ParserProcessorAdapter
    implements Transformer, LogEnabled, Composable, Parameterizable,
               Recyclable, Disposable, CacheableProcessingComponent {
  
      /** Namespace for the SAX events. */
  /*    public final static String NS = "http://apache.org/cocoon/lexemes/1.0";*/
  
      private XMLConsumer consumer = null;
  
      private String grammar = null;
      private Source grammarSource = null;
  
      private Logger logger = null;
      private ComponentManager manager = null;
      private SourceResolver resolver = null;
  
      private ParserAutomaton automaton = null;
      private ParserHandlerAdapter adapter = new ParserHandlerAdapter(true);
      private boolean ignoring = false;
  
      /**
       * Provide component with a logger.
       *
       * @param logger the logger
       */
      public void enableLogging(Logger logger) {
          this.logger = logger;
      }
  
      /**
       * Pass the ComponentManager to the composer. The Composable
       * implementation should use the specified ComponentManager
       * to acquire the components it needs for execution.
       *
       * @param manager The ComponentManager which this Composable uses.
       */
      public void compose(ComponentManager manager) {
          this.manager = manager;
      }
  
      /**
       * Provide component with parameters.
       *
       * @param parameters the parameters
       * @throws ParameterException if parameters are invalid
       */
      public void parameterize(Parameters parameters)
        throws ParameterException {
  
          adapter.setFlatten(parameters.getParameterAsBoolean("flatten",
              false));
          ignoring = parameters.getParameterAsBoolean("ignoring", false);
      }
  
      /**
       * Set the <code>XMLConsumer</code> that will receive XML data.
       *
       * @param consumer
       */
      public void setConsumer(XMLConsumer consumer) {
          this.consumer = consumer;
  
          setContentHandler(consumer);
          setLexicalHandler(consumer);
  
          adapter.setContentHandler(consumer);
  //        adapter.setNamespace(NS);
      }
  
      /**
       * Set the SourceResolver, objectModel Map, the source and sitemap
       * Parameters used to process the request.
       *
       * @param resolver Source resolver
       * @param objectmodel Object model
       * @param src Source
       * @param parameters Parameters
       *
       * @throws IOException
       * @throws ProcessingException
       * @throws SAXException
       */
      public void setup(SourceResolver resolver, Map objectmodel, String src,
                        Parameters parameters)
                          throws ProcessingException, SAXException,
                                 IOException {
  
          this.resolver = resolver;
          Store store = null;
  
          try {
              this.grammar = src;
  
              this.grammarSource = resolver.resolveURI(this.grammar);
  
              // Retrieve the parser automaton from the transient store
              store = (Store) this.manager.lookup(Store.TRANSIENT_STORE);
              ParserAutomatonEntry entry = (ParserAutomatonEntry) store.get(this.grammarSource.getURI());
  
              // If the parser automaton has changed, rebuild the parser automaton
              if ((entry==null) || (entry.getValidity()==null) ||
                  (entry.getValidity().isValid(this.grammarSource.getValidity()))<=
                  0) {
  
                  this.logger.info("(Re)building the automaton from '"+
                                   this.grammarSource.getURI()+"'");
  
                  SAXConfigurationHandler confighandler = new SAXConfigurationHandler();
  
                  if (this.grammarSource.getInputStream()==null) {
                      throw new ProcessingException("Source '"+
                                                    this.grammarSource.getURI()+
                                                    "' not found");
                  }
                  SourceUtil.toSAX(this.grammarSource, confighandler,
                                   this.manager);
  
                  Configuration config = confighandler.getConfiguration();
                  Grammar grammar = GrammarFactory.createGrammar(config);
  
                  ParserAutomatonBuilder builder = new ParserAutomatonBuilder(grammar,
                                                       this.logger);
  
                  this.automaton = builder.getParserAutomaton();
  
                  this.logger.info("Store automaton into store for '"+
                                   this.grammarSource.getURI()+"'");
                  store.store(this.grammarSource.getURI(),
                              new ParserAutomatonEntry(this.automaton,
                                                       this.grammarSource.getValidity()));
              } else {
                  this.logger.info("Getting automaton from store for '"+
                                   this.grammarSource.getURI()+"'");
                  this.automaton = entry.getParserAutomaton();
              }
  
              if (getParserProcessor()==null) {
                  ParserProcessor processor = new ParserProcessor();
  
                  processor.setParserHandler(this.adapter);
                  processor.setLogger(this.logger);
                  processor.setIgnoreUnexpectedLexemes(ignoring);
                  setParserProcessor(processor);
              }
  
              getParserProcessor().setParserAutomaton(this.automaton);
  
          } catch (ConfigurationException confige) {
              throw new ProcessingException("Error during retrieving the grammar",
                                            confige);
          } catch (SourceException se) {
              throw new ProcessingException("Error during resolving of '"+src+
                                            "'.", se);
          } catch (ComponentException ce) {
              throw new ProcessingException("Could not lookup for component",
                                            ce);
          } finally {
              if (store!=null) {
                  this.manager.release(store);
              }
          }
      }
  
      /**
       * Generate the unique key.
       * This key must be unique inside the space of this component.
       *
       * @return The generated key hashes the src
       */
      public Serializable generateKey() {
          return this.grammarSource.getURI();
      }
  
      /**
       * Generate the validity object.
       *
       * @return The generated validity object or <code>null</code> if the
       *         component is currently not cacheable.
       */
      public SourceValidity generateValidity() {
          return this.grammarSource.getValidity();
      }
  
      /**
       * Recycle this component.
       * All instance variables are set to <code>null</code>.
       */
      public void recycle() {
          if ((this.resolver!=null) && (this.grammarSource!=null)) {
              this.resolver.release(this.grammarSource);
              this.grammarSource = null;
          }
  
          this.automaton = null;
      }
  
      /**
       * The dispose operation is called at the end of a
       * components lifecycle.
       */
      public void dispose() {
          if ((this.resolver!=null) && (this.grammarSource!=null)) {
              this.resolver.release(this.grammarSource);
              this.grammarSource = null;
          }
  
          this.manager = null;
      }
  
      /**
       * This class represent a entry in a store to cache
    * the parser automaton.
       */
      public class ParserAutomatonEntry implements Serializable {
          private SourceValidity validity = null;
          private ParserAutomaton automaton = null;
  
          /**
           * Create a new entry.
           *
           * @param automaton Parser automaton.
           * @param validity Validity for the grammar file.
           */
          public ParserAutomatonEntry(ParserAutomaton automaton,
                                      SourceValidity validity) {
              this.automaton = automaton;
              this.validity = validity;
          }
  
          /**
           * Return the validity of the grammar file.
           *
           * @return Validity of the grammar file.
           */
          public SourceValidity getValidity() {
              return this.validity;
          }
  
          /**
           * Return the parser automaton.
           *
           * @return Parser automaton.
           */
          public ParserAutomaton getParserAutomaton() {
              return this.automaton;
          }
      }
  }
  
  
  
  1.1                  xml-cocoon2/src/blocks/chaperon/java/org/apache/cocoon/transformation/PatternTransformer.java
  
  Index: PatternTransformer.java
  ===================================================================
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  
   Redistribution and use in source and binary forms, with or without modifica-
   tion, are permitted provided that the following conditions are met:
  
   1. Redistributions of  source code must  retain the above copyright  notice,
      this list of conditions and the following disclaimer.
  
   2. Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
  
   3. The end-user documentation included with the redistribution, if any, must
      include  the following  acknowledgment:   "This product includes software
      developed  by the  Apache Software Foundation  (http://www.apache.org/)."
      Alternately, this  acknowledgment may  appear in the software itself,  if
      and wherever such third-party acknowledgments normally appear.
  
   4. The names "Apache Cocoon" and  "Apache Software Foundation" must  not  be
      used to  endorse or promote  products derived from  this software without
      prior written permission. For written permission, please contact
      apache@apache.org.
  
   5. Products  derived from this software may not  be called "Apache", nor may
      "Apache" appear  in their name,  without prior written permission  of the
      Apache Software Foundation.
  
   THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
   FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
   APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
   INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
   DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
   OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
   ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
   (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
   THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  
   This software  consists of voluntary contributions made  by many individuals
   on  behalf of the Apache Software  Foundation and was  originally created by
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.transformation;
  
  import org.apache.avalon.excalibur.pool.Recyclable;
  
  import org.apache.avalon.framework.activity.Disposable;
  import org.apache.avalon.framework.component.Component;
  import org.apache.avalon.framework.component.ComponentException;
  import org.apache.avalon.framework.component.ComponentManager;
  import org.apache.avalon.framework.component.Composable;
  import org.apache.avalon.framework.configuration.Configuration;
  import org.apache.avalon.framework.configuration.ConfigurationException;
  import org.apache.avalon.framework.configuration.SAXConfigurationHandler;
  import org.apache.avalon.framework.logger.LogEnabled;
  import org.apache.avalon.framework.logger.Logger;
  import org.apache.avalon.framework.parameters.ParameterException;
  import org.apache.avalon.framework.parameters.Parameters;
  
  import org.apache.cocoon.ProcessingException;
  import org.apache.cocoon.caching.CacheableProcessingComponent;
  import org.apache.cocoon.components.source.SourceUtil;
  import org.apache.cocoon.environment.SourceResolver;
  import org.apache.cocoon.transformation.AbstractTransformer;
  import org.apache.cocoon.xml.EmbeddedXMLPipe;
  import org.apache.cocoon.xml.XMLConsumer;
  
  import org.apache.excalibur.source.Source;
  import org.apache.excalibur.source.SourceException;
  import org.apache.excalibur.source.SourceValidity;
  import org.apache.excalibur.store.Store;
  
  import org.xml.sax.Attributes;
  import org.xml.sax.InputSource;
  import org.xml.sax.SAXException;
  import org.xml.sax.ContentHandler;
  import org.xml.sax.helpers.AttributesImpl;
  
  import java.io.IOException;
  import java.io.Serializable;
  import java.util.Map;
  
  import net.sourceforge.chaperon.adapter.avalon.LexiconFactory;
  import net.sourceforge.chaperon.adapter.sax.LexicalHandlerAdapter;
  import net.sourceforge.chaperon.adapter.sax.LexicalProcessorAdapter;
  import net.sourceforge.chaperon.build.LexicalAutomatonBuilder;
  import net.sourceforge.chaperon.common.Decoder;
  import net.sourceforge.chaperon.model.lexicon.Lexicon;
  import net.sourceforge.chaperon.process.LexicalAutomaton;
  import net.sourceforge.chaperon.process.PatternProcessor;
  
  /**
   * This transfomer transforms text pattern of a XML
   * file into lexemes by using a lexicon file.
   *
   * <p>Input:</p>
   * <pre>
   * &lt;section&gt;
   *  Text 123 bla
   * &lt;/section&gt;
   * </pre>
   *
   * <p>can be transformed into the following output:</p>
   * <pre>
   * &lt;section&gt;
   *  Text
   *  &lt;lexeme symbol="number" text="123"/&gt;
   *  bla
   * &lt;/section&gt;
   * </pre>
   *
   * @author <a href="mailto:stephan@apache.org">Stephan Michels</a>
   * @version CVS $Id: PatternTransformer.java,v 1.1 2003/02/03 19:15:34 stephan Exp $
   */
  public class PatternTransformer extends AbstractTransformer
    implements LogEnabled, Composable, Recyclable, Disposable,
               CacheableProcessingComponent {
  
      /** Namespace for the SAX events. */
      public final static String NS = "http://chaperon.sourceforge.net/schema/lexemes/1.0";
  
      private String lexicon = null;
      private Source lexiconSource = null;
  
      private Logger logger = null;
      private ComponentManager manager = null;
      private SourceResolver resolver = null;
  
      private LexicalAutomaton automaton = null;
      private PatternProcessor processor = new PatternProcessor();
  
      private StringBuffer buffer = new StringBuffer();
      private StringBuffer output = new StringBuffer();
  
      /**
       * Provide component with a logger.
       *
       * @param logger the logger
       */
      public void enableLogging(Logger logger) {
          this.logger = logger;
      }
  
      /**
       * Pass the ComponentManager to the composer. The Composable
       * implementation should use the specified ComponentManager
       * to acquire the components it needs for execution.
       *
       * @param manager The ComponentManager which this Composable uses.
       */
      public void compose(ComponentManager manager) {
          this.manager = manager;
      }
  
      /**
       * Set the SourceResolver, objectModel Map, the source and sitemap
       * Parameters used to process the request.
       *
       * @param resolver Source resolver
       * @param objectmodel Object model
       * @param src Source
       * @param parameters Parameters
       *
       * @throws IOException
       * @throws ProcessingException
       * @throws SAXException
       */
      public void setup(SourceResolver resolver, Map objectmodel, String src,
                        Parameters parameters)
                          throws ProcessingException, SAXException,
                                 IOException {
  
          this.resolver = resolver;
          Store store = null;
  
          try {
              this.lexicon = src;
  
              this.lexiconSource = resolver.resolveURI(this.lexicon);
  
              // Retrieve the lexical automaton from the transient store
              store = (Store) this.manager.lookup(Store.TRANSIENT_STORE);
              LexicalAutomatonEntry entry = (LexicalAutomatonEntry) store.get(this.lexiconSource.getURI());
  
              // If the lexicon has changed, rebuild the lexical automaton
              if ((entry==null) || (entry.getValidity()==null) ||
                  (entry.getValidity().isValid(this.lexiconSource.getValidity())<=
                   0)) {
                  this.logger.info("(Re)building the automaton from '"+
                                   this.lexiconSource.getURI()+"'");
  
                  SAXConfigurationHandler confighandler = new SAXConfigurationHandler();
  
                  if (this.lexiconSource.getInputStream()==null) {
                      throw new ProcessingException("Source '"+
                                                    this.lexiconSource.getURI()+
                                                    "' not found");
                  }
                  SourceUtil.toSAX(this.lexiconSource, confighandler,
                                   this.manager);
  
                  Configuration config = confighandler.getConfiguration();
                  Lexicon lexicon = LexiconFactory.createLexicon(config);
  
                  LexicalAutomatonBuilder builder = new LexicalAutomatonBuilder(lexicon,
                                                        this.logger);
  
                  this.automaton = builder.getLexicalAutomaton();
  
                  this.logger.info("Store automaton into store for '"+
                                   this.lexiconSource.getURI()+"'");
                  store.store(this.lexiconSource.getURI(),
                              new LexicalAutomatonEntry(this.automaton,
                                                        this.lexiconSource.getValidity()));
              } else {
                  this.logger.info("Getting automaton from store for '"+
                                   this.lexiconSource.getURI()+"'");
                  this.automaton = entry.getLexicalAutomaton();
              }
          } catch (ConfigurationException confige) {
              throw new ProcessingException("Error during retrieving the lexicon",
                                            confige);
          } catch (SourceException se) {
              throw new ProcessingException("Error during resolving of '"+src+
                                            "'.", se);
          } catch (ComponentException ce) {
              throw new ProcessingException("Could not lookup for component",
                                            ce);
          } finally {
              if (store!=null) {
                  this.manager.release(store);
              }
          }
      }
  
      /**
       * Generate the unique key.
       * This key must be unique inside the space of this component.
       *
       * @return The generated key hashes the src
       */
      public Serializable generateKey() {
          return this.lexiconSource.getURI();
      }
  
      /**
       * Generate the validity object.
       *
       * @return The generated validity object or <code>null</code> if the
       *         component is currently not cacheable.
       */
      public SourceValidity generateValidity() {
          return this.lexiconSource.getValidity();
      }
  
      /**
       * Recycle this component.
       * All instance variables are set to <code>null</code>.
       */
      public void recycle() {
          if ((this.resolver!=null) && (this.lexiconSource!=null)) {
              this.resolver.release(this.lexiconSource);
              this.lexiconSource = null;
          }
  
          this.automaton = null;
      }
  
      /**
       * The dispose operation is called at the end of a
       * components lifecycle.
       */
      public void dispose() {
          if ((this.resolver!=null) && (this.lexiconSource!=null)) {
              this.resolver.release(this.lexiconSource);
              this.lexiconSource = null;
          }
  
          this.manager = null;
      }
  
      /**
       * Receive notification of the beginning of an element.
       *
       * @param uri The Namespace URI, or the empty string if the element has no
       *            Namespace URI or if Namespace
       *            processing is not being performed.
       * @param loc The local name (without prefix), or the empty string if
       *            Namespace processing is not being performed.
       * @param raw The raw XML 1.0 name (with prefix), or the empty string if
       *            raw names are not available.
       * @param a The attributes attached to the element. If there are no
       *          attributes, it shall be an empty Attributes object.
       *
       * @throws SAXException
       */
      public void startElement(String uri, String loc, String raw,
                               Attributes a) throws SAXException {
  
          search();
  
          if (contentHandler!=null) {
              contentHandler.startElement(uri, loc, raw, a);
          }
      }
  
      /**
       * Receive notification of the end of an element.
       *
       * @param uri The Namespace URI, or the empty string if the element has no
       *            Namespace URI or if Namespace
       *            processing is not being performed.
       * @param loc The local name (without prefix), or the empty string if
       *            Namespace processing is not being performed.
       * @param raw The raw XML 1.0 name (with prefix), or the empty string if
       *            raw names are not available.
       *
       * @throws SAXException
       */
      public void endElement(String uri, String loc,
                             String raw) throws SAXException {
  
          search();
  
          if (contentHandler!=null) {
              contentHandler.endElement(uri, loc, raw);
          }
      }
  
      /**
       * Receive notification of character data.
       *
       * @param c The characters from the XML document.
       * @param start The start position in the array.
       * @param len The number of characters to read from the array.
       *
       * @throws SAXException
       */
      public void characters(char c[], int start, int len) throws SAXException {
  
          buffer.append(c, start, len);
      }
  
      /**
       * Receive notification of ignorable whitespace in element content.
       *
       * @param c The characters from the XML document.
       * @param start The start position in the array.
       * @param len The number of characters to read from the array.
       *
       * @throws SAXException
       */
      public void ignorableWhitespace(char c[], int start,
                                      int len) throws SAXException {
  
          buffer.append(c, start, len);
      }
  
      /**
       * Receive notification of a processing instruction.
       *
       * @param target The processing instruction target.
       * @param data The processing instruction data, or null if none was
       *             supplied.
       *
       * @throws SAXException
       */
      public void processingInstruction(String target,
                                        String data) throws SAXException {
          search();
  
          if (contentHandler!=null) {
              contentHandler.processingInstruction(target, data);
          }
      }
  
      /**
       * Report an XML comment anywhere in the document.
       *
       * @param ch An array holding the characters in the comment.
       * @param start The starting position in the array.
       * @param len The number of characters to use from the array.
       *
       * @throws SAXException
       */
      public void comment(char ch[], int start, int len) throws SAXException {
          search();
  
          if (lexicalHandler!=null) {
              lexicalHandler.comment(ch, start, len);
          }
      }
  
      /**
       *
       *
       * @throws SAXException
       */
      private void search() throws SAXException {
          if (buffer.length()<=0) {
              return;
          }
  
          char[] text = buffer.toString().toCharArray();
  
          String lexemesymbol, lexemetext;
          int lexemeindex = 0;
          int position = 0;
  
          output.setLength(0);
          do {
              lexemesymbol = null;
              lexemetext = null;
  
              for (lexemeindex = automaton.getLexemeCount()-1; lexemeindex>=0;
                  lexemeindex--) {
                  processor.setPatternAutomaton(automaton.getLexemeDefinition(lexemeindex));
  
                  if ((processor.match(text, position)) &&
                      ((lexemetext==null) ||
                       (processor.getGroup().length()>=lexemetext.length()))) {
                      lexemesymbol = automaton.getLexemeSymbol(lexemeindex);
                      lexemetext = processor.getGroup();
                  }
              }
  
              if (lexemetext!=null) {
                  if (lexemesymbol!=null) {
                      if (logger!=null) {
                          logger.debug("Recognize token "+lexemesymbol+
                                       " with '"+Decoder.decode(lexemetext)+
                                       "'");
                      }
  
                      if (output.length()>0) {
                          contentHandler.characters(output.toString().toCharArray(),
                                                    0, output.length());
                      }
                      output.setLength(0);
  
                      contentHandler.startPrefixMapping("", NS);
                      AttributesImpl atts = new AttributesImpl();
  
                      atts.addAttribute("", "symbol", "symbol", "CDATA",
                                        lexemesymbol);
                      atts.addAttribute("", "text", "text", "CDATA",
                                        lexemetext);
                      contentHandler.startElement(NS, "lexeme", "lexeme", atts);
                      contentHandler.endElement(NS, "lexeme", "lexeme");
                      contentHandler.endPrefixMapping("");
                  } else if (logger!=null) {
                      logger.debug("Ignore lexeme with '"+
                                   Decoder.decode(lexemetext)+"'");
                  }
  
                  /*if (locator!=null)
                  {
                    int column = locator.getColumnNumber();
                    int line = locator.getLineNumber();
  
                    for (int i = position; i<(position+lexemetext.length()); i++)
                    {
                      if ((text[i]=='\n') && ((i==0) || (text[i-1]!='\r')))
                      {
                        column = 1;
                        line++;
                      }
                      else if ((text[i]=='\r') &&
                               ((i==text.length-1) || (text[i+1]!='\n')))
                      {
                        column = 1;
                        line++;
                      }
                      else
                        column++;
                    }
                    locator.setColumnNumber(column);
                    locator.setLineNumber(line);
                  }*/
  
                  position += lexemetext.length();
              } else {
                  output.append(text[position]);
                  position++;
              }
          } while (position<text.length);
  
          if (output.length()>0) {
              contentHandler.characters(output.toString().toCharArray(), 0,
                                        output.length());
          }
  
          buffer.setLength(0);
      }
  
      /**
       * This class represent a entry in a store to cache the lexical automaton.
       */
      public class LexicalAutomatonEntry implements Serializable {
          private SourceValidity validity = null;
          private LexicalAutomaton automaton = null;
  
          /**
           * Create a new entry.
           *
           * @param automaton Lexical automaton.
           * @param validity Validity of the lexicon file.
           */
          public LexicalAutomatonEntry(LexicalAutomaton automaton,
                                       SourceValidity validity) {
              this.automaton = automaton;
              this.validity = validity;
          }
  
          /**
           * Return the validity of the lexicon file.
           *
           * @return Validity of the lexicon file.
           */
          public SourceValidity getValidity() {
              return this.validity;
          }
  
          /**
           * Return the lexical automaton.
           *
           * @return Lexical automaton.
           */
          public LexicalAutomaton getLexicalAutomaton() {
              return this.automaton;
          }
      }
  }
  
  
  
  1.1                  xml-cocoon2/src/blocks/chaperon/java/org/apache/cocoon/xml/TextXMLizer.java
  
  Index: TextXMLizer.java
  ===================================================================
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  
   Redistribution and use in source and binary forms, with or without modifica-
   tion, are permitted provided that the following conditions are met:
  
   1. Redistributions of  source code must  retain the above copyright  notice,
      this list of conditions and the following disclaimer.
  
   2. Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
  
   3. The end-user documentation included with the redistribution, if any, must
      include  the following  acknowledgment:   "This product includes software
      developed  by the  Apache Software Foundation  (http://www.apache.org/)."
      Alternately, this  acknowledgment may  appear in the software itself,  if
      and wherever such third-party acknowledgments normally appear.
  
   4. The names "Apache Cocoon" and  "Apache Software Foundation" must  not  be
      used to  endorse or promote  products derived from  this software without
      prior written permission. For written permission, please contact
      apache@apache.org.
  
   5. Products  derived from this software may not  be called "Apache", nor may
      "Apache" appear  in their name,  without prior written permission  of the
      Apache Software Foundation.
  
   THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
   FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
   APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
   INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
   DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
   OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
   ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
   (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
   THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  
   This software  consists of voluntary contributions made  by many individuals
   on  behalf of the Apache Software  Foundation and was  originally created by
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.xml;
  
  import org.apache.avalon.framework.thread.ThreadSafe;
  import org.apache.avalon.framework.component.Component;
  import org.apache.excalibur.xml.sax.SAXParser;
  
  import org.xml.sax.Attributes;
  import org.xml.sax.ContentHandler;
  import org.xml.sax.InputSource;
  import org.xml.sax.SAXException;
  import org.xml.sax.ext.LexicalHandler;
  import org.xml.sax.helpers.AttributesImpl;
  import org.xml.sax.helpers.LocatorImpl;
  
  import java.io.InputStream;
  import java.io.InputStreamReader;
  import java.io.IOException;
  import java.io.LineNumberReader;
  
  /**
   * This XMLizer creates a SAX stream of a plain text document. The
   * text will be embedded in a text element.
   *
   * @author <a href="mailto:stephan@apache.org">Stephan Michels </a>
   * @version CVS $Id: TextXMLizer.java,v 1.1 2003/02/03 19:15:34 stephan Exp $
   */
  public class TextXMLizer implements SAXParser, ThreadSafe, Component {
  
      /** The URI of the text element */
      public final static String URI = "http://chaperon.sourceforge.net/schema/text/1.0";
  
      /**
       * Parse the {@link InputSource} and send
       * SAX events to the consumer.
       *
       * @param source Input source.
       * @param contentHandler Content handler.
       * @param lexicalHandler Lexical handler.
       */
      public void parse(InputSource source, ContentHandler contentHandler,
                        LexicalHandler lexicalHandler)
                          throws SAXException, IOException {
          parse(source, contentHandler);
      }
  
      /**
       * Parse the {@link InputSource} and send
       * SAX events to the consumer.
       * Attention: the consumer can  implement the
       * {@link LexicalHandler} as well.
       * The parse should take care of this.
       *
       * @param source
       * @param contentHandler
       */
      public void parse(InputSource source,
                        ContentHandler contentHandler)
                          throws SAXException, IOException {
  
          LocatorImpl locator = new LocatorImpl();
  
          locator.setPublicId(source.getPublicId());
          locator.setSystemId(source.getSystemId());
          locator.setLineNumber(1);
          locator.setColumnNumber(1);
  
          contentHandler.setDocumentLocator(locator);
          contentHandler.startDocument();
          contentHandler.startPrefixMapping("", URI);
  
          AttributesImpl atts = new AttributesImpl();
  
          contentHandler.startElement(URI, "text", "text", atts);
  
          LineNumberReader reader = null;
  
          if (source.getCharacterStream()!=null) {
              reader = new LineNumberReader(source.getCharacterStream());
          } else {
              reader = new LineNumberReader(new InputStreamReader(source.getByteStream()));
          }
  
          String line, newline = null;
          String separator = System.getProperty("line.separator");
  
          while (true) {
              if (newline==null) {
                  line = reader.readLine();
              } else {
                  line = newline;
              }
  
              if (line==null) {
                  break;
              }
  
              newline = reader.readLine();
  
              line = (newline!=null) ? line+separator : line;
  
              locator.setLineNumber(reader.getLineNumber());
              locator.setColumnNumber(1);
              contentHandler.characters(line.toCharArray(), 0, line.length());
  
              if (newline==null) {
                  break;
              }
          }
  
          contentHandler.endElement(URI, "text", "text");
  
          contentHandler.endPrefixMapping("");
          contentHandler.endDocument();
  
      }
  }
  
  
  
  1.2       +128 -65   xml-cocoon2/src/blocks/chaperon/samples/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/blocks/chaperon/samples/sitemap.xmap,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- sitemap.xmap	31 Jan 2003 19:20:01 -0000	1.1
  +++ sitemap.xmap	3 Feb 2003 19:15:34 -0000	1.2
  @@ -16,46 +16,61 @@
      <map:generator name="serverpages" logger="sitemap.generator.serverpages" label="content,data"
                     src="org.apache.cocoon.generation.ServerPagesGenerator"/>
   
  -   <map:generator name="textparser" label="content,data"
  -                  src="org.apache.cocoon.generation.TextParserGenerator" 
  -                  logger="sitemap.generator.textparser"/>
  +   <map:generator label="content,data" logger="sitemap.generator.directory" name="directory"
  +                  src="org.apache.cocoon.generation.DirectoryGenerator"/>
   
     </map:generators>
   
   <!-- =========================== Transformers ================================= -->
   
     <map:transformers default="xslt">
  -   <map:transformer logger="sitemap.transformer.xslt" name="xslt"
  -                    src="org.apache.cocoon.transformation.TraxTransformer">
  +   <map:transformer name="xslt" src="org.apache.cocoon.transformation.TraxTransformer"
  +                    logger="sitemap.transformer.xsltc">
       <use-request-parameters>true</use-request-parameters>
       <use-browser-capabilities-db>false</use-browser-capabilities-db>
  +    <transformer-factory>org.apache.xalan.xsltc.trax.TransformerFactoryImpl</transformer-factory>
      </map:transformer>
   
  -   <map:transformer name="textparser" 
  -                    src="org.apache.cocoon.transformation.TextFragmentParserTransformer" 
  -                    logger="sitemap.transformer.textparser"/>
  +   <map:transformer logger="sitemap.transformer.log" name="log" 
  +                    src="org.apache.cocoon.transformation.LogTransformer"/>
   
  -  </map:transformers>
  -
  -<!-- =========================== Readers ================================= -->
  +   <map:transformer name="lexer" 
  +                    src="net.sourceforge.chaperon.adapter.cocoon.LexicalTransformer" 
  +                    logger="chaperon.lexer"/>
  +   <map:transformer name="parser" 
  +                    src="net.sourceforge.chaperon.adapter.cocoon.ParserTransformer" 
  +                    logger="chaperon.parser">
  +    <map:parameter name="flatten" value="true"/>
  +    <map:parameter name="ignoring" value="true"/>
  +   </map:transformer>
   
  -  <map:readers default="resource">
  -   <map:reader logger="sitemap.reader.resource" name="resource" 
  -                src="org.apache.cocoon.reading.ResourceReader"/>
  -  </map:readers>
  +  </map:transformers>
   
   <!-- =========================== Serializers ================================= -->
   
     <map:serializers default="html">
      <map:serializer logger="sitemap.serializer.xml" mime-type="text/xml" name="xml"
  -                   src="org.apache.cocoon.serialization.XMLSerializer"/>
  +                   src="org.apache.cocoon.serialization.XMLSerializer">
  +    <indent>yes</indent>
  +   </map:serializer>
   
      <map:serializer logger="sitemap.serializer.html" mime-type="text/html" name="html" 
                      src="org.apache.cocoon.serialization.HTMLSerializer">
       <buffer-size>1024</buffer-size>
      </map:serializer>
  +
  +   <map:serializer logger="sitemap.serializer.links" name="links"
  +                   src="org.apache.cocoon.serialization.LinkSerializer"/>
  +
     </map:serializers>
   
  +<!-- =========================== Readers ================================= -->
  +
  +  <map:readers default="resource">
  +   <map:reader logger="sitemap.reader.resource" name="resource" 
  +                src="org.apache.cocoon.reading.ResourceReader"/>
  +  </map:readers>
  +
   <!-- =========================== Matchers ================================= -->
   
     <map:matchers default="wildcard">
  @@ -66,32 +81,65 @@
   <!-- ====================== Pipelines defintions ============================= -->
   
     <map:pipes default="caching">
  -   <map:pipe name="caching" src="org.apache.cocoon.components.pipeline.impl.CachingProcessingPipeline"/>
  +   <map:pipe name="caching"    src="org.apache.cocoon.components.pipeline.impl.CachingProcessingPipeline"/>
      <map:pipe name="noncaching" src="org.apache.cocoon.components.pipeline.impl.NonCachingProcessingPipeline"/>
  +   
     </map:pipes>
   
    </map:components>
   
  +<!-- =========================== Views =================================== -->
  +
  + <map:views>
  +  <map:view from-label="content" name="content">
  +   <map:serialize type="xml"/>
  +  </map:view>
  +
  +  <map:view from-position="last" name="links">
  +   <map:serialize type="links"/>
  +  </map:view>
  +
  + </map:views>
   
   <!-- =========================== Pipelines ================================= -->
   
    <map:pipelines>
   
  -  <map:pipeline internal-only="true">
  +  <map:pipeline type="noncaching"><!-- internal-only="true">-->
  +   <map:match pattern="*.xlex">
  +    <map:generate                src="grammars/{1}.grm"/>
  +    <map:transform type="lexer"  src="grammars/grm.xlex"/>
  +    <map:transform type="parser" src="grammars/grm.xgrm"/>
  +    <map:transform               src="stylesheets/text4regex.xsl"/>
  +    <map:transform type="lexer"  src="grammars/regex.xlex"/>
  +    <map:transform type="parser" src="grammars/regex.xgrm"/>
  +    <map:transform               src="stylesheets/grm2xlex.xsl"/>
  +    <map:serialize type="xml"/>
  +   </map:match>
  +
  +   <map:match pattern="*.xgrm">
  +    <map:generate                src="grammars/{1}.grm"/>
  +    <map:transform type="lexer"  src="grammars/grm.xlex"/>
  +    <map:transform type="parser" src="grammars/grm.xgrm"/>
  +    <map:transform               src="stylesheets/text4regex.xsl"/>
  +    <map:transform type="lexer"  src="grammars/regex.xlex"/>
  +    <map:transform type="parser" src="grammars/regex.xgrm"/>
  +    <map:transform               src="stylesheets/grm2xgrm.xsl"/>
  +    <map:serialize type="xml"/>
  +   </map:match>
   
  -   <!-- IMPORTANT! This pipeline sould be cachable -->
  -   <map:match pattern="*.grm">
  -    <map:generate type="textparser" src="grammars/{1}.rgrm">
  -     <map:parameter name="grammar" value="context://samples/chaperon/grammars/rgrm.grm"/>
  -    </map:generate>
   
  -    <map:transform src="stylesheets/rgrm2grm.xsl"/>
  +   <map:match pattern="packages.xml">
  +    <map:generate  type="directory"   src="misc/">
  +     <map:parameter name="depth" value="6"/>
  +    </map:generate>
  +    <map:transform src="stylesheets/index4java.xsl"/>
       <map:serialize type="xml"/>
      </map:match>
  -  </map:pipeline>
   
  -  <map:pipeline>   
  +  </map:pipeline>
   
  +  <map:pipeline>  
      <map:match pattern="">
       <map:redirect-to uri="welcome"/>
      </map:match>
  @@ -104,69 +152,84 @@
       <map:serialize/>
      </map:match>
   
  -   <map:match pattern="images/*">
  -     <map:redirect-to uri="../../images/{1}"/>
  -   </map:match>
  -
      <!-- ========================= Chaperon ================================ -->
   
      <map:match pattern="mathexp.html">
       <map:generate type="serverpages" src="misc/mathexp.xsp"/>
  -
  -    <map:transform src="stylesheets/parsefragment.xsl">
  -     <map:parameter name="parse_element" value="math"/>
  -    </map:transform>
  -
  -    <map:transform type="textparser">
  -     <map:parameter name="grammar" value="context://samples/chaperon/grammars/mathexp.grm"/>
  -    </map:transform>
  -
  -    <map:transform src="stylesheets/mathexp2html.xsl"/>
  -    <map:serialize/>
  +    <map:transform               src="stylesheets/mathexp.xsl"/>
  +    <map:transform type="lexer"  src="grammars/mathexp.xlex"/>
  +    <map:transform type="parser" src="grammars/mathexp.xgrm"/>
  +    <map:transform               src="stylesheets/mathexp2html.xsl"/>
  +    <map:serialize type="html"/>
      </map:match>
   
      <map:match pattern="wiki.html">
       <map:generate type="serverpages" src="misc/wiki.xsp"/>
  +    <map:transform type="lexer"  src="cocoon:/wiki.xlex"/>
  +    <map:transform type="parser" src="cocoon:/wiki.xgrm"/>
  +    <map:transform               src="stylesheets/wiki2html.xsl"/>
  +    <map:serialize type="html"/>
  +   </map:match>
   
  -    <map:transform type="textparser">
  -     <!--<map:parameter name="grammar" value="cocoon:/wiki.grm"/>-->
  -     <map:parameter name="grammar" value="context://samples/chaperon/grammars/wiki.grm"/>
  +   <map:match pattern="**/index.html">
  +    <map:generate                src="cocoon:/packages.xml"/>
  +    <map:transform               src="stylesheets/package2html.xsl">
  +     <map:parameter name="package" value="{1}"/>
       </map:transform>
  -
  -    <map:transform src="stylesheets/wiki2html.xsl"/>
       <map:serialize type="html"/>
      </map:match>
   
  -   <map:match pattern="java1.html">
  -    <map:generate type="textparser" src="misc/test1.java">
  -     <map:parameter name="grammar" value="cocoon:/java.grm"/>
  -     <!--<map:parameter name="grammar" value="context:/grammars/java.grm"/>-->
  -     <map:parameter name="includeignorabletokens" value="true"/>
  -    </map:generate>
  -
  -    <map:transform src="stylesheets/java2html.xsl"/>
  +   <map:match pattern="**/*.java.html">
  +    <map:aggregate element="java">
  +     <map:part                   src="cocoon:/packages.xml"/>
  +     <map:part                   src="misc/{1}/{2}.java"/>
  +    </map:aggregate>
  +    <!--<map:transform type="lexer"  src="cocoon:/java.xlex"/>-->
  +    <map:transform type="lexer"  src="grammars/java.xlex"/>
  +    <map:transform               src="stylesheets/text4javadoc.xsl"/>
  +    <!--<map:transform type="lexer" src="cocoon:/javadoc.xlex"/>-->
  +    <map:transform type="lexer"  src="grammars/javadoc.xlex"/>
  +    <map:transform               src="stylesheets/java2html.xsl">
  +     <map:parameter name="package" value="{1}"/>
  +     <map:parameter name="class"   value="{2}"/>
  +    </map:transform>
       <map:serialize type="html"/>
      </map:match>
   
  -   <map:match pattern="java2.html">
  -    <map:generate type="textparser" src="misc/test2.java">
  -     <map:parameter name="grammar" value="cocoon:/java.grm"/>
  -     <!--<map:parameter name="grammar" value="context:/grammars/java.grm"/>-->
  -     <map:parameter name="includeignorabletokens" value="true"/>
  -    </map:generate>
  -
  -    <map:transform src="stylesheets/java2html.xsl"/>
  +   <map:match pattern="**/*.class.html">
  +    <map:aggregate element="java">
  +     <map:part                   src="cocoon:/packages.xml"/>
  +     <map:part                   src="misc/{1}/{2}.java"/>
  +    </map:aggregate>
  +    <!--<map:transform type="lexer"  src="cocoon:/java.xlex"/>-->
  +    <map:transform type="lexer"  src="grammars/java.xlex"/>
  +    <map:transform               src="stylesheets/remove4class.xsl"/>
  +    <!--<map:transform type="parser" src="cocoon:/java.xgrm"/>-->
  +    <map:transform type="parser" src="grammars/java.xgrm"/>
  +    <map:transform               src="stylesheets/text4javadoc2.xsl"/>
  +    <!--<map:transform type="lexer"  src="cocoon:/javadoc.xlex"/>-->
  +    <map:transform type="lexer"  src="grammars/javadoc.xlex"/>
  +    <!--<map:transform type="parser" src="cocoon:/javadoc.xgrm"/>-->
  +    <map:transform type="parser" src="grammars/javadoc.xgrm"/>
  +    <map:transform               src="stylesheets/class2html.xsl">
  +     <map:parameter name="package" value="{1}"/>
  +     <map:parameter name="class"   value="{2}"/>
  +    </map:transform>
       <map:serialize type="html"/>
      </map:match>
   
  -   <map:match pattern="java.css">
  -    <map:read src="misc/java.css"/>
  +   <map:match pattern="*.css">
  +    <map:read src="misc/{1}.css"/>
  +   </map:match>
  +
  +   <map:match pattern="**/*.css">
  +    <map:read src="misc/{2}.css"/>
      </map:match>
   
      <!-- ========================= Server ================================ -->
   
      <map:handle-errors>
  -    <map:transform src="context://stylesheets/system/error2html.xsl"/>
  +    <map:transform src="context://samples/stylesheets/system/error2html.xsl"/>
       <map:serialize status-code="500"/>
      </map:handle-errors>
   
  
  
  
  1.2       +134 -380  xml-cocoon2/src/blocks/chaperon/samples/grammars/wiki.grm
  
  Index: wiki.grm
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/blocks/chaperon/samples/grammars/wiki.grm,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- wiki.grm	31 Jan 2003 19:20:02 -0000	1.1
  +++ wiki.grm	3 Feb 2003 19:15:34 -0000	1.2
  @@ -1,380 +1,134 @@
  -<?xml version="1.0" encoding="US-ASCII"?>
  -<!--<!DOCTYPE grammar PUBLIC "-//Chaperon//DTD grammar 1.0//EN" "grammar.dtd">-->
  -<grammar uri="http://chaperon.sourceforge.net/grammar/wiki/1.0">
  -<tokens>
  -<token tsymbol="LINE">
  -<concat>
  -<string content="---"/>
  -<concat maxOccurs="*" minOccurs="1">
  -<string content="-"/>
  -</concat>
  -</concat>
  -</token>
  -<token tsymbol="QUOTE">
  -<string content=":"/>
  -</token>
  -<token tsymbol="BULLETED">
  -<concat maxOccurs="*" minOccurs="1">
  -<string content="*"/>
  -</concat>
  -</token>
  -<token tsymbol="NUMBERED3">
  -<string content="###"/>
  -</token>
  -<token tsymbol="NUMBERED2">
  -<string content="##"/>
  -</token>
  -<token tsymbol="NUMBERED1">
  -<string content="#"/>
  -</token>
  -<token tsymbol="HEAD">
  -<concat maxOccurs="*" minOccurs="1">
  -<string content="!"/>
  -</concat>
  -</token>
  -<token assoc="left" tsymbol="ITALIC">
  -<string content="&quot;"/>
  -</token>
  -<token assoc="left" tsymbol="BOLD">
  -<string content="__"/>
  -</token>
  -<token assoc="left" tsymbol="UNDERLINE">
  -<string content="_"/>
  -</token>
  -<token tsymbol="LINK">
  -<concat>
  -<alt>
  -<string content="http"/>
  -<string content="ftp"/>
  -<string content="mailto"/>
  -<string content="news"/>
  -</alt>
  -<string content=":"/>
  -<concat minOccurs="1" maxOccurs="3">
  -<string content="/"/>
  -</concat>
  -<concat maxOccurs="*" minOccurs="0">
  -<cc>
  -<ci min="A" max="Z"/>
  -<ci min="a" max="z"/>
  -<ci min="0" max="9"/>
  -<cs content="."/>
  -<cs content="_"/>
  -<cs content="-"/>
  -</cc>
  -</concat>
  -</concat>
  -</token>
  -<token tsymbol="BOPEN">
  -<string content="["/>
  -</token>
  -<token tsymbol="BCLOSE">
  -<string content="]"/>
  -</token>
  -<token tsymbol="TEXT">
  -<concat>
  -<concat maxOccurs="*" minOccurs="1">
  -<cc>
  -<ci min="A" max="Z"/>
  -<ci min="a" max="z"/>
  -<ci min="0" max="9"/>
  -<cs content=","/>
  -<cs content="'"/>
  -<cs content="."/>
  -<cs content="?"/>
  -<cs content=":"/>
  -</cc>
  -</concat>
  -<concat maxOccurs="*" minOccurs="0">
  -<cc>
  -<ci min="A" max="Z"/>
  -<ci min="a" max="z"/>
  -<ci min="0" max="9"/>
  -<cs content=" "/>
  -<cs content="	"/>
  -<cs content=","/>
  -<cs content="'"/>
  -<cs content="."/>
  -<cs content="?"/>
  -<cs content="!"/>
  -<cs content=":"/>
  -</cc>
  -</concat>
  -</concat>
  -</token>
  -<token assoc="left" tsymbol="EMPTY">
  -<alt>
  -<concat>
  -<string content="&#10;"/>
  -<concat maxOccurs="*" minOccurs="0">
  -<cc>
  -<cs content=" "/>
  -<cs content="	"/>
  -</cc>
  -</concat>
  -<string content="&#10;"/>
  -</concat>
  -<concat>
  -<string content="&#13;"/>
  -<concat maxOccurs="*" minOccurs="0">
  -<cc>
  -<cs content=" "/>
  -<cs content="	"/>
  -</cc>
  -</concat>
  -<string content="&#13;"/>
  -</concat>
  -<concat>
  -<string content="&#10;"/>
  -<concat maxOccurs="*" minOccurs="0">
  -<cc>
  -<cs content=" "/>
  -<cs content="	"/>
  -</cc>
  -</concat>
  -<string content="&#10;"/>
  -</concat>
  -</alt>
  -</token>
  -<token tsymbol="EOL">
  -<alt>
  -<concat>
  -<string content="&#13;"/>
  -<concat maxOccurs="1" minOccurs="0">
  -<string content="&#10;"/>
  -</concat>
  -</concat>
  -<string content="&#10;"/>
  -</alt>
  -</token>
  -</tokens>
  - <ignorabletokens>
  -  <token tsymbol="whitespace">
  -<concat maxOccurs="*" minOccurs="1">
  -<cc>
  -<cs content=" "/>
  -<cs content="&#13;"/>
  -<cs content="&#10;"/>
  -</cc>
  -</concat>
  -  </token>
  - </ignorabletokens>
  -<productions>
  -<production ntsymbol="wiki" reducetype="append">
  -<ntsymbol name="wiki"/>
  -<ntsymbol name="paragraphs"/>
  -</production>
  -<production ntsymbol="wiki" reducetype="append">
  -<ntsymbol name="paragraphs"/>
  -</production>
  -<production ntsymbol="paragraphs" reducetype="append">
  -<ntsymbol name="paragraphs"/>
  -<ntsymbol name="paragraph"/>
  -</production>
  -<production ntsymbol="paragraphs" reducetype="append">
  -<ntsymbol name="paragraph"/>
  -</production>
  -<production ntsymbol="paragraph">
  -<ntsymbol name="bulletedlist"/>
  -</production>
  -<production ntsymbol="paragraph">
  -<ntsymbol name="numberedlist1"/>
  -</production>
  -<production ntsymbol="paragraph">
  -<ntsymbol name="textitem"/>
  -</production>
  -<production ntsymbol="paragraph">
  -<ntsymbol name="headitem"/>
  -</production>
  -<production ntsymbol="paragraph">
  -<ntsymbol name="footnote"/>
  -</production>
  -<production ntsymbol="paragraph">
  -<tsymbol name="LINE"/>
  -</production>
  -<production ntsymbol="paragraph">
  -<tsymbol name="EMPTY"/>
  -</production>
  -<production ntsymbol="bulletedlist" reducetype="append">
  -<ntsymbol name="bulletedlist"/>
  -<ntsymbol name="bulletedlistitem"/>
  -</production>
  -<production ntsymbol="bulletedlist" reducetype="append">
  -<ntsymbol name="bulletedlistitem"/>
  -</production>
  -<production ntsymbol="bulletedlistitem">
  -<tsymbol name="BULLETED"/>
  -<ntsymbol name="textblock"/>
  -<ntsymbol name="textsequence"/>
  -</production>
  -<production ntsymbol="bulletedlistitem">
  -<tsymbol name="BULLETED"/>
  -<ntsymbol name="textblock"/>
  -</production>
  -<production ntsymbol="numberedlist1" reducetype="append">
  -<ntsymbol name="numberedlist1"/>
  -<ntsymbol name="numberedlistitem1"/>
  -</production>
  -<production ntsymbol="numberedlist1" reducetype="append">
  -<ntsymbol name="numberedlistitem1"/>
  -</production>
  -<production ntsymbol="numberedlist1" reducetype="append">
  -<ntsymbol name="numberedlist1"/>
  -<ntsymbol name="numberedlist2"/>
  -</production>
  -<production ntsymbol="numberedlist1" reducetype="append">
  -<ntsymbol name="numberedlist2"/>
  -</production>
  -<production ntsymbol="numberedlistitem1">
  -<tsymbol name="NUMBERED1"/>
  -<ntsymbol name="textblock"/>
  -<ntsymbol name="textsequence"/>
  -</production>
  -<production ntsymbol="numberedlistitem1">
  -<tsymbol name="NUMBERED1"/>
  -<ntsymbol name="textblock"/>
  -</production>
  -<production ntsymbol="numberedlist2" reducetype="append">
  -<ntsymbol name="numberedlist2"/>
  -<ntsymbol name="numberedlistitem2"/>
  -</production>
  -<production ntsymbol="numberedlist2" reducetype="append">
  -<ntsymbol name="numberedlistitem2"/>
  -</production>
  -<production ntsymbol="numberedlist2" reducetype="append">
  -<ntsymbol name="numberedlist2"/>
  -<ntsymbol name="numberedlist3"/>
  -</production>
  -<production ntsymbol="numberedlist2" reducetype="append">
  -<ntsymbol name="numberedlist3"/>
  -</production>
  -<production ntsymbol="numberedlistitem2">
  -<tsymbol name="NUMBERED2"/>
  -<ntsymbol name="textblock"/>
  -<ntsymbol name="textsequence"/>
  -</production>
  -<production ntsymbol="numberedlistitem2">
  -<tsymbol name="NUMBERED2"/>
  -<ntsymbol name="textblock"/>
  -</production>
  -<production ntsymbol="numberedlist3" reducetype="append">
  -<ntsymbol name="numberedlist3"/>
  -<ntsymbol name="numberedlistitem3"/>
  -</production>
  -<production ntsymbol="numberedlist3" reducetype="append">
  -<ntsymbol name="numberedlistitem3"/>
  -</production>
  -<production ntsymbol="numberedlistitem3">
  -<tsymbol name="NUMBERED3"/>
  -<ntsymbol name="textblock"/>
  -<ntsymbol name="textsequence"/>
  -</production>
  -<production ntsymbol="numberedlistitem3">
  -<tsymbol name="NUMBERED3"/>
  -<ntsymbol name="textblock"/>
  -</production>
  -<production ntsymbol="textitem">
  -<ntsymbol name="firstblock"/>
  -<ntsymbol name="textblock"/>
  -<ntsymbol name="textsequence"/>
  -</production>
  -<production ntsymbol="textitem">
  -<ntsymbol name="firstblock"/>
  -<ntsymbol name="textblock"/>
  -</production>
  -<production ntsymbol="textitem">
  -<ntsymbol name="firstblock"/>
  -</production>
  -<production ntsymbol="headitem">
  -<tsymbol name="HEAD"/>
  -<ntsymbol name="textblock"/>
  -<ntsymbol name="textsequence"/>
  -</production>
  -<production ntsymbol="headitem">
  -<tsymbol name="HEAD"/>
  -<ntsymbol name="textblock"/>
  -</production>
  -<production ntsymbol="footnote">
  -<ntsymbol name="note"/>
  -<ntsymbol name="textblock"/>
  -<ntsymbol name="textsequence"/>
  -</production>
  -<production ntsymbol="footnote">
  -<ntsymbol name="note"/>
  -<ntsymbol name="textblock"/>
  -</production>
  -<production ntsymbol="textsequence" reducetype="resolve">
  -<ntsymbol name="textsequence"/>
  -<tsymbol name="EOL"/>
  -</production>
  -<production ntsymbol="textsequence" reducetype="resolve">
  -<tsymbol name="EOL"/>
  -</production>
  -<production ntsymbol="textsequence" reducetype="resolve">
  -<ntsymbol name="textsequence"/>
  -<ntsymbol name="textblock"/>
  -</production>
  -<production ntsymbol="textsequence" reducetype="resolve">
  -<ntsymbol name="textblock"/>
  -</production>
  -<production ntsymbol="textblock">
  -<tsymbol name="LINK"/>
  -</production>
  -<production ntsymbol="textblock">
  -<ntsymbol name="boldblock"/>
  -</production>
  -<production ntsymbol="textblock">
  -<ntsymbol name="italicblock"/>
  -</production>
  -<production ntsymbol="textblock">
  -<ntsymbol name="underlineblock"/>
  -</production>
  -<production ntsymbol="textblock">
  -<tsymbol name="TEXT"/>
  -</production>
  -<production ntsymbol="textblock">
  -<ntsymbol name="note"/>
  -</production>
  -<production ntsymbol="firstblock">
  -<tsymbol name="LINK"/>
  -</production>
  -<production ntsymbol="firstblock">
  -<ntsymbol name="boldblock"/>
  -</production>
  -<production ntsymbol="firstblock">
  -<ntsymbol name="italicblock"/>
  -</production>
  -<production ntsymbol="firstblock">
  -<ntsymbol name="underlineblock"/>
  -</production>
  -<production ntsymbol="firstblock">
  -<tsymbol name="TEXT"/>
  -</production>
  -<production ntsymbol="italicblock">
  -<tsymbol name="ITALIC"/>
  -<tsymbol name="TEXT"/>
  -<tsymbol name="ITALIC"/>
  -</production>
  -<production ntsymbol="boldblock">
  -<tsymbol name="BOLD"/>
  -<tsymbol name="TEXT"/>
  -<tsymbol name="BOLD"/>
  -</production>
  -<production ntsymbol="underlineblock">
  -<tsymbol name="UNDERLINE"/>
  -<tsymbol name="TEXT"/>
  -<tsymbol name="UNDERLINE"/>
  -</production>
  -<production ntsymbol="note">
  -<tsymbol name="BOPEN"/>
  -<tsymbol name="TEXT"/>
  -<tsymbol name="BCLOSE"/>
  -</production>
  -<production ntsymbol="note">
  -<tsymbol name="BOPEN"/>
  -<tsymbol name="LINK"/>
  -<tsymbol name="BCLOSE"/>
  -</production>
  -</productions>
  -<ssymbol ntsymbol="wiki"/>
  -</grammar>
  +%token LINE "\-\-\-(\-)+";
  +
  +%token QUOTE  ":";
  +%token BULLETED "(\*)+";
  +
  +%token NUMBERED3 "\#\#\#";
  +%token NUMBERED2 "\#\#";
  +%token NUMBERED1 "\#";
  +
  +%token HEAD "(\!)+";
  +
  +%right ITALIC "\"";
  +%right BOLD "__";
  +%right UNDERLINE "_";
  +
  +%token LINK "(http|ftp|mailto|news):(/){1,3}[A-Za-z0-9\.\_\-]*";
  +
  +%token BOPEN "\[";
  +%token BCLOSE "\]";
  +
  +%token TEXT "[A-Za-z0-9\,\'\.\?\:]+[A-Za-z0-9\ \t\,\'\.\?\!\:]*";
  +
  +%right EMPTY "\r\n [\ \t]* \r\n |
  +             \r   [\ \t]* \r   |
  +             \n   [\ \t]* \n   ";
  +
  +%token EOL "(\r(\n)?|\n)";
  +
  +
  +%start wiki;
  +
  +%ignore "[\ \r\n]+"; // whitespace
  +
  +%%
  +
  +wiki : wiki paragraphs 
  +     | paragraphs      
  +     ;
  +
  +paragraphs : paragraphs paragraph 
  +           | paragraph            
  +           ;
  +
  +paragraph : bulletedlist
  +          | numberedlist1
  +          | textitem 
  +          | headitem 
  +          | footnote
  +          | LINE EOL
  +          | EMPTY
  +          ;
  +
  +bulletedlist : bulletedlist bulletedlistitem 
  +             | bulletedlistitem              
  +             ;
  +
  +bulletedlistitem : BULLETED textblock textsequence
  +                 | BULLETED textblock
  +                 ;
  +
  +numberedlist1 : numberedlist1 numberedlistitem1 
  +              | numberedlistitem1               
  +              | numberedlist1 numberedlist2     
  +              | numberedlist2                   
  +              ;
  +
  +numberedlistitem1 : NUMBERED1 textblock textsequence
  +                  | NUMBERED1 textblock
  +                  ;
  +
  +numberedlist2 : numberedlist2 numberedlistitem2 
  +              | numberedlistitem2               
  +              | numberedlist2 numberedlist3     
  +              | numberedlist3                   
  +              ; 
  +
  +numberedlistitem2 : NUMBERED2 textblock textsequence
  +                  | NUMBERED2 textblock 
  +                  ;
  +
  +numberedlist3 : numberedlist3 numberedlistitem3 
  +              | numberedlistitem3               
  +              ; 
  +
  +numberedlistitem3 : NUMBERED3 textblock textsequence
  +                  | NUMBERED3 textblock 
  +                  ;
  +
  +textitem : firstblock textblock textsequence
  +         | firstblock textblock
  +         | firstblock
  +         ;
  +
  +headitem : HEAD textblock textsequence
  +         | HEAD textblock
  +         ;
  +
  +footnote : note textblock textsequence
  +         | note textblock
  +         ;
  +
  +textsequence : textsequence EOL       
  +             | EOL                    
  +             | textsequence textblock 
  +             | textblock              
  +             ; 
  +
  +textblock : LINK                           
  +          | boldblock                      
  +          | italicblock            
  +          | underlineblock                
  +          | TEXT                         
  +          | note                         
  +          ;
  +
  +firstblock : LINK                 
  +           | boldblock                
  +           | italicblock                
  +           | underlineblock          
  +           | TEXT               
  +           ;
  +
  +italicblock : ITALIC TEXT ITALIC
  +            ;
  +
  +boldblock : BOLD TEXT BOLD
  +          ;
  +
  +underlineblock : UNDERLINE TEXT UNDERLINE 
  +               ;
  +
  +note : BOPEN TEXT BCLOSE
  +     | BOPEN LINK BCLOSE
  +     ;
  
  
  
  1.1                  xml-cocoon2/src/blocks/chaperon/samples/grammars/grammar-v20.dtd
  
  Index: grammar-v20.dtd
  ===================================================================
  <!-- GRAMMAR DTD -->
  <!ELEMENT grammar ((priority)?,(associativity)*,(production)*, start)>
  
  <!-- PRIORITY -->
  <!ELEMENT priority (terminal)+>
  
  <!-- PRODUCTION -->
  <!ELEMENT associativity EMPTY>
  <!ATTLIST associativity symbol CDATA    #REQUIRED
                          type   (left|right|nonassoc) "nonassoc">
                 
  <!-- PRODUCTION -->
  <!ELEMENT production (terminal|nonterminal)+>
  <!ATTLIST production symbol     CDATA    #REQUIRED
                       precedence CDATA    #IMPLIED>
  
  <!-- TOKEN REFERENZ -->
  <!ELEMENT terminal EMPTY>
  <!ATTLIST terminal symbol CDATA    #REQUIRED>
  
  <!-- TOKEN REFERENZ -->
  <!ELEMENT nonterminal EMPTY>
  <!ATTLIST nonterminal symbol CDATA    #REQUIRED>
  
  <!-- START SYMBOL -->
  <!ELEMENT start EMPTY>
  <!ATTLIST start symbol CDATA    #REQUIRED>
  
  
  
  
  
  1.1                  xml-cocoon2/src/blocks/chaperon/samples/grammars/grm.xgrm
  
  Index: grm.xgrm
  ===================================================================
  <?xml version="1.0" standalone="no"?>
  <!DOCTYPE grammar PUBLIC "-//Chaperon//DTD grammar 2.0//EN" "grammar-v20.dtd">
  
  <grammar>
  
   <production symbol="grammar">
    <nonterminal symbol="token_decls"/><terminal symbol="delimiter"/>
    <nonterminal symbol="production_decls"/>
   </production>
  
   <production symbol="token_decls">
    <nonterminal symbol="token_decls"/> <nonterminal symbol="token_decl"/>
   </production>
  
   <production symbol="token_decls">
    <nonterminal symbol="token_decl"/>
   </production>
  
   <production symbol="token_decls">
    <nonterminal symbol="token_decls"/><nonterminal symbol="start_decl"/>
   </production>
  
   <production symbol="token_decls">
    <nonterminal symbol="start_decl"/>
   </production>
  
   <production symbol="token_decls">
    <nonterminal symbol="token_decls"/><nonterminal symbol="ignorabletoken_decl"/>
   </production>
  
   <production symbol="token_decls">
    <nonterminal symbol="ignorabletoken_decl"/>
   </production>
  
   <production symbol="token_decls">
    <nonterminal symbol="token_decls"/><nonterminal symbol="ab_decl"/>
   </production>
    
   <production symbol="token_decls">
    <nonterminal symbol="ab_decl"/>
   </production>
  
   <production symbol="token_decl">
    <terminal symbol="token_decl"/><terminal symbol="id"/>
    <terminal symbol="string"/><terminal symbol="semicolon"/>
   </production>
  
   <production symbol="start_decl">
    <terminal symbol="start_decl"/><terminal symbol="id"/><terminal symbol="semicolon"/>
   </production>
  
   <production symbol="ignorabletoken_decl">
    <terminal symbol="ignorabletoken_decl"/><terminal symbol="string"/><terminal symbol="semicolon"/>
   </production>
  
   <production symbol="ab_decl">
    <terminal symbol="ab_decl"/><terminal symbol="id"/>
    <terminal symbol="string"/><terminal symbol="semicolon"/>
   </production>
  
   <production symbol="production_decls">
    <nonterminal symbol="production_decls"/><nonterminal symbol="production_decl"/>
   </production>
  
   <production symbol="production_decls">
    <nonterminal symbol="production_decl"/>
   </production>
  
   <production symbol="production_decl">
    <terminal symbol="id"/><terminal symbol="colon"/><nonterminal symbol="production_defs"/>
    <terminal symbol="semicolon"/>
   </production>
  
   <production symbol="production_defs">
    <nonterminal symbol="production_defs"/><terminal symbol="alt"/><nonterminal symbol="production_def"/>
   </production>
   
   <production symbol="production_defs">
    <nonterminal symbol="production_def"/>
   </production>
  
   <production symbol="prec_decl">
    <terminal symbol="prec_decl"/><terminal symbol="id"/>
   </production>
  
   <production symbol="production_def">
    <nonterminal symbol="ids"/>
   </production>
  
   <production symbol="production_def">
    <nonterminal symbol="ids"/><nonterminal symbol="prec_decl"/>
   </production>
  
   <production symbol="ids">
    <nonterminal symbol="ids"/><terminal symbol="id"/>
   </production>
  
   <production symbol="ids">
    <terminal symbol="id"/>
   </production>
  
   <start symbol="grammar"/>
  </grammar>
  
  
  
  1.1                  xml-cocoon2/src/blocks/chaperon/samples/grammars/grm.xlex
  
  Index: grm.xlex
  ===================================================================
  <?xml version="1.0" standalone="no"?>
  <!DOCTYPE lexicon PUBLIC "-//Chaperon//DTD lexicon 2.0//EN" "lexicon-v20.dtd">
  
  <lexicon>
  
   <lexeme symbol="token_decl">
    <alt>
     <cstring content="%token"/>
     <cstring content="%left"/>
     <cstring content="%right"/>
    </alt>
   </lexeme>
  
   <lexeme symbol="ab_decl">
    <cstring content="%ab"/>
   </lexeme>
  
   <lexeme symbol="start_decl">
    <cstring content="%start"/>
   </lexeme>
  
   <lexeme symbol="ignorabletoken_decl">
    <cstring content="%ignore"/>
   </lexeme>
  
   <lexeme symbol="prec_decl">
    <cstring content="%prec"/>
   </lexeme>
  
   <lexeme symbol="delimiter">
    <cstring content="%%"/>
   </lexeme>
  
   <lexeme symbol="colon">
    <cstring content=":"/>
   </lexeme>
  
   <lexeme symbol="alt">
    <cstring content="|"/>
   </lexeme>
  
   <lexeme symbol="semicolon">
    <cstring content=";"/>
   </lexeme>
  
   <lexeme symbol="string">
    <concat>
     <cstring content="&#34;"/>
     <alt minOccurs="1" maxOccurs="*">
      <cclass exclusive="true"><cset content="&#92;&#34;"/></cclass>
      <concat><cstring content="&#92;"/><cclass exclusive="true"><cset content="u"/></cclass></concat>
      <concat>
       <cstring content="&#92;u"/>
       <cclass><cinterval min="0" max="9"/><cinterval min="a" max="f"/><cinterval min="A" max="F"/></cclass>
       <cclass><cinterval min="0" max="9"/><cinterval min="a" max="f"/><cinterval min="A" max="F"/></cclass>
       <cclass><cinterval min="0" max="9"/><cinterval min="a" max="f"/><cinterval min="A" max="F"/></cclass>
       <cclass><cinterval min="0" max="9"/><cinterval min="a" max="f"/><cinterval min="A" max="F"/></cclass>
      </concat>
     </alt>
     <cstring content="&#34;"/>
    </concat>
   </lexeme>
  
   <lexeme symbol="id">
    <concat>
     <cclass><cinterval min="A" max="Z"/><cinterval min="a" max="z"/></cclass>
     <cclass minOccurs="0" maxOccurs="*">
      <cinterval min="A" max="Z"/><cinterval min="a" max="z"/><cinterval min="0" max="9"/><cset content="_"/>
     </cclass>
    </concat>
   </lexeme>
  
   <lexeme>
    <alt>
     <concat>
      <cstring content="//"/>
      <cclass exclusive="true" minOccurs="0" maxOccurs="*">
       <cset content="&#10;&#13;"/>
      </cclass>
     </concat>
     <concat>
      <cstring content="/*"/>
      <alt minOccurs="0" maxOccurs="*">
       <cclass exclusive="true"><cset content="*"/></cclass>
       <concat><cstring content="*"/><cclass exclusive="true"><cset content="/"/></cclass></concat>
      </alt>
      <cstring content="*/"/>
     </concat>
    </alt>
   </lexeme>
   
   <lexeme> 
    <cclass maxOccurs="*"><cset content="&#10;&#13;&#9;&#32;"/></cclass>
   </lexeme>
  </lexicon>
  
  
  
  1.1                  xml-cocoon2/src/blocks/chaperon/samples/grammars/java.xgrm
  
  Index: java.xgrm
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  <grammar xmlns="http://chaperon.sourceforge.net/schema/grammar/1.0">
  <priority>
  <terminal symbol="DOPEN"/>
  <terminal symbol="DCLOSE"/>
  <terminal symbol="COPEN"/>
  <terminal symbol="CCLOSE"/>
  <terminal symbol="BOPEN"/>
  <terminal symbol="BCLOSE"/>
  <terminal symbol="SEMICOLON"/>
  <terminal symbol="COMMA"/>
  <terminal symbol="DOT"/>
  <terminal symbol="OP_EQ"/>
  <terminal symbol="OP_LE"/>
  <terminal symbol="OP_GE"/>
  <terminal symbol="OP_NE"/>
  <terminal symbol="OP_LOR"/>
  <terminal symbol="OP_LAND"/>
  <terminal symbol="OP_INC"/>
  <terminal symbol="OP_DEC"/>
  <terminal symbol="OP_SHR"/>
  <terminal symbol="OP_SHL"/>
  <terminal symbol="OP_SHRR"/>
  <terminal symbol="ASS_OP"/>
  <terminal symbol="EQ"/>
  <terminal symbol="GT"/>
  <terminal symbol="LT"/>
  <terminal symbol="NOT"/>
  <terminal symbol="TILDE"/>
  <terminal symbol="QM"/>
  <terminal symbol="COLON"/>
  <terminal symbol="PLUS"/>
  <terminal symbol="MINUS"/>
  <terminal symbol="MULT"/>
  <terminal symbol="DIV"/>
  <terminal symbol="AND"/>
  <terminal symbol="OR"/>
  <terminal symbol="XOR"/>
  <terminal symbol="MOD"/>
  <terminal symbol="BOOLLIT"/>
  <terminal symbol="ABSTRACT"/>
  <terminal symbol="DO"/>
  <terminal symbol="IMPLEMENTS"/>
  <terminal symbol="PACKAGE"/>
  <terminal symbol="THROW"/>
  <terminal symbol="BOOLEAN"/>
  <terminal symbol="DOUBLE"/>
  <terminal symbol="IMPORT"/>
  <terminal symbol="PRIVATE"/>
  <terminal symbol="THROWS"/>
  <terminal symbol="BREAK"/>
  <terminal symbol="ELSE"/>
  <terminal symbol="INNER"/>
  <terminal symbol="PROTECTED"/>
  <terminal symbol="TRANSIENT"/>
  <terminal symbol="BYTE"/>
  <terminal symbol="EXTENDS"/>
  <terminal symbol="INSTANCEOF"/>
  <terminal symbol="PUBLIC"/>
  <terminal symbol="TRY"/>
  <terminal symbol="CASE"/>
  <terminal symbol="FINAL"/>
  <terminal symbol="INT"/>
  <terminal symbol="REST"/>
  <terminal symbol="VAR"/>
  <terminal symbol="CAST"/>
  <terminal symbol="FINALLY"/>
  <terminal symbol="INTERFACE"/>
  <terminal symbol="RETURN"/>
  <terminal symbol="VOID"/>
  <terminal symbol="CATCH"/>
  <terminal symbol="FLOAT"/>
  <terminal symbol="LONG"/>
  <terminal symbol="SHORT"/>
  <terminal symbol="VOLATILE"/>
  <terminal symbol="CHAR"/>
  <terminal symbol="FOR"/>
  <terminal symbol="NATIVE"/>
  <terminal symbol="STATIC"/>
  <terminal symbol="WHILE"/>
  <terminal symbol="CLASS"/>
  <terminal symbol="FUTURE"/>
  <terminal symbol="NEW"/>
  <terminal symbol="SUPER"/>
  <terminal symbol="CONST"/>
  <terminal symbol="GENERIC"/>
  <terminal symbol="NULL"/>
  <terminal symbol="SWITCH"/>
  <terminal symbol="CONTINUE"/>
  <terminal symbol="GOTO"/>
  <terminal symbol="OPERATOR"/>
  <terminal symbol="SYNCHRONIZED"/>
  <terminal symbol="DEFAULT"/>
  <terminal symbol="IF"/>
  <terminal symbol="OUTER"/>
  <terminal symbol="THIS"/>
  <terminal symbol="LITERAL"/>
  <terminal symbol="IDENTIFIER"/>
  <terminal symbol="OP_DIM"/>
  <terminal symbol="SPACES"/>
  <terminal symbol="TAB"/>
  <terminal symbol="EOL"/>
  <terminal symbol="JAVADOC"/>
  <terminal symbol="MULTILINECOMMENT"/>
  <terminal symbol="SINGLELINECOMMENT"/>
  </priority>
  <associativity type="right" symbol="DOT"/>
  <associativity type="right" symbol="ELSE"/>
  <production symbol="TypeSpecifier">
  <nonterminal symbol="TypeName"/>
  </production>
  <production symbol="TypeSpecifier">
  <nonterminal symbol="TypeName"/>
  <nonterminal symbol="Dims"/>
  </production>
  <production symbol="TypeName">
  <nonterminal symbol="PrimitiveType"/>
  </production>
  <production symbol="TypeName" precedence="DOT">
  <nonterminal symbol="QualifiedName"/>
  </production>
  <production symbol="ClassNameList">
  <nonterminal symbol="QualifiedName"/>
  </production>
  <production symbol="ClassNameList">
  <nonterminal symbol="ClassNameList"/>
  <terminal symbol="COMMA"/>
  <nonterminal symbol="QualifiedName"/>
  </production>
  <production symbol="PrimitiveType">
  <terminal symbol="BOOLEAN"/>
  </production>
  <production symbol="PrimitiveType">
  <terminal symbol="CHAR"/>
  </production>
  <production symbol="PrimitiveType">
  <terminal symbol="BYTE"/>
  </production>
  <production symbol="PrimitiveType">
  <terminal symbol="SHORT"/>
  </production>
  <production symbol="PrimitiveType">
  <terminal symbol="INT"/>
  </production>
  <production symbol="PrimitiveType">
  <terminal symbol="LONG"/>
  </production>
  <production symbol="PrimitiveType">
  <terminal symbol="FLOAT"/>
  </production>
  <production symbol="PrimitiveType">
  <terminal symbol="DOUBLE"/>
  </production>
  <production symbol="PrimitiveType">
  <terminal symbol="VOID"/>
  </production>
  <production symbol="SemiColons">
  <terminal symbol="SEMICOLON"/>
  </production>
  <production symbol="SemiColons">
  <nonterminal symbol="SemiColons"/>
  <terminal symbol="SEMICOLON"/>
  </production>
  <production symbol="CompilationUnit">
  <nonterminal symbol="ProgramFile"/>
  </production>
  <production symbol="ProgramFile">
  <nonterminal symbol="PackageStatement"/>
  <nonterminal symbol="ImportStatements"/>
  <nonterminal symbol="TypeDeclarations"/>
  </production>
  <production symbol="ProgramFile">
  <nonterminal symbol="PackageStatement"/>
  <nonterminal symbol="ImportStatements"/>
  </production>
  <production symbol="ProgramFile">
  <nonterminal symbol="PackageStatement"/>
  <nonterminal symbol="TypeDeclarations"/>
  </production>
  <production symbol="ProgramFile">
  <nonterminal symbol="ImportStatements"/>
  <nonterminal symbol="TypeDeclarations"/>
  </production>
  <production symbol="ProgramFile">
  <nonterminal symbol="PackageStatement"/>
  </production>
  <production symbol="ProgramFile">
  <nonterminal symbol="ImportStatements"/>
  </production>
  <production symbol="ProgramFile">
  <nonterminal symbol="TypeDeclarations"/>
  </production>
  <production symbol="PackageStatement">
  <terminal symbol="PACKAGE"/>
  <nonterminal symbol="QualifiedName"/>
  <nonterminal symbol="SemiColons"/>
  </production>
  <production symbol="TypeDeclarations">
  <nonterminal symbol="TypeDeclarationOptSemi"/>
  </production>
  <production symbol="TypeDeclarations">
  <nonterminal symbol="TypeDeclarations"/>
  <nonterminal symbol="TypeDeclarationOptSemi"/>
  </production>
  <production symbol="TypeDeclarationOptSemi">
  <nonterminal symbol="TypeDeclaration"/>
  </production>
  <production symbol="TypeDeclarationOptSemi">
  <nonterminal symbol="TypeDeclaration"/>
  <nonterminal symbol="SemiColons"/>
  </production>
  <production symbol="ImportStatements">
  <nonterminal symbol="ImportStatement"/>
  </production>
  <production symbol="ImportStatements">
  <nonterminal symbol="ImportStatements"/>
  <nonterminal symbol="ImportStatement"/>
  </production>
  <production symbol="ImportStatement">
  <terminal symbol="IMPORT"/>
  <nonterminal symbol="QualifiedName"/>
  <nonterminal symbol="SemiColons"/>
  </production>
  <production symbol="ImportStatement">
  <terminal symbol="IMPORT"/>
  <nonterminal symbol="QualifiedName"/>
  <terminal symbol="DOT"/>
  <terminal symbol="MULT"/>
  <nonterminal symbol="SemiColons"/>
  </production>
  <production symbol="QualifiedName">
  <terminal symbol="IDENTIFIER"/>
  </production>
  <production symbol="QualifiedName">
  <nonterminal symbol="QualifiedName"/>
  <terminal symbol="DOT"/>
  <terminal symbol="IDENTIFIER"/>
  </production>
  <production symbol="TypeDeclaration">
  <nonterminal symbol="ClassHeader"/>
  <terminal symbol="COPEN"/>
  <nonterminal symbol="FieldDeclarations"/>
  <terminal symbol="CCLOSE"/>
  </production>
  <production symbol="TypeDeclaration">
  <nonterminal symbol="ClassHeader"/>
  <terminal symbol="COPEN"/>
  <terminal symbol="CCLOSE"/>
  </production>
  <production symbol="TypeDeclaration">
  <terminal symbol="JAVADOC"/>
  <nonterminal symbol="ClassHeader"/>
  <terminal symbol="COPEN"/>
  <nonterminal symbol="FieldDeclarations"/>
  <terminal symbol="CCLOSE"/>
  </production>
  <production symbol="TypeDeclaration">
  <terminal symbol="JAVADOC"/>
  <nonterminal symbol="ClassHeader"/>
  <terminal symbol="COPEN"/>
  <terminal symbol="CCLOSE"/>
  </production>
  <production symbol="ClassHeader">
  <nonterminal symbol="Modifiers"/>
  <nonterminal symbol="ClassWord"/>
  <terminal symbol="IDENTIFIER"/>
  <nonterminal symbol="Extends"/>
  <nonterminal symbol="Interfaces"/>
  </production>
  <production symbol="ClassHeader">
  <nonterminal symbol="Modifiers"/>
  <nonterminal symbol="ClassWord"/>
  <terminal symbol="IDENTIFIER"/>
  <nonterminal symbol="Extends"/>
  </production>
  <production symbol="ClassHeader">
  <nonterminal symbol="Modifiers"/>
  <nonterminal symbol="ClassWord"/>
  <terminal symbol="IDENTIFIER"/>
  <nonterminal symbol="Interfaces"/>
  </production>
  <production symbol="ClassHeader">
  <nonterminal symbol="ClassWord"/>
  <terminal symbol="IDENTIFIER"/>
  <nonterminal symbol="Extends"/>
  <nonterminal symbol="Interfaces"/>
  </production>
  <production symbol="ClassHeader">
  <nonterminal symbol="Modifiers"/>
  <nonterminal symbol="ClassWord"/>
  <terminal symbol="IDENTIFIER"/>
  </production>
  <production symbol="ClassHeader">
  <nonterminal symbol="ClassWord"/>
  <terminal symbol="IDENTIFIER"/>
  <nonterminal symbol="Extends"/>
  </production>
  <production symbol="ClassHeader">
  <nonterminal symbol="ClassWord"/>
  <terminal symbol="IDENTIFIER"/>
  <nonterminal symbol="Interfaces"/>
  </production>
  <production symbol="ClassHeader">
  <nonterminal symbol="ClassWord"/>
  <terminal symbol="IDENTIFIER"/>
  </production>
  <production symbol="Modifiers">
  <nonterminal symbol="Modifier"/>
  </production>
  <production symbol="Modifiers">
  <nonterminal symbol="Modifiers"/>
  <nonterminal symbol="Modifier"/>
  </production>
  <production symbol="Modifier">
  <terminal symbol="ABSTRACT"/>
  </production>
  <production symbol="Modifier">
  <terminal symbol="FINAL"/>
  </production>
  <production symbol="Modifier">
  <terminal symbol="PUBLIC"/>
  </production>
  <production symbol="Modifier">
  <terminal symbol="PROTECTED"/>
  </production>
  <production symbol="Modifier">
  <terminal symbol="PRIVATE"/>
  </production>
  <production symbol="Modifier">
  <terminal symbol="STATIC"/>
  </production>
  <production symbol="Modifier">
  <terminal symbol="TRANSIENT"/>
  </production>
  <production symbol="Modifier">
  <terminal symbol="VOLATILE"/>
  </production>
  <production symbol="Modifier">
  <terminal symbol="NATIVE"/>
  </production>
  <production symbol="Modifier">
  <terminal symbol="SYNCHRONIZED"/>
  </production>
  <production symbol="ClassWord">
  <terminal symbol="CLASS"/>
  </production>
  <production symbol="ClassWord">
  <terminal symbol="INTERFACE"/>
  </production>
  <production symbol="Interfaces">
  <terminal symbol="IMPLEMENTS"/>
  <nonterminal symbol="ClassNameList"/>
  </production>
  <production symbol="FieldDeclarations">
  <nonterminal symbol="FieldDeclarationOptSemi"/>
  </production>
  <production symbol="FieldDeclarations">
  <nonterminal symbol="FieldDeclarations"/>
  <nonterminal symbol="FieldDeclarationOptSemi"/>
  </production>
  <production symbol="FieldDeclarationOptSemi">
  <nonterminal symbol="FieldDeclaration"/>
  </production>
  <production symbol="FieldDeclarationOptSemi">
  <nonterminal symbol="FieldDeclaration"/>
  <nonterminal symbol="SemiColons"/>
  </production>
  <production symbol="FieldDeclaration">
  <nonterminal symbol="FieldVariableDeclaration"/>
  <terminal symbol="SEMICOLON"/>
  </production>
  <production symbol="FieldDeclaration">
  <nonterminal symbol="MethodDeclaration"/>
  </production>
  <production symbol="FieldDeclaration">
  <nonterminal symbol="ConstructorDeclaration"/>
  </production>
  <production symbol="FieldDeclaration">
  <nonterminal symbol="StaticInitializer"/>
  </production>
  <production symbol="FieldDeclaration">
  <nonterminal symbol="NonStaticInitializer"/>
  </production>
  <production symbol="FieldDeclaration">
  <nonterminal symbol="TypeDeclaration"/>
  </production>
  <production symbol="FieldVariableDeclaration">
  <nonterminal symbol="Modifiers"/>
  <nonterminal symbol="TypeSpecifier"/>
  <nonterminal symbol="VariableDeclarators"/>
  </production>
  <production symbol="FieldVariableDeclaration">
  <nonterminal symbol="TypeSpecifier"/>
  <nonterminal symbol="VariableDeclarators"/>
  </production>
  <production symbol="FieldVariableDeclaration">
  <terminal symbol="JAVADOC"/>
  <nonterminal symbol="Modifiers"/>
  <nonterminal symbol="TypeSpecifier"/>
  <nonterminal symbol="VariableDeclarators"/>
  </production>
  <production symbol="FieldVariableDeclaration">
  <terminal symbol="JAVADOC"/>
  <nonterminal symbol="TypeSpecifier"/>
  <nonterminal symbol="VariableDeclarators"/>
  </production>
  <production symbol="VariableDeclarators">
  <nonterminal symbol="VariableDeclarator"/>
  </production>
  <production symbol="VariableDeclarators">
  <nonterminal symbol="VariableDeclarators"/>
  <terminal symbol="COMMA"/>
  <nonterminal symbol="VariableDeclarator"/>
  </production>
  <production symbol="VariableDeclarator">
  <nonterminal symbol="DeclaratorName"/>
  </production>
  <production symbol="VariableDeclarator">
  <nonterminal symbol="DeclaratorName"/>
  <terminal symbol="EQ"/>
  <nonterminal symbol="VariableInitializer"/>
  </production>
  <production symbol="VariableInitializer">
  <nonterminal symbol="Expression"/>
  </production>
  <production symbol="VariableInitializer">
  <terminal symbol="COPEN"/>
  <terminal symbol="CCLOSE"/>
  </production>
  <production symbol="VariableInitializer">
  <terminal symbol="COPEN"/>
  <nonterminal symbol="ArrayInitializers"/>
  <terminal symbol="CCLOSE"/>
  </production>
  <production symbol="ArrayInitializers">
  <nonterminal symbol="VariableInitializer"/>
  </production>
  <production symbol="ArrayInitializers">
  <nonterminal symbol="ArrayInitializers"/>
  <terminal symbol="COMMA"/>
  <nonterminal symbol="VariableInitializer"/>
  </production>
  <production symbol="ArrayInitializers">
  <nonterminal symbol="ArrayInitializers"/>
  <terminal symbol="COMMA"/>
  </production>
  <production symbol="MethodDeclaration">
  <nonterminal symbol="Modifiers"/>
  <nonterminal symbol="TypeSpecifier"/>
  <nonterminal symbol="MethodDeclarator"/>
  <nonterminal symbol="Throws"/>
  <nonterminal symbol="MethodBody"/>
  </production>
  <production symbol="MethodDeclaration">
  <nonterminal symbol="Modifiers"/>
  <nonterminal symbol="TypeSpecifier"/>
  <nonterminal symbol="MethodDeclarator"/>
  <nonterminal symbol="MethodBody"/>
  </production>
  <production symbol="MethodDeclaration">
  <nonterminal symbol="TypeSpecifier"/>
  <nonterminal symbol="MethodDeclarator"/>
  <nonterminal symbol="Throws"/>
  <nonterminal symbol="MethodBody"/>
  </production>
  <production symbol="MethodDeclaration">
  <nonterminal symbol="TypeSpecifier"/>
  <nonterminal symbol="MethodDeclarator"/>
  <nonterminal symbol="MethodBody"/>
  </production>
  <production symbol="MethodDeclaration">
  <terminal symbol="JAVADOC"/>
  <nonterminal symbol="Modifiers"/>
  <nonterminal symbol="TypeSpecifier"/>
  <nonterminal symbol="MethodDeclarator"/>
  <nonterminal symbol="Throws"/>
  <nonterminal symbol="MethodBody"/>
  </production>
  <production symbol="MethodDeclaration">
  <terminal symbol="JAVADOC"/>
  <nonterminal symbol="Modifiers"/>
  <nonterminal symbol="TypeSpecifier"/>
  <nonterminal symbol="MethodDeclarator"/>
  <nonterminal symbol="MethodBody"/>
  </production>
  <production symbol="MethodDeclaration">
  <terminal symbol="JAVADOC"/>
  <nonterminal symbol="TypeSpecifier"/>
  <nonterminal symbol="MethodDeclarator"/>
  <nonterminal symbol="Throws"/>
  <nonterminal symbol="MethodBody"/>
  </production>
  <production symbol="MethodDeclaration">
  <terminal symbol="JAVADOC"/>
  <nonterminal symbol="TypeSpecifier"/>
  <nonterminal symbol="MethodDeclarator"/>
  <nonterminal symbol="MethodBody"/>
  </production>
  <production symbol="MethodDeclarator">
  <nonterminal symbol="DeclaratorName"/>
  <terminal symbol="DOPEN"/>
  <nonterminal symbol="ParameterList"/>
  <terminal symbol="DCLOSE"/>
  </production>
  <production symbol="MethodDeclarator">
  <nonterminal symbol="DeclaratorName"/>
  <terminal symbol="DOPEN"/>
  <terminal symbol="DCLOSE"/>
  </production>
  <production symbol="MethodDeclarator">
  <nonterminal symbol="MethodDeclarator"/>
  <terminal symbol="OP_DIM"/>
  </production>
  <production symbol="ParameterList">
  <nonterminal symbol="Parameter"/>
  </production>
  <production symbol="ParameterList">
  <nonterminal symbol="ParameterList"/>
  <terminal symbol="COMMA"/>
  <nonterminal symbol="Parameter"/>
  </production>
  <production symbol="Parameter">
  <nonterminal symbol="TypeSpecifier"/>
  <nonterminal symbol="DeclaratorName"/>
  </production>
  <production symbol="Parameter">
  <terminal symbol="FINAL"/>
  <nonterminal symbol="TypeSpecifier"/>
  <nonterminal symbol="DeclaratorName"/>
  </production>
  <production symbol="DeclaratorName">
  <terminal symbol="IDENTIFIER"/>
  </production>
  <production symbol="DeclaratorName">
  <nonterminal symbol="DeclaratorName"/>
  <terminal symbol="OP_DIM"/>
  </production>
  <production symbol="Throws">
  <terminal symbol="THROWS"/>
  <nonterminal symbol="ClassNameList"/>
  </production>
  <production symbol="MethodBody">
  <nonterminal symbol="Block"/>
  </production>
  <production symbol="MethodBody">
  <terminal symbol="SEMICOLON"/>
  </production>
  <production symbol="ConstructorDeclaration">
  <nonterminal symbol="Modifiers"/>
  <nonterminal symbol="ConstructorDeclarator"/>
  <nonterminal symbol="Throws"/>
  <nonterminal symbol="Block"/>
  </production>
  <production symbol="ConstructorDeclaration">
  <nonterminal symbol="Modifiers"/>
  <nonterminal symbol="ConstructorDeclarator"/>
  <nonterminal symbol="Block"/>
  </production>
  <production symbol="ConstructorDeclaration">
  <nonterminal symbol="ConstructorDeclarator"/>
  <nonterminal symbol="Throws"/>
  <nonterminal symbol="Block"/>
  </production>
  <production symbol="ConstructorDeclaration">
  <nonterminal symbol="ConstructorDeclarator"/>
  <nonterminal symbol="Block"/>
  </production>
  <production symbol="ConstructorDeclaration">
  <terminal symbol="JAVADOC"/>
  <nonterminal symbol="Modifiers"/>
  <nonterminal symbol="ConstructorDeclarator"/>
  <nonterminal symbol="Throws"/>
  <nonterminal symbol="Block"/>
  </production>
  <production symbol="ConstructorDeclaration">
  <terminal symbol="JAVADOC"/>
  <nonterminal symbol="Modifiers"/>
  <nonterminal symbol="ConstructorDeclarator"/>
  <nonterminal symbol="Block"/>
  </production>
  <production symbol="ConstructorDeclaration">
  <terminal symbol="JAVADOC"/>
  <nonterminal symbol="ConstructorDeclarator"/>
  <nonterminal symbol="Throws"/>
  <nonterminal symbol="Block"/>
  </production>
  <production symbol="ConstructorDeclaration">
  <terminal symbol="JAVADOC"/>
  <nonterminal symbol="ConstructorDeclarator"/>
  <nonterminal symbol="Block"/>
  </production>
  <production symbol="ConstructorDeclarator">
  <terminal symbol="IDENTIFIER"/>
  <terminal symbol="DOPEN"/>
  <nonterminal symbol="ParameterList"/>
  <terminal symbol="DCLOSE"/>
  </production>
  <production symbol="ConstructorDeclarator">
  <terminal symbol="IDENTIFIER"/>
  <terminal symbol="DOPEN"/>
  <terminal symbol="DCLOSE"/>
  </production>
  <production symbol="StaticInitializer">
  <terminal symbol="STATIC"/>
  <nonterminal symbol="Block"/>
  </production>
  <production symbol="NonStaticInitializer">
  <nonterminal symbol="Block"/>
  </production>
  <production symbol="Extends">
  <terminal symbol="EXTENDS"/>
  <nonterminal symbol="TypeName"/>
  </production>
  <production symbol="Extends">
  <nonterminal symbol="Extends"/>
  <terminal symbol="COMMA"/>
  <nonterminal symbol="TypeName"/>
  </production>
  <production symbol="Block">
  <terminal symbol="COPEN"/>
  <nonterminal symbol="LocalVariableDeclarationsAndStatements"/>
  <terminal symbol="CCLOSE"/>
  </production>
  <production symbol="Block">
  <terminal symbol="COPEN"/>
  <terminal symbol="CCLOSE"/>
  </production>
  <production symbol="LocalVariableDeclarationsAndStatements">
  <nonterminal symbol="LocalVariableDeclarationOrStatement"/>
  </production>
  <production symbol="LocalVariableDeclarationsAndStatements">
  <nonterminal symbol="LocalVariableDeclarationsAndStatements"/>
  <nonterminal symbol="LocalVariableDeclarationOrStatement"/>
  </production>
  <production symbol="LocalVariableDeclarationOrStatement">
  <nonterminal symbol="LocalVariableDeclarationStatement"/>
  </production>
  <production symbol="LocalVariableDeclarationOrStatement">
  <nonterminal symbol="Statement"/>
  </production>
  <production symbol="LocalVariableDeclarationStatement">
  <nonterminal symbol="TypeSpecifier"/>
  <nonterminal symbol="VariableDeclarators"/>
  <terminal symbol="SEMICOLON"/>
  </production>
  <production symbol="LocalVariableDeclarationStatement">
  <terminal symbol="FINAL"/>
  <nonterminal symbol="TypeSpecifier"/>
  <nonterminal symbol="VariableDeclarators"/>
  <terminal symbol="SEMICOLON"/>
  </production>
  <production symbol="Statement">
  <nonterminal symbol="EmptyStatement"/>
  </production>
  <production symbol="Statement">
  <nonterminal symbol="LabelStatement"/>
  </production>
  <production symbol="Statement">
  <nonterminal symbol="ExpressionStatement"/>
  <terminal symbol="SEMICOLON"/>
  </production>
  <production symbol="Statement">
  <nonterminal symbol="SelectionStatement"/>
  </production>
  <production symbol="Statement">
  <nonterminal symbol="IterationStatement"/>
  </production>
  <production symbol="Statement">
  <nonterminal symbol="JumpStatement"/>
  </production>
  <production symbol="Statement">
  <nonterminal symbol="GuardingStatement"/>
  </production>
  <production symbol="Statement">
  <nonterminal symbol="Block"/>
  </production>
  <production symbol="EmptyStatement">
  <terminal symbol="SEMICOLON"/>
  </production>
  <production symbol="LabelStatement">
  <terminal symbol="IDENTIFIER"/>
  <terminal symbol="COLON"/>
  </production>
  <production symbol="LabelStatement">
  <terminal symbol="CASE"/>
  <nonterminal symbol="ConstantExpression"/>
  <terminal symbol="COLON"/>
  </production>
  <production symbol="LabelStatement">
  <terminal symbol="DEFAULT"/>
  <terminal symbol="COLON"/>
  </production>
  <production symbol="ExpressionStatement">
  <nonterminal symbol="Expression"/>
  </production>
  <production symbol="SelectionStatement" precedence="ELSE">
  <terminal symbol="IF"/>
  <terminal symbol="DOPEN"/>
  <nonterminal symbol="Expression"/>
  <terminal symbol="DCLOSE"/>
  <nonterminal symbol="Statement"/>
  </production>
  <production symbol="SelectionStatement" precedence="ELSE">
  <terminal symbol="IF"/>
  <terminal symbol="DOPEN"/>
  <nonterminal symbol="Expression"/>
  <terminal symbol="DCLOSE"/>
  <nonterminal symbol="Statement"/>
  <terminal symbol="ELSE"/>
  <nonterminal symbol="Statement"/>
  </production>
  <production symbol="SelectionStatement">
  <terminal symbol="SWITCH"/>
  <terminal symbol="DOPEN"/>
  <nonterminal symbol="Expression"/>
  <terminal symbol="DCLOSE"/>
  <nonterminal symbol="Block"/>
  </production>
  <production symbol="IterationStatement">
  <terminal symbol="WHILE"/>
  <terminal symbol="DOPEN"/>
  <nonterminal symbol="Expression"/>
  <terminal symbol="DCLOSE"/>
  <nonterminal symbol="Statement"/>
  </production>
  <production symbol="IterationStatement">
  <terminal symbol="DO"/>
  <nonterminal symbol="Statement"/>
  <terminal symbol="WHILE"/>
  <terminal symbol="DOPEN"/>
  <nonterminal symbol="Expression"/>
  <terminal symbol="DCLOSE"/>
  <terminal symbol="SEMICOLON"/>
  </production>
  <production symbol="IterationStatement">
  <terminal symbol="FOR"/>
  <terminal symbol="DOPEN"/>
  <nonterminal symbol="ForInit"/>
  <nonterminal symbol="ForExpr"/>
  <nonterminal symbol="ForIncr"/>
  <terminal symbol="DCLOSE"/>
  <nonterminal symbol="Statement"/>
  </production>
  <production symbol="IterationStatement">
  <terminal symbol="FOR"/>
  <terminal symbol="DOPEN"/>
  <nonterminal symbol="ForInit"/>
  <nonterminal symbol="ForExpr"/>
  <terminal symbol="DCLOSE"/>
  <nonterminal symbol="Statement"/>
  </production>
  <production symbol="ForInit">
  <nonterminal symbol="ExpressionStatements"/>
  <terminal symbol="SEMICOLON"/>
  </production>
  <production symbol="ForInit">
  <nonterminal symbol="LocalVariableDeclarationStatement"/>
  </production>
  <production symbol="ForInit">
  <terminal symbol="SEMICOLON"/>
  </production>
  <production symbol="ForExpr">
  <nonterminal symbol="Expression"/>
  <terminal symbol="SEMICOLON"/>
  </production>
  <production symbol="ForExpr">
  <terminal symbol="SEMICOLON"/>
  </production>
  <production symbol="ForIncr">
  <nonterminal symbol="ExpressionStatements"/>
  </production>
  <production symbol="ExpressionStatements">
  <nonterminal symbol="ExpressionStatement"/>
  </production>
  <production symbol="ExpressionStatements">
  <nonterminal symbol="ExpressionStatements"/>
  <terminal symbol="COMMA"/>
  <nonterminal symbol="ExpressionStatement"/>
  </production>
  <production symbol="JumpStatement">
  <terminal symbol="BREAK"/>
  <terminal symbol="IDENTIFIER"/>
  <terminal symbol="SEMICOLON"/>
  </production>
  <production symbol="JumpStatement">
  <terminal symbol="BREAK"/>
  <terminal symbol="SEMICOLON"/>
  </production>
  <production symbol="JumpStatement">
  <terminal symbol="CONTINUE"/>
  <terminal symbol="IDENTIFIER"/>
  <terminal symbol="SEMICOLON"/>
  </production>
  <production symbol="JumpStatement">
  <terminal symbol="CONTINUE"/>
  <terminal symbol="SEMICOLON"/>
  </production>
  <production symbol="JumpStatement">
  <terminal symbol="RETURN"/>
  <nonterminal symbol="Expression"/>
  <terminal symbol="SEMICOLON"/>
  </production>
  <production symbol="JumpStatement">
  <terminal symbol="RETURN"/>
  <terminal symbol="SEMICOLON"/>
  </production>
  <production symbol="JumpStatement">
  <terminal symbol="THROW"/>
  <nonterminal symbol="Expression"/>
  <terminal symbol="SEMICOLON"/>
  </production>
  <production symbol="GuardingStatement">
  <terminal symbol="SYNCHRONIZED"/>
  <terminal symbol="DOPEN"/>
  <nonterminal symbol="Expression"/>
  <terminal symbol="DCLOSE"/>
  <nonterminal symbol="Statement"/>
  </production>
  <production symbol="GuardingStatement">
  <terminal symbol="TRY"/>
  <nonterminal symbol="Block"/>
  <nonterminal symbol="Finally"/>
  </production>
  <production symbol="GuardingStatement">
  <terminal symbol="TRY"/>
  <nonterminal symbol="Block"/>
  <nonterminal symbol="Catches"/>
  </production>
  <production symbol="GuardingStatement">
  <terminal symbol="TRY"/>
  <nonterminal symbol="Block"/>
  <nonterminal symbol="Catches"/>
  <nonterminal symbol="Finally"/>
  </production>
  <production symbol="Catches">
  <nonterminal symbol="Catch"/>
  </production>
  <production symbol="Catches">
  <nonterminal symbol="Catches"/>
  <nonterminal symbol="Catch"/>
  </production>
  <production symbol="Catch">
  <nonterminal symbol="CatchHeader"/>
  <nonterminal symbol="Block"/>
  </production>
  <production symbol="CatchHeader">
  <terminal symbol="CATCH"/>
  <terminal symbol="DOPEN"/>
  <nonterminal symbol="TypeSpecifier"/>
  <terminal symbol="IDENTIFIER"/>
  <terminal symbol="DCLOSE"/>
  </production>
  <production symbol="CatchHeader">
  <terminal symbol="CATCH"/>
  <terminal symbol="DOPEN"/>
  <nonterminal symbol="TypeSpecifier"/>
  <terminal symbol="DCLOSE"/>
  </production>
  <production symbol="Finally">
  <terminal symbol="FINALLY"/>
  <nonterminal symbol="Block"/>
  </production>
  <production symbol="PrimaryExpression">
  <nonterminal symbol="QualifiedName"/>
  </production>
  <production symbol="PrimaryExpression">
  <nonterminal symbol="NotJustName"/>
  </production>
  <production symbol="NotJustName">
  <nonterminal symbol="SpecialName"/>
  </production>
  <production symbol="NotJustName">
  <nonterminal symbol="NewAllocationExpression"/>
  </production>
  <production symbol="NotJustName">
  <nonterminal symbol="ComplexPrimary"/>
  </production>
  <production symbol="ComplexPrimary">
  <terminal symbol="DOPEN"/>
  <nonterminal symbol="Expression"/>
  <terminal symbol="DCLOSE"/>
  </production>
  <production symbol="ComplexPrimary">
  <nonterminal symbol="ComplexPrimaryNoParenthesis"/>
  </production>
  <production symbol="ComplexPrimaryNoParenthesis">
  <terminal symbol="LITERAL"/>
  </production>
  <production symbol="ComplexPrimaryNoParenthesis">
  <terminal symbol="BOOLLIT"/>
  </production>
  <production symbol="ComplexPrimaryNoParenthesis">
  <nonterminal symbol="ArrayAccess"/>
  </production>
  <production symbol="ComplexPrimaryNoParenthesis">
  <nonterminal symbol="FieldAccess"/>
  </production>
  <production symbol="ComplexPrimaryNoParenthesis">
  <nonterminal symbol="MethodCall"/>
  </production>
  <production symbol="ArrayAccess">
  <nonterminal symbol="QualifiedName"/>
  <terminal symbol="BOPEN"/>
  <nonterminal symbol="Expression"/>
  <terminal symbol="BCLOSE"/>
  </production>
  <production symbol="ArrayAccess">
  <nonterminal symbol="ComplexPrimary"/>
  <terminal symbol="BOPEN"/>
  <nonterminal symbol="Expression"/>
  <terminal symbol="BCLOSE"/>
  </production>
  <production symbol="FieldAccess">
  <nonterminal symbol="NotJustName"/>
  <terminal symbol="DOT"/>
  <terminal symbol="IDENTIFIER"/>
  </production>
  <production symbol="FieldAccess">
  <nonterminal symbol="RealPostfixExpression"/>
  <terminal symbol="DOT"/>
  <terminal symbol="IDENTIFIER"/>
  </production>
  <production symbol="FieldAccess">
  <nonterminal symbol="QualifiedName"/>
  <terminal symbol="DOT"/>
  <terminal symbol="THIS"/>
  </production>
  <production symbol="FieldAccess">
  <nonterminal symbol="QualifiedName"/>
  <terminal symbol="DOT"/>
  <terminal symbol="CLASS"/>
  </production>
  <production symbol="FieldAccess">
  <nonterminal symbol="PrimitiveType"/>
  <terminal symbol="DOT"/>
  <terminal symbol="CLASS"/>
  </production>
  <production symbol="MethodCall">
  <nonterminal symbol="MethodAccess"/>
  <terminal symbol="DOPEN"/>
  <nonterminal symbol="ArgumentList"/>
  <terminal symbol="DCLOSE"/>
  </production>
  <production symbol="MethodCall">
  <nonterminal symbol="MethodAccess"/>
  <terminal symbol="DOPEN"/>
  <terminal symbol="DCLOSE"/>
  </production>
  <production symbol="MethodAccess">
  <nonterminal symbol="ComplexPrimaryNoParenthesis"/>
  </production>
  <production symbol="MethodAccess">
  <nonterminal symbol="SpecialName"/>
  </production>
  <production symbol="MethodAccess">
  <nonterminal symbol="QualifiedName"/>
  </production>
  <production symbol="SpecialName">
  <terminal symbol="THIS"/>
  </production>
  <production symbol="SpecialName">
  <terminal symbol="SUPER"/>
  </production>
  <production symbol="SpecialName">
  <terminal symbol="NULL"/>
  </production>
  <production symbol="ArgumentList">
  <nonterminal symbol="Expression"/>
  </production>
  <production symbol="ArgumentList">
  <nonterminal symbol="ArgumentList"/>
  <terminal symbol="COMMA"/>
  <nonterminal symbol="Expression"/>
  </production>
  <production symbol="NewAllocationExpression">
  <nonterminal symbol="PlainNewAllocationExpression"/>
  </production>
  <production symbol="NewAllocationExpression">
  <nonterminal symbol="QualifiedName"/>
  <terminal symbol="DOT"/>
  <nonterminal symbol="PlainNewAllocationExpression"/>
  </production>
  <production symbol="PlainNewAllocationExpression">
  <nonterminal symbol="ArrayAllocationExpression"/>
  </production>
  <production symbol="PlainNewAllocationExpression">
  <nonterminal symbol="ClassAllocationExpression"/>
  </production>
  <production symbol="PlainNewAllocationExpression">
  <nonterminal symbol="ArrayAllocationExpression"/>
  <terminal symbol="COPEN"/>
  <terminal symbol="CCLOSE"/>
  </production>
  <production symbol="PlainNewAllocationExpression">
  <nonterminal symbol="ClassAllocationExpression"/>
  <terminal symbol="COPEN"/>
  <terminal symbol="CCLOSE"/>
  </production>
  <production symbol="PlainNewAllocationExpression">
  <nonterminal symbol="ArrayAllocationExpression"/>
  <terminal symbol="COPEN"/>
  <nonterminal symbol="ArrayInitializers"/>
  <terminal symbol="CCLOSE"/>
  </production>
  <production symbol="PlainNewAllocationExpression">
  <nonterminal symbol="ClassAllocationExpression"/>
  <terminal symbol="COPEN"/>
  <nonterminal symbol="FieldDeclarations"/>
  <terminal symbol="CCLOSE"/>
  </production>
  <production symbol="ClassAllocationExpression">
  <terminal symbol="NEW"/>
  <nonterminal symbol="TypeName"/>
  <terminal symbol="DOPEN"/>
  <nonterminal symbol="ArgumentList"/>
  <terminal symbol="DCLOSE"/>
  </production>
  <production symbol="ClassAllocationExpression">
  <terminal symbol="NEW"/>
  <nonterminal symbol="TypeName"/>
  <terminal symbol="DOPEN"/>
  <terminal symbol="DCLOSE"/>
  </production>
  <production symbol="ArrayAllocationExpression">
  <terminal symbol="NEW"/>
  <nonterminal symbol="TypeName"/>
  <nonterminal symbol="DimExprs"/>
  <nonterminal symbol="Dims"/>
  </production>
  <production symbol="ArrayAllocationExpression">
  <terminal symbol="NEW"/>
  <nonterminal symbol="TypeName"/>
  <nonterminal symbol="DimExprs"/>
  </production>
  <production symbol="ArrayAllocationExpression">
  <terminal symbol="NEW"/>
  <nonterminal symbol="TypeName"/>
  <nonterminal symbol="Dims"/>
  </production>
  <production symbol="DimExprs">
  <nonterminal symbol="DimExpr"/>
  </production>
  <production symbol="DimExprs">
  <nonterminal symbol="DimExprs"/>
  <nonterminal symbol="DimExpr"/>
  </production>
  <production symbol="DimExpr">
  <terminal symbol="BOPEN"/>
  <nonterminal symbol="Expression"/>
  <terminal symbol="BCLOSE"/>
  </production>
  <production symbol="Dims">
  <terminal symbol="OP_DIM"/>
  </production>
  <production symbol="Dims">
  <nonterminal symbol="Dims"/>
  <terminal symbol="OP_DIM"/>
  </production>
  <production symbol="PostfixExpression">
  <nonterminal symbol="PrimaryExpression"/>
  </production>
  <production symbol="PostfixExpression">
  <nonterminal symbol="RealPostfixExpression"/>
  </production>
  <production symbol="RealPostfixExpression">
  <nonterminal symbol="PostfixExpression"/>
  <terminal symbol="OP_INC"/>
  </production>
  <production symbol="RealPostfixExpression">
  <nonterminal symbol="PostfixExpression"/>
  <terminal symbol="OP_DEC"/>
  </production>
  <production symbol="UnaryExpression">
  <terminal symbol="OP_INC"/>
  <nonterminal symbol="UnaryExpression"/>
  </production>
  <production symbol="UnaryExpression">
  <terminal symbol="OP_DEC"/>
  <nonterminal symbol="UnaryExpression"/>
  </production>
  <production symbol="UnaryExpression">
  <nonterminal symbol="ArithmeticUnaryOperator"/>
  <nonterminal symbol="CastExpression"/>
  </production>
  <production symbol="UnaryExpression">
  <nonterminal symbol="LogicalUnaryExpression"/>
  </production>
  <production symbol="LogicalUnaryExpression">
  <nonterminal symbol="PostfixExpression"/>
  </production>
  <production symbol="LogicalUnaryExpression">
  <nonterminal symbol="LogicalUnaryOperator"/>
  <nonterminal symbol="UnaryExpression"/>
  </production>
  <production symbol="LogicalUnaryOperator">
  <terminal symbol="TILDE"/>
  </production>
  <production symbol="LogicalUnaryOperator">
  <terminal symbol="NOT"/>
  </production>
  <production symbol="ArithmeticUnaryOperator">
  <terminal symbol="PLUS"/>
  </production>
  <production symbol="ArithmeticUnaryOperator">
  <terminal symbol="MINUS"/>
  </production>
  <production symbol="CastExpression">
  <nonterminal symbol="UnaryExpression"/>
  </production>
  <production symbol="CastExpression">
  <terminal symbol="DOPEN"/>
  <nonterminal symbol="PrimitiveTypeExpression"/>
  <terminal symbol="DCLOSE"/>
  <nonterminal symbol="CastExpression"/>
  </production>
  <production symbol="CastExpression">
  <terminal symbol="DOPEN"/>
  <nonterminal symbol="ClassTypeExpression"/>
  <terminal symbol="DCLOSE"/>
  <nonterminal symbol="CastExpression"/>
  </production>
  <production symbol="CastExpression">
  <terminal symbol="DOPEN"/>
  <nonterminal symbol="Expression"/>
  <terminal symbol="DCLOSE"/>
  <nonterminal symbol="LogicalUnaryExpression"/>
  </production>
  <production symbol="PrimitiveTypeExpression">
  <nonterminal symbol="PrimitiveType"/>
  </production>
  <production symbol="PrimitiveTypeExpression">
  <nonterminal symbol="PrimitiveType"/>
  <nonterminal symbol="Dims"/>
  </production>
  <production symbol="ClassTypeExpression">
  <nonterminal symbol="QualifiedName"/>
  <nonterminal symbol="Dims"/>
  </production>
  <production symbol="MultiplicativeExpression">
  <nonterminal symbol="CastExpression"/>
  </production>
  <production symbol="MultiplicativeExpression">
  <nonterminal symbol="MultiplicativeExpression"/>
  <terminal symbol="MULT"/>
  <nonterminal symbol="CastExpression"/>
  </production>
  <production symbol="MultiplicativeExpression">
  <nonterminal symbol="MultiplicativeExpression"/>
  <terminal symbol="DIV"/>
  <nonterminal symbol="CastExpression"/>
  </production>
  <production symbol="MultiplicativeExpression">
  <nonterminal symbol="MultiplicativeExpression"/>
  <terminal symbol="MOD"/>
  <nonterminal symbol="CastExpression"/>
  </production>
  <production symbol="AdditiveExpression">
  <nonterminal symbol="MultiplicativeExpression"/>
  </production>
  <production symbol="AdditiveExpression">
  <nonterminal symbol="AdditiveExpression"/>
  <terminal symbol="PLUS"/>
  <nonterminal symbol="MultiplicativeExpression"/>
  </production>
  <production symbol="AdditiveExpression">
  <nonterminal symbol="AdditiveExpression"/>
  <terminal symbol="MINUS"/>
  <nonterminal symbol="MultiplicativeExpression"/>
  </production>
  <production symbol="ShiftExpression">
  <nonterminal symbol="AdditiveExpression"/>
  </production>
  <production symbol="ShiftExpression">
  <nonterminal symbol="ShiftExpression"/>
  <terminal symbol="OP_SHL"/>
  <nonterminal symbol="AdditiveExpression"/>
  </production>
  <production symbol="ShiftExpression">
  <nonterminal symbol="ShiftExpression"/>
  <terminal symbol="OP_SHR"/>
  <nonterminal symbol="AdditiveExpression"/>
  </production>
  <production symbol="ShiftExpression">
  <nonterminal symbol="ShiftExpression"/>
  <terminal symbol="OP_SHRR"/>
  <nonterminal symbol="AdditiveExpression"/>
  </production>
  <production symbol="RelationalExpression">
  <nonterminal symbol="ShiftExpression"/>
  </production>
  <production symbol="RelationalExpression">
  <nonterminal symbol="RelationalExpression"/>
  <terminal symbol="LT"/>
  <nonterminal symbol="ShiftExpression"/>
  </production>
  <production symbol="RelationalExpression">
  <nonterminal symbol="RelationalExpression"/>
  <terminal symbol="GT"/>
  <nonterminal symbol="ShiftExpression"/>
  </production>
  <production symbol="RelationalExpression">
  <nonterminal symbol="RelationalExpression"/>
  <terminal symbol="OP_LE"/>
  <nonterminal symbol="ShiftExpression"/>
  </production>
  <production symbol="RelationalExpression">
  <nonterminal symbol="RelationalExpression"/>
  <terminal symbol="OP_GE"/>
  <nonterminal symbol="ShiftExpression"/>
  </production>
  <production symbol="RelationalExpression">
  <nonterminal symbol="RelationalExpression"/>
  <terminal symbol="INSTANCEOF"/>
  <nonterminal symbol="TypeSpecifier"/>
  </production>
  <production symbol="EqualityExpression">
  <nonterminal symbol="RelationalExpression"/>
  </production>
  <production symbol="EqualityExpression">
  <nonterminal symbol="EqualityExpression"/>
  <terminal symbol="OP_EQ"/>
  <nonterminal symbol="RelationalExpression"/>
  </production>
  <production symbol="EqualityExpression">
  <nonterminal symbol="EqualityExpression"/>
  <terminal symbol="OP_NE"/>
  <nonterminal symbol="RelationalExpression"/>
  </production>
  <production symbol="AndExpression">
  <nonterminal symbol="EqualityExpression"/>
  </production>
  <production symbol="AndExpression">
  <nonterminal symbol="AndExpression"/>
  <terminal symbol="AND"/>
  <nonterminal symbol="EqualityExpression"/>
  </production>
  <production symbol="ExclusiveOrExpression">
  <nonterminal symbol="AndExpression"/>
  </production>
  <production symbol="ExclusiveOrExpression">
  <nonterminal symbol="ExclusiveOrExpression"/>
  <terminal symbol="XOR"/>
  <nonterminal symbol="AndExpression"/>
  </production>
  <production symbol="InclusiveOrExpression">
  <nonterminal symbol="ExclusiveOrExpression"/>
  </production>
  <production symbol="InclusiveOrExpression">
  <nonterminal symbol="InclusiveOrExpression"/>
  <terminal symbol="OR"/>
  <nonterminal symbol="ExclusiveOrExpression"/>
  </production>
  <production symbol="ConditionalAndExpression">
  <nonterminal symbol="InclusiveOrExpression"/>
  </production>
  <production symbol="ConditionalAndExpression">
  <nonterminal symbol="ConditionalAndExpression"/>
  <terminal symbol="OP_LAND"/>
  <nonterminal symbol="InclusiveOrExpression"/>
  </production>
  <production symbol="ConditionalOrExpression">
  <nonterminal symbol="ConditionalAndExpression"/>
  </production>
  <production symbol="ConditionalOrExpression">
  <nonterminal symbol="ConditionalOrExpression"/>
  <terminal symbol="OP_LOR"/>
  <nonterminal symbol="ConditionalAndExpression"/>
  </production>
  <production symbol="ConditionalExpression">
  <nonterminal symbol="ConditionalOrExpression"/>
  </production>
  <production symbol="ConditionalExpression">
  <nonterminal symbol="ConditionalOrExpression"/>
  <terminal symbol="QM"/>
  <nonterminal symbol="Expression"/>
  <terminal symbol="COLON"/>
  <nonterminal symbol="ConditionalExpression"/>
  </production>
  <production symbol="AssignmentExpression">
  <nonterminal symbol="ConditionalExpression"/>
  </production>
  <production symbol="AssignmentExpression">
  <nonterminal symbol="UnaryExpression"/>
  <nonterminal symbol="AssignmentOperator"/>
  <nonterminal symbol="AssignmentExpression"/>
  </production>
  <production symbol="AssignmentOperator">
  <terminal symbol="EQ"/>
  </production>
  <production symbol="AssignmentOperator">
  <terminal symbol="ASS_OP"/>
  </production>
  <production symbol="Expression">
  <nonterminal symbol="AssignmentExpression"/>
  </production>
  <production symbol="ConstantExpression">
  <nonterminal symbol="ConditionalExpression"/>
  </production>
  <start symbol="CompilationUnit"/>
  </grammar>
  
  
  
  1.1                  xml-cocoon2/src/blocks/chaperon/samples/grammars/java.xlex
  
  Index: java.xlex
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  <lexicon xmlns="http://chaperon.sourceforge.net/schema/lexicon/1.0">
  <lexeme symbol="DOPEN">
  <cstring content="("/>
  </lexeme>
  <lexeme symbol="DCLOSE">
  <cstring content=")"/>
  </lexeme>
  <lexeme symbol="COPEN">
  <cstring content="{"/>
  </lexeme>
  <lexeme symbol="CCLOSE">
  <cstring content="}"/>
  </lexeme>
  <lexeme symbol="BOPEN">
  <cstring content="["/>
  </lexeme>
  <lexeme symbol="BCLOSE">
  <cstring content="]"/>
  </lexeme>
  <lexeme symbol="SEMICOLON">
  <cstring content=";"/>
  </lexeme>
  <lexeme symbol="COMMA">
  <cstring content=","/>
  </lexeme>
  <lexeme symbol="DOT" assoc="right">
  <cstring content="."/>
  </lexeme>
  <lexeme symbol="OP_EQ">
  <concat>
  <cstring content="="/>
  <cstring content="="/>
  </concat>
  </lexeme>
  <lexeme symbol="OP_LE">
  <concat>
  <cstring content="&lt;"/>
  <cstring content="="/>
  </concat>
  </lexeme>
  <lexeme symbol="OP_GE">
  <concat>
  <cstring content="&gt;"/>
  <cstring content="="/>
  </concat>
  </lexeme>
  <lexeme symbol="OP_NE">
  <concat>
  <cstring content="!"/>
  <cstring content="="/>
  </concat>
  </lexeme>
  <lexeme symbol="OP_LOR">
  <concat>
  <cstring content="|"/>
  <cstring content="|"/>
  </concat>
  </lexeme>
  <lexeme symbol="OP_LAND">
  <concat>
  <cstring content="&amp;"/>
  <cstring content="&amp;"/>
  </concat>
  </lexeme>
  <lexeme symbol="OP_INC">
  <concat>
  <cstring content="+"/>
  <cstring content="+"/>
  </concat>
  </lexeme>
  <lexeme symbol="OP_DEC">
  <concat>
  <cstring content="-"/>
  <cstring content="-"/>
  </concat>
  </lexeme>
  <lexeme symbol="OP_SHR">
  <concat>
  <cstring content="&gt;"/>
  <cstring content="&gt;"/>
  </concat>
  </lexeme>
  <lexeme symbol="OP_SHL">
  <concat>
  <cstring content="&lt;"/>
  <cstring content="&lt;"/>
  </concat>
  </lexeme>
  <lexeme symbol="OP_SHRR">
  <concat>
  <cstring content="&gt;"/>
  <cstring content="&gt;"/>
  <cstring content="&gt;"/>
  </concat>
  </lexeme>
  <lexeme symbol="ASS_OP">
  <alt>
  <concat>
  <cstring content="+"/>
  <cstring content="="/>
  </concat>
  <concat>
  <cstring content="-"/>
  <cstring content="="/>
  </concat>
  <concat>
  <cstring content="*"/>
  <cstring content="="/>
  </concat>
  <concat>
  <cstring content="/"/>
  <cstring content="="/>
  </concat>
  <concat>
  <cstring content="&amp;"/>
  <cstring content="="/>
  </concat>
  <concat>
  <cstring content="|"/>
  <cstring content="="/>
  </concat>
  <concat>
  <cstring content="^"/>
  <cstring content="="/>
  </concat>
  <concat>
  <cstring content="%"/>
  <cstring content="="/>
  </concat>
  <concat>
  <cstring content="&lt;"/>
  <cstring content="&lt;"/>
  <cstring content="="/>
  </concat>
  <concat>
  <cstring content="&gt;"/>
  <cstring content="&gt;"/>
  <cstring content="="/>
  </concat>
  <concat>
  <cstring content="&gt;"/>
  <cstring content="&gt;"/>
  <cstring content="&gt;"/>
  <cstring content="="/>
  </concat>
  </alt>
  </lexeme>
  <lexeme symbol="EQ">
  <cstring content="="/>
  </lexeme>
  <lexeme symbol="GT">
  <cstring content="&gt;"/>
  </lexeme>
  <lexeme symbol="LT">
  <cstring content="&lt;"/>
  </lexeme>
  <lexeme symbol="NOT">
  <cstring content="!"/>
  </lexeme>
  <lexeme symbol="TILDE">
  <cstring content="~"/>
  </lexeme>
  <lexeme symbol="QM">
  <cstring content="?"/>
  </lexeme>
  <lexeme symbol="COLON">
  <cstring content=":"/>
  </lexeme>
  <lexeme symbol="PLUS">
  <cstring content="+"/>
  </lexeme>
  <lexeme symbol="MINUS">
  <cstring content="-"/>
  </lexeme>
  <lexeme symbol="MULT">
  <cstring content="*"/>
  </lexeme>
  <lexeme symbol="DIV">
  <cstring content="/"/>
  </lexeme>
  <lexeme symbol="AND">
  <cstring content="&amp;"/>
  </lexeme>
  <lexeme symbol="OR">
  <cstring content="|"/>
  </lexeme>
  <lexeme symbol="XOR">
  <cstring content="^"/>
  </lexeme>
  <lexeme symbol="MOD">
  <cstring content="%"/>
  </lexeme>
  <lexeme symbol="BOOLLIT">
  <alt>
  <concat>
  <cstring content="t"/>
  <cstring content="r"/>
  <cstring content="u"/>
  <cstring content="e"/>
  </concat>
  <concat>
  <cstring content="f"/>
  <cstring content="a"/>
  <cstring content="l"/>
  <cstring content="s"/>
  <cstring content="e"/>
  </concat>
  </alt>
  </lexeme>
  <lexeme symbol="ABSTRACT">
  <concat>
  <cstring content="a"/>
  <cstring content="b"/>
  <cstring content="s"/>
  <cstring content="t"/>
  <cstring content="r"/>
  <cstring content="a"/>
  <cstring content="c"/>
  <cstring content="t"/>
  </concat>
  </lexeme>
  <lexeme symbol="DO">
  <concat>
  <cstring content="d"/>
  <cstring content="o"/>
  </concat>
  </lexeme>
  <lexeme symbol="IMPLEMENTS">
  <concat>
  <cstring content="i"/>
  <cstring content="m"/>
  <cstring content="p"/>
  <cstring content="l"/>
  <cstring content="e"/>
  <cstring content="m"/>
  <cstring content="e"/>
  <cstring content="n"/>
  <cstring content="t"/>
  <cstring content="s"/>
  </concat>
  </lexeme>
  <lexeme symbol="PACKAGE">
  <concat>
  <cstring content="p"/>
  <cstring content="a"/>
  <cstring content="c"/>
  <cstring content="k"/>
  <cstring content="a"/>
  <cstring content="g"/>
  <cstring content="e"/>
  </concat>
  </lexeme>
  <lexeme symbol="THROW">
  <concat>
  <cstring content="t"/>
  <cstring content="h"/>
  <cstring content="r"/>
  <cstring content="o"/>
  <cstring content="w"/>
  </concat>
  </lexeme>
  <lexeme symbol="BOOLEAN">
  <concat>
  <cstring content="b"/>
  <cstring content="o"/>
  <cstring content="o"/>
  <cstring content="l"/>
  <cstring content="e"/>
  <cstring content="a"/>
  <cstring content="n"/>
  </concat>
  </lexeme>
  <lexeme symbol="DOUBLE">
  <concat>
  <cstring content="d"/>
  <cstring content="o"/>
  <cstring content="u"/>
  <cstring content="b"/>
  <cstring content="l"/>
  <cstring content="e"/>
  </concat>
  </lexeme>
  <lexeme symbol="IMPORT">
  <concat>
  <cstring content="i"/>
  <cstring content="m"/>
  <cstring content="p"/>
  <cstring content="o"/>
  <cstring content="r"/>
  <cstring content="t"/>
  </concat>
  </lexeme>
  <lexeme symbol="PRIVATE">
  <concat>
  <cstring content="p"/>
  <cstring content="r"/>
  <cstring content="i"/>
  <cstring content="v"/>
  <cstring content="a"/>
  <cstring content="t"/>
  <cstring content="e"/>
  </concat>
  </lexeme>
  <lexeme symbol="THROWS">
  <concat>
  <cstring content="t"/>
  <cstring content="h"/>
  <cstring content="r"/>
  <cstring content="o"/>
  <cstring content="w"/>
  <cstring content="s"/>
  </concat>
  </lexeme>
  <lexeme symbol="BREAK">
  <concat>
  <cstring content="b"/>
  <cstring content="r"/>
  <cstring content="e"/>
  <cstring content="a"/>
  <cstring content="k"/>
  </concat>
  </lexeme>
  <lexeme symbol="ELSE" assoc="right">
  <concat>
  <cstring content="e"/>
  <cstring content="l"/>
  <cstring content="s"/>
  <cstring content="e"/>
  </concat>
  </lexeme>
  <lexeme symbol="INNER">
  <concat>
  <cstring content="i"/>
  <cstring content="n"/>
  <cstring content="n"/>
  <cstring content="e"/>
  <cstring content="r"/>
  </concat>
  </lexeme>
  <lexeme symbol="PROTECTED">
  <concat>
  <cstring content="p"/>
  <cstring content="r"/>
  <cstring content="o"/>
  <cstring content="t"/>
  <cstring content="e"/>
  <cstring content="c"/>
  <cstring content="t"/>
  <cstring content="e"/>
  <cstring content="d"/>
  </concat>
  </lexeme>
  <lexeme symbol="TRANSIENT">
  <concat>
  <cstring content="t"/>
  <cstring content="r"/>
  <cstring content="a"/>
  <cstring content="n"/>
  <cstring content="s"/>
  <cstring content="i"/>
  <cstring content="e"/>
  <cstring content="n"/>
  <cstring content="t"/>
  </concat>
  </lexeme>
  <lexeme symbol="BYTE">
  <concat>
  <cstring content="b"/>
  <cstring content="y"/>
  <cstring content="t"/>
  <cstring content="e"/>
  </concat>
  </lexeme>
  <lexeme symbol="EXTENDS">
  <concat>
  <cstring content="e"/>
  <cstring content="x"/>
  <cstring content="t"/>
  <cstring content="e"/>
  <cstring content="n"/>
  <cstring content="d"/>
  <cstring content="s"/>
  </concat>
  </lexeme>
  <lexeme symbol="INSTANCEOF">
  <concat>
  <cstring content="i"/>
  <cstring content="n"/>
  <cstring content="s"/>
  <cstring content="t"/>
  <cstring content="a"/>
  <cstring content="n"/>
  <cstring content="c"/>
  <cstring content="e"/>
  <cstring content="o"/>
  <cstring content="f"/>
  </concat>
  </lexeme>
  <lexeme symbol="PUBLIC">
  <concat>
  <cstring content="p"/>
  <cstring content="u"/>
  <cstring content="b"/>
  <cstring content="l"/>
  <cstring content="i"/>
  <cstring content="c"/>
  </concat>
  </lexeme>
  <lexeme symbol="TRY">
  <concat>
  <cstring content="t"/>
  <cstring content="r"/>
  <cstring content="y"/>
  </concat>
  </lexeme>
  <lexeme symbol="CASE">
  <concat>
  <cstring content="c"/>
  <cstring content="a"/>
  <cstring content="s"/>
  <cstring content="e"/>
  </concat>
  </lexeme>
  <lexeme symbol="FINAL">
  <concat>
  <cstring content="f"/>
  <cstring content="i"/>
  <cstring content="n"/>
  <cstring content="a"/>
  <cstring content="l"/>
  </concat>
  </lexeme>
  <lexeme symbol="INT">
  <concat>
  <cstring content="i"/>
  <cstring content="n"/>
  <cstring content="t"/>
  </concat>
  </lexeme>
  <lexeme symbol="REST">
  <concat>
  <cstring content="r"/>
  <cstring content="e"/>
  <cstring content="s"/>
  <cstring content="t"/>
  </concat>
  </lexeme>
  <lexeme symbol="VAR">
  <concat>
  <cstring content="v"/>
  <cstring content="a"/>
  <cstring content="r"/>
  </concat>
  </lexeme>
  <lexeme symbol="CAST">
  <concat>
  <cstring content="c"/>
  <cstring content="a"/>
  <cstring content="s"/>
  <cstring content="t"/>
  </concat>
  </lexeme>
  <lexeme symbol="FINALLY">
  <concat>
  <cstring content="f"/>
  <cstring content="i"/>
  <cstring content="n"/>
  <cstring content="a"/>
  <cstring content="l"/>
  <cstring content="l"/>
  <cstring content="y"/>
  </concat>
  </lexeme>
  <lexeme symbol="INTERFACE">
  <concat>
  <cstring content="i"/>
  <cstring content="n"/>
  <cstring content="t"/>
  <cstring content="e"/>
  <cstring content="r"/>
  <cstring content="f"/>
  <cstring content="a"/>
  <cstring content="c"/>
  <cstring content="e"/>
  </concat>
  </lexeme>
  <lexeme symbol="RETURN">
  <concat>
  <cstring content="r"/>
  <cstring content="e"/>
  <cstring content="t"/>
  <cstring content="u"/>
  <cstring content="r"/>
  <cstring content="n"/>
  </concat>
  </lexeme>
  <lexeme symbol="VOID">
  <concat>
  <cstring content="v"/>
  <cstring content="o"/>
  <cstring content="i"/>
  <cstring content="d"/>
  </concat>
  </lexeme>
  <lexeme symbol="CATCH">
  <concat>
  <cstring content="c"/>
  <cstring content="a"/>
  <cstring content="t"/>
  <cstring content="c"/>
  <cstring content="h"/>
  </concat>
  </lexeme>
  <lexeme symbol="FLOAT">
  <concat>
  <cstring content="f"/>
  <cstring content="l"/>
  <cstring content="o"/>
  <cstring content="a"/>
  <cstring content="t"/>
  </concat>
  </lexeme>
  <lexeme symbol="LONG">
  <concat>
  <cstring content="l"/>
  <cstring content="o"/>
  <cstring content="n"/>
  <cstring content="g"/>
  </concat>
  </lexeme>
  <lexeme symbol="SHORT">
  <concat>
  <cstring content="s"/>
  <cstring content="h"/>
  <cstring content="o"/>
  <cstring content="r"/>
  <cstring content="t"/>
  </concat>
  </lexeme>
  <lexeme symbol="VOLATILE">
  <concat>
  <cstring content="v"/>
  <cstring content="o"/>
  <cstring content="l"/>
  <cstring content="a"/>
  <cstring content="t"/>
  <cstring content="i"/>
  <cstring content="l"/>
  <cstring content="e"/>
  </concat>
  </lexeme>
  <lexeme symbol="CHAR">
  <concat>
  <cstring content="c"/>
  <cstring content="h"/>
  <cstring content="a"/>
  <cstring content="r"/>
  </concat>
  </lexeme>
  <lexeme symbol="FOR">
  <concat>
  <cstring content="f"/>
  <cstring content="o"/>
  <cstring content="r"/>
  </concat>
  </lexeme>
  <lexeme symbol="NATIVE">
  <concat>
  <cstring content="n"/>
  <cstring content="a"/>
  <cstring content="t"/>
  <cstring content="i"/>
  <cstring content="v"/>
  <cstring content="e"/>
  </concat>
  </lexeme>
  <lexeme symbol="STATIC">
  <concat>
  <cstring content="s"/>
  <cstring content="t"/>
  <cstring content="a"/>
  <cstring content="t"/>
  <cstring content="i"/>
  <cstring content="c"/>
  </concat>
  </lexeme>
  <lexeme symbol="WHILE">
  <concat>
  <cstring content="w"/>
  <cstring content="h"/>
  <cstring content="i"/>
  <cstring content="l"/>
  <cstring content="e"/>
  </concat>
  </lexeme>
  <lexeme symbol="CLASS">
  <concat>
  <cstring content="c"/>
  <cstring content="l"/>
  <cstring content="a"/>
  <cstring content="s"/>
  <cstring content="s"/>
  </concat>
  </lexeme>
  <lexeme symbol="FUTURE">
  <concat>
  <cstring content="f"/>
  <cstring content="u"/>
  <cstring content="t"/>
  <cstring content="u"/>
  <cstring content="r"/>
  <cstring content="e"/>
  </concat>
  </lexeme>
  <lexeme symbol="NEW">
  <concat>
  <cstring content="n"/>
  <cstring content="e"/>
  <cstring content="w"/>
  </concat>
  </lexeme>
  <lexeme symbol="SUPER">
  <concat>
  <cstring content="s"/>
  <cstring content="u"/>
  <cstring content="p"/>
  <cstring content="e"/>
  <cstring content="r"/>
  </concat>
  </lexeme>
  <lexeme symbol="CONST">
  <concat>
  <cstring content="c"/>
  <cstring content="o"/>
  <cstring content="n"/>
  <cstring content="s"/>
  <cstring content="t"/>
  </concat>
  </lexeme>
  <lexeme symbol="GENERIC">
  <concat>
  <cstring content="g"/>
  <cstring content="e"/>
  <cstring content="n"/>
  <cstring content="e"/>
  <cstring content="r"/>
  <cstring content="i"/>
  <cstring content="c"/>
  </concat>
  </lexeme>
  <lexeme symbol="NULL">
  <concat>
  <cstring content="n"/>
  <cstring content="u"/>
  <cstring content="l"/>
  <cstring content="l"/>
  </concat>
  </lexeme>
  <lexeme symbol="SWITCH">
  <concat>
  <cstring content="s"/>
  <cstring content="w"/>
  <cstring content="i"/>
  <cstring content="t"/>
  <cstring content="c"/>
  <cstring content="h"/>
  </concat>
  </lexeme>
  <lexeme symbol="CONTINUE">
  <concat>
  <cstring content="c"/>
  <cstring content="o"/>
  <cstring content="n"/>
  <cstring content="t"/>
  <cstring content="i"/>
  <cstring content="n"/>
  <cstring content="u"/>
  <cstring content="e"/>
  </concat>
  </lexeme>
  <lexeme symbol="GOTO">
  <concat>
  <cstring content="g"/>
  <cstring content="o"/>
  <cstring content="t"/>
  <cstring content="o"/>
  </concat>
  </lexeme>
  <lexeme symbol="OPERATOR">
  <concat>
  <cstring content="o"/>
  <cstring content="p"/>
  <cstring content="e"/>
  <cstring content="r"/>
  <cstring content="a"/>
  <cstring content="t"/>
  <cstring content="o"/>
  <cstring content="r"/>
  </concat>
  </lexeme>
  <lexeme symbol="SYNCHRONIZED">
  <concat>
  <cstring content="s"/>
  <cstring content="y"/>
  <cstring content="n"/>
  <cstring content="c"/>
  <cstring content="h"/>
  <cstring content="r"/>
  <cstring content="o"/>
  <cstring content="n"/>
  <cstring content="i"/>
  <cstring content="z"/>
  <cstring content="e"/>
  <cstring content="d"/>
  </concat>
  </lexeme>
  <lexeme symbol="DEFAULT">
  <concat>
  <cstring content="d"/>
  <cstring content="e"/>
  <cstring content="f"/>
  <cstring content="a"/>
  <cstring content="u"/>
  <cstring content="l"/>
  <cstring content="t"/>
  </concat>
  </lexeme>
  <lexeme symbol="IF">
  <concat>
  <cstring content="i"/>
  <cstring content="f"/>
  </concat>
  </lexeme>
  <lexeme symbol="OUTER">
  <concat>
  <cstring content="o"/>
  <cstring content="u"/>
  <cstring content="t"/>
  <cstring content="e"/>
  <cstring content="r"/>
  </concat>
  </lexeme>
  <lexeme symbol="THIS">
  <concat>
  <cstring content="t"/>
  <cstring content="h"/>
  <cstring content="i"/>
  <cstring content="s"/>
  </concat>
  </lexeme>
  <lexeme symbol="LITERAL">
  <alt>
  <alt>
  <alt>
  <concat>
  <cclass>
  <cinterval min="1" max="9"/>
  </cclass>
  <concat maxOccurs="*" minOccurs="0">
  <cclass>
  <cinterval min="0" max="9"/>
  </cclass>
  </concat>
  <concat maxOccurs="1" minOccurs="0">
  <alt>
  <cstring content="l"/>
  <cstring content="L"/>
  </alt>
  </concat>
  </concat>
  <concat>
  <cstring content="0"/>
  <concat maxOccurs="*" minOccurs="0">
  <cclass>
  <cinterval min="0" max="7"/>
  </cclass>
  </concat>
  <concat maxOccurs="1" minOccurs="0">
  <alt>
  <cstring content="l"/>
  <cstring content="L"/>
  </alt>
  </concat>
  </concat>
  <concat>
  <cstring content="0"/>
  <alt>
  <cstring content="x"/>
  <cstring content="X"/>
  </alt>
  <cclass>
  <cinterval min="0" max="9"/>
  <cinterval min="a" max="f"/>
  <cinterval min="A" max="F"/>
  </cclass>
  <concat maxOccurs="*" minOccurs="0">
  <cclass>
  <cinterval min="0" max="9"/>
  <cinterval min="a" max="f"/>
  <cinterval min="A" max="F"/>
  </cclass>
  </concat>
  <concat maxOccurs="1" minOccurs="0">
  <alt>
  <cstring content="l"/>
  <cstring content="L"/>
  </alt>
  </concat>
  </concat>
  </alt>
  <alt>
  <concat>
  <concat maxOccurs="*" minOccurs="1">
  <cclass>
  <cinterval min="0" max="9"/>
  </cclass>
  </concat>
  <cstring content="."/>
  <concat maxOccurs="1" minOccurs="0">
  <concat maxOccurs="*" minOccurs="1">
  <cclass>
  <cinterval min="0" max="9"/>
  </cclass>
  </concat>
  </concat>
  <concat maxOccurs="1" minOccurs="0">
  <concat>
  <alt>
  <cstring content="e"/>
  <cstring content="E"/>
  </alt>
  <concat maxOccurs="1" minOccurs="0">
  <concat>
  <concat maxOccurs="1" minOccurs="0">
  <alt>
  <cstring content="+"/>
  <cstring content="-"/>
  </alt>
  </concat>
  <concat maxOccurs="*" minOccurs="1">
  <cclass>
  <cinterval min="0" max="9"/>
  </cclass>
  </concat>
  </concat>
  </concat>
  </concat>
  </concat>
  <concat maxOccurs="1" minOccurs="0">
  <alt>
  <cstring content="f"/>
  <cstring content="F"/>
  <cstring content="d"/>
  <cstring content="D"/>
  </alt>
  </concat>
  </concat>
  <concat>
  <cstring content="."/>
  <concat maxOccurs="*" minOccurs="1">
  <cclass>
  <cinterval min="0" max="9"/>
  </cclass>
  </concat>
  <concat maxOccurs="1" minOccurs="0">
  <concat>
  <alt>
  <cstring content="e"/>
  <cstring content="E"/>
  </alt>
  <concat maxOccurs="1" minOccurs="0">
  <concat>
  <concat maxOccurs="1" minOccurs="0">
  <alt>
  <cstring content="+"/>
  <cstring content="-"/>
  </alt>
  </concat>
  <concat maxOccurs="*" minOccurs="1">
  <cclass>
  <cinterval min="0" max="9"/>
  </cclass>
  </concat>
  </concat>
  </concat>
  </concat>
  </concat>
  <concat maxOccurs="1" minOccurs="0">
  <alt>
  <cstring content="f"/>
  <cstring content="F"/>
  <cstring content="d"/>
  <cstring content="D"/>
  </alt>
  </concat>
  </concat>
  <concat>
  <concat maxOccurs="*" minOccurs="1">
  <cclass>
  <cinterval min="0" max="9"/>
  </cclass>
  </concat>
  <concat>
  <alt>
  <cstring content="e"/>
  <cstring content="E"/>
  </alt>
  <concat maxOccurs="1" minOccurs="0">
  <concat>
  <concat maxOccurs="1" minOccurs="0">
  <alt>
  <cstring content="+"/>
  <cstring content="-"/>
  </alt>
  </concat>
  <concat maxOccurs="*" minOccurs="1">
  <cclass>
  <cinterval min="0" max="9"/>
  </cclass>
  </concat>
  </concat>
  </concat>
  </concat>
  <concat maxOccurs="1" minOccurs="0">
  <alt>
  <cstring content="f"/>
  <cstring content="F"/>
  <cstring content="d"/>
  <cstring content="D"/>
  </alt>
  </concat>
  </concat>
  <concat>
  <concat maxOccurs="*" minOccurs="1">
  <cclass>
  <cinterval min="0" max="9"/>
  </cclass>
  </concat>
  <alt>
  <cstring content="f"/>
  <cstring content="F"/>
  <cstring content="d"/>
  <cstring content="D"/>
  </alt>
  </concat>
  </alt>
  </alt>
  <concat>
  <cstring content="'"/>
  <alt>
  <concat>
  <cclass>
  <cset content="\"/>
  </cclass>
  <cclass>
  <cset content="r"/>
  <cset content="n"/>
  <cset content="b"/>
  <cset content="f"/>
  <cset content="t"/>
  <cset content="\"/>
  <cset content="'"/>
  <cset content="&quot;"/>
  </cclass>
  </concat>
  <alt>
  <concat>
  <cstring content="\"/>
  <cclass>
  <cinterval min="0" max="7"/>
  </cclass>
  </concat>
  <concat>
  <cstring content="\"/>
  <cclass>
  <cinterval min="0" max="7"/>
  </cclass>
  <cclass>
  <cinterval min="0" max="7"/>
  </cclass>
  </concat>
  <concat>
  <cstring content="\"/>
  <cclass>
  <cinterval min="0" max="3"/>
  </cclass>
  <cclass>
  <cinterval min="0" max="7"/>
  </cclass>
  <cclass>
  <cinterval min="0" max="7"/>
  </cclass>
  </concat>
  </alt>
  <cclass exclusive="true">
  <cset content="\"/>
  <cset content="'"/>
  </cclass>
  </alt>
  <cstring content="'"/>
  </concat>
  <concat>
  <cstring content="&quot;"/>
  <concat maxOccurs="*" minOccurs="0">
  <alt>
  <concat>
  <cclass>
  <cset content="\"/>
  </cclass>
  <cclass>
  <cset content="r"/>
  <cset content="n"/>
  <cset content="b"/>
  <cset content="f"/>
  <cset content="t"/>
  <cset content="\"/>
  <cset content="'"/>
  <cset content="&quot;"/>
  </cclass>
  </concat>
  <alt>
  <concat>
  <cstring content="\"/>
  <cclass>
  <cinterval min="0" max="7"/>
  </cclass>
  </concat>
  <concat>
  <cstring content="\"/>
  <cclass>
  <cinterval min="0" max="7"/>
  </cclass>
  <cclass>
  <cinterval min="0" max="7"/>
  </cclass>
  </concat>
  <concat>
  <cstring content="\"/>
  <cclass>
  <cinterval min="0" max="3"/>
  </cclass>
  <cclass>
  <cinterval min="0" max="7"/>
  </cclass>
  <cclass>
  <cinterval min="0" max="7"/>
  </cclass>
  </concat>
  </alt>
  <cclass exclusive="true">
  <cset content="\"/>
  <cset content="&quot;"/>
  </cclass>
  </alt>
  </concat>
  <cstring content="&quot;"/>
  </concat>
  </alt>
  </lexeme>
  <lexeme symbol="IDENTIFIER">
  <concat>
  <alt>
  <cclass>
  <cinterval min="a" max="z"/>
  <cinterval min="A" max="Z"/>
  <cset content="_"/>
  </cclass>
  <cclass>
  <cset content="1"/>
  <cset content="b"/>
  </cclass>
  </alt>
  <concat maxOccurs="*" minOccurs="0">
  <alt>
  <alt>
  <cclass>
  <cinterval min="a" max="z"/>
  <cinterval min="A" max="Z"/>
  <cset content="_"/>
  </cclass>
  <cclass>
  <cset content="1"/>
  <cset content="b"/>
  </cclass>
  </alt>
  <cclass>
  <cinterval min="0" max="9"/>
  </cclass>
  </alt>
  </concat>
  </concat>
  </lexeme>
  <lexeme symbol="OP_DIM">
  <concat>
  <cstring content="["/>
  <concat maxOccurs="*" minOccurs="0">
  <alt>
  <cclass>
  <cset code="13"/>
  <cset code="10"/>
  <cset code="9"/>
  <cset content=" "/>
  </cclass>
  <alt>
  <concat>
  <cstring content="/"/>
  <cstring content="*"/>
  <concat maxOccurs="*" minOccurs="0">
  <alt>
  <cclass exclusive="true">
  <cset content="*"/>
  </cclass>
  <concat>
  <cstring content="*"/>
  <cclass exclusive="true">
  <cset content="/"/>
  </cclass>
  </concat>
  </alt>
  </concat>
  <cstring content="*"/>
  <cstring content="/"/>
  </concat>
  <concat>
  <cstring content="/"/>
  <cstring content="/"/>
  <concat maxOccurs="*" minOccurs="0">
  <cclass exclusive="true">
  <cset code="10"/>
  <cset code="13"/>
  </cclass>
  </concat>
  </concat>
  </alt>
  </alt>
  </concat>
  <cstring content="]"/>
  </concat>
  </lexeme>
  <lexeme symbol="SPACES">
  <concat maxOccurs="*" minOccurs="1">
  <cstring content=" "/>
  </concat>
  </lexeme>
  <lexeme symbol="TAB">
  <cstring code="9"/>
  </lexeme>
  <lexeme symbol="EOL">
  <alt>
  <concat>
  <cstring code="13"/>
  <concat maxOccurs="1" minOccurs="0">
  <cstring code="10"/>
  </concat>
  </concat>
  <cstring code="10"/>
  </alt>
  </lexeme>
  <lexeme symbol="JAVADOC">
  <concat>
  <cstring content="/"/>
  <cstring content="*"/>
  <cstring content="*"/>
  <concat maxOccurs="*" minOccurs="0">
  <alt>
  <cclass exclusive="true">
  <cset content="*"/>
  </cclass>
  <concat>
  <cclass>
  <cset content="*"/>
  </cclass>
  <cclass exclusive="true">
  <cset content="/"/>
  </cclass>
  </concat>
  </alt>
  </concat>
  <cstring content="*"/>
  <cstring content="/"/>
  </concat>
  </lexeme>
  <lexeme symbol="MULTILINECOMMENT">
  <concat>
  <cstring content="/"/>
  <cstring content="*"/>
  <concat maxOccurs="*" minOccurs="0">
  <alt>
  <cclass exclusive="true">
  <cset content="*"/>
  </cclass>
  <concat>
  <cstring content="*"/>
  <cclass exclusive="true">
  <cset content="/"/>
  </cclass>
  </concat>
  </alt>
  </concat>
  <cstring content="*"/>
  <cstring content="/"/>
  </concat>
  </lexeme>
  <lexeme symbol="SINGLELINECOMMENT">
  <concat>
  <cstring content="/"/>
  <cstring content="/"/>
  <concat maxOccurs="*" minOccurs="0">
  <cclass exclusive="true">
  <cset code="10"/>
  <cset code="13"/>
  </cclass>
  </concat>
  </concat>
  </lexeme>
  </lexicon>
  
  
  
  1.1                  xml-cocoon2/src/blocks/chaperon/samples/grammars/javadoc.xgrm
  
  Index: javadoc.xgrm
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  <grammar xmlns="http://chaperon.sourceforge.net/schema/grammar/1.0">
  <priority>
  <terminal symbol="ASTERISK"/>
  <terminal symbol="TEXT"/>
  <terminal symbol="TAG"/>
  <terminal symbol="PROPERTYNAME"/>
  <terminal symbol="SPACES"/>
  <terminal symbol="TAB"/>
  <terminal symbol="EOL"/>
  </priority>
  <production symbol="JavaDoc">
  <nonterminal symbol="Description"/>
  <nonterminal symbol="Properties"/>
  </production>
  <production symbol="JavaDoc">
  <nonterminal symbol="Description"/>
  </production>
  <production symbol="Description">
  <nonterminal symbol="Description"/>
  <terminal symbol="TEXT"/>
  </production>
  <production symbol="Description">
  <nonterminal symbol="Description"/>
  <terminal symbol="TAG"/>
  </production>
  <production symbol="Description">
  <terminal symbol="TEXT"/>
  </production>
  <production symbol="Description">
  <terminal symbol="TAG"/>
  </production>
  <production symbol="Properties">
  <nonterminal symbol="Properties"/>
  <nonterminal symbol="Property"/>
  </production>
  <production symbol="Properties">
  <nonterminal symbol="Property"/>
  </production>
  <production symbol="Property">
  <terminal symbol="PROPERTYNAME"/>
  <nonterminal symbol="Description"/>
  </production>
  <production symbol="Property">
  <terminal symbol="PROPERTYNAME"/>
  </production>
  <start symbol="JavaDoc"/>
  </grammar>
  
  
  
  1.1                  xml-cocoon2/src/blocks/chaperon/samples/grammars/javadoc.xlex
  
  Index: javadoc.xlex
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  <lexicon xmlns="http://chaperon.sourceforge.net/schema/lexicon/1.0">
  <lexeme symbol="ASTERISK">
  <cstring content="*"/>
  </lexeme>
  <lexeme symbol="TEXT">
  <concat>
  <cclass exclusive="true">
  <cset content=" "/>
  <cset code="9"/>
  <cset content="*"/>
  <cset code="13"/>
  <cset code="10"/>
  <cset content="@"/>
  <cset content="&lt;"/>
  <cset content="&gt;"/>
  </cclass>
  <concat maxOccurs="1" minOccurs="0">
  <concat>
  <concat maxOccurs="*" minOccurs="0">
  <cclass exclusive="true">
  <cset content="*"/>
  <cset code="13"/>
  <cset code="10"/>
  <cset content="@"/>
  <cset content="&lt;"/>
  <cset content="&gt;"/>
  </cclass>
  </concat>
  <cclass exclusive="true">
  <cset content=" "/>
  <cset content="*"/>
  <cset code="13"/>
  <cset code="10"/>
  <cset content="@"/>
  <cset content="&lt;"/>
  <cset content="&gt;"/>
  </cclass>
  </concat>
  </concat>
  </concat>
  </lexeme>
  <lexeme symbol="TAG">
  <concat>
  <cstring content="&lt;"/>
  <concat maxOccurs="1" minOccurs="0">
  <cstring content="/"/>
  </concat>
  <cclass>
  <cinterval min="A" max="Z"/>
  <cinterval min="a" max="z"/>
  </cclass>
  <concat maxOccurs="*" minOccurs="0">
  <cclass>
  <cinterval min="A" max="Z"/>
  <cinterval min="a" max="z"/>
  <cinterval min="0" max="9"/>
  </cclass>
  </concat>
  <concat maxOccurs="*" minOccurs="0">
  <concat>
  <concat maxOccurs="*" minOccurs="1">
  <cclass>
  <cset content=" "/>
  <cset code="9"/>
  <cset code="13"/>
  <cset code="10"/>
  </cclass>
  </concat>
  <cclass>
  <cinterval min="A" max="Z"/>
  <cinterval min="a" max="z"/>
  </cclass>
  <concat maxOccurs="*" minOccurs="0">
  <cclass>
  <cinterval min="A" max="Z"/>
  <cinterval min="a" max="z"/>
  <cinterval min="0" max="9"/>
  </cclass>
  </concat>
  <cstring content="="/>
  <cstring content="&quot;"/>
  <concat maxOccurs="*" minOccurs="0">
  <cclass exclusive="true">
  <cset content="&quot;"/>
  </cclass>
  </concat>
  <cstring content="&quot;"/>
  </concat>
  </concat>
  <concat maxOccurs="*" minOccurs="0">
  <cclass>
  <cset content=" "/>
  <cset code="9"/>
  <cset code="13"/>
  <cset code="10"/>
  </cclass>
  </concat>
  <concat maxOccurs="1" minOccurs="0">
  <cstring content="/"/>
  </concat>
  <cstring content="&gt;"/>
  </concat>
  </lexeme>
  <lexeme symbol="PROPERTYNAME">
  <concat>
  <cstring content="@"/>
  <cclass>
  <cinterval min="A" max="Z"/>
  <cinterval min="a" max="z"/>
  </cclass>
  <concat maxOccurs="*" minOccurs="0">
  <cclass>
  <cinterval min="A" max="Z"/>
  <cinterval min="a" max="z"/>
  <cinterval min="0" max="9"/>
  </cclass>
  </concat>
  </concat>
  </lexeme>
  <lexeme symbol="SPACES">
  <concat maxOccurs="*" minOccurs="1">
  <cstring content=" "/>
  </concat>
  </lexeme>
  <lexeme symbol="TAB">
  <cstring code="9"/>
  </lexeme>
  <lexeme symbol="EOL">
  <alt>
  <concat>
  <cstring code="13"/>
  <concat maxOccurs="1" minOccurs="0">
  <cstring code="10"/>
  </concat>
  </concat>
  <cstring code="10"/>
  </alt>
  </lexeme>
  </lexicon>
  
  
  
  1.1                  xml-cocoon2/src/blocks/chaperon/samples/grammars/lexicon-v20.dtd
  
  Index: lexicon-v20.dtd
  ===================================================================
  <!-- LEXICON DTD -->
  <!ELEMENT lexicon (lexeme)+>
                 
  <!-- LEXEME -->
  <!ELEMENT lexeme (concat|alt|cstring|cclass|cuniversal|bol|eol)>
  <!ATTLIST lexeme symbol      CDATA    #IMPLIED>
  
  <!-- CONCATENATION -->
  <!ELEMENT concat (concat|alt|cstring|cclass|cuniversal|bol|eol)+>
  <!ATTLIST concat minOccurs CDATA "1"
                   maxOccurs CDATA "1">
  
  <!-- ALTERNATION -->
  <!ELEMENT alt (concat|alt|cstring|cclass|cuniversal|bol|eol)+>
  <!ATTLIST alt minOccurs CDATA "1"
                maxOccurs CDATA "1">
  
  <!-- CHARACTER STRING -->
  <!ELEMENT cstring EMPTY>
  <!ATTLIST cstring content CDATA    #REQUIRED
                    minOccurs CDATA "1"
                    maxOccurs CDATA "1">
  
  <!-- UNIVERSAL CHARACTER -->
  <!ELEMENT cuniversal EMPTY>
  <!ATTLIST cuniversal minOccurs CDATA "1"
                       maxOccurs CDATA "1">
  
  <!-- CHARACTER CLASS -->
  <!ELEMENT cclass (cset|cinterval)+>
  <!ATTLIST cclass exclusive (true|false) "false"
                   minOccurs CDATA "1"
                   maxOccurs CDATA "1">
  
  <!-- CHARACTER SET  -->
  <!ELEMENT cset EMPTY>   
  <!ATTLIST cset content  CDATA #REQUIRED>
  
  <!-- CHARACTER INTERVALL -->
  <!ELEMENT cinterval EMPTY>   
  <!ATTLIST cinterval min  CDATA #REQUIRED
                      max  CDATA #REQUIRED>
  
  
  
  
  
  
  1.1                  xml-cocoon2/src/blocks/chaperon/samples/grammars/mathexp.xgrm
  
  Index: mathexp.xgrm
  ===================================================================
  <?xml version="1.0"?>
  <!DOCTYPE grammar PUBLIC "-//Chaperon//DTD grammar 2.0//EN" "grammar-v20.dtd">
  
  <grammar>
   <production symbol="E">
    <nonterminal symbol="E"/><terminal symbol="plus"/><nonterminal symbol="T"/>
   </production>
  
   <production symbol="E">
    <nonterminal symbol="T"/>
   </production>
  
   <production symbol="T">
    <nonterminal symbol="T"/><terminal symbol="mult"/><nonterminal symbol="F"/>
   </production>
  
   <production symbol="T">
    <nonterminal symbol="F"/>
   </production>
  
   <production symbol="F">
    <terminal symbol="dopen"/><nonterminal symbol="E"/><terminal symbol="dclose"/>
   </production>
  
   <production symbol="F">
    <terminal symbol="id"/>
   </production>
  
   <production symbol="F">
    <terminal symbol="number"/>
   </production>
  
   <start symbol="E"/>
  </grammar>
  
  
  
  1.1                  xml-cocoon2/src/blocks/chaperon/samples/grammars/mathexp.xlex
  
  Index: mathexp.xlex
  ===================================================================
  <?xml version="1.0"?>
  <!DOCTYPE lexicon PUBLIC "-//Chaperon//DTD lexicon 2.0//EN" "lexicon-v20.dtd">
  
  <lexicon>
   <lexeme symbol="plus">
    <cclass><cset content="+-"/></cclass>
   </lexeme>
  
   <lexeme symbol="mult">
    <cclass><cset content="*/"/></cclass>
   </lexeme>
  
   <lexeme symbol="dopen">
    <cstring content="("/>
   </lexeme>
  
   <lexeme symbol="dclose">
    <cstring content=")"/>
   </lexeme>
  
   <lexeme symbol="id">
    <concat>
     <cclass><cinterval min="A" max="Z"/><cinterval min="a" max="z"/></cclass>
     <cclass minOccurs="0" maxOccurs="*"><cinterval min="A" max="Z"/><cinterval min="a" max="z"/><cinterval min="0" max="9"/><cset content="_"/></cclass>
    </concat>
   </lexeme>
  
   <lexeme symbol="number">
    <alt>
     <concat>
      <cclass minOccurs="1" maxOccurs="*"><cinterval min="0" max="9"/></cclass>
      <concat minOccurs="0" maxOccurs="1">
       <cstring content="."/>
       <cclass minOccurs="0" maxOccurs="*"><cinterval min="0" max="9"/></cclass>
      </concat>
     </concat>
     <concat>
      <cstring content="."/>
      <cclass minOccurs="1" maxOccurs="*"><cinterval min="0" max="9"/></cclass>
     </concat>
    </alt>
   </lexeme>
  
   <lexeme>
    <cclass maxOccurs="*"><cset content="&#10;&#13;&#9;&#32;"/></cclass>
   </lexeme>
  </lexicon>
  
  
  
  1.1                  xml-cocoon2/src/blocks/chaperon/samples/grammars/regex.xgrm
  
  Index: regex.xgrm
  ===================================================================
  <?xml version="1.0" standalone="no"?>
  <!DOCTYPE grammar PUBLIC "-//Chaperon//DTD grammar 2.0//EN" "grammar-v20.dtd">
  <grammar>
   <priority>
    <terminal symbol="plus"/>
   </priority>
  
   <associativity symbol="plus" type="right"/>
  
   <production symbol="intervall">
    <terminal symbol="character"/><terminal symbol="minus"/><terminal symbol="character"/>
   </production>
  
   <production symbol="intervall">
    <terminal symbol="maskedcharacter"/><terminal symbol="minus"/><terminal symbol="character"/>
   </production>
  
   <production symbol="intervall">
    <terminal symbol="character"/><terminal symbol="minus"/><terminal symbol="maskedcharacter"/>
   </production>
  
   <production symbol="intervall">
    <terminal symbol="maskedcharacter"/><terminal symbol="minus"/><terminal symbol="maskedcharacter"/>
   </production>
  
   <production symbol="sequence">
    <nonterminal symbol="sequence"/><nonterminal symbol="intervall"/>
   </production>
  
   <production symbol="sequence">
    <nonterminal symbol="sequence"/><terminal symbol="character"/>
   </production>
  
   <production symbol="sequence">
    <nonterminal symbol="sequence"/><terminal symbol="maskedcharacter"/>
   </production>
  
   <production symbol="sequence">
    <nonterminal symbol="intervall"/>
   </production>
  
   <production symbol="sequence">
    <terminal symbol="character"/>
   </production>
  
   <production symbol="sequence">
    <terminal symbol="maskedcharacter"/>
   </production>
  
   <production symbol="string">
    <nonterminal symbol="string"/><terminal symbol="character"/>
   </production>
  
  <!-- <production symbol="string">
    <nonterminal symbol="string"/><terminal symbol="maskedcharacter"/>
   </production>-->
  
   <production symbol="string">
    <terminal symbol="character"/>
   </production>
  
  <!-- <production symbol="string">
    <terminal symbol="maskedcharacter"/>
   </production>-->
  
   <production symbol="characterclass">
    <terminal symbol="ccbegin"/><nonterminal symbol="sequence"/><terminal symbol="ccend"/>
   </production>
  
   <production symbol="exclusivecharacterclass">
    <terminal symbol="ccbegin"/><terminal symbol="hat"/><nonterminal symbol="sequence"/><terminal symbol="ccend"/>
   </production>
  
   <production symbol="regexdot">
    <terminal symbol="regexdot"/>
   </production>
  
   <production symbol="regexbol">
    <terminal symbol="hat"/>
   </production>
  
   <production symbol="regexeol">
    <terminal symbol="dollar"/>
   </production>
  
   <production symbol="regexklammer">
    <terminal symbol="dopen"/><nonterminal symbol="regexalternation"/><terminal symbol="dclose"/>
   </production>
  
   <production symbol="regexabref">
    <terminal symbol="abopen"/><nonterminal symbol="string"/><terminal symbol="abclose"/>
   </production>
  
   <production symbol="regexterm">
    <nonterminal symbol="characterclass"/>
   </production>
  
   <production symbol="regexterm">
    <nonterminal symbol="exclusivecharacterclass"/>
   </production>
  
   <production symbol="regexterm">
    <nonterminal symbol="regexklammer"/>
   </production>
  
   <production symbol="regexterm">
    <nonterminal symbol="string"/>
   </production>
  
   <production symbol="regexterm">
    <terminal symbol="maskedcharacter"/>
   </production>
  
   <production symbol="regexterm">
    <nonterminal symbol="regexdot"/>
   </production>
  
   <production symbol="regexterm">
    <nonterminal symbol="regexbol"/>
   </production>
  
   <production symbol="regexterm">
    <nonterminal symbol="regexabref"/>
   </production>
  
   <production symbol="regexoptional">
    <nonterminal symbol="regexterm"/><terminal symbol="questionmark"/>
   </production>
  
   <production symbol="regexstar">
    <nonterminal symbol="regexterm"/><terminal symbol="mult"/>
   </production>
  
   <production symbol="regexplus">
    <nonterminal symbol="regexterm"/><terminal symbol="plus"/>
   </production>
  
   <production symbol="regexmultiplicator">
    <terminal symbol="copen"/><nonterminal symbol="string"/><terminal symbol="cclose"/>
   </production>
  
   <production symbol="regexmultiplicator">
    <terminal symbol="copen"/><nonterminal symbol="string"/>
    <terminal symbol="comma"/><nonterminal symbol="string"/><terminal symbol="cclose"/>
   </production>
  
   <production symbol="regexvar">
    <nonterminal symbol="regexterm"/><nonterminal symbol="regexmultiplicator"/>
   </production>
  
   <production symbol="regexquantifier">
    <nonterminal symbol="regexoptional"/>
   </production>
  
   <production symbol="regexquantifier">
    <nonterminal symbol="regexstar"/>
   </production>
  
   <production symbol="regexquantifier">
    <nonterminal symbol="regexplus"/>
   </production>
  
   <production symbol="regexquantifier" precedence="plus">
    <nonterminal symbol="regexterm"/>
   </production>
  
   <production symbol="regexquantifier">
    <nonterminal symbol="regexvar"/>
   </production>
  
   <production symbol="regexconcatenation">
    <nonterminal symbol="regexconcatenation"/><nonterminal symbol="regexquantifier"/>
   </production>
  
   <production symbol="regexconcatenation">
    <nonterminal symbol="regexquantifier"/>
   </production>
  
   <production symbol="regexalternation">
    <nonterminal symbol="regexalternation"/><terminal symbol="alt"/><nonterminal symbol="regexconcatenation"/>
   </production>
  
   <production symbol="regexalternation">
    <nonterminal symbol="regexconcatenation"/>
   </production>
  
   <production symbol="regexexpression">
    <nonterminal symbol="regexalternation"/>
   </production>
  
   <start symbol="regexexpression"/>
  </grammar>
  
  
  
  1.1                  xml-cocoon2/src/blocks/chaperon/samples/grammars/regex.xlex
  
  Index: regex.xlex
  ===================================================================
  <?xml version="1.0" standalone="no"?>
  <!DOCTYPE lexicon PUBLIC "-//Chaperon//DTD lexicon 2.0//EN" "lexicon-v20.dtd">
  
  <lexicon>
  
   <lexeme symbol="alt">
    <cstring content="|"/>
   </lexeme>
  
   <lexeme symbol="comma">
    <cstring content=","/>
   </lexeme>
  
   <lexeme symbol="copen">
    <cstring content="{"/>
   </lexeme>
  
   <lexeme symbol="cclose">
    <cstring content="}"/>
   </lexeme>
  
   <lexeme symbol="abopen">
    <cstring content="&lt;"/>
   </lexeme>
  
   <lexeme symbol="abclose">
    <cstring content=">"/>
   </lexeme>
  
   <lexeme symbol="character">
    <cclass exclusive="true">
     <cset content="&#92;[]-&#10;&#13;&#32;()[]|+?*^$.&lt;>&#34;"/>
    </cclass>
   </lexeme>
  
   <lexeme symbol="maskedcharacter">
    <alt>
     <concat>
      <cstring content="&#92;"/>
      <cclass exclusive="true">
       <cset content="u"/>
      </cclass>
     </concat>
     <concat>
      <cstring content="&#92;u"/>
      <cclass><cinterval min="0" max="9"/><cinterval min="a" max="f"/><cinterval min="A" max="F"/></cclass>
      <cclass><cinterval min="0" max="9"/><cinterval min="a" max="f"/><cinterval min="A" max="F"/></cclass>
      <cclass><cinterval min="0" max="9"/><cinterval min="a" max="f"/><cinterval min="A" max="F"/></cclass>
      <cclass><cinterval min="0" max="9"/><cinterval min="a" max="f"/><cinterval min="A" max="F"/></cclass>
     </concat>
    </alt>
   </lexeme>
  
   <lexeme symbol="minus">
    <cstring content="-"/>
   </lexeme>
  
   <lexeme symbol="hat">
    <cstring content="^"/>
   </lexeme>
  
   <lexeme symbol="dollar">
    <cstring content="$"/>
   </lexeme>
  
   <lexeme symbol="ccbegin">
    <cstring content="["/>
   </lexeme>
  
   <lexeme symbol="ccend">
    <cstring content="]"/>
   </lexeme>
  
   <lexeme symbol="regexdot">
    <cstring content="."/>
   </lexeme>
  
   <lexeme symbol="dopen">
    <cstring content="("/>
   </lexeme>
  
   <lexeme symbol="dclose">
    <cstring content=")"/>
   </lexeme>
  
   <lexeme symbol="questionmark">
    <cstring content="?"/>
   </lexeme>
  
   <lexeme symbol="mult">
    <cstring content="*"/>
   </lexeme>
  
   <lexeme symbol="plus">
    <cstring content="+"/>
   </lexeme>
  
   <lexeme> 
    <cclass maxOccurs="*"><cset content="&#10;&#13;&#9;&#32;"/></cclass>
   </lexeme>
  
  </lexicon>
  
  
  
  1.2       +178 -66   xml-cocoon2/src/blocks/chaperon/samples/misc/java.css
  
  Index: java.css
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/blocks/chaperon/samples/misc/java.css,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- java.css	31 Jan 2003 19:20:02 -0000	1.1
  +++ java.css	3 Feb 2003 19:15:35 -0000	1.2
  @@ -1,66 +1,178 @@
  -
  -body { background-color: #FFFFFF; }
  -
  -body {  color: #000000}
  -
  -#Header  { color: #ffffff;  background-color:#8697a5 }
  -
  -#CharacerLiteral	{ color: #FF00FF; }
  -#StringLiteral		{ color: #FF00FF; }
  -#SingleLineComment	{ color: #008000; }
  -#FormalComment		{ color: #008000; }
  -#MultiLineComment	{ color: #008000; }
  -#ABSTRACT		{ color: #0000FF ; font-weight: bold }
  -#BOOLEAN		{ color: #0000FF ; font-weight: bold }
  -#BREAK			{ color: #0000FF ; font-weight: bold }
  -#BYTE			{ color: #0000FF ; font-weight: bold }
  -#CASE			{ color: #0000FF ; font-weight: bold }
  -#CATCH			{ color: #0000FF ; font-weight: bold }
  -#CHAR			{ color: #0000FF ; font-weight: bold }
  -#CLASS			{ color: #0000FF ; font-weight: bold }
  -#CONST			{ color: #0000FF ; font-weight: bold }
  -#CONTINUE		{ color: #0000FF ; font-weight: bold }
  -#DEFAULT		{ color: #0000FF ; font-weight: bold }
  -#DO			{ color: #0000FF ; font-weight: bold }
  -#DOUBLE		{ color: #0000FF ; font-weight: bold }
  -#ELSE			{ color: #0000FF ; font-weight: bold }
  -#EXTENDS		{ color: #0000FF ; font-weight: bold }
  -#FALSE			{ color: #0000FF ; font-weight: bold }
  -#FINAL			{ color: #0000FF ; font-weight: bold }
  -#FINALLY		{ color: #0000FF ; font-weight: bold }
  -#FLOAT			{ color: #0000FF ; font-weight: bold }
  -#FOR			{ color: #0000FF ; font-weight: bold }
  -#GOTO			{ color: #0000FF ; font-weight: bold }
  -#IF			{ color: #0000FF ; font-weight: bold }
  -#IMPLEMENTS		{ color: #0000FF ; font-weight: bold }
  -#IMPORT		{ color: #0000FF ; font-weight: bold }
  -#INSTANCEOF		{ color: #0000FF ; font-weight: bold }
  -#INT			{ color: #0000FF ; font-weight: bold }
  -#INTERFACE		{ color: #0000FF ; font-weight: bold }
  -#LONG			{ color: #0000FF ; font-weight: bold }
  -#NATIVE		{ color: #0000FF ; font-weight: bold }
  -#NEW			{ color: #0000FF ; font-weight: bold }
  -#PACKAGE		{ color: #0000FF ; font-weight: bold }
  -#PRIVATE		{ color: #0000FF ; font-weight: bold }
  -#PROTECTED		{ color: #0000FF ; font-weight: bold }
  -#PUBLIC		{ color: #0000FF ; font-weight: bold }
  -#RETURN		{ color: #0000FF ; font-weight: bold }
  -#SHORT			{ color: #0000FF ; font-weight: bold }
  -#STATIC		{ color: #0000FF ; font-weight: bold }
  -#SUPER			{ color: #0000FF ; font-weight: bold }
  -#SWITCH		{ color: #0000FF ; font-weight: bold }
  -#SYCHRONIZED		{ color: #0000FF ; font-weight: bold }
  -#THIS			{ color: #0000FF ; font-weight: bold }
  -#THROW			{ color: #0000FF ; font-weight: bold }
  -#THROWS		{ color: #0000FF ; font-weight: bold }
  -#TRANSIENT		{ color: #0000FF ; font-weight: bold }
  -#TRUE			{ color: #0000FF ; font-weight: bold }
  -#TRY			{ color: #0000FF ; font-weight: bold }
  -#VOID			{ color: #0000FF ; font-weight: bold }
  -#VOLATILE		{ color: #0000FF ; font-weight: bold }
  -#WHILE			{ color: #0000FF ; font-weight: bold }
  -#StrictFP			{ color: #0000FF ; font-weight: bold }
  -#LITERAL	{ color: #b27b8c }
  -#IDENTIFIER { color: #000000 }
  -
  -
  +BODY {
  +	FONT-FAMILY: verdana, arial, sans-serif
  +}
  +
  +a:link { 
  +  color: #1F354D;
  +  FONT-SIZE: 12px;
  +}
  +
  +a:visited { 
  +  color: #1F354D;
  +  FONT-SIZE: 12px;
  +}
  +
  +a:hover { 
  +  color: #FF5A00;
  +  FONT-SIZE: 12px;
  +}
  +
  +a:active { 
  +  color: #FF5A00;
  +  FONT-SIZE: 12px;
  +}
  +
  +TABLE {
  +	FONT-SIZE: 9px
  +}
  +
  +TD.titleText {
  +	 BACKGROUND: #eff7ff; PADDING-left: 5px;
  +}
  +
  +TABLE.view {
  +  FONT-SIZE: 12px; 
  +  /*BORDER:#aca9ac 1px solid;*/
  +}
  +
  +TD.headerTitle {
  +  BACKGROUND: #d5e2ee; 
  +  BORDER: #aca9ac 1px solid; 
  +  WIDTH: 100%;
  +}
  +
  +TD.headerLeft {
  +  BACKGROUND: #f6f6f6; 
  +  BORDER-LEFT: #aca9ac 1px solid;
  +  BORDER-BOTTOM: #aca9ac 1px solid;
  +}
  +
  +TD.header {
  +  BACKGROUND: #f6f6f6; 
  +  BORDER-LEFT: #aca9ac 1px solid; 
  +  BORDER-BOTTOM: #aca9ac 1px solid;
  +}
  +TD.headerRight {
  +  BACKGROUND: #f6f6f6; 
  +  BORDER-LEFT: #aca9ac 1px solid; 
  +  BORDER-BOTTOM: #aca9ac 1px solid;
  +  BORDER-RIGHT: #aca9ac 1px solid;
  +  WIDTH: 100%;
  +}
  +
  +TD.itemLeft {
  +  BACKGROUND: #ffffff; 
  +  BORDER-LEFT: #aca9ac 1px solid; 
  +  BORDER-BOTTOM: #aca9ac 1px solid;
  +  vertical-align:top;
  +}
  +
  +TD.item {
  +  BACKGROUND: #ffffff; 
  +  BORDER-LEFT: #aca9ac 1px solid; 
  +  BORDER-BOTTOM: #aca9ac 1px solid;  
  +  vertical-align:top;
  +}
  +
  +TD.itemRight {
  +  BACKGROUND: #ffffff; 
  +  BORDER-LEFT: #aca9ac 1px solid; 
  +  BORDER-BOTTOM: #aca9ac 1px solid; 
  +  BORDER-RIGHT: #aca9ac 1px solid;
  +  WIDTH: 100%;
  +  vertical-align:top;
  +}
  +
  +FONT.current {
  +  padding: 2px; 
  +  font-weight: bold; 
  +  color: #FFFFFF; 
  +  background-color:#00008B;
  +}
  +
  +TABLE.srcView {
  +	FONT-SIZE: 12px; BORDER-LEFT:#dcdcdc 1px solid;BORDER-RIGHT:#dcdcdc 1px solid; BORDER-BOTTOM:#dcdcdc 1px solid;
  +}
  +
  +TD.lineCount {
  +  BACKGROUND: #f6f6f6;
  +  BORDER-LEFT: #aca9ac 1px solid;
  +  BORDER-BOTTOM: #aca9ac 1px solid;
  +  BORDER-RIGHT: #aca9ac 1px solid;
  +  PADDING-RIGHT: 3px; 
  +  FONT-SIZE: 12px;
  +}
  +
  +TD.srcLine {
  +  WIDTH: 100%;
  +  BORDER-BOTTOM: #aca9ac 1px solid;
  +  BORDER-RIGHT: #aca9ac 1px solid;
  +}
  +
  +PRE.srcLine {
  +  BACKGROUND: #ffffff; MARGIN-BOTTOM: 0px; FONT-SIZE: 12px;
  +}
  +
  +TD.footer {
  +  BORDER-TOP:#dcdcdc 1px solid;	 FONT-SIZE: 9px
  +}
  +
  +/* Token Colours */
  +FONT.CharacerLiteral	{ color: #FF00FF; }
  +FONT.StringLiteral		{ color: #FF00FF; }
  +FONT.SingleLineComment	{ color: #008000; }
  +FONT.FormalComment		{ color: #008000; }
  +FONT.MultiLineComment	{ color: #008000; }
  +FONT.ABSTRACT		{ color: #2020BF ; font-weight: normal }
  +FONT.BOOLEAN		{ color: #2020BF ; font-weight: normal }
  +FONT.BREAK			{ color: #2020BF ; font-weight: normal }
  +FONT.BYTE			{ color: #2020BF ; font-weight: normal }
  +FONT.CASE			{ color: #2020BF ; font-weight: normal }
  +FONT.CATCH			{ color: #2020BF ; font-weight: normal }
  +FONT.CHAR			{ color: #2020BF ; font-weight: normal }
  +FONT.CLASS			{ color: #2020BF ; font-weight: normal }
  +FONT.CONST			{ color: #2020BF ; font-weight: normal }
  +FONT.CONTINUE		{ color: #2020BF ; font-weight: normal }
  +FONT.DEFAULT		{ color: #2020BF ; font-weight: normal }
  +FONT.DO			{ color: #2020BF ; font-weight: normal }
  +FONT.DOUBLE		{ color: #2020BF ; font-weight: normal }
  +FONT.ELSE			{ color: #2020BF ; font-weight: normal }
  +FONT.EXTENDS		{ color: #2020BF ; font-weight: normal }
  +FONT.FALSE			{ color: #2020BF ; font-weight: normal }
  +FONT.FINAL			{ color: #2020BF ; font-weight: normal }
  +FONT.FINALLY		{ color: #2020BF ; font-weight: normal }
  +FONT.FLOAT			{ color: #2020BF ; font-weight: normal }
  +FONT.FOR			{ color: #2020BF ; font-weight: normal }
  +FONT.GOTO			{ color: #2020BF ; font-weight: normal }
  +FONT.IF			{ color: #2020BF ; font-weight: normal }
  +FONT.IMPLEMENTS		{ color: #2020BF ; font-weight: normal }
  +FONT.IMPORT		{ color: #2020BF ; font-weight: normal }
  +FONT.INSTANCEOF		{ color: #2020BF ; font-weight: normal }
  +FONT.INT			{ color: #2020BF ; font-weight: normal }
  +FONT.INTERFACE		{ color: #2020BF ; font-weight: normal }
  +FONT.LONG			{ color: #2020BF ; font-weight: normal }
  +FONT.NATIVE		{ color: #2020BF ; font-weight: normal }
  +FONT.NEW			{ color: #2020BF ; font-weight: normal }
  +FONT.PACKAGE		{ color: #2020BF ; font-weight: normal }
  +FONT.PRIVATE		{ color: #2020BF ; font-weight: normal }
  +FONT.PROTECTED		{ color: #2020BF ; font-weight: normal }
  +FONT.PUBLIC		{ color: #2020BF ; font-weight: normal }
  +FONT.RETURN		{ color: #2020BF ; font-weight: normal }
  +FONT.SHORT			{ color: #2020BF ; font-weight: normal }
  +FONT.STATIC		{ color: #2020BF ; font-weight: normal }
  +FONT.SUPER			{ color: #2020BF ; font-weight: normal }
  +FONT.SWITCH		{ color: #2020BF ; font-weight: normal }
  +FONT.SYCHRONIZED		{ color: #2020BF ; font-weight: normal }
  +FONT.THIS			{ color: #2020BF ; font-weight: normal }
  +FONT.THROW			{ color: #2020BF ; font-weight: normal }
  +FONT.THROWS		{ color: #2020BF ; font-weight: normal }
  +FONT.TRANSIENT		{ color: #2020BF ; font-weight: normal }
  +FONT.TRUE			{ color: #2020BF ; font-weight: normal }
  +FONT.TRY			{ color: #2020BF ; font-weight: normal }
  +FONT.VOID			{ color: #2020BF ; font-weight: normal }
  +FONT.VOLATILE		{ color: #2020BF ; font-weight: normal }
  +FONT.WHILE			{ color: #2020BF ; font-weight: normal }
  +FONT.StrictFP			{ color: #2020BF ; font-weight: normal }
  +FONT.LITERAL	{ color: #b27b8c }
  +FONT.IDENTIFIER { color: #000000 }
  +
  
  
  
  1.2       +2 -2      xml-cocoon2/src/blocks/chaperon/samples/misc/mathexp.xsp
  
  Index: mathexp.xsp
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/blocks/chaperon/samples/misc/mathexp.xsp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- mathexp.xsp	31 Jan 2003 19:20:02 -0000	1.1
  +++ mathexp.xsp	3 Feb 2003 19:15:35 -0000	1.2
  @@ -13,8 +13,8 @@
     <h1>Mathexp Example</h1>
   
     <p>
  -   <textfragment xmlns="http://chaperon.sourceforge.net/schema/textfragment/1.0"><xsp-request:get-parameter name="text" 
  -    default="3*a-5*6/7 + ( b-c)*5- b"/></textfragment>
  +   <text xmlns="http://chaperon.sourceforge.net/schema/text/1.0"><xsp-request:get-parameter name="text" 
  +    default="3*a-5*6/7 + ( b-c)*5- b"/></text>
     </p>
   
     <p>
  
  
  
  1.2       +4 -3      xml-cocoon2/src/blocks/chaperon/samples/misc/samples.xml
  
  Index: samples.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/blocks/chaperon/samples/misc/samples.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- samples.xml	31 Jan 2003 19:20:02 -0000	1.1
  +++ samples.xml	3 Feb 2003 19:15:35 -0000	1.2
  @@ -16,11 +16,12 @@
    </group>
   
    <group name="Syntax highlighting example">
  -  <sample name="Example 1" href="java1.html">The parser also be used to colorize
  -   some source code. (Need once 2-3min, for the parser table generation process)
  +  <sample name="Example 1" href="test/Grammar.java.html">The parser can also be used to colorize
  +   some source code.
     </sample>
   
  -  <sample name="Example 2" href="java2.html">Another example.
  +  <sample name="Example 2" href="test/PatternProcessor.class.html">This example show a another view
  +   of a java class, similar to javadoc.(Need once 2-3min, for the parser table generation process)
     </sample>
    </group>
   
  
  
  
  1.2       +1 -1      xml-cocoon2/src/blocks/chaperon/samples/misc/wiki.xsp
  
  Index: wiki.xsp
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/blocks/chaperon/samples/misc/wiki.xsp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- wiki.xsp	31 Jan 2003 19:20:02 -0000	1.1
  +++ wiki.xsp	3 Feb 2003 19:15:35 -0000	1.2
  @@ -232,7 +232,7 @@
   
     <p>
      <div class="block"><span class="tab">Preview</span><div class="content">
  - <textfragment xmlns="http://chaperon.sourceforge.net/schema/textfragment/1.0"><xsp-request:get-parameter name="text" default="No text"/></textfragment>
  + <text xmlns="http://chaperon.sourceforge.net/schema/text/1.0"><xsp-request:get-parameter name="text" default="No text"/></text>
      </div></div>
     </p>
   
  
  
  
  1.1                  xml-cocoon2/src/blocks/chaperon/samples/misc/test/Grammar.java
  
  Index: Grammar.java
  ===================================================================
  /*
   *  Copyright (C) Chaperon. All rights reserved.
   *  -------------------------------------------------------------------------
   *  This software is published under the terms of the Apache Software License
   *  version 1.1, a copy of which has been included  with this distribution in
   *  the LICENSE file.
   */
  
  package net.sourceforge.chaperon.model.grammar;
  
  import java.io.Serializable;
  import java.util.Hashtable;
  import java.util.Enumeration;
  import java.util.Vector;
  
  import net.sourceforge.chaperon.common.IntegerList;
  import net.sourceforge.chaperon.model.Violations;
  import net.sourceforge.chaperon.model.symbol.Symbol;
  import net.sourceforge.chaperon.model.symbol.SymbolList;
  import net.sourceforge.chaperon.model.symbol.SymbolSet;
  import net.sourceforge.chaperon.model.symbol.Nonterminal;
  import net.sourceforge.chaperon.model.symbol.Terminal;
  
  /**
   * This class represents a model for a grammar. The content of
   * the grammar includes the productions, start symbol, associativities
   * and priorities.
   *
   * @author <a href="mailto:stephan@apache.org">Stephan Michels </a>
   * @version CVS $Id: Grammar.java,v 1.1 2003/02/03 19:15:35 stephan Exp $
   */
  public class Grammar implements Serializable, Cloneable
  {
  	// Start symbol
  	private Nonterminal startsymbol = null;
  
  	// Productions
  	private Vector productions = new Vector();
  
  	private Hashtable priorities = new Hashtable();
  	private Hashtable associativities = new Hashtable();
  
  	private String location = null;
  
  	/**
  	 * Creates an empty grammar.
  	 */
  	public Grammar()
  	{
  	}
  
  	/**
  	 * Add a production to this grammar.
  	 *
  	 * @param production Production, which should be added.
  	 *
  	 * @return Index of the production in this grammar.
  	 */
  	public int addProduction(Production production)
  	{
  		if (production==null)
  			throw new NullPointerException();
  
  		productions.addElement(production);
  		return productions.size()-1;
  	}
  
  	/**
  	 * Add a list of productions to this grammar.
  	 *
  	 * @param list Array of productions.
  	 */
  	public void addProduction(Production[] list)
  	{
  		for (int i = 0; i<list.length; i++)
  		{
  			try
  			{
  				addProduction((Production) list[i].clone());
  			}
  			catch (CloneNotSupportedException cnse)
  			{
  				throw new IllegalArgumentException("Could not clone token:"+
  																					 cnse.getMessage());
  			}
  		}
  	}
  
  	/**
  	 * Removes a production by an index from this grammar.
  	 *
  	 * @param index Index of the production, which should be removed.
  	 */
  	public void removeProduction(int index)
  	{
  		productions.removeElementAt(index);
  	}
  
  	/**
  	 * Replace a production by an index in this grammar.
  	 *
  	 * @param index The index, at which the productionshould be replaced.
  	 * @param production The production.
  	 */
  	public void setProduction(int index, Production production)
  	{
  		if ((index<0) || (index>productions.size()))
  			throw new IndexOutOfBoundsException();
  		productions.setElementAt(production, index);
  	}
  
  	/**
  	 * Return a production giving by an index.
  	 *
  	 * @param index Index of the Production.
  	 *
  	 * @return The production.
  	 */
  	public Production getProduction(int index)
  	{
  		if ((index<0) || (index>productions.size()))
  			throw new IndexOutOfBoundsException();
  
  		return (Production) productions.elementAt(index);
  	}
  
  	/**
  	 * Returns all production for given nonterminal symbol as
     * a list of indices.
  	 *
  	 * @param ntsymbol Nonterminal symbol
  	 *
  	 * @return List of indices from the productions
  	 */
  	public IntegerList getProductionList(Symbol ntsymbol)
  	{
  		IntegerList list = new IntegerList();
  		int i;
  
  		for (i = 0; i<getProductionCount(); i++)
  		{
  			if (getProduction(i).getSymbol().equals(ntsymbol))
  				list.add(i);
  		}
  		return list;
  	}
  
  	/**
  	 * Returns the count of productions in this grammar.
  	 *
  	 * @return Count of productions.
  	 */
  	public int getProductionCount()
  	{
  		return productions.size();
  	}
  
  	/**
  	 * Return the index of a production.
  	 *
  	 * @param production The production.
  	 *
  	 * @return Index of the Production.
  	 */
  	public int indexOf(Production production)
  	{
  		for (int i = 0; i<productions.size(); i++)
  			if (((Production) productions.elementAt(i)).equals(production))
  				return i;
  		return -1;
  	}
  
  	/**
  	 * Return the index of the next production, which found
     * by a nonterminal symbol.
  	 *
  	 * @param ntsymbol Nonterminal symbol
  	 *
  	 * @return Index of the production.
  	 */
  	public int indexOf(Symbol ntsymbol)
  	{
  		for (int i = 0; i<productions.size(); i++)
  			if (((Production) productions.elementAt(i)).getSymbol().equals(ntsymbol))
  				return i;
  		return -1;
  	}
  
  	/**
  	 * If the grammar contains a production.
  	 *
  	 * @param production The production, which the grammar should contain.
  	 *
  	 * @return True, if the grammar contains the production.
  	 */
  	public boolean contains(Production production)
  	{
  		return (indexOf(production)!=-1);
  	}
  
  	/**
  	 * If the grammar contains a production with this nonterminal symbol.
  	 *
  	 * @param ntsymbol Nonterminal symbol.
  	 *
  	 * @return True, if the grammar contains a production with the symbol.
  	 */
  	public boolean contains(Symbol ntsymbol)
  	{
  		return (indexOf(ntsymbol)!=-1);
  	}
  
  	/**
  	 * Removes all productions from this grammar.
  	 */
  	public void removeAllProduction()
  	{
  		productions.removeAllElements();
  	}
  
  	/**
  	 * Returns the production, which this grammar contains, as an array.
  	 *
  	 * @return Array if productions.
  	 */
  	public Production[] getProduction()
  	{
  		int size = productions.size();
  		Production[] mArray = new Production[size];
  
  		for (int index = 0; index<size; index++)
  			mArray[index] = (Production) productions.elementAt(index);
  		return mArray;
  	}
  
  	/**
  	 * Replace the productions of this grammar by an array of productions.
  	 *
  	 * @param productionArray Array of productions.
  	 */
  	public void setProduction(Production[] productionArray)
  	{
  		productions.removeAllElements();
  		for (int i = 0; i<productionArray.length; i++)
  			productions.addElement(productionArray[i]);
  	}
  
  	/**
  	 * Set a priority of a terminal symbol.
  	 *
  	 * @param terminal Terminal symbol.
  	 * @param priority Priority of the symbol.
  	 */
  	public void setPriority(Terminal terminal, int priority)
  	{
  		if (terminal==null)
  			throw new NullPointerException();
  
  		priorities.put(terminal, new Integer(priority));
  	}
  
  	/**
  	 * Returns the priority of a terminal symbol.
  	 *
  	 * @param terminal Terminal symbol.
  	 *
  	 * @return Priority of the symbol.
  	 */
  	public int getPriority(Terminal terminal)
  	{
  		Integer priority = (Integer) priorities.get(terminal);
  
  		if (priority==null)
  			return 0;
  		return priority.intValue();
  	}
  
  	/**
  	 * Return the priority of a production in this grammar.
  	 *
  	 * @param production Production.
  	 *
  	 * @return Priority of the production.
  	 */
  	public int getPriority(Production production)
  	{
  		if ( !contains(production))
  			return 0;
  
  		if (production.getPrecedence()!=null)
  			return getPriority(production.getPrecedence());
  
  		SymbolList definition = production.getDefinition();
  
  		for (int i = definition.getSymbolCount()-1; i>=0; i--)
  			if (definition.getSymbol(i) instanceof Terminal)
  			{
  				int priority = getPriority((Terminal) definition.getSymbol(i));
  
  				return priority;
  			}
  
  		return getProductionCount()-indexOf(production);
  	}
  
  	/**
  	 * Set the associativity of a terminal symbol.
  	 *
  	 * @param terminal Terminal symbol.
  	 * @param assoc Associativity of the symbol.
  	 */
  	public void setAssociativity(Terminal terminal, Associativity assoc)
  	{
  		if (terminal==null)
  			throw new NullPointerException();
  
  		associativities.put(terminal, assoc);
  	}
  
  	/**
  	 * Return the associativity of a terminal symbol.
  	 *
  	 * @param terminal Terminal symbol.
  	 *
  	 * @return Associativity of the symbol.
  	 */
  	public Associativity getAssociativity(Terminal terminal)
  	{
  		Associativity assoc = (Associativity) associativities.get(terminal);
  
  		if (assoc==null)
  			return Associativity.NONASSOC;
  		return assoc;
  	}
  
  	/**
  	 * Return the associativity of a production in this grammar.
  	 *
  	 * @param production Production.
  	 *
  	 * @return Associativity of the production.
  	 */
  	public Associativity getAssociativity(Production production)
  	{
  		if (!contains(production))
  			return Associativity.NONASSOC;
  
  		if (production.getPrecedence()!=null)
  			return getAssociativity(production.getPrecedence());
  
  		SymbolList definition = production.getDefinition();
  
  		for (int i = definition.getSymbolCount()-1; i>=0; i--)
  			if (definition.getSymbol(i) instanceof Terminal)
  				return getAssociativity((Terminal) definition.getSymbol(i));
  
  		return Associativity.NONASSOC;
  	}
  
  	/**
  	 * Return all used symbol in this grammar.
  	 *
  	 * @return Set of symbols, which were used.
  	 */
  	public SymbolSet getSymbols()
  	{
  		SymbolSet set = new SymbolSet();
  
  		for (int i = 0; i<getProductionCount(); i++)
  			set.addSymbol(getProduction(i).getSymbols());
  		return set;
  	}
  
  	/**
  	 * Set the start symbol for this grammar.
  	 *
  	 * @param startsymbol Start symbol.
  	 */
  	public void setStartSymbol(Nonterminal startsymbol)
  	{
  		this.startsymbol = startsymbol;
  	}
  
  	/**
  	 * Return the start symbol.
  	 *
  	 * @return Start symbol.
  	 */
  	public Nonterminal getStartSymbol()
  	{
  		return startsymbol;
  	}
  
  	/**
  	 * Set the location from the input source.
  	 *
  	 * @param location Location in the input source.
  	 */
  	public void setLocation(String location)
  	{
  		this.location = location;
  	}
  
  	/**
  	 * Returns the location from the input source.
  	 *
  	 * @return Location in the input source.
  	 */
  	public String getLocation()
  	{
  		return location;
  	}
  
  	/**
  	 * Validated the grammar.
  	 *
  	 * @return Return a list of violations, if this
     *         object isn't valid.
  	 */
  	public Violations validate()
  	{
  		Violations violations = new Violations();
  
  		if (startsymbol==null)
  			violations.addViolation("Start symbol is not defined", location);
  		else if ( !contains(startsymbol))
  			violations.addViolation("Start symbol \""+startsymbol+"\""+
  															"is not defined through a production", location);
  
  		if (getProductionCount()<=0)
  			violations.addViolation("No productions are defined", location);
  
  		for (Enumeration e = productions.elements(); e.hasMoreElements(); )
  			violations.addViolations(((Production) e.nextElement()).validate());
  
  		SymbolSet ntsymbols = getSymbols().getNonterminals();
  
  		for (int i = 0; i<ntsymbols.getSymbolCount(); i++)
  			if ( !contains(ntsymbols.getSymbol(i)))
  				violations.addViolation("Nonterminal symbol \""+
  																ntsymbols.getSymbol(i)+"\""+
  																"is not defined through a production", location);
  
  		return violations;
  	}
  
  	/**
  	 * Return a string representation of the grammar.
  	 *
  	 * @return String representation.
  	 */
  	public String toString()
  	{
  		StringBuffer buffer = new StringBuffer();
  
  		buffer.append("Terminal symbols:\n");
  		SymbolSet tsymbols = getSymbols().getTerminals();
  
  		for (int i = 0; i<tsymbols.getSymbolCount(); i++)
  		{
  			buffer.append(String.valueOf(i));
  			buffer.append(".Terminal: ");
  			buffer.append(tsymbols.getSymbol(i));
  			buffer.append(" Priority=");
  			buffer.append(String.valueOf(getPriority((Terminal) tsymbols.getSymbol(i))));
  			buffer.append(" Associativity=");
  			buffer.append(String.valueOf(getAssociativity((Terminal) tsymbols.getSymbol(i))));
  			buffer.append("\n");
  		}
  
  		buffer.append("Produktions:\n");
  		for (int i = 0; i<getProductionCount(); i++)
  		{
  			buffer.append(String.valueOf(i));
  			buffer.append(".Production: ");
  			buffer.append(getProduction(i).toString());
  			buffer.append("\n");
  		}
  
  		buffer.append("\n");
  
  		return buffer.toString();
  	}
  
  	/**
  	 * Creates a clone of this grammar.
  	 *
  	 * @return Clone of this grammar.
  	 *
  	 * @throws CloneNotSupportedException If an exception occurs during the
     *                                    cloning.
  	 */
  	public Object clone() throws CloneNotSupportedException
  	{
  		Grammar clone = new Grammar();
  
  		clone.startsymbol = startsymbol;
  		for (int i = 0; i<productions.size(); i++)
  			clone.addProduction((Production) ((Production) productions.elementAt(i)).clone());
  
  		clone.location = location;
  
  		return clone;
  	}
  }
  
  
  
  1.1                  xml-cocoon2/src/blocks/chaperon/samples/misc/test/PatternProcessor.java
  
  Index: PatternProcessor.java
  ===================================================================
  /*
   *  Copyright (C) Chaperon. All rights reserved.
   *  -------------------------------------------------------------------------
   *  This software is published under the terms of the Apache Software License
   *  version 1.1, a copy of which has been included  with this distribution in
   *  the LICENSE file.
   */
  
  package net.sourceforge.chaperon.process;
  
  import net.sourceforge.chaperon.common.Decoder;
  import net.sourceforge.chaperon.common.IntegerList;
  
  /**
   * Processor for pattern, which try for matching against a pattern.
   *
   * @author <a href="mailto:stephan@apache.org">Stephan Michels</a>
   * @version CVS $Id: PatternProcessor.java,v 1.1 2003/02/03 19:15:35 stephan Exp $
   */
  public class PatternProcessor
  {
  	private PatternAutomaton automaton;
  
  	private IntegerList states = new IntegerList();
  	private IntegerList statekeys = new IntegerList();
  
  	private IntegerList newstates = new IntegerList();
  	private IntegerList newstatekeys = new IntegerList();
  
  	// for storing the traversed states
  	private IntegerList historystates = new IntegerList();
  	private IntegerList dependencies = new IntegerList();
  
  	// for storing the group, which were found
  	private String[] groups = new String[10];
  	private int[] groupstarts = new int[10];
  	private int[] groupends = new int[10];
  	private int groupcount = 0;
  
  	/**
  	 * Create a new pattern processor.
  	 */
  	public PatternProcessor()
  	{
  	}
  
  	/**
  	 * Create a new pattern processor.
  	 *
  	 * @param automaton Automaton, which the processor should use.
  	 */
  	public PatternProcessor(PatternAutomaton automaton)
  	{
  		setPatternAutomaton(automaton);
  	}
  
  	/**
  	 * Set the pattern automaton.
  	 *
  	 * @param automaton Automaton, which the processor should use. 
  	 */
  	public void setPatternAutomaton(PatternAutomaton automaton)
  	{
  		if (automaton==null)
  			throw new NullPointerException();
  
  		this.automaton = automaton;
  		if (groupstarts.length<=(automaton.getGroupCount()))
  		{
  			groups = new String[automaton.getGroupCount()+1];
  			groupstarts = new int[automaton.getGroupCount()+1];
  			groupends = new int[automaton.getGroupCount()+1];
  		}
  	}
  
  	/**
  	 * Search a postion, where the processor is successful.
  	 *
  	 * @param text Text.
  	 *
  	 * @return Next first position where the parser is successfull
     *         otherwise -1.
  	 */
  	public boolean search(char[] text)
  	{
  		return search(text, 0);
  	}
  
  	/**
  	 * Search a postion, where the processor is successful.
  	 *
  	 * @param text Text.
  	 * @param start Start position within the text. 
  	 *
  	 * @return Next first position where the parser is successfull
     *         otherwise -1.
  	 */
  	public boolean search(char[] text, int start)
  	{
  		for (int position = start; position<=text.length; position++)
  			if (match(text, position))
  				return true;
  
  		return false;
  	}
  
    private boolean verbose = false;
  
    public void setVerbose(boolean verbose)
    {
      this.verbose = verbose;
    }
  
  	/**
  	 * Matches for pattern.
  	 *
  	 * @param text Text.
  	 *
  	 * @return True, if the processor matches successfully.
  	 */
  	public boolean match(char[] text)
  	{
  		return match(text, 0);
  	}
  
  	/**
  	 * Matches for pattern at specified position within the text.
  	 *
  	 * @param text Text
  	 * @param start Position within the text.  
  	 *
  	 * @return True, if the processor matches successfully.
  	 */
  	public boolean match(char[] text, int start)
  	{
  		if (automaton==null)
  			throw new NullPointerException("PatternAutomaton is null");
  		if (automaton.getStateCount()<=0)
  			return false;
  
  		for (int i = 0; i<=automaton.getGroupCount(); i++)
  		{
  			groupstarts[i] = start;
  			groupends[i] = start;
  			groups[i] = null;
  		}
  
  		int position = start;
  		int state, key;
  		boolean found = false;
  		int foundkey = 0;
      int foundPosition = start;
  
  		states.clear();
  		states.push(automaton.getFirstState());
  
  		newstates.clear();
  
  		statekeys.clear();
  		statekeys.push(0);
  
  		historystates.clear();
  		historystates.push(automaton.getFirstState());
  
  		dependencies.clear();
  		dependencies.push(0);
  
  		while (( !states.isEmpty()) && (position<=text.length))
  		{
  			state = states.pop();
  			key = statekeys.pop();
  
  			if (automaton.isFinalState(state))
  			{
  				found = true;
  				foundkey = key;
          foundPosition = position;
  			}
  			else
  			{
  				switch (automaton.getType(state))
  				{
  				case PatternAutomaton.TYPE_NOMATCH :
  					pushState(states, statekeys, state, key);
  					break;
  
  				case PatternAutomaton.TYPE_MATCH :
  					if ((position<text.length) &&
  							(automaton.getIntervalBegin(state)<=text[position]) &&
  							(automaton.getIntervalEnd(state)>=text[position]))
  						pushState(newstates, newstatekeys, state, key);
  					break;
  
  				case PatternAutomaton.TYPE_EXMATCH :
  					if ((position<text.length) &&
  							((automaton.getIntervalBegin(state)>text[position]) ||
  							 (automaton.getIntervalEnd(state)<text[position])))
  						pushState(states, statekeys, state, key);
  					break;
  
  				case PatternAutomaton.TYPE_MATCHANY :
  					pushState(newstates, newstatekeys, state, key);
  					break;
  
  				case PatternAutomaton.TYPE_BOL :
  					if (position==0)
  						pushState(states, statekeys, state, key);
  					else if ((position==1) &&
  									 (((text[position-1]=='\n') && (text[position]!='\r')) ||
  										(text[position-1]=='\r')))
  						pushState(states, statekeys, state, key);
  					else if ((text[position-1]=='\r') ||
  									 ((text[position-1]=='\n') && (text[position]!='\r')))
  						pushState(states, statekeys, state, key);
  					break;
  
  				case PatternAutomaton.TYPE_EOL :
  					if (position>=text.length)
  						pushState(states, statekeys, state, key);
  					else if (((position+1)==text.length) &&
  									 ((text[position]=='\r') || (text[position]=='\n')))
  						pushState(states, statekeys, state, key);
  					else if ((text[position]=='\r') || (text[position]=='\n'))
  						pushState(states, statekeys, state, key);
  					break;
  
  				case PatternAutomaton.TYPE_GROUPSTART :
  					pushState(states, statekeys, state, key);
  					break;
  
  				case PatternAutomaton.TYPE_GROUPEND :
  					pushState(states, statekeys, state, key);
  					break;
  				}
  			}
  
  			if (states.isEmpty())
  			{
  				IntegerList temp = newstates;
  
  				newstates = states;
  				states = temp;
  
  				temp = newstatekeys;
  				newstatekeys = statekeys;
  				statekeys = temp;
  
  				position++; // next character
  			}
  		}
  
  		position = foundPosition;
  		key = foundkey;
  		while (key!=0)
  		{
  			key = dependencies.get(key);
  			state = historystates.get(key);
  
  			switch (automaton.getType(state))
  			{
  			case PatternAutomaton.TYPE_NOMATCH :
  				break;
  
  			case PatternAutomaton.TYPE_MATCH :
  				position--;
  				break;
  
  			case PatternAutomaton.TYPE_EXMATCH :
  				break;
  
  			case PatternAutomaton.TYPE_MATCHANY :
  				position--;
  				break;
  
  			case PatternAutomaton.TYPE_BOL :
  				break;
  
  			case PatternAutomaton.TYPE_EOL :
  				break;
  
  			case PatternAutomaton.TYPE_GROUPSTART :
  				if (groups[automaton.getGroupIndex(state)]==null)
  				{
  					groupstarts[automaton.getGroupIndex(state)] = position;
  					groups[automaton.getGroupIndex(state)] = new String(text, position,
  							groupends[automaton.getGroupIndex(state)]-position);
  
  				}
  				break;
  
  			case PatternAutomaton.TYPE_GROUPEND :
  				if (groups[automaton.getGroupIndex(state)]==null)
  					groupends[automaton.getGroupIndex(state)] = position;
  				break;
  			}
  		}
  
  		groupcount = automaton.getGroupCount();
  		for (int i = groupcount-1; (i>=0) && (groups[i]==null); i--)
  			groupcount--;
  
  		return found;
  	}
  
  	/**
  	 * Push a state into the history.
  	 *
  	 * @param states The traversed states.
  	 * @param keys Keys of the traversed paths.
  	 * @param state Current state.
  	 * @param key Current key.
  	 */
  	private void pushState(IntegerList states, IntegerList keys, int state,
  												 int key)
  	{
  		states.push(automaton.getTransitions(state));
  		historystates.push(automaton.getTransitions(state));
  		for (int i = automaton.getTransitions(state).length; i>0; i--)
  		{
  			keys.push(dependencies.getCount());
  			dependencies.push(key);
  		}
  	}
  
  	/**
  	 * Return the text, which in last match was found.
  	 *
  	 * @return Text.
  	 */
  	public String getGroup()
  	{
  		return groups[0];
  	}
  
  	/**
  	 * Return the text of the specifed group, which in 
     * last match was found.
  	 *
  	 * @param group Index of group;
  	 *
  	 * @return Text
  	 */
  	public String getGroup(int group)
  	{
  		return groups[group];
  	}
  
  	/**
  	 * Return count of groups.
  	 *
  	 * @return Count of groups.
  	 */
  	public int getGroupCount()
  	{
  		return groupcount;
  	}
  
  	/**
  	 * Return the start position of the last match.
  	 *
  	 * @return Start position.
  	 */
  	public int getGroupStart()
  	{
  		return groupstarts[0];
  	}
  
  	/**
  	 * Return the start position of a group 
     * from the last match.
  	 *
  	 * @param group Index of group.
  	 *
  	 * @return Start position.
  	 */
  	public int getGroupStart(int group)
  	{
  		return groupstarts[group];
  	}
  
  	/**
  	 * Return the end position of the last match.
  	 *
  	 * @return End position.
  	 */
  	public int getGroupEnd()
  	{
  		return groupends[0];
  	}
  
  	/**
  	 * Return the end position of a group 
     * from the last match.
     *
     * @param group Index of group.
     *
     * @return End position.
  	 */
  	public int getGroupEnd(int group)
  	{
  		return groupends[group];
  	}
  }
  
  
  
  1.2       +311 -630  xml-cocoon2/src/blocks/chaperon/samples/stylesheets/java2html.xsl
  
  Index: java2html.xsl
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/blocks/chaperon/samples/stylesheets/java2html.xsl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- java2html.xsl	31 Jan 2003 19:20:02 -0000	1.1
  +++ java2html.xsl	3 Feb 2003 19:15:35 -0000	1.2
  @@ -1,858 +1,539 @@
   <?xml version="1.0"?>
   <xsl:stylesheet version="1.0"
                   xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
  -                xmlns:java="http://chaperon.sourceforge.net/grammar/java/1.0"
  -                xmlns="http://www.w3.org/1999/xhtml">
  +                xmlns:lex="http://chaperon.sourceforge.net/schema/lexemes/1.0">
   
    <xsl:output indent="no"/>
   
  - <!--<xsl:strip-space elements="*"/>-->
  - <xsl:param name="selected">MethodDeclaration</xsl:param>
  + <xsl:param name="package"/>
  + <xsl:param name="class"/>
   
  - <xsl:template match="java:CompilationUnit" >
  + <xsl:param name="prefix">cocoon/samples/chaperon/</xsl:param>
  +
  + <xsl:template match="/java">
     <html>
      <head>
  +    <title>Java2HTML</title>
       <link rel="stylesheet" type="text/css" href="java.css" title="Style"/>
  -    <title>java2html example</title>
      </head>
      <body>
  -    <table id="Header" border="0" cellpadding="0" cellspacing="0" width="100%">
  +
  +    <table>
        <tr>
  -      <td colspan="2" width="33%">&#160;</td>
  -      <td align="center" colspan="2" width="33%">
  -       <font size="4">java2html example</font>
  +      <td align="left" valign="top">
  +       <p>
  +       <table width="100%" cellpadding="3" cellspacing="0" class="view">
  +        <tr>
  +         <td valign="top" class="headerTitle">
  +          <b>Packages</b>
  +         </td>
  +        </tr>
  +        <tr>
  +         <td class="headerRight">
  +          <xsl:apply-templates select="packages/package"/>
  +         </td>
  +        </tr>
  +       </table>
  +       </p>
  +       <p>
  +       <table width="100%" cellpadding="3" cellspacing="0" class="view">
  +        <tr>
  +         <td valign="top" class="headerTitle">
  +          <b>Classes</b>
  +         </td>
  +        </tr>
  +        <tr>
  +         <td class="headerRight">
  +          <xsl:apply-templates select="packages/classes/class"/>
  +         </td>
  +        </tr>
  +       </table>
  +       </p>
         </td>
  -      <td align="right" colspan="2" width="33%"></td>
  -     </tr>
  -    </table>
  -<!--    <p>
  -     <form>
  -      <select size="1" name="selected">
  -       <option value=""><xsl:if test="$selected=''"><xsl:attribute name="selected"/></xsl:if>Nothing selected</option>
  -       <option value="QualifiedName"><xsl:if test="$selected='QualifiedName'"><xsl:attribute name="selected"/></xsl:if>Qualified name</option>
  -       <option value="FieldVariableDeclaration"><xsl:if test="$selected='FieldVariableDeclaration'"><xsl:attribute name="selected"/></xsl:if>Field variable declaration</option>
  -       <option value="MethodDeclaration"><xsl:if test="$selected='MethodDeclaration'"><xsl:attribute name="selected"/></xsl:if>Method declaration</option>
  -       <option value="SelectionStatement"><xsl:if test="$selected='SelectionStatement'"><xsl:attribute name="selected"/></xsl:if>Selection statement</option>
  -       <option value="IterationStatement"><xsl:if test="$selected='IterationStatement'"><xsl:attribute name="selected"/></xsl:if>Iteration statement</option>
  -       <option value="GuardingStatement"><xsl:if test="$selected='GuardingStatement'"><xsl:attribute name="selected"/></xsl:if>Guarding statement</option>
  -      </select>
  -     </form>
  -    </p>-->
  -    <pre id="Classes">
  -     <xsl:apply-templates/>
  -    </pre>
  -   </body>
  -  </html>
  - </xsl:template>
  -
  - <xsl:template match="java:ABSTRACT">
  -  <font id="ABSTRACT"><xsl:apply-templates/></font>
  - </xsl:template>
  -
  - <xsl:template match="java:BOOLEAN">
  -  <font id="BOOLEAN"><xsl:apply-templates/></font>
  - </xsl:template>
  -
  - <xsl:template match="java:BREAK">
  -  <font id="BREAK"><xsl:apply-templates/></font>
  - </xsl:template>
  -
  - <xsl:template match="java:BYTE">
  -  <font id="BYTE"><xsl:apply-templates/></font>
  - </xsl:template>
  -
  - <xsl:template match="java:CASE">
  -  <font id="CASE"><xsl:apply-templates/></font>
  - </xsl:template>
  -
  - <xsl:template match="java:CATCH">
  -  <font id="CATCH"><xsl:apply-templates/></font>
  - </xsl:template>
  -
  - <xsl:template match="java:CHAR">
  -  <font id="CHAR"><xsl:apply-templates/></font>
  - </xsl:template>
  -
  - <xsl:template match="java:CLASS">
  -  <font id="CLASS"><xsl:apply-templates/></font>
  - </xsl:template>
  -
  - <xsl:template match="java:CONST">
  -  <font id="CONST"><xsl:apply-templates/></font>
  - </xsl:template>
  -
  - <xsl:template match="java:CONTINUE">
  -  <font id="CONTINUE"><xsl:apply-templates/></font>
  - </xsl:template>
  -
  - <xsl:template match="java:DEFAULT">
  -  <font id="DEFAULT"><xsl:apply-templates/></font>
  - </xsl:template>
  -
  - <xsl:template match="java:DO">
  -  <font id="DO"><xsl:apply-templates/></font>
  - </xsl:template>
  -
  - <xsl:template match="java:DOUBLE">
  -  <font id="DOUBLE"><xsl:apply-templates/></font>
  - </xsl:template>
  -
  - <xsl:template match="java:ELSE">
  -  <font id="ELSE"><xsl:apply-templates/></font>
  - </xsl:template>
  -
  - <xsl:template match="java:EXTENDS">
  -  <font id="EXTENDS"><xsl:apply-templates/></font>
  - </xsl:template>
  -
  - <xsl:template match="java:FALSE">
  -  <font id="FALSE"><xsl:apply-templates/></font>
  - </xsl:template>
  -
  - <xsl:template match="java:FINAL">
  -  <font id="FINAL"><xsl:apply-templates/></font>
  - </xsl:template>
  -
  - <xsl:template match="java:FINALLY">
  -  <font id="FINALLY"><xsl:apply-templates/></font>
  - </xsl:template>
  -
  - <xsl:template match="java:FLOAT">
  -  <font id="FLOAT"><xsl:apply-templates/></font>
  - </xsl:template>
  +      <td width="100%" align="left" valign="top">
   
  - <xsl:template match="java:FOR">
  -  <font id="FOR"><xsl:apply-templates/></font>
  - </xsl:template>
  -
  - <xsl:template match="java:GOTO">
  -  <font id="GOTO"><xsl:apply-templates/></font>
  - </xsl:template>
  +       <p>
  +        <table width="100%" cellpadding="3" cellspacing="0" class="view">
  +         <tr>
  +          <td valign="top" class="headerTitle">
  +           <a href="index.html"><b>Package</b></a>&#160;&#160;&#160;
  +           <a href="{$class}.class.html"><b>Class</b></a>&#160;&#160;&#160;
  +           <font class="current">File</font>
  +          </td>
  +         </tr>
  +        </table>
  +       </p>
  +
  +       <p>
  +        <table width="100%" cellspacing="0" cellpadding="0" class="view">
  +         <tr>
  +          <td class="headerTitle" colspan="2"><b><nobr>&#160;Source file: <xsl:value-of select="$class"/>.java&#160;</nobr></b></td>
  +         </tr>
  +         <tr>
  +          <td align="right" class="lineCount">
  +           <pre><xsl:call-template name="linenumber">
  +             <xsl:with-param name="max" select="count(//lex:lexeme[@symbol='EOL'])"/>
  +            </xsl:call-template>
  +           </pre>
  +          </td>
  +          <td class="srcLine">
  +           <pre class="srcLine"><xsl:apply-templates select="lex:lexemes/lex:lexeme"/></pre>
  +          </td>
  +         </tr>
  +        </table>
  +       </p>
   
  - <xsl:template match="java:IF">
  -  <font id="IF"><xsl:apply-templates/></font>
  - </xsl:template>
  -
  - <xsl:template match="java:IMPLEMENTS">
  -  <font id="IMPLEMENTS"><xsl:apply-templates/></font>
  - </xsl:template>
  -
  - <xsl:template match="java:IMPORT">
  -  <font id="IMPORT"><xsl:apply-templates/></font>
  - </xsl:template>
  -
  - <xsl:template match="java:INSTANCEOF">
  -  <font id="INSTANCEOF"><xsl:apply-templates/></font>
  - </xsl:template>
  -
  - <xsl:template match="java:INT">
  -  <font id="INT"><xsl:apply-templates/></font>
  - </xsl:template>
  -
  - <xsl:template match="java:INTERFACE">
  -  <font id="INTERFACE"><xsl:apply-templates/></font>
  - </xsl:template>
  -
  - <xsl:template match="java:LONG">
  -  <font id="LONG"><xsl:apply-templates/></font>
  - </xsl:template>
  -
  - <xsl:template match="java:NATIVE">
  -  <font id="NATIVE"><xsl:apply-templates/></font>
  - </xsl:template>
  -
  - <xsl:template match="java:NEW">
  -  <font id="NEW"><xsl:apply-templates/></font>
  - </xsl:template>
  -
  - <xsl:template match="java:PACKAGE">
  -  <font id="PACKAGE"><xsl:apply-templates/></font>
  - </xsl:template>
  -
  - <xsl:template match="java:PRIVATE">
  -  <font id="PRIVATE"><xsl:apply-templates/></font>
  - </xsl:template>
  -
  - <xsl:template match="java:PROTECTED">
  -  <font id="PROTECTED"><xsl:apply-templates/></font>
  - </xsl:template>
  -
  - <xsl:template match="java:PUBLIC">
  -  <font id="PUBLIC"><xsl:apply-templates/></font>
  - </xsl:template>
  +      </td>
  +     </tr>
  +    </table>
   
  - <xsl:template match="java:RETURN">
  -  <font id="RETURN"><xsl:apply-templates/></font>
  - </xsl:template>
  +    <p>
  +     <table width="100%">
  +      <tr><td class="hbreak" colspan="6">&#160;</td></tr>
  +      <tr>
  +       <td class="footer" colspan="6">
  +        <table>
  +         <tr>
  +          <td>
  +           <i>Generated by</i>
  +           <a target="_new" href="http://chaperon.sourceforge.net">Chaperon</a>.
  +          </td>
  +          <td>&#160;</td>
  +          <td style="BORDER-LEFT: #9c9c9c 1px solid;">&#160;</td>
  +          <td>&#160;</td>
  +         </tr>
  +        </table>
  +       </td>
  +      </tr>
  +     </table>
  +    </p>
   
  - <xsl:template match="java:SHORT">
  -  <font id="SHORT"><xsl:apply-templates/></font>
  +   </body>
  +  </html>
    </xsl:template>
   
  - <xsl:template match="java:STATIC">
  -  <font id="STATIC"><xsl:apply-templates/></font>
  + <xsl:template match="package">
  +  <a href="/{$prefix}{translate(@full,'.','/')}/index.html"><xsl:value-of select="@full"/></a><br/>
    </xsl:template>
   
  - <xsl:template match="java:SUPER">
  -  <font id="SUPER"><xsl:apply-templates/></font>
  + <xsl:template match="class">
  +  <a href="/{$prefix}{translate(@full,'.','/')}.java.html"><xsl:value-of select="@name"/></a><br/>
    </xsl:template>
   
  - <xsl:template match="java:SWITCH">
  -  <font id="SWITCH"><xsl:apply-templates/></font>
  + <xsl:template name="linenumber">
  +  <xsl:param name="nr">1</xsl:param>
  +  <xsl:param name="max">1</xsl:param>&#160;<xsl:value-of select="$nr"/><xsl:text>
  +</xsl:text><xsl:if test="$nr &lt;= $max">
  +   <xsl:call-template name="linenumber">
  +     <xsl:with-param name="nr"  select="$nr + 1"/>
  +     <xsl:with-param name="max" select="$max"/>
  +   </xsl:call-template>
  +  </xsl:if>
    </xsl:template>
   
  - <xsl:template match="java:SYCHRONIZED">
  -  <font id="SYCHRONIZED"><xsl:apply-templates/></font>
  + <xsl:template match="lex:lexeme[@symbol='ABSTRACT']">
  +  <font class="ABSTRACT"><xsl:value-of select="@text"/></font>
    </xsl:template>
   
  - <xsl:template match="java:THIS">
  -  <font id="THIS"><xsl:apply-templates/></font>
  + <xsl:template match="lex:lexeme[@symbol='BOOLEAN']">
  +  <font class="BOOLEAN"><xsl:value-of select="@text"/></font>
    </xsl:template>
   
  - <xsl:template match="java:THROW">
  -  <font id="THROW"><xsl:apply-templates/></font>
  + <xsl:template match="lex:lexeme[@symbol='BREAK']">
  +  <font class="BREAK"><xsl:value-of select="@text"/></font>
    </xsl:template>
   
  - <xsl:template match="java:THROWS">
  -  <font id="THROWS"><xsl:apply-templates/></font>
  + <xsl:template match="lex:lexeme[@symbol='BYTE']">
  +  <font class="BYTE"><xsl:value-of select="@text"/></font>
    </xsl:template>
   
  - <xsl:template match="java:TRANSIENT">
  -  <font id="TRANSIENT"><xsl:apply-templates/></font>
  + <xsl:template match="lex:lexeme[@symbol='CASE']">
  +  <font class="CASE"><xsl:value-of select="@text"/></font>
    </xsl:template>
   
  - <xsl:template match="java:TRUE">
  -  <font id="TRUE"><xsl:apply-templates/></font>
  + <xsl:template match="lex:lexeme[@symbol='CATCH']">
  +  <font class="CATCH"><xsl:value-of select="@text"/></font>
    </xsl:template>
   
  - <xsl:template match="java:TRY">
  -  <font id="TRY"><xsl:apply-templates/></font>
  + <xsl:template match="lex:lexeme[@symbol='CHAR']">
  +  <font class="CHAR"><xsl:value-of select="@text"/></font>
    </xsl:template>
   
  - <xsl:template match="java:VOID">
  -  <font id="VOID"><xsl:apply-templates/></font>
  + <xsl:template match="lex:lexeme[@symbol='CLASS']">
  +  <font class="CLASS"><xsl:value-of select="@text"/></font>
    </xsl:template>
   
  - <xsl:template match="java:VOLATILE">
  -  <font id="VOLATILE"><xsl:apply-templates/></font>
  + <xsl:template match="lex:lexeme[@symbol='CONST']">
  +  <font class="CONST"><xsl:value-of select="@text"/></font>
    </xsl:template>
   
  - <xsl:template match="java:WHILE">
  -  <font id="WHILE"><xsl:apply-templates/></font>
  + <xsl:template match="lex:lexeme[@symbol='CONTINUE']">
  +  <font class="CONTINUE"><xsl:value-of select="@text"/></font>
    </xsl:template>
   
  - <xsl:template match="java:LITERAL">
  -  <font id="LITERAL"><xsl:apply-templates/></font>
  + <xsl:template match="lex:lexeme[@symbol='DEFAULT']">
  +  <font class="DEFAULT"><xsl:value-of select="@text"/></font>
    </xsl:template>
   
  - <xsl:template match="java:IDENTIFIER">
  -  <font id="IDENTIFIER"><xsl:apply-templates/></font> 
  + <xsl:template match="lex:lexeme[@symbol='DO']">
  +  <font class="DO"><xsl:value-of select="@text"/></font>
    </xsl:template>
   
  - <xsl:template match="java:DOPEN">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='DOUBLE']">
  +  <font class="DOUBLE"><xsl:value-of select="@text"/></font>
    </xsl:template>
   
  - <xsl:template match="java:DCLOSE">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='ELSE']">
  +  <font class="ELSE"><xsl:value-of select="@text"/></font>
    </xsl:template>
   
  - <xsl:template match="java:COPEN">
  -  <xsl:apply-templates/>
  - </xsl:template>
  -  
  - <xsl:template match="java:CCLOSE">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='EXTENDS']">
  +  <font class="EXTENDS"><xsl:value-of select="@text"/></font>
    </xsl:template>
   
  - <xsl:template match="java:BOPEN">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='FALSE']">
  +  <font class="FALSE"><xsl:value-of select="@text"/></font>
    </xsl:template>
   
  - <xsl:template match="java:BCLOSE">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='FINAL']">
  +  <font class="FINAL"><xsl:value-of select="@text"/></font>
    </xsl:template>
   
  - <xsl:template match="java:SEMICOLON">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='FINALLY']">
  +  <font class="FINALLY"><xsl:value-of select="@text"/></font>
    </xsl:template>
   
  - <xsl:template match="java:COMMA">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='FLOAT']">
  +  <font class="FLOAT"><xsl:value-of select="@text"/></font>
    </xsl:template>
   
  - <xsl:template match="java:DOT">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='FOR']">
  +  <font class="FOR"><xsl:value-of select="@text"/></font>
    </xsl:template>
   
  - <xsl:template match="java:OP_EQ">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='GOTO']">
  +  <font class="GOTO"><xsl:value-of select="@text"/></font>
    </xsl:template>
   
  - <xsl:template match="java:OP_LE">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='IF']">
  +  <font class="IF"><xsl:value-of select="@text"/></font>
    </xsl:template>
   
  - <xsl:template match="java:OP_GE">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='IMPLEMENTS']">
  +  <font class="IMPLEMENTS"><xsl:value-of select="@text"/></font>
    </xsl:template>
   
  - <xsl:template match="java:OP_NE">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='IMPORT']">
  +  <font class="IMPORT"><xsl:value-of select="@text"/></font>
    </xsl:template>
   
  - <xsl:template match="java:OP_LOR">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='INSTANCEOF']">
  +  <font class="INSTANCEOF"><xsl:value-of select="@text"/></font>
    </xsl:template>
   
  - <xsl:template match="java:OP_LAND">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='INT']">
  +  <font class="INT"><xsl:value-of select="@text"/></font>
    </xsl:template>
   
  - <xsl:template match="java:OP_INC">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='INTERFACE']">
  +  <font class="INTERFACE"><xsl:value-of select="@text"/></font>
    </xsl:template>
   
  - <xsl:template match="java:OP_DEC">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='LONG']">
  +  <font class="LONG"><xsl:value-of select="@text"/></font>
    </xsl:template>
   
  - <xsl:template match="java:OP_SHR">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='NATIVE']">
  +  <font class="NATIVE"><xsl:value-of select="@text"/></font>
    </xsl:template>
   
  - <xsl:template match="java:OP_SHL">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='NEW']">
  +  <font class="NEW"><xsl:value-of select="@text"/></font>
    </xsl:template>
   
  - <xsl:template match="java:OP_SHRR">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='PACKAGE']">
  +  <font class="PACKAGE"><xsl:value-of select="@text"/></font>
    </xsl:template>
   
  - <xsl:template match="java:ASS_OP">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='PRIVATE']">
  +  <font class="PRIVATE"><xsl:value-of select="@text"/></font>
    </xsl:template>
   
  - <xsl:template match="java:EQ">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='PROTECTED']">
  +  <font class="PROTECTED"><xsl:value-of select="@text"/></font>
    </xsl:template>
   
  - <xsl:template match="java:GT">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='PUBLIC']">
  +  <font class="PUBLIC"><xsl:value-of select="@text"/></font>
    </xsl:template>
   
  - <xsl:template match="java:LT">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='RETURN']">
  +  <font class="RETURN"><xsl:value-of select="@text"/></font>
    </xsl:template>
   
  - <xsl:template match="java:NOT">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='SHORT']">
  +  <font class="SHORT"><xsl:value-of select="@text"/></font>
    </xsl:template>
   
  - <xsl:template match="java:TILDE">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='STATIC']">
  +  <font class="STATIC"><xsl:value-of select="@text"/></font>
    </xsl:template>
   
  - <xsl:template match="java:QM">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='SUPER']">
  +  <font class="SUPER"><xsl:value-of select="@text"/></font>
    </xsl:template>
   
  - <xsl:template match="java:COLON">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='SWITCH']">
  +  <font class="SWITCH"><xsl:value-of select="@text"/></font>
    </xsl:template>
   
  - <xsl:template match="java:PLUS">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='SYCHRONIZED']">
  +  <font class="SYCHRONIZED"><xsl:value-of select="@text"/></font>
    </xsl:template>
   
  - <xsl:template match="java:MINUS">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='THIS']">
  +  <font class="THIS"><xsl:value-of select="@text"/></font>
    </xsl:template>
   
  - <xsl:template match="java:MULT">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='THROW']">
  +  <font class="THROW"><xsl:value-of select="@text"/></font>
    </xsl:template>
   
  - <xsl:template match="java:DIV">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='THROWS']">
  +  <font class="THROWS"><xsl:value-of select="@text"/></font>
    </xsl:template>
   
  - <xsl:template match="java:AND">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='TRANSIENT']">
  +  <font class="TRANSIENT"><xsl:value-of select="@text"/></font>
    </xsl:template>
   
  - <xsl:template match="java:OR">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='TRUE']">
  +  <font class="TRUE"><xsl:value-of select="@text"/></font>
    </xsl:template>
   
  - <xsl:template match="java:XOR">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='TRY']">
  +  <font class="TRY"><xsl:value-of select="@text"/></font>
    </xsl:template>
   
  - <xsl:template match="java:MOD">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='VOID']">
  +  <font class="VOID"><xsl:value-of select="@text"/></font>
    </xsl:template>
   
  - <xsl:template match="java:BOOLLIT">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='VOLATILE']">
  +  <font class="VOLATILE"><xsl:value-of select="@text"/></font>
    </xsl:template>
   
  - <xsl:template match="java:eol">
  -  <xsl:text>
  -</xsl:text>
  + <xsl:template match="lex:lexeme[@symbol='WHILE']">
  +  <font class="WHILE"><xsl:value-of select="@text"/></font>
    </xsl:template>
   
  - <xsl:template match="java:whitespace">
  -  <!--<xsl:text><xsl:value-of select="."/></xsl:text>-->
  -  <xsl:value-of select="."/>
  + <xsl:template match="lex:lexeme[@symbol='LITERAL']">
  +  <font class="LITERAL"><xsl:value-of select="@text"/></font>
    </xsl:template>
   
  - <xsl:template match="java:comment">
  -  <font id="MultiLineComment"><xsl:value-of select="."/></font>
  + <xsl:template match="lex:lexeme[@symbol='IDENTIFIER']">
  +  <font class="IDENTIFIER"><xsl:value-of select="@text"/></font> 
    </xsl:template>
   
  - <xsl:template match="java:TypeSpecifier">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='DOPEN']">
  +  <xsl:value-of select="@text"/>
    </xsl:template>
   
  - <xsl:template match="java:TypeName">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='DCLOSE']">
  +  <xsl:value-of select="@text"/>
    </xsl:template>
   
  - <xsl:template match="java:ClassNameList">
  -  <xsl:apply-templates/>
  - </xsl:template>
  -  
  - <xsl:template match="java:PrimitiveType">
  -  <xsl:apply-templates/>
  - </xsl:template>
  -  
  - <xsl:template match="java:SemiColons">
  -  <xsl:apply-templates/>
  - </xsl:template>
  -  
  - <xsl:template match="java:ProgramFile">
  -  <xsl:apply-templates/>
  - </xsl:template>
  -  
  - <xsl:template match="java:PackageStatement">
  -  <xsl:apply-templates/>
  - </xsl:template>
  -  
  - <xsl:template match="java:TypeDeclarations">
  -  <xsl:apply-templates/>
  - </xsl:template>
  -  
  - <xsl:template match="java:TypeDeclarationOptSemi">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='COPEN']">
  +  <xsl:value-of select="@text"/>
    </xsl:template>
     
  - <xsl:template match="java:ImportStatements">
  -  <xsl:apply-templates/>
  - </xsl:template>
  -  
  - <xsl:template match="java:ImportStatement">
  -  <xsl:apply-templates/>
  - </xsl:template>
  -  
  - <xsl:template match="java:QualifiedName">
  -  <xsl:choose>
  -   <xsl:when test="$selected=local-name(.)">
  -    <span class="selected"><xsl:apply-templates/></span>
  -   </xsl:when>
  -   <xsl:otherwise>
  -    <xsl:apply-templates/>
  -   </xsl:otherwise>
  -  </xsl:choose>
  - </xsl:template>
  -  
  - <xsl:template match="java:TypeDeclaration">
  -  <xsl:apply-templates/>
  - </xsl:template>
  -  
  - <xsl:template match="java:ClassHeader">
  -  <xsl:apply-templates/>
  - </xsl:template>
  -  
  - <xsl:template match="java:Modifiers">
  -  <xsl:apply-templates/>
  - </xsl:template>
  -  
  - <xsl:template match="java:Modifier">
  -  <xsl:apply-templates/>
  - </xsl:template>
  -  
  - <xsl:template match="java:ClassWord">
  -  <xsl:apply-templates/>
  - </xsl:template>
  -  
  - <xsl:template match="java:Interfaces">
  -  <xsl:apply-templates/>
  - </xsl:template>
  -  
  - <xsl:template match="java:FieldDeclarations">
  -  <xsl:apply-templates/>
  - </xsl:template>
  -  
  - <xsl:template match="java:FieldDeclarationOptSemi">
  -  <xsl:apply-templates/>
  - </xsl:template>
  -  
  - <xsl:template match="java:FieldDeclaration">
  -  <xsl:apply-templates/>
  - </xsl:template>
  -  
  - <xsl:template match="java:FieldVariableDeclaration">
  -  <xsl:choose>
  -   <xsl:when test="$selected=local-name(.)">
  -    <span class="selected"><xsl:apply-templates/></span>
  -   </xsl:when>
  -   <xsl:otherwise>
  -    <xsl:apply-templates/>
  -   </xsl:otherwise>
  -  </xsl:choose>
  - </xsl:template>
  -  
  - <xsl:template match="java:VariableDeclarators">
  -  <xsl:apply-templates/>
  - </xsl:template>
  -  
  - <xsl:template match="java:VariableDeclarator">
  -  <xsl:apply-templates/>
  - </xsl:template>
  -  
  - <xsl:template match="java:VariableInitializer">
  -  <xsl:apply-templates/>
  - </xsl:template>
  -  
  - <xsl:template match="java:ArrayInitializers">
  -  <xsl:apply-templates/>
  - </xsl:template>
  -  
  - <xsl:template match="java:MethodDeclaration">
  -  <xsl:choose>
  -   <xsl:when test="$selected=local-name(.)">
  -    <span class="selected"><xsl:apply-templates/></span>
  -   </xsl:when>
  -   <xsl:otherwise>
  -    <xsl:apply-templates/>
  -   </xsl:otherwise>
  -  </xsl:choose>
  - </xsl:template>
  -  
  - <xsl:template match="java:MethodDeclarator">
  -  <xsl:apply-templates/>
  - </xsl:template>
  -  
  - <xsl:template match="java:ParameterList">
  -  <xsl:apply-templates/>
  - </xsl:template>
  -  
  - <xsl:template match="java:Parameter">
  -  <xsl:apply-templates/>
  - </xsl:template>
  -  
  - <xsl:template match="java:DeclaratorName">
  -  <xsl:apply-templates/>
  - </xsl:template>
  -
  - <xsl:template match="java:Throws">
  -  <xsl:apply-templates/>
  - </xsl:template>
  -
  - <xsl:template match="java:MethodBody">
  -  <xsl:apply-templates/>
  - </xsl:template>
  -
  - <xsl:template match="java:ConstructorDeclaration">
  -  <xsl:apply-templates/>
  - </xsl:template>
  -
  - <xsl:template match="java:ConstructorDeclarator">
  -  <xsl:apply-templates/>
  - </xsl:template>
  -
  - <xsl:template match="java:StaticInitializer">
  -  <xsl:apply-templates/>
  - </xsl:template>
  -
  - <xsl:template match="java:NonStaticInitializer">
  -  <xsl:apply-templates/>
  - </xsl:template>
  -
  - <xsl:template match="java:Extends">
  -  <xsl:apply-templates/>
  - </xsl:template>
  -
  - <xsl:template match="java:Block">
  -  <xsl:apply-templates/>
  - </xsl:template>
  -
  - <xsl:template match="java:LocalVariableDeclarationsAndStatements">
  -  <xsl:apply-templates/>
  - </xsl:template>
  -
  - <xsl:template match="java:LocalVariableDeclarationOrStatement">
  -  <xsl:apply-templates/>
  - </xsl:template>
  -
  - <xsl:template match="java:LocalVariableDeclarationStatement">
  -  <xsl:apply-templates/>
  - </xsl:template>
  -
  - <xsl:template match="java:Statement">
  -  <xsl:apply-templates/>
  - </xsl:template>
  -
  - <xsl:template match="java:EmptyStatement">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='CCLOSE']">
  +  <xsl:value-of select="@text"/>
    </xsl:template>
   
  - <xsl:template match="java:LabelStatement">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='BOPEN']">
  +  <xsl:value-of select="@text"/>
    </xsl:template>
   
  - <xsl:template match="java:ExpressionStatement">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='BCLOSE']">
  +  <xsl:value-of select="@text"/>
    </xsl:template>
   
  - <xsl:template match="java:SelectionStatement">
  -  <xsl:choose>
  -   <xsl:when test="$selected=local-name(.)">
  -    <span class="selected"><xsl:apply-templates/></span>
  -   </xsl:when>
  -   <xsl:otherwise>
  -    <xsl:apply-templates/>
  -   </xsl:otherwise>
  -  </xsl:choose>
  + <xsl:template match="lex:lexeme[@symbol='SEMICOLON']">
  +  <xsl:value-of select="@text"/>
    </xsl:template>
   
  - <xsl:template match="java:IterationStatement">
  -  <xsl:choose>
  -   <xsl:when test="$selected=local-name(.)">
  -    <span class="selected"><xsl:apply-templates/></span>
  -   </xsl:when>
  -   <xsl:otherwise>
  -    <xsl:apply-templates/>
  -   </xsl:otherwise>
  -  </xsl:choose>
  + <xsl:template match="lex:lexeme[@symbol='COMMA']">
  +  <xsl:value-of select="@text"/>
    </xsl:template>
   
  - <xsl:template match="java:ForInit">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='DOT']">
  +  <xsl:value-of select="@text"/>
    </xsl:template>
   
  - <xsl:template match="java:ForExpr">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='OP_EQ']">
  +  <xsl:value-of select="@text"/>
    </xsl:template>
   
  - <xsl:template match="java:ForIncr">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='OP_LE']">
  +  <xsl:value-of select="@text"/>
    </xsl:template>
   
  - <xsl:template match="java:ExpressionStatements">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='OP_GE']">
  +  <xsl:value-of select="@text"/>
    </xsl:template>
   
  - <xsl:template match="java:JumpStatement">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='OP_NE']">
  +  <xsl:value-of select="@text"/>
    </xsl:template>
   
  - <xsl:template match="java:GuardingStatement">
  -  <xsl:choose>
  -   <xsl:when test="$selected=local-name(.)">
  -    <span class="selected"><xsl:apply-templates/></span>
  -   </xsl:when>
  -   <xsl:otherwise>
  -    <xsl:apply-templates/>
  -   </xsl:otherwise>
  -  </xsl:choose>
  + <xsl:template match="lex:lexeme[@symbol='OP_LOR']">
  +  <xsl:value-of select="@text"/>
    </xsl:template>
   
  - <xsl:template match="java:Catches">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='OP_LAND']">
  +  <xsl:value-of select="@text"/>
    </xsl:template>
   
  - <xsl:template match="java:Catch">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='OP_INC']">
  +  <xsl:value-of select="@text"/>
    </xsl:template>
   
  - <xsl:template match="java:CatchHeader">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='OP_DEC']">
  +  <xsl:value-of select="@text"/>
    </xsl:template>
   
  - <xsl:template match="java:Finally">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='OP_SHR']">
  +  <xsl:value-of select="@text"/>
    </xsl:template>
   
  - <xsl:template match="java:PrimaryExpression">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='OP_SHL']">
  +  <xsl:value-of select="@text"/>
    </xsl:template>
   
  - <xsl:template match="java:NotJustName">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='OP_SHRR']">
  +  <xsl:value-of select="@text"/>
    </xsl:template>
   
  - <xsl:template match="java:ComplexPrimary">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='ASS_OP']">
  +  <xsl:value-of select="@text"/>
    </xsl:template>
   
  - <xsl:template match="java:ComplexPrimaryNoParenthesis">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='EQ']">
  +  <xsl:value-of select="@text"/>
    </xsl:template>
   
  - <xsl:template match="java:ArrayAccess">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='GT']">
  +  <xsl:value-of select="@text"/>
    </xsl:template>
   
  - <xsl:template match="java:FieldAccess">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='LT']">
  +  <xsl:value-of select="@text"/>
    </xsl:template>
   
  - <xsl:template match="java:MethodCall">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='NOT']">
  +  <xsl:value-of select="@text"/>
    </xsl:template>
   
  - <xsl:template match="java:MethodAccess">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='TILDE']">
  +  <xsl:value-of select="@text"/>
    </xsl:template>
   
  - <xsl:template match="java:SpecialName">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='QM']">
  +  <xsl:value-of select="@text"/>
    </xsl:template>
   
  - <xsl:template match="java:ArgumentList">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='COLON']">
  +  <xsl:value-of select="@text"/>
    </xsl:template>
   
  - <xsl:template match="java:NewAllocationExpression">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='PLUS']">
  +  <xsl:value-of select="@text"/>
    </xsl:template>
   
  - <xsl:template match="java:PlainNewAllocationExpression">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='MINUS']">
  +  <xsl:value-of select="@text"/>
    </xsl:template>
   
  - <xsl:template match="java:ClassAllocationExpression">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='MULT']">
  +  <xsl:value-of select="@text"/>
    </xsl:template>
   
  - <xsl:template match="java:ArrayAllocationExpression">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='DIV']">
  +  <xsl:value-of select="@text"/>
    </xsl:template>
   
  - <xsl:template match="java:DimExprs">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='AND']">
  +  <xsl:value-of select="@text"/>
    </xsl:template>
   
  - <xsl:template match="java:DimExpr">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='OR']">
  +  <xsl:value-of select="@text"/>
    </xsl:template>
   
  - <xsl:template match="java:Dims">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='XOR']">
  +  <xsl:value-of select="@text"/>
    </xsl:template>
   
  - <xsl:template match="java:PostfixExpression">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='MOD']">
  +  <xsl:value-of select="@text"/>
    </xsl:template>
   
  - <xsl:template match="java:RealPostfixExpression">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='BOOLLIT']">
  +  <xsl:value-of select="@text"/>
    </xsl:template>
   
  - <xsl:template match="java:UnaryExpression">
  -  <xsl:apply-templates/>
  - </xsl:template>
  -
  - <xsl:template match="java:LogicalUnaryExpression">
  -  <xsl:apply-templates/>
  - </xsl:template>
  -
  - <xsl:template match="java:LogicalUnaryOperator">
  -  <xsl:apply-templates/>
  - </xsl:template>
  -
  - <xsl:template match="java:ArithmeticUnaryOperator">
  -  <xsl:apply-templates/>
  - </xsl:template>
  -
  - <xsl:template match="java:CastExpression">
  -  <xsl:apply-templates/>
  - </xsl:template>
  -
  - <xsl:template match="java:PrimitiveTypeExpression">
  -  <xsl:apply-templates/>
  - </xsl:template>
  -
  - <xsl:template match="java:ClassTypeExpression">
  -  <xsl:apply-templates/>
  - </xsl:template>
  -
  - <xsl:template match="java:MultiplicativeExpression">
  -  <xsl:apply-templates/>
  - </xsl:template>
  -
  - <xsl:template match="java:AdditiveExpression">
  -  <xsl:apply-templates/>
  - </xsl:template>
  -
  - <xsl:template match="java:ShiftExpression">
  -  <xsl:apply-templates/>
  - </xsl:template>
  -
  - <xsl:template match="java:RelationalExpression">
  -  <xsl:apply-templates/>
  - </xsl:template>
  -
  - <xsl:template match="java:EqualityExpression">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='EOL']">
  +  <xsl:text>
  +&#160;</xsl:text>
  +<!--  <br/>-->
    </xsl:template>
   
  - <xsl:template match="java:AndExpression">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='SPACES']">
  +  <xsl:text><xsl:value-of select="@text"/></xsl:text>
    </xsl:template>
   
  - <xsl:template match="java:ExclusiveOrExpression">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='TAB']">
  +  <xsl:text>  </xsl:text>
    </xsl:template>
   
  - <xsl:template match="java:InclusiveOrExpression">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='JAVADOC']">
  +  <font class="MultiLineComment">/*<xsl:apply-templates select="lex:lexemes/*"/>/</font>
    </xsl:template>
   
  - <xsl:template match="java:ConditionalAndExpression">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='MULTILINECOMMENT']">
  +<!--  <font class="MultiLineComment">/<xsl:apply-templates select="lex:lexemes/*"/>/</font>-->
  +  <font class="MultiLineComment"><xsl:value-of select="@text"/></font>
    </xsl:template>
   
  - <xsl:template match="java:ConditionalOrExpression">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='SINGLEMULTILINECOMMENT']">
  +  <font class="MultiLineComment"><xsl:value-of select="@text"/></font>
    </xsl:template>
   
  - <xsl:template match="java:ConditionalExpression">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='ASTERISK']">
  +  <xsl:value-of select="@text"/>
    </xsl:template>
   
  - <xsl:template match="java:AssignmentExpression">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='TEXT']">
  +  <xsl:value-of select="@text"/>
    </xsl:template>
   
  - <xsl:template match="java:AssignmentOperator">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='TAG']">
  +  <xsl:value-of select="@text"/>
    </xsl:template>
   
  - <xsl:template match="java:Expression">
  -  <xsl:apply-templates/>
  + <xsl:template match="lex:lexeme[@symbol='PROPERTYNAME']">
  +  <xsl:value-of select="@text"/>
    </xsl:template>
   
  - <xsl:template match="java:ConstantExpression">
  -  <xsl:apply-templates/>
  - </xsl:template>
  +<!-- <xsl:template match="text()" priority="-1">
  +  <xsl:value-of select="."/>
  + </xsl:template>-->
   
  - <xsl:template match="@*|*|text()|processing-instruction()" priority="-1">
  +<!-- <xsl:template match="@*|*|text()|processing-instruction()" priority="-1">
     <xsl:copy>
      <xsl:apply-templates select="@*|*|text()|processing-instruction()"/>
     </xsl:copy>
  - </xsl:template>
  + </xsl:template>-->
   
   </xsl:stylesheet>
  
  
  
  1.2       +5 -5      xml-cocoon2/src/blocks/chaperon/samples/stylesheets/mathexp2html.xsl
  
  Index: mathexp2html.xsl
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/blocks/chaperon/samples/stylesheets/mathexp2html.xsl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- mathexp2html.xsl	31 Jan 2003 19:20:02 -0000	1.1
  +++ mathexp2html.xsl	3 Feb 2003 19:15:36 -0000	1.2
  @@ -1,10 +1,10 @@
   <?xml version="1.0"?>
   <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
  -                xmlns:m="http://chaperon.sourceforge.net/grammar/mathexp/1.0"
  -                xmlns="http://www.w3.org/1999/xhtml" version="1.0">
  +                xmlns:st="http://chaperon.sourceforge.net/schema/syntaxtree/1.0"
  +                version="1.0">
   
   
  - <xsl:template match="m:E">
  + <xsl:template match="st:E">
     <table bgcolor="#a0ffff" cellspacing="1">
      <tr>
       <xsl:for-each select="child::node()">
  @@ -16,7 +16,7 @@
     </table>
    </xsl:template>
   
  - <xsl:template match="m:F">
  + <xsl:template match="st:F">
     <table bgcolor="#ffffa0" cellspacing="1">
      <tr>
       <xsl:for-each select="child::node()">
  @@ -28,7 +28,7 @@
     </table>
    </xsl:template>
   
  - <xsl:template match="m:T">
  + <xsl:template match="st:T">
     <table bgcolor="#ffa0ff" cellspacing="1">
      <tr>
       <xsl:for-each select="child::node()">
  
  
  
  1.2       +51 -51    xml-cocoon2/src/blocks/chaperon/samples/stylesheets/wiki2html.xsl
  
  Index: wiki2html.xsl
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/blocks/chaperon/samples/stylesheets/wiki2html.xsl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- wiki2html.xsl	31 Jan 2003 19:20:02 -0000	1.1
  +++ wiki2html.xsl	3 Feb 2003 19:15:36 -0000	1.2
  @@ -1,20 +1,20 @@
   <?xml version="1.0"?>
   <xsl:stylesheet version="1.0"
                   xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
  -                xmlns:wiki="http://chaperon.sourceforge.net/grammar/wiki/1.0"
  +                xmlns:st="http://chaperon.sourceforge.net/schema/syntaxtree/1.0"
                   xmlns="http://www.w3.org/1999/xhtml">
   
    <xsl:output indent="yes" method="html"/>
   
  - <xsl:template match="/">
  +<!-- <xsl:template match="/">
     <xsl:choose>
  -   <xsl:when test="wiki:wiki">
  +   <xsl:when test="st:wiki">
       <html>
        <head>
         <title>Wiki example</title>
        </head>
        <body>
  -      <xsl:apply-templates select="wiki:wiki/wiki:paragraphs/wiki:paragraph"/>
  +      <xsl:apply-templates select="st:wiki/st:paragraphs/st:paragraph"/>
        </body>
       </html>   
      </xsl:when>
  @@ -22,7 +22,7 @@
       <xsl:apply-templates/>
      </xsl:otherwise>
     </xsl:choose>
  - </xsl:template>
  + </xsl:template>-->
   
    <xsl:template match="//wiki">
     <div style="background: #b9d3ee; border: thin; border-color: black; border-style: solid; padding-left: 0.8em; 
  @@ -31,134 +31,134 @@
     </div>
    </xsl:template>
   
  - <xsl:template match="wiki:paragraph" >
  -  <xsl:apply-templates select="wiki:bulletedlist|wiki:numberedlist1|wiki:numberedlist2|wiki:numberedlist3|wiki:headitem|wiki:footnote|wiki:textitem|wiki:LINE"/>
  + <xsl:template match="st:paragraph" >
  +  <xsl:apply-templates select="st:bulletedlist|st:numberedlist1|st:numberedlist2|st:numberedlist3|st:headitem|st:footnote|st:textitem|st:LINE"/>
    </xsl:template>
   
  - <xsl:template match="wiki:textitem" >
  + <xsl:template match="st:textitem" >
     <p>
  -   <xsl:apply-templates select="wiki:firstblock|wiki:textblock"/>
  +   <xsl:apply-templates select="st:firstblock|st:textblock"/>
     </p>
    </xsl:template>
   
  - <xsl:template match="wiki:textblock" >
  -  <xsl:apply-templates select="wiki:LINK|wiki:boldblock|wiki:italicblock|wiki:underlineblock|wiki:TEXT|wiki:note"/>
  + <xsl:template match="st:textblock" >
  +  <xsl:apply-templates select="st:LINK|st:boldblock|st:italicblock|st:underlineblock|st:TEXT|st:note"/>
    </xsl:template>
   
  - <xsl:template match="wiki:firstblock" >
  -  <xsl:apply-templates select="wiki:LINK|wiki:boldblock|wiki:italicblock|wiki:underlineblock|wiki:TEXT"/>
  + <xsl:template match="st:firstblock" >
  +  <xsl:apply-templates select="st:LINK|st:boldblock|st:italicblock|st:underlineblock|st:TEXT"/>
    </xsl:template>
   
  - <xsl:template match="wiki:LINE" >
  + <xsl:template match="st:LINE" >
     <hr/>
    </xsl:template>
   
  - <xsl:template match="wiki:bulletedlist" >
  + <xsl:template match="st:bulletedlist" >
     <ul>
  -   <xsl:apply-templates select="wiki:bulletedlistitem"/>
  +   <xsl:apply-templates select="st:bulletedlistitem"/>
     </ul>
    </xsl:template>
   
  - <xsl:template match="wiki:bulletedlistitem" >
  + <xsl:template match="st:bulletedlistitem" >
     <li>
  -   <xsl:apply-templates select="wiki:textblock"/>
  +   <xsl:apply-templates select="st:textblock"/>
     </li>
    </xsl:template>
   
  - <xsl:template match="wiki:numberedlist1" >
  + <xsl:template match="st:numberedlist1" >
     <ol>
  -   <xsl:apply-templates select="wiki:numberedlistitem1|wiki:numberedlist2"/>
  +   <xsl:apply-templates select="st:numberedlistitem1|st:numberedlist2"/>
     </ol>
    </xsl:template>
   
  - <xsl:template match="wiki:numberedlistitem1" >
  + <xsl:template match="st:numberedlistitem1" >
     <li>
  -   <xsl:apply-templates select="wiki:textblock"/>
  +   <xsl:apply-templates select="st:textblock"/>
     </li>
    </xsl:template>
   
  - <xsl:template match="wiki:numberedlist2" >
  + <xsl:template match="st:numberedlist2" >
     <ol>
  -   <xsl:apply-templates select="wiki:numberedlistitem2|wiki:numberedlist3"/>
  +   <xsl:apply-templates select="st:numberedlistitem2|st:numberedlist3"/>
     </ol>
    </xsl:template>
       
  - <xsl:template match="wiki:numberedlistitem2" >
  + <xsl:template match="st:numberedlistitem2" >
     <li>
  -   <xsl:apply-templates select="wiki:textblock"/>
  +   <xsl:apply-templates select="st:textblock"/>
     </li>
    </xsl:template>
   
  - <xsl:template match="wiki:numberedlist3" >
  + <xsl:template match="st:numberedlist3" >
     <ol>
  -   <xsl:apply-templates select="wiki:numberedlistitem3"/>
  +   <xsl:apply-templates select="st:numberedlistitem3"/>
     </ol>
    </xsl:template>
       
  - <xsl:template match="wiki:numberedlistitem3" >
  + <xsl:template match="st:numberedlistitem3" >
     <li>
  -   <xsl:apply-templates select="wiki:textblock"/>
  +   <xsl:apply-templates select="st:textblock"/>
     </li>
    </xsl:template>
   
  - <xsl:template match="wiki:headitem" >
  + <xsl:template match="st:headitem" >
     <xsl:choose>
  -   <xsl:when test="string-length(wiki:HEAD)=2">
  +   <xsl:when test="string-length(st:HEAD)=2">
       <h2>
  -     <xsl:apply-templates select="wiki:textblock"/>
  +     <xsl:apply-templates select="st:textblock"/>
       </h2>
      </xsl:when>
  -   <xsl:when test="string-length(wiki:HEAD)=3">
  +   <xsl:when test="string-length(st:HEAD)=3">
       <h3>
  -     <xsl:apply-templates select="wiki:textblock"/>
  +     <xsl:apply-templates select="st:textblock"/>
       </h3>
      </xsl:when>
      <xsl:otherwise>
       <h1>
  -     <xsl:apply-templates select="wiki:textblock"/>
  +     <xsl:apply-templates select="st:textblock"/>
       </h1>
      </xsl:otherwise>
     </xsl:choose>
    </xsl:template>
   
  - <xsl:template match="wiki:footnote" >
  -  <a name="{normalize-space(wiki:note/wiki:TEXT|wiki:note/wiki:LINK)}">
  -   [<xsl:apply-templates select="wiki:note/wiki:TEXT|wiki:note/wiki:LINK"/>]
  -   <xsl:apply-templates select="wiki:textblock"/>
  + <xsl:template match="st:footnote" >
  +  <a name="{normalize-space(st:note/st:TEXT|st:note/st:LINK)}">
  +   [<xsl:apply-templates select="st:note/st:TEXT|st:note/st:LINK"/>]
  +   <xsl:apply-templates select="st:textblock"/>
     </a>
    </xsl:template>
   
  - <xsl:template match="wiki:LINK" >
  + <xsl:template match="st:LINK" >
     <a href="{normalize-space(.)}">
      <xsl:value-of select="."/>
     </a>
    </xsl:template>
   
  - <xsl:template match="wiki:boldblock" >
  + <xsl:template match="st:boldblock" >
     <b>
  -   <xsl:value-of select="wiki:TEXT"/>
  +   <xsl:value-of select="st:TEXT"/>
     </b>
    </xsl:template>
   
  - <xsl:template match="wiki:italicblock" >
  + <xsl:template match="st:italicblock" >
     <i>
  -   <xsl:value-of select="wiki:TEXT"/>
  +   <xsl:value-of select="st:TEXT"/>
     </i>
    </xsl:template>
   
  - <xsl:template match="wiki:underlineblock" >
  + <xsl:template match="st:underlineblock" >
     <u>
  -   <xsl:value-of select="wiki:TEXT"/>
  +   <xsl:value-of select="st:TEXT"/>
     </u><xsl:text> </xsl:text>
    </xsl:template>
   
  - <xsl:template match="wiki:note" >
  -  <a href="#{normalize-space(wiki:TEXT|wiki:LINK)}">
  -   [<xsl:apply-templates select="wiki:TEXT|wiki:LINK"/>]
  + <xsl:template match="st:note" >
  +  <a href="#{normalize-space(st:TEXT|st:LINK)}">
  +   [<xsl:apply-templates select="st:TEXT|st:LINK"/>]
     </a>
    </xsl:template>
   
  - <xsl:template match="wiki:TEXT" >
  + <xsl:template match="st:TEXT" >
     <xsl:value-of select="."/>
    </xsl:template>
   
  
  
  
  1.1                  xml-cocoon2/src/blocks/chaperon/samples/stylesheets/class2html.xsl
  
  Index: class2html.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet version="1.0"
                  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
                  xmlns:st="http://chaperon.sourceforge.net/schema/syntaxtree/1.0">
  
   <xsl:output indent="no"/>
  
   <xsl:param name="package"/>
   <xsl:param name="class"/>
  
   <xsl:param name="prefix">cocoon/samples/chaperon/</xsl:param>
  
   <xsl:template match="/java">
    <html>
     <head>
      <title>Java2HTML</title>
      <link rel="stylesheet" type="text/css" href="java.css" title="Style"/>
     </head>
     <body>
  
      <table>
       <tr>
        <td align="left" valign="top">
         <p>
         <table width="100%" cellpadding="3" cellspacing="0" class="view">
          <tr>
           <td valign="top" class="headerTitle">
            <b>Packages</b>
           </td>
          </tr>
          <tr>
           <td class="headerRight">
            <xsl:apply-templates select="packages/package"/>
           </td>
          </tr>
         </table>
         </p>
         <p>
         <table width="100%" cellpadding="3" cellspacing="0" class="view">
          <tr>
           <td valign="top" class="headerTitle">
            <b>Classes</b>
           </td>
          </tr>
          <tr>
           <td class="headerRight">
            <xsl:apply-templates select="packages/classes/class"/>
           </td>
          </tr>
         </table>
         </p>
        </td>
        <td width="100%" align="left" valign="top">
  
         <p>
          <table width="100%" cellpadding="3" cellspacing="0" class="view">
           <tr>
            <td valign="top" class="headerTitle">
             <div class="navBar">
              <a href="index.html"><b>Package</b></a>&#160;&#160;&#160;
              <font class="current">Class</font>&#160;&#160;&#160;
              <a href="{$class}.java.html"><b>File</b></a>
             </div>
            </td>
           </tr>
          </table>
         </p>
  
         <xsl:call-template name="header"/>
     
         <xsl:call-template name="declaration"/>
  
        </td>
       </tr>
      </table>
  
      <p>
       <table width="100%">
        <tr><td class="hbreak">&#160;</td></tr>
        <tr>
         <td class="footer">
          <table>
           <tr>
            <td>
             <i>Generated by</i>
             <a target="_new" href="http://chaperon.sourceforge.net">Chaperon</a>.
            </td>
            <td>&#160;</td>
            <td style="BORDER-LEFT: #9c9c9c 1px solid;">&#160;</td>
            <td>&#160;</td>
           </tr>
          </table>
         </td>
        </tr>
       </table>
      </p>
  
     </body>
    </html>
   </xsl:template>
  
   <xsl:template match="package">
    <a href="/{$prefix}{translate(@full,'.','/')}/index.html"><xsl:value-of select="@full"/></a><br/>
   </xsl:template>
  
   <xsl:template match="class">
    <a href="/{$prefix}{translate(@full,'.','/')}.class.html"><xsl:value-of select="@name"/></a><br/>
   </xsl:template>
  
   <xsl:template name="header">
    <p>
     <table width="100%" cellpadding="3" cellspacing="0" class="view">
      <tbody>
       <tr>
        <td class="headerTitle" colspan="4"><b>&#160;Summary&#160;</b></td>
       </tr>
       <tr>
        <td class="headerLeft"><b><nobr>&#160;Package&#160;</nobr></b></td>
        <td class="header"><b>&#160;Type&#160;</b></td>
        <td class="header"><b>&#160;Name&#160;</b></td>
        <td class="headerRight"><b>&#160;Description&#160;</b></td>
       </tr>
       <tr>
        <td class="itemLeft"><xsl:value-of select="st:CompilationUnit/st:ProgramFile/
                    st:PackageStatement/st:QualifiedName"/></td>
        <td class="item"><xsl:value-of select="st:CompilationUnit/st:ProgramFile/
                                              st:TypeDeclarations/st:TypeDeclarationOptSemi/
                                          st:TypeDeclaration/st:ClassHeader/st:ClassWord"/></td>
        <td class="item"><xsl:value-of select="st:CompilationUnit/st:ProgramFile/
                                              st:TypeDeclarations/st:TypeDeclarationOptSemi/
                                          st:TypeDeclaration/st:ClassHeader/st:IDENTIFIER"/></td>
        <td class="itemRight"><xsl:apply-templates select="st:CompilationUnit/st:ProgramFile/
                                              st:TypeDeclarations/st:TypeDeclarationOptSemi/
                                          st:TypeDeclaration/st:JavaDoc" mode="short"/>&#160;</td>
       </tr>
      </tbody>
     </table>
    </p>
   </xsl:template>
  
   <xsl:template name="declaration">
    <xsl:apply-templates select="st:CompilationUnit/st:ProgramFile/st:TypeDeclarations/
                                 st:TypeDeclarationOptSemi/st:TypeDeclaration/st:FieldDeclarations"/>
   </xsl:template>
  
   
  
   <xsl:template match="st:FieldDeclarations">
    <p>
     <table width="100%" cellpadding="3" cellspacing="0" class="view">
      <tbody>
       <tr>
        <td class="headerTitle" colspan="4"><b>&#160;Field Summary&#160;</b></td>
       </tr>
       <tr>
        <td class="headerLeft"><b><nobr>&#160;Modifier&#160;</nobr></b></td>
        <td class="header"><b>&#160;Type&#160;</b></td>
        <td class="header"><b>&#160;Name&#160;</b></td>
        <td class="headerRight"><b>&#160;Description&#160;</b></td>
       </tr>
       <xsl:apply-templates select="st:FieldDeclarationOptSemi/st:FieldDeclaration/st:FieldVariableDeclaration"/>
      </tbody>
     </table>
    </p>
  
    <p>
     <table width="100%" cellpadding="3" cellspacing="0" class="view">
      <tbody>
       <tr>
        <td class="headerTitle" colspan="3"><b>&#160;Constructor Summary&#160;</b></td>
       </tr>
       <tr>
        <td class="headerLeft"><b><nobr>&#160;Modifier&#160;</nobr></b></td>
        <td class="header"><b>&#160;Name&#160;</b></td>
        <td class="headerRight"><b>&#160;Description&#160;</b></td>
       </tr>
       <xsl:apply-templates select="st:FieldDeclarationOptSemi/st:FieldDeclaration/st:ConstructorDeclaration"/>
      </tbody>
     </table>
    </p>
  
    <p>
     <table width="100%" cellpadding="3" cellspacing="0" class="view">
      <tbody>
       <tr>
        <td class="headerTitle" colspan="4"><b>&#160;Method Summary&#160;</b></td>
       </tr>
       <tr>
        <td class="headerLeft"><b><nobr>&#160;Modifier&#160;</nobr></b></td>
        <td class="header"><b>&#160;Type&#160;</b></td>
        <td class="header"><b>&#160;Name&#160;</b></td>
        <td class="headerRight"><b>&#160;Description&#160;</b></td>
       </tr>
       <xsl:apply-templates select="st:FieldDeclarationOptSemi/st:FieldDeclaration/st:MethodDeclaration"/>
      </tbody>
     </table>
    </p>
  
    <xsl:apply-templates select="st:FieldDeclarationOptSemi/st:FieldDeclaration/st:MethodDeclaration" mode="detail"/>
  
   </xsl:template>
  
   <xsl:template match="st:FieldVariableDeclaration">
    <xsl:if test="not(contains(st:Modifiers/st:Modifier,'private'))">
    <tr>
     <td class="itemLeft">
      <nobr>
       <xsl:for-each select="st:Modifiers/st:Modifier">
        <xsl:value-of select="."/>&#160;
       </xsl:for-each>
      </nobr>
     </td>
     <td class="item">&#160;<xsl:value-of select="st:TypeSpecifier"/></td>
     <td class="item">
      <xsl:value-of select="st:VariableDeclarators/st:VariableDeclarator/st:DeclaratorName"/>
     </td>
     <td class="itemRight">
      <xsl:apply-templates select="st:JavaDoc" mode="short"/>&#160;
     </td>
    </tr>
    </xsl:if>
   </xsl:template>
  
   <xsl:template match="st:FieldVariableDeclaration" mode="detail">
   </xsl:template>
  
   <xsl:template match="st:ConstructorDeclaration">
    <tr>
     <td class="itemLeft">
      <nobr>
       <xsl:for-each select="st:Modifiers/st:Modifier">
        <xsl:value-of select="."/>&#160;
       </xsl:for-each>
      </nobr>
     </td>
     <td class="item">
      <nobr>
       <xsl:value-of select="st:ConstructorDeclarator/st:IDENTIFIER"/>
       (<xsl:for-each select="st:ConstructorDeclarator/st:ParameterList/st:Parameter">
        <xsl:if test="position()!=1">&#160;,</xsl:if>
         <xsl:value-of select="st:TypeSpecifier/st:TypeName"/>&#160;<xsl:value-of select="st:DeclaratorName"/>
       </xsl:for-each>)
      </nobr>
     </td>
     <td class="itemRight">
      <xsl:apply-templates select="st:JavaDoc" mode="short"/>&#160;
     </td>
    </tr>
   </xsl:template>
  
   <xsl:template match="st:ConstructorDeclaration" mode="detail">
   </xsl:template>
  
   <xsl:template match="st:MethodDeclaration">
    <tr>
     <td class="itemLeft">
      <nobr>
       <xsl:for-each select="st:Modifiers/st:Modifier">
        <xsl:value-of select="."/>&#160;
       </xsl:for-each>
      </nobr>
     </td>
     <td class="item"><xsl:value-of select="st:TypeSpecifier"/></td>
     <td class="item">
      <nobr>
       <xsl:value-of select="st:MethodDeclarator/st:DeclaratorName"/>
       (<xsl:for-each select="st:MethodDeclarator/st:ParameterList/st:Parameter">
        <xsl:if test="position()!=1">&#160;,</xsl:if>
         <xsl:value-of select="st:TypeSpecifier/st:TypeName"/>&#160;<xsl:value-of select="st:DeclaratorName"/>
       </xsl:for-each>)
      </nobr>
     </td>
     <td class="itemRight">
      <xsl:apply-templates select="st:JavaDoc" mode="short"/>&#160;
     </td>
    </tr>
   </xsl:template>
  
   <xsl:template match="st:MethodDeclaration" mode="detail">
    <p>
     <table width="100%" cellpadding="3" cellspacing="0" class="view">
      <tr>
       <td class="headerTitle" colspan="4">
  <!--<b>&#160;Method Detail&#160;</b>-->
        <b>
        <nobr>
         <xsl:for-each select="st:Modifiers/st:Modifier">
          <xsl:value-of select="."/>&#160;
         </xsl:for-each>
         <xsl:value-of select="st:TypeSpecifier"/>&#160;
         <xsl:value-of select="st:MethodDeclarator/st:DeclaratorName"/>
         (<xsl:for-each select="st:MethodDeclarator/st:ParameterList/st:Parameter">
          <xsl:if test="position()!=1">&#160;,</xsl:if>
           <xsl:value-of select="st:TypeSpecifier/st:TypeName"/>&#160;<xsl:value-of select="st:DeclaratorName"/>
         </xsl:for-each>)
        </nobr>
        </b>
       </td>
      </tr>
      <tr>
       <td class="itemRight">
   
  <!--      <p>
        <nobr>
         <xsl:for-each select="st:Modifiers/st:Modifier">
          <xsl:value-of select="."/>&#160;
         </xsl:for-each>
         <xsl:value-of select="st:TypeSpecifier"/>&#160;
         <xsl:value-of select="st:MethodDeclarator/st:DeclaratorName"/>
         (<xsl:for-each select="st:MethodDeclarator/st:ParameterList/st:Parameter">
          <xsl:if test="position()!=1">&#160;,</xsl:if>
           <xsl:value-of select="st:TypeSpecifier/st:TypeName"/>&#160;<xsl:value-of select="st:DeclaratorName"/>
         </xsl:for-each>)
        </nobr>
        </p>-->
  
        <dl>
         <dd><xsl:apply-templates select="st:JavaDoc"/></dd>
  
         <dt><b>Parameters:</b></dt>
  
         <xsl:for-each select="st:MethodDeclarator/st:ParameterList/st:Parameter">
          <dd>
           <code><xsl:value-of select="st:DeclaratorName"/></code><xsl:text> - </xsl:text>
           <xsl:variable name="name"><xsl:value-of select="st:DeclaratorName"/></xsl:variable> 
           <xsl:for-each select="../../../st:JavaDoc/st:Properties/
                st:Property[substring-after(st:PROPERTYNAME,'@')='param']/st:Description">
            <xsl:if test="starts-with(.,$name)">
             <xsl:value-of select="substring(.,string-length($name)+1,string-length(.)-string-length($name))"/>
  <!--               <xsl:value-of select="."/>-->
            </xsl:if>
           </xsl:for-each>
          </dd>
         </xsl:for-each>
  
         <dt><b>Returns:</b></dt>
         <dd>
          <code><xsl:value-of select="st:TypeSpecifier"/></code>
          <xsl:if test="st:JavaDoc/st:Properties/st:Property[substring-after(st:PROPERTYNAME,'@')='return']/st:Description">
           <xsl:text> - </xsl:text>
          </xsl:if>
          <xsl:value-of select="st:JavaDoc/st:Properties/st:Property[substring-after(st:PROPERTYNAME,'@')='return']/st:Description"/>
         </dd>
        </dl>
  
       </td>
      </tr>
     </table>
    </p>
   </xsl:template>
  
   <xsl:template match="st:JavaDoc">
    <xsl:apply-templates select="st:Description"/>
   </xsl:template>
  
   <xsl:template match="st:JavaDoc" mode="short">
    <xsl:choose>
     <xsl:when test="string-length(substring-before(st:Description/st:TEXT,'.'))>0">
      <xsl:value-of select="substring-before(st:Description/st:TEXT,'.')"/>
     </xsl:when>
     <xsl:otherwise>
      <xsl:value-of select="st:Description/st:TEXT"/>
     </xsl:otherwise>
    </xsl:choose>
   </xsl:template>
  
   <xsl:template match="st:Description">
    <xsl:apply-templates select="st:TEXT|st:TAG"/>
   </xsl:template>
  
   <xsl:template match="st:TAG">
    <xsl:text disable-output-escaping="yes"><xsl:value-of select="."/></xsl:text>
   </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  xml-cocoon2/src/blocks/chaperon/samples/stylesheets/grm2xgrm.xsl
  
  Index: grm2xgrm.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet version="1.0"
                  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
                  xmlns:st="http://chaperon.sourceforge.net/schema/syntaxtree/1.0"
                  xmlns="http://chaperon.sourceforge.net/schema/grammar/1.0"
                  exclude-result-prefixes="st text">
  
   <xsl:output indent="yes" method="xml" encoding="ASCII"/>
  
   <xsl:template match="st:grammar" >
    <grammar>
     <priority>
      <xsl:apply-templates select="st:token_decls/st:token_decl" mode="priority"/>
     </priority>
     <xsl:apply-templates select="st:token_decls/st:token_decl" mode="associativity"/>
     <xsl:apply-templates select="st:production_decls"/>
     <xsl:apply-templates select="st:token_decls/st:start_decl"/>
    </grammar>
   </xsl:template>
  
   <xsl:template match="st:token_decl" mode="priority">
    <terminal symbol="{st:id}"/>
   </xsl:template>
  
   <xsl:template match="st:token_decl" mode="associativity">
    <xsl:if test="st:token_decl = '%left'">
     <associativity symbol="{st:id}" type="left"/>
    </xsl:if>
    <xsl:if test="st:token_decl = '%right'">
     <associativity symbol="{st:id}" type="right"/>
    </xsl:if>
   </xsl:template>
  
   <xsl:template match="st:production_decls" >
    <xsl:for-each select="st:production_decl/st:production_defs/st:production_def">
     <production>
      <xsl:attribute name="symbol"><xsl:value-of select="../../st:id"/></xsl:attribute>
       
      <xsl:if test="st:prec_decl">
       <xsl:attribute name="precedence"><xsl:value-of select="st:prec_decl/st:id"/></xsl:attribute>
      </xsl:if>
  
      <xsl:apply-templates select="st:ids/st:id"/>
     </production>
    </xsl:for-each>
   </xsl:template>
  
   <xsl:template match="st:id" >
    <xsl:variable name="symbol" select="text()"/>
    <xsl:choose>
     <xsl:when test="/st:grammar/st:token_decls/st:token_decl/st:id[.=$symbol]">
      <terminal symbol="{.}"/>
     </xsl:when>
     <xsl:otherwise>
      <nonterminal symbol="{.}"/>
     </xsl:otherwise>
    </xsl:choose>
   </xsl:template>
  
   <xsl:template match="st:start_decl" >
    <start symbol="{st:id}"/>
   </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  xml-cocoon2/src/blocks/chaperon/samples/stylesheets/grm2xlex.xsl
  
  Index: grm2xlex.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet version="1.0"
                  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
                  xmlns:st="http://chaperon.sourceforge.net/schema/syntaxtree/1.0"
                  xmlns="http://chaperon.sourceforge.net/schema/lexicon/1.0"
                  exclude-result-prefixes="st text">
  
   <xsl:output indent="yes" method="xml" encoding="ASCII"/>
  
   <xsl:template match="st:grammar" >
    <lexicon>
     <xsl:apply-templates select="st:token_decls/st:token_decl | st:token_decls/st:ignorabletoken_decl"/>
    </lexicon>
   </xsl:template>
  
   <xsl:template match="st:token_decl" >
    <lexeme symbol="{st:id}">
     <xsl:if test="st:token_decl = '%left'">
      <xsl:attribute name="assoc">left</xsl:attribute>
     </xsl:if>
     <xsl:if test="st:token_decl = '%right'">
      <xsl:attribute name="assoc">right</xsl:attribute>
     </xsl:if>
     <xsl:apply-templates select="st:regexexpression"/>
    </lexeme>
   </xsl:template>
  
   <xsl:template match="st:ignorabletoken_decl" >
    <lexeme>
     <xsl:apply-templates select="st:regexexpression"/>
    </lexeme>
   </xsl:template>
  
   <xsl:template match="st:regexexpression" >
    <xsl:apply-templates select="st:regexalternation"/>
   </xsl:template>
  
   <xsl:template match="st:regexalternation" >
    <xsl:choose>
     <xsl:when test="count(st:regexconcatenation)>1">
      <alt>
       <xsl:apply-templates select="st:regexconcatenation"/>
      </alt>
     </xsl:when>
     <xsl:otherwise>
      <xsl:apply-templates select="st:regexconcatenation"/>
     </xsl:otherwise>
    </xsl:choose>
   </xsl:template>
  
   <xsl:template match="st:regexconcatenation" >
    <xsl:choose>
     <xsl:when test="count(st:regexquantifier)>1">
      <concat>
       <xsl:apply-templates select="st:regexquantifier"/>
      </concat>
     </xsl:when>
     <xsl:otherwise>
      <xsl:apply-templates select="st:regexquantifier"/>
     </xsl:otherwise>
    </xsl:choose>
   </xsl:template>
  
   <xsl:template match="st:regexquantifier" >
    <xsl:apply-templates select="st:regexoptional|st:regexstar|st:regexplus|st:regexterm|st:regexvar"/>
   </xsl:template>
  
   <xsl:template match="st:regexoptional" >
    <concat minOccurs="0" maxOccurs="1">
     <xsl:apply-templates select="st:regexterm"/>
    </concat>
   </xsl:template>
  
   <xsl:template match="st:regexstar" >
    <concat minOccurs="0" maxOccurs="*">
     <xsl:apply-templates select="st:regexterm"/>
    </concat>
   </xsl:template>
  
   <xsl:template match="st:regexplus" >
    <concat minOccurs="1" maxOccurs="*">
     <xsl:apply-templates select="st:regexterm"/>
    </concat>
   </xsl:template>
  
   <xsl:template match="st:regexvar">
    <xsl:choose>
     <xsl:when test="count(st:regexmultiplicator/st:string)=2">
      <concat>
       <xsl:attribute name="minOccurs"><xsl:value-of select="normalize-space(st:regexmultiplicator/st:string[1])"/></xsl:attribute>
       <xsl:attribute name="maxOccurs"><xsl:value-of select="normalize-space(st:regexmultiplicator/st:string[2])"/></xsl:attribute>
       <xsl:apply-templates select="st:regexterm"/>
      </concat>
     </xsl:when>
     <xsl:otherwise>
      <concat>
       <xsl:attribute name="minOccurs"><xsl:value-of select="normalize-space(st:regexmultiplicator/st:string)"/></xsl:attribute>
       <xsl:attribute name="maxOccurs"><xsl:value-of select="normalize-space(st:regexmultiplicator/st:string)"/></xsl:attribute>
       <xsl:apply-templates select="st:regexterm"/>
      </concat>
     </xsl:otherwise>
    </xsl:choose>
   </xsl:template>
  
   <xsl:template match="st:regexterm">
    <xsl:apply-templates select="st:characterclass|st:exclusivecharacterclass|st:regexklammer|st:string|st:maskedcharacter|st:regexdot|st:regexbol|st:regexabref"/>
   </xsl:template>
  
   <xsl:template match="st:regexklammer">
    <xsl:apply-templates select="st:regexalternation"/>
   </xsl:template>
  
   <xsl:template match="st:regexdot">
    <cclass exclusive="true">
     <!--<cset content="&#10;&#13;"/>-->
     <cset code="10"/>
     <cset code="13"/>
    </cclass>
   </xsl:template>
  
   <xsl:template match="st:regexbol">
    <bol/>
   </xsl:template>
  
   <xsl:template match="st:regexeol">
    <eol/>
   </xsl:template>
  
   <xsl:template match="st:regexabref">
    <xsl:variable name="ref" select="translate(normalize-space(st:string), ' ', '')"/>
    <xsl:apply-templates select="/st:grammar/st:token_decls/st:ab_decl[st:id=$ref]/st:regexexpression"/>
   </xsl:template>
  
   <xsl:template match="st:string" mode="name">
    <xsl:for-each select="st:character"><xsl:value-of select="normalize-space(.)"/></xsl:for-each>
   </xsl:template>
  
   <xsl:template match="st:string">
    <cstring>
     <xsl:attribute name="content"><xsl:apply-templates select="st:character" mode="string"/></xsl:attribute>
    </cstring>
   </xsl:template>
  
   <xsl:template match="st:characterclass">
    <cclass>
     <xsl:apply-templates select="st:sequence"/>
    </cclass>
   </xsl:template>
  
   <xsl:template match="st:exclusivecharacterclass" >
    <cclass exclusive="true">
     <xsl:apply-templates select="st:sequence"/>
    </cclass>
   </xsl:template>
  
   <xsl:template match="st:sequence">
    <xsl:apply-templates select="st:character|st:maskedcharacter|st:intervall" mode="cclass"/>
   </xsl:template>
  
   <xsl:template match="st:character" mode="cclass">
    <cset>
     <xsl:attribute name="content"><xsl:value-of select="translate(normalize-space(.), ' ', '')"/></xsl:attribute>
    </cset>
   </xsl:template>
  
   <xsl:template match="st:maskedcharacter" mode="cclass">
    <cset>
     <xsl:choose>
      <xsl:when test="substring(translate(normalize-space(.), ' ', ''), 2,1) = 'n'">
  <!--     <xsl:attribute name="content"><xsl:text disable-output-escaping="yes">&#10;</xsl:text></xsl:attribute>-->
       <xsl:attribute name="code">10</xsl:attribute>
      </xsl:when>
      <xsl:when test="substring(translate(normalize-space(.), ' ', ''), 2,1) = 'r'">
  <!--     <xsl:attribute name="content"><xsl:text disable-output-escaping="yes">&#13;</xsl:text></xsl:attribute>-->
       <xsl:attribute name="code">13</xsl:attribute>
      </xsl:when>
      <xsl:when test="substring(translate(normalize-space(.), ' ', ''), 2,1) = 't'">
  <!--     <xsl:attribute name="content"><xsl:text disable-output-escaping="yes">&#9;</xsl:text></xsl:attribute>-->
       <xsl:attribute name="code">9</xsl:attribute>
      </xsl:when>
      <xsl:when test="substring(translate(normalize-space(.), ' ', ''), 2,1) = 'u'">
       <xsl:attribute name="code">#<xsl:value-of select="substring(translate(normalize-space(.), ' ', ''),2,6)"/></xsl:attribute>
      </xsl:when>
      <xsl:when test="contains(.,'\ ')">
       <xsl:attribute name="content"><xsl:text disable-output-escaping="yes">&#32;</xsl:text></xsl:attribute>
      </xsl:when>
      <xsl:otherwise>
       <xsl:attribute name="content"><xsl:value-of select="substring(translate(normalize-space(.), ' ', ''), 2,1)"/></xsl:attribute>
      </xsl:otherwise>
     </xsl:choose>
    </cset>
   </xsl:template>
  
   <xsl:template match="st:character" mode="string">
    <xsl:value-of select="translate(normalize-space(.), ' ', '')"/>
   </xsl:template>
   
   <xsl:template match="st:maskedcharacter">
    <xsl:choose>
      <xsl:when test="substring(translate(normalize-space(.), ' ', ''), 2,1) = 'n'">
       <!--<xsl:text disable-output-escaping="yes">&#10;</xsl:text>-->
       <cstring code="10"/>
      </xsl:when>
      <xsl:when test="substring(translate(normalize-space(.), ' ', ''), 2,1) = 'r'">
       <!--<xsl:text disable-output-escaping="yes">&#13;</xsl:text>-->
       <cstring code="13"/>
      </xsl:when>
      <xsl:when test="substring(translate(normalize-space(.), ' ', ''), 2,1) = 't'">
       <!--<xsl:text disable-output-escaping="yes">&#9;</xsl:text>-->
       <cstring code="9"/>
      </xsl:when>
      <xsl:when test="substring(translate(normalize-space(.), ' ', ''), 2,1) = 'u'">
       <cstring code="#{substring(translate(normalize-space(.), ' ', ''), 2,6)}"/>
      </xsl:when>
      <xsl:when test="contains(.,'\ ')">
       <!--<xsl:text disable-output-escaping="yes">&#32;</xsl:text>-->
       <cstring content=" "/>
      </xsl:when>
      <xsl:otherwise>
       <cstring content="{substring(translate(normalize-space(.), ' ', ''),2,1)}"/>
      </xsl:otherwise>
     </xsl:choose>
   </xsl:template>
  
   <xsl:template match="st:intervall" mode="cclass">
    <cinterval>
     <xsl:attribute name="min"><xsl:value-of select="st:character[1]"/></xsl:attribute>
     <xsl:attribute name="max"><xsl:value-of select="st:character[2]"/></xsl:attribute>
    </cinterval>
   </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  xml-cocoon2/src/blocks/chaperon/samples/stylesheets/index4java.xsl
  
  Index: index4java.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet version="1.0" 
                  xmlns:dir="http://apache.org/cocoon/directory/2.0"
                  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
   <xsl:template match="/dir:directory">
    <packages>
    <xsl:apply-templates select="dir:directory"/>
  
    <classes>
     <xsl:apply-templates select="//dir:file"/>
    </classes>
    </packages>
   </xsl:template>
  
   <xsl:template match="dir:directory">
    <package name="{@name}">
     <xsl:attribute name="full">
      <xsl:for-each select="ancestor::dir:directory[parent::dir:directory]"><xsl:value-of select="@name"/>.</xsl:for-each>
      <xsl:value-of select="@name"/>
     </xsl:attribute>
  
     <xsl:apply-templates select="dir:file"/>
    </package>
  
    <xsl:apply-templates select="dir:directory"/>
   </xsl:template>
  
   <xsl:template match="dir:file">
    <xsl:if test="substring-after(@name, '.')='java'">
     <class name="{substring-before(@name, '.')}">
      <xsl:attribute name="full">
       <xsl:for-each select="ancestor::dir:directory[parent::dir:directory]"><xsl:value-of select="@name"/>.</xsl:for-each>
       <xsl:value-of select="substring-before(@name, '.')"/>
      </xsl:attribute>
     </class>
    </xsl:if>
   </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  xml-cocoon2/src/blocks/chaperon/samples/stylesheets/mathexp.xsl
  
  Index: mathexp.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
                  xmlns:text="http://chaperon.sourceforge.net/schema/text/1.0"
                  version="1.0">
  
   <xsl:param name="text">3*a-5*6/7 + ( b-c)*5- b</xsl:param>
  
   <xsl:template match="input[@name='text']">
    <input name="text" type="text" size="80" maxlength="110" value="{$text}"/>
   </xsl:template>
  
   <xsl:template match="text:text">
    <text:text><xsl:value-of select="$text"/></text:text>
   </xsl:template>
  
   <xsl:template match="@*|*|text()|processing-instruction()" priority="-1">
    <xsl:copy>
     <xsl:apply-templates select="@*|*|text()|processing-instruction()"/>
    </xsl:copy>
   </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  xml-cocoon2/src/blocks/chaperon/samples/stylesheets/package2html.xsl
  
  Index: package2html.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet version="1.0"
                  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
                  xmlns:lex="http://chaperon.sourceforge.net/schema/lexemes/1.0">
  
   <xsl:output indent="no"/>
  
   <xsl:param name="package"/>
   <xsl:param name="class"/>
  
   <xsl:param name="prefix">cocoon/samples/chaperon/</xsl:param>
  
   <xsl:template match="/">
    <html>
     <head>
      <title>Java2HTML</title>
      <link rel="stylesheet" type="text/css" href="java.css" title="Style"/>
     </head>
     <body>
  
      <table>
       <tr>
        <td align="left" valign="top">
         <p>
         <table width="100%" cellpadding="3" cellspacing="0" class="view">
          <tr>
           <td valign="top" class="headerTitle">
            <b>Packages</b>
           </td>
          </tr>
          <tr>
           <td class="headerRight">
            <xsl:apply-templates select="packages/package"/>
           </td>
          </tr>
         </table>
         </p>
         <p>
         <table width="100%" cellpadding="3" cellspacing="0" class="view">
          <tr>
           <td valign="top" class="headerTitle">
            <b>Classes</b>
           </td>
          </tr>
          <tr>
           <td class="headerRight">
            <xsl:apply-templates select="packages/classes/class"/>
           </td>
          </tr>
         </table>
         </p>
        </td>
        <td width="100%" align="left" valign="top">
  
         <p>
          <table width="100%" cellpadding="3" cellspacing="0" class="view">
           <tr>
            <td valign="top" class="headerTitle">
             <font class="current">Package</font>&#160;&#160;&#160;
             <b>Class</b>&#160;&#160;&#160;
             <b>File</b>
            </td>
           </tr>
          </table>
         </p>
  
         <p>
          <table width="100%" cellpadding="3" cellspacing="0" class="view">
           <tr>
            <td class="headerTitle" colspan="2"><b><nobr>&#160;Package <xsl:value-of select="translate($package,'/','.')"/>&#160;</nobr></b></td>
           </tr>
           <tr>
            <td class="headerLeft">
             Classes
            </td>
            <td class="headerRight">
             Description
            </td>
           </tr>
           <xsl:apply-templates select="packages/package[@full=translate($package,'/','.')]/class" mode="overview"/>
          </table>
         </p>
  
        </td>
       </tr>
      </table>
  
      <p>
       <table width="100%">
        <tr><td class="hbreak" colspan="6">&#160;</td></tr>
        <tr>
         <td class="footer" colspan="6">
          <table>
           <tr>
            <td>
             <i>Generated by</i>
             <a target="_new" href="http://chaperon.sourceforge.net">Chaperon</a>.
            </td>
            <td>&#160;</td>
            <td style="BORDER-LEFT: #9c9c9c 1px solid;">&#160;</td>
            <td>&#160;</td>
           </tr>
          </table>
         </td>
        </tr>
       </table>
      </p>
  
     </body>
    </html>
   </xsl:template>
  
   <xsl:template match="package">
    <a href="/{$prefix}{translate(@full,'.','/')}/index.html"><xsl:value-of select="@full"/></a><br/>
   </xsl:template>
  
   <xsl:template match="class">
    <a href="/{$prefix}{translate(@full,'.','/')}.java.html"><xsl:value-of select="@name"/></a><br/>
   </xsl:template>
  
   <xsl:template match="class" mode="overview">
    <tr>
     <td class="itemLeft">
      <a href="/{$prefix}{translate(@full,'.','/')}.java.html"><xsl:value-of select="@name"/></a>
     </td>
     <td class="itemRight">
      &#160;<br/>
     </td>
    </tr>
   </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  xml-cocoon2/src/blocks/chaperon/samples/stylesheets/remove4class.xsl
  
  Index: remove4class.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet version="1.0" 
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:lex="http://chaperon.sourceforge.net/schema/lexemes/1.0">
  
  <!-- <xsl:template match="lex:lexeme[@symbol='JAVADOCCOMMENT']">
   </xsl:template>-->
  
   <xsl:template match="lex:lexeme[@symbol='MULTILINECOMMENT']">
   </xsl:template>
  
   <xsl:template match="lex:lexeme[@symbol='SINGLELINECOMMENT']">
   </xsl:template>
  
   <xsl:template match="lex:lexeme[@symbol='WHITESPACE']">
   </xsl:template>
  
   <xsl:template match="lex:lexeme[@symbol='EOL']">
   </xsl:template>
  
   <xsl:template match="@*|*|text()|processing-instruction()" priority="-1">
    <xsl:copy>
     <xsl:apply-templates select="@*|*|text()|processing-instruction()"/>
    </xsl:copy>
   </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  xml-cocoon2/src/blocks/chaperon/samples/stylesheets/text4javadoc.xsl
  
  Index: text4javadoc.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet version="1.0" 
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:lex="http://chaperon.sourceforge.net/schema/lexemes/1.0"
      xmlns:text="http://chaperon.sourceforge.net/schema/text/1.0">
  
   <xsl:template match="lex:lexeme[@symbol='JAVADOC']">
    <lex:lexeme symbol="JAVADOC">
     <text:text><xsl:value-of select="substring(@text,3,string-length(@text)-3)"/></text:text>
    </lex:lexeme>
   </xsl:template>
  
  <!-- <xsl:template match="lex:lexeme[@symbol='MULTILINECOMMENT']">
    <lex:lexeme symbol="MULTILINECOMMENT">
     <text:text><xsl:value-of select="substring(@text,2,string-length(@text)-2)"/></text:text>
    </lex:lexeme>
   </xsl:template>-->
  
    <xsl:template match="@*|*|text()|processing-instruction()" priority="-1">
      <xsl:copy>
        <xsl:apply-templates select="@*|*|text()|processing-instruction()"/>
      </xsl:copy>
    </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  xml-cocoon2/src/blocks/chaperon/samples/stylesheets/text4javadoc2.xsl
  
  Index: text4javadoc2.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet version="1.0" 
                  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                  xmlns:st="http://chaperon.sourceforge.net/schema/syntaxtree/1.0"
                  xmlns:text="http://chaperon.sourceforge.net/schema/text/1.0">
  
   <xsl:template match="st:JAVADOC">
    <xsl:variable name="text"><xsl:value-of select="."/></xsl:variable>
    <text:text><xsl:value-of select="substring($text,3,string-length($text)-3)"/></text:text>
   </xsl:template>
  
   <xsl:template match="@*|*|text()|processing-instruction()" priority="-1">
    <xsl:copy>
     <xsl:apply-templates select="@*|*|text()|processing-instruction()"/>
    </xsl:copy>
   </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  xml-cocoon2/src/blocks/chaperon/samples/stylesheets/text4regex.xsl
  
  Index: text4regex.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet version="1.0" 
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:st="http://chaperon.sourceforge.net/schema/syntaxtree/1.0"
      xmlns:text="http://chaperon.sourceforge.net/schema/text/1.0"
      exclude-result-prefixes="st">
  
   <xsl:output encoding="ASCII"/>
  
   <xsl:template match="st:string">
    <text:text><xsl:value-of select="substring(.,2,string-length(.)-2)"/></text:text>
   </xsl:template>
  
    <xsl:template match="@*|*|text()|processing-instruction()" priority="-1">
      <xsl:copy>
        <xsl:apply-templates select="@*|*|text()|processing-instruction()"/>
      </xsl:copy>
    </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.24      +5 -0      xml-cocoon2/src/webapp/WEB-INF/web.xml
  
  Index: web.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/webapp/WEB-INF/web.xml,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- web.xml	30 Jan 2003 07:07:38 -0000	1.23
  +++ web.xml	3 Feb 2003 19:15:36 -0000	1.24
  @@ -376,4 +376,9 @@
       <mime-type>text/plain</mime-type>
     </mime-mapping>
   
  +  <mime-mapping>
  +    <extension>grm</extension>
  +    <mime-type>text/plain</mime-type>
  +  </mime-mapping>
  +
   </web-app>
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message