/*
 * Copyright (C) 2015 Francis Galiegue <fgaliegue@gmail.com>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.github.fge.grappa.run;

import com.github.fge.grappa.run.events.MatchFailureEvent;
import com.github.fge.grappa.run.events.MatchSuccessEvent;
import com.github.fge.grappa.run.events.PostParseEvent;
import com.github.fge.grappa.run.events.PreMatchEvent;
import com.github.fge.grappa.run.events.PreParseEvent;
import com.google.common.eventbus.Subscribe;

import javax.annotation.ParametersAreNonnullByDefault;

@ParametersAreNonnullByDefault
public class ParseRunnerListener<V>
{
    @Subscribe
    public void beforeParse(final PreParseEvent<V> event)
    {
    }

    @Subscribe
    public void beforeMatch(final PreMatchEvent<V> event)
    {
    }

    @Subscribe
    public void matchSuccess(final MatchSuccessEvent<V> event)
    {
    }

    @Subscribe
    public void matchFailure(final MatchFailureEvent<V> event)
    {
    }

    @Subscribe
    public void afterParse(final PostParseEvent<V> event)
    {
    }
}

@@ -928,32 +928,88 @@
 .PreParseEvent;%0A
+import com.github.fge.grappa.run.trace.TracingListener;%0A
 import com.googl
@@ -1098,430 +1098,1964 @@
 t;%0A%0A
-@ParametersAreNonnullByDefault%0Apublic class ParseRunnerListener%3CV%3E%0A%7B%0A    @Subscribe%0A    public void beforeParse(final PreParseEvent%3CV%3E event)%0A    %7B%0A    %7D%0A%0A    @Subscribe%0A    public void beforeMatch(final PreMatchEvent%3CV%3E event)%0A    %7B%0A    %7D%0A%0A    @Subscribe%0A    public void matchSuccess(final MatchSuccessEvent%3CV%3E event)%0A    %7B%0A    %7D%0A%0A    @Subscribe%0A    public void matchFailure(final MatchFailureEvent%3CV%3E event)%0A    %7B%0A    %7D%0A
+/**%0A * A listener which you can register to a %7B@link ListeningParseRunner%7D%0A *%0A * %3Cp%3EYou can register listeners at five different points in the parsing%0A * process:%3C/p%3E%0A *%0A * %3Cul%3E%0A *     %3Cli%3Ebefore the parsing starts;%3C/li%3E%0A *     %3Cli%3Ebefore a match is attempted;%3C/li%3E%0A *     %3Cli%3Eafter a match is attempted, successfully or not (those are two%0A *     separate events);%3C/li%3E%0A *     %3Cli%3Eafter the parsing is completed.%3C/li%3E%0A * %3C/ul%3E%0A *%0A * %3Cp%3EOne example implementation provided with grappa is the %7B@link%0A * TracingListener%7D, which records all parsing events and produces a zip file%0A * which can then be used with the %3Ca href=%22https://github.com/fge/grappa-debugger%22%0A * target=%22_blank%22%3Edebugger%3C/a%3E.%3C/p%3E%0A *%0A * %3Cp%3EAll the default implementations of methods in this class do nothing. A%0A * call to %7B@code super()%7D in implementations is therefore not necessary.%3C/p%3E%0A *%0A * @param %3CV%3E the type of the parser's stack elements%0A *%0A * @see ListeningParseRunner#registerListener(ParseRunnerListener)%0A */%0A@ParametersAreNonnullByDefault%0Apublic class ParseRunnerListener%3CV%3E%0A%7B%0A    /**%0A     * Method called before the parsing process starts%0A     *%0A     * @param event the event%0A     */%0A    @Subscribe%0A    public void beforeParse(final PreParseEvent%3CV%3E event)%0A    %7B%0A    %7D%0A%0A    /**%0A     * Method called before a match is attempted%0A     *%0A     * @param event the event%0A     */%0A    @Subscribe%0A    public void beforeMatch(final PreMatchEvent%3CV%3E event)%0A    %7B%0A    %7D%0A%0A    /**%0A     * Method called when a match is completed with success%0A     *%0A     * @param event the event%0A     */%0A    @Subscribe%0A    public void matchSuccess(final MatchSuccessEvent%3CV%3E event)%0A    %7B%0A    %7D%0A%0A    /**%0A     * Method called when a match has resulted in a failure%0A     *%0A     * @param event the event%0A     */%0A    @Subscribe%0A    public void matchFailure(final MatchFailureEvent%3CV%3E event)%0A    %7B%0A    %7D%0A%0A    /**%0A     * Method called after the parsing process is complete%0A     *%0A     * @param event the event%0A     */
 %0A   

add javadoc