Update years in copyright line
[Sone.git] / src / main / java / net / pterodactylus / sone / text / Parser.java
index ccec36a..f5f8f1b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Sone - Parser.java - Copyright © 2010 David Roden
+ * Sone - Parser.java - Copyright © 2010–2015 David Roden
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -24,19 +24,23 @@ import java.io.Reader;
  * Interface for parsers that can create {@link Part}s from a text source
  * (usually a {@link Reader}).
  *
+ * @param <C>
+ *            The type of the parser context
  * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
  */
-public interface Parser {
+public interface Parser<C extends ParserContext> {
 
        /**
-        * Create a {@link Part} from the given text source.
+        * Create one or more {@link Part}s from the given text source.
         *
+        * @param context
+        *            The parser context (may be {@code null})
         * @param source
         *            The text source
-        * @return The parsed part
+        * @return The parsed parts
         * @throws IOException
         *             if an I/O error occurs
         */
-       public Part parse(Reader source) throws IOException;
+       public Iterable<Part> parse(C context, Reader source) throws IOException;
 
 }