Thumbnail file hits. Based on a patch from D Bera
[beagle.git] / beagled / Lucene.Net / Analysis / Standard / CharStream.cs
blob19285b69160e4c0d6f61f912b1e95770fa5acd68
1 /*
2 * Copyright 2004 The Apache Software Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 /* Generated By:JavaCC: Do not edit this line. CharStream.java Version 3.0 */
18 using System;
19 namespace Lucene.Net.Analysis.Standard
21 public interface CharStream
24 /// <summary> Returns the next character from the selected input. The method
25 /// of selecting the input is the responsibility of the class
26 /// implementing this interface. Can throw any java.io.IOException.
27 /// </summary>
28 char ReadChar();
30 /// <summary> Returns the column position of the character last read.</summary>
31 /// <deprecated>
32 /// </deprecated>
33 /// <seealso cref="#getEndColumn">
34 /// </seealso>
35 int GetColumn();
37 /// <summary> Returns the line number of the character last read.</summary>
38 /// <deprecated>
39 /// </deprecated>
40 /// <seealso cref="#getEndLine">
41 /// </seealso>
42 int GetLine();
44 /// <summary> Returns the column number of the last character for current token (being
45 /// matched after the last call to BeginTOken).
46 /// </summary>
47 int GetEndColumn();
49 /// <summary> Returns the line number of the last character for current token (being
50 /// matched after the last call to BeginTOken).
51 /// </summary>
52 int GetEndLine();
54 /// <summary> Returns the column number of the first character for current token (being
55 /// matched after the last call to BeginTOken).
56 /// </summary>
57 int GetBeginColumn();
59 /// <summary> Returns the line number of the first character for current token (being
60 /// matched after the last call to BeginTOken).
61 /// </summary>
62 int GetBeginLine();
64 /// <summary> Backs up the input stream by amount steps. Lexer calls this method if it
65 /// had already read some characters, but could not use them to match a
66 /// (longer) token. So, they will be used again as the prefix of the next
67 /// token and it is the implemetation's responsibility to do this right.
68 /// </summary>
69 void Backup(int amount);
71 /// <summary> Returns the next character that marks the beginning of the next token.
72 /// All characters must remain in the buffer between two successive calls
73 /// to this method to implement backup correctly.
74 /// </summary>
75 char BeginToken();
77 /// <summary> Returns a string made up of characters from the marked token beginning
78 /// to the current buffer position. Implementations have the choice of returning
79 /// anything that they want to. For example, for efficiency, one might decide
80 /// to just return null, which is a valid implementation.
81 /// </summary>
82 System.String GetImage();
84 /// <summary> Returns an array of characters that make up the suffix of length 'len' for
85 /// the currently matched token. This is used to build up the matched string
86 /// for use in actions in the case of MORE. A simple and inefficient
87 /// implementation of this is as follows :
88 ///
89 /// {
90 /// String t = GetImage();
91 /// return t.substring(t.length() - len, t.length()).toCharArray();
92 /// }
93 /// </summary>
94 char[] GetSuffix(int len);
96 /// <summary> The lexer calls this function to indicate that it is done with the stream
97 /// and hence implementations can free any resources held by this class.
98 /// Again, the body of this function can be just empty and it will not
99 /// affect the lexer's operation.
100 /// </summary>
101 void Done();