Lucene.Net  3.0.3
Lucene.Net is a port of the Lucene search engine library, written in C# and targeted at .NET runtime users.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Pages
Token.cs
Go to the documentation of this file.
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. Token.java Version 3.0 */
19 
20 using System;
21 
22 namespace Lucene.Net.Demo.Html
23 {
24 
25  /// <summary> Describes the input token stream.</summary>
26 
27  public class Token
28  {
29 
30  /// <summary> An integer that describes the kind of this token. This numbering
31  /// system is determined by JavaCCParser, and a table of these numbers is
32  /// stored in the file ...Constants.java.
33  /// </summary>
34  public int kind;
35 
36  /// <summary> beginLine and beginColumn describe the position of the first character
37  /// of this token; endLine and endColumn describe the position of the
38  /// last character of this token.
39  /// </summary>
40  public int beginLine, beginColumn, endLine, endColumn;
41 
42  /// <summary> The string image of the token.</summary>
43  public System.String image;
44 
45  /// <summary> A reference to the next regular (non-special) token from the input
46  /// stream. If this is the last token from the input stream, or if the
47  /// token manager has not read tokens beyond this one, this field is
48  /// set to null. This is true only if this token is also a regular
49  /// token. Otherwise, see below for a description of the contents of
50  /// this field.
51  /// </summary>
52  public Token next;
53 
54  /// <summary> This field is used to access special tokens that occur prior to this
55  /// token, but after the immediately preceding regular (non-special) token.
56  /// If there are no such special tokens, this field is set to null.
57  /// When there are more than one such special token, this field refers
58  /// to the last of these special tokens, which in turn refers to the next
59  /// previous special token through its specialToken field, and so on
60  /// until the first special token (whose specialToken field is null).
61  /// The next fields of special tokens refer to other special tokens that
62  /// immediately follow it (without an intervening regular token). If there
63  /// is no such token, this field is null.
64  /// </summary>
66 
67  /// <summary> Returns the image.</summary>
68  public override System.String ToString()
69  {
70  return image;
71  }
72 
73  /// <summary> Returns a new Token object, by default. However, if you want, you
74  /// can create and return subclass objects based on the value of ofKind.
75  /// Simply add the cases to the switch for all those special cases.
76  /// For example, if you have a subclass of Token called IDToken that
77  /// you want to create if ofKind is ID, simlpy add something like :
78  ///
79  /// case MyParserConstants.ID : return new IDToken();
80  ///
81  /// to the following switch statement. Then you can cast matchedToken
82  /// variable to the appropriate type and use it in your lexical actions.
83  /// </summary>
84  public static Token NewToken(int ofKind)
85  {
86  switch (ofKind)
87  {
88 
89  default: return new Token();
90 
91  }
92  }
93  }
94 }