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
9 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 /* Generated By:JavaCC: Do not edit this line. CharStream.java Version 4.1 */
19 /* JavaCCOptions:STATIC=false */
23 namespace Mono.Lucene.Net.QueryParsers
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
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
40 public interface CharStream
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.
49 /// <summary> Returns the column position of the character last read.</summary>
52 /// <seealso cref="getEndColumn">
57 /// <summary> Returns the line number of the character last read.</summary>
60 /// <seealso cref="getEndLine">
65 /// <summary> Returns the column number of the last character for current token (being
66 /// matched after the last call to BeginTOken).
70 /// <summary> Returns the line number of the last character for current token (being
71 /// matched after the last call to BeginTOken).
75 /// <summary> Returns the column number of the first character for current token (being
76 /// matched after the last call to BeginTOken).
80 /// <summary> Returns the line number of the first character for current token (being
81 /// matched after the last call to BeginTOken).
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.
90 void Backup(int amount);
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.
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.
103 System.String GetImage();
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 :
111 /// String t = GetImage();
112 /// return t.substring(t.length() - len, t.length()).toCharArray();
115 char[] GetSuffix(int len);
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.
124 /* JavaCC - OriginalChecksum=a83909a2403f969f94d18375f9f143e4 (do not edit this line) */