Returns a new Token object, by default. However, if you want, you can create and return subclass objects based on the value of ofKind. Simply add the cases to the switch for all those special cases. For example, if you have a subclass of Token called IDToken that you want to create if ofKind is ID, simply add something like : case MyParserConstants.ID : return new IDToken(ofKind, image); to the following switch statement. Then you can cast matchedToken variable to the appropriate type and use sit in your lexical actions.

Namespace: Lucene.Net.QueryParsers
Assembly: Lucene.Net (in Lucene.Net.dll) Version: 2.9.4.1

Syntax

C#
public static Token NewToken(
	int ofKind,
	string image
)
Visual Basic
Public Shared Function NewToken ( _
	ofKind As Integer, _
	image As String _
) As Token
Visual C++
public:
static Token^ NewToken(
	int ofKind, 
	String^ image
)

Parameters

ofKind
Type: System..::..Int32

[Missing <param name="ofKind"/> documentation for "M:Lucene.Net.QueryParsers.Token.NewToken(System.Int32,System.String)"]

image
Type: System..::..String

[Missing <param name="image"/> documentation for "M:Lucene.Net.QueryParsers.Token.NewToken(System.Int32,System.String)"]

Return Value

[Missing <returns> documentation for "M:Lucene.Net.QueryParsers.Token.NewToken(System.Int32,System.String)"]

See Also