package jp.gr.java_conf.dyama.rink.parser;

import java.io.IOException;

/**
 * Parsing Sample
 * @author Hiroyasu Yamada
 *
 */
public interface Sample {


    /**
     * parse one step  at the current position
     * @return true if the sample can be parsed. return false if the sample can not be parsed any more.
     */
    public boolean parseOneStep();

    /**
     * prepare to re-parse the current sentence
     */
    public void reparse();

    /**
     * prepare to re-parse the current sentence, and set the start position
     * @param start
     */
    public void reparse(int start);

    /**
     * get the sentence
     * @return sentence
     */
    public Sentence getSentence();

    /**
     * read a new sentence and setup.
     * @return true if the reader can read  a new sentence and setup. return false if there is no sentence.
     * @throws IOException if the reader fail to read a sentence from input stream.
     */
    public boolean read() throws IOException;

}

@@ -77,22 +77,27 @@
 %0A * 
-Parsing Sample
+Sample for parsing.
 %0A * 
@@ -170,21 +170,22 @@
 %0A     * 
-p
+P
 arse
+s
  one ste
@@ -366,39 +366,40 @@
 %0A    /**%0A     * 
-p
+P
 repare
+s
  to re-parse the
@@ -471,15 +471,16 @@
   * 
-p
+P
 repare
+s
  to 
@@ -528,32 +528,33 @@
 e start position
+.
 %0A     * @param s
@@ -557,16 +557,36 @@
 am start
+ the start position.
 %0A     */
@@ -638,19 +638,23 @@
 %0A     * 
-g
+R
 et
+urns
  the sen
@@ -654,24 +654,25 @@
 the sentence
+.
 %0A     * @ret
@@ -743,20 +743,21 @@
 %0A     * 
-r
+R
 ead
+s
  a new s
@@ -771,18 +771,21 @@
  and set
+s 
 up
+ 
 .%0A     *
@@ -821,17 +821,16 @@
 an read 
- 
 a new se
@@ -875,16 +875,25 @@
 e is no 
+readable 
 sentence

revise API document