Merge pull request #409 from Alkarex/patch-1
[mono.git] / mcs / tools / monkeydoc / Lucene.Net / Lucene.Net / QueryParser / CharStream.cs
1 /* 
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements.  See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License.  You may obtain a copy of the License at
8  * 
9  * http://www.apache.org/licenses/LICENSE-2.0
10  * 
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17
18 /* Generated By:JavaCC: Do not edit this line. CharStream.java Version 4.1 */
19 /* JavaCCOptions:STATIC=false */
20
21 using System;
22
23 namespace Mono.Lucene.Net.QueryParsers
24 {
25         
26         /// <summary> This interface describes a character stream that maintains line and
27         /// column number positions of the characters.  It also has the capability
28         /// to backup the stream to some extent.  An implementation of this
29         /// interface is used in the TokenManager implementation generated by
30         /// JavaCCParser.
31         /// 
32         /// All the methods except backup can be implemented in any fashion. backup
33         /// needs to be implemented correctly for the correct operation of the lexer.
34         /// Rest of the methods are all used to get information like line number,
35         /// column number and the String that constitutes a token and are not used
36         /// by the lexer. Hence their implementation won't affect the generated lexer's
37         /// operation.
38         /// </summary>
39         
40         public interface CharStream
41         {
42                 
43                 /// <summary> Returns the next character from the selected input.  The method
44                 /// of selecting the input is the responsibility of the class
45                 /// implementing this interface.  Can throw any java.io.IOException.
46                 /// </summary>
47                 char ReadChar();
48                 
49                 /// <summary> Returns the column position of the character last read.</summary>
50                 /// <deprecated>
51                 /// </deprecated>
52                 /// <seealso cref="getEndColumn">
53                 /// </seealso>
54         [Obsolete]
55                 int GetColumn();
56                 
57                 /// <summary> Returns the line number of the character last read.</summary>
58                 /// <deprecated>
59                 /// </deprecated>
60                 /// <seealso cref="getEndLine">
61                 /// </seealso>
62         [Obsolete]
63                 int GetLine();
64                 
65                 /// <summary> Returns the column number of the last character for current token (being
66                 /// matched after the last call to BeginTOken).
67                 /// </summary>
68                 int GetEndColumn();
69                 
70                 /// <summary> Returns the line number of the last character for current token (being
71                 /// matched after the last call to BeginTOken).
72                 /// </summary>
73                 int GetEndLine();
74                 
75                 /// <summary> Returns the column number of the first character for current token (being
76                 /// matched after the last call to BeginTOken).
77                 /// </summary>
78                 int GetBeginColumn();
79                 
80                 /// <summary> Returns the line number of the first character for current token (being
81                 /// matched after the last call to BeginTOken).
82                 /// </summary>
83                 int GetBeginLine();
84                 
85                 /// <summary> Backs up the input stream by amount steps. Lexer calls this method if it
86                 /// had already read some characters, but could not use them to match a
87                 /// (longer) token. So, they will be used again as the prefix of the next
88                 /// token and it is the implemetation's responsibility to do this right.
89                 /// </summary>
90                 void  Backup(int amount);
91                 
92                 /// <summary> Returns the next character that marks the beginning of the next token.
93                 /// All characters must remain in the buffer between two successive calls
94                 /// to this method to implement backup correctly.
95                 /// </summary>
96                 char BeginToken();
97                 
98                 /// <summary> Returns a string made up of characters from the marked token beginning
99                 /// to the current buffer position. Implementations have the choice of returning
100                 /// anything that they want to. For example, for efficiency, one might decide
101                 /// to just return null, which is a valid implementation.
102                 /// </summary>
103                 System.String GetImage();
104                 
105                 /// <summary> Returns an array of characters that make up the suffix of length 'len' for
106                 /// the currently matched token. This is used to build up the matched string
107                 /// for use in actions in the case of MORE. A simple and inefficient
108                 /// implementation of this is as follows :
109                 /// 
110                 /// {
111                 /// String t = GetImage();
112                 /// return t.substring(t.length() - len, t.length()).toCharArray();
113                 /// }
114                 /// </summary>
115                 char[] GetSuffix(int len);
116                 
117                 /// <summary> The lexer calls this function to indicate that it is done with the stream
118                 /// and hence implementations can free any resources held by this class.
119                 /// Again, the body of this function can be just empty and it will not
120                 /// affect the lexer's operation.
121                 /// </summary>
122                 void  Done();
123         }
124         /* JavaCC - OriginalChecksum=a83909a2403f969f94d18375f9f143e4 (do not edit this line) */
125 }