* KNotesQueryable.cs: Dont re-index all the notes when the notes file changes. Since...
[beagle.git] / beagled / Lucene.Net / QueryParser / CharStream.cs
blob23e310733a1357d83511cbb9542dde1b70d7dcd4
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 */
19 using System;
21 namespace Lucene.Net.QueryParsers
24 /// <summary> This interface describes a character stream that maintains line and
25 /// column number positions of the characters. It also has the capability
26 /// to backup the stream to some extent. An implementation of this
27 /// interface is used in the TokenManager implementation generated by
28 /// JavaCCParser.
29 ///
30 /// All the methods except backup can be implemented in any fashion. backup
31 /// needs to be implemented correctly for the correct operation of the lexer.
32 /// Rest of the methods are all used to get information like line number,
33 /// column number and the String that constitutes a token and are not used
34 /// by the lexer. Hence their implementation won't affect the generated lexer's
35 /// operation.
36 /// </summary>
38 public interface CharStream
41 /// <summary> Returns the next character from the selected input. The method
42 /// of selecting the input is the responsibility of the class
43 /// implementing this interface. Can throw any java.io.IOException.
44 /// </summary>
45 char ReadChar();
47 /// <summary> Returns the column position of the character last read.</summary>
48 /// <deprecated>
49 /// </deprecated>
50 /// <seealso cref="getEndColumn">
51 /// </seealso>
52 int GetColumn();
54 /// <summary> Returns the line number of the character last read.</summary>
55 /// <deprecated>
56 /// </deprecated>
57 /// <seealso cref="getEndLine">
58 /// </seealso>
59 int GetLine();
61 /// <summary> Returns the column number of the last character for current token (being
62 /// matched after the last call to BeginTOken).
63 /// </summary>
64 int GetEndColumn();
66 /// <summary> Returns the line number of the last character for current token (being
67 /// matched after the last call to BeginTOken).
68 /// </summary>
69 int GetEndLine();
71 /// <summary> Returns the column number of the first character for current token (being
72 /// matched after the last call to BeginTOken).
73 /// </summary>
74 int GetBeginColumn();
76 /// <summary> Returns the line number of the first character for current token (being
77 /// matched after the last call to BeginTOken).
78 /// </summary>
79 int GetBeginLine();
81 /// <summary> Backs up the input stream by amount steps. Lexer calls this method if it
82 /// had already read some characters, but could not use them to match a
83 /// (longer) token. So, they will be used again as the prefix of the next
84 /// token and it is the implemetation's responsibility to do this right.
85 /// </summary>
86 void Backup(int amount);
88 /// <summary> Returns the next character that marks the beginning of the next token.
89 /// All characters must remain in the buffer between two successive calls
90 /// to this method to implement backup correctly.
91 /// </summary>
92 char BeginToken();
94 /// <summary> Returns a string made up of characters from the marked token beginning
95 /// to the current buffer position. Implementations have the choice of returning
96 /// anything that they want to. For example, for efficiency, one might decide
97 /// to just return null, which is a valid implementation.
98 /// </summary>
99 System.String GetImage();
101 /// <summary> Returns an array of characters that make up the suffix of length 'len' for
102 /// the currently matched token. This is used to build up the matched string
103 /// for use in actions in the case of MORE. A simple and inefficient
104 /// implementation of this is as follows :
105 ///
106 /// {
107 /// String t = GetImage();
108 /// return t.substring(t.length() - len, t.length()).toCharArray();
109 /// }
110 /// </summary>
111 char[] GetSuffix(int len);
113 /// <summary> The lexer calls this function to indicate that it is done with the stream
114 /// and hence implementations can free any resources held by this class.
115 /// Again, the body of this function can be just empty and it will not
116 /// affect the lexer's operation.
117 /// </summary>
118 void Done();