Class Token
Token class used by StreamTokenizer. This represents a single token in the input stream. This is subclassed to provide specific token types, such as CharToken, FloatToken, etc.
Inherited Members
Namespace: RTools_NTS.Util
Assembly: NetTopologySuite.dll
Syntax
public abstract class Token
Constructors
| Edit this page View SourceToken(int)
Construct a Token with the specified line number.
Declaration
public Token(int line)
Parameters
Type | Name | Description |
---|---|---|
int | line | The line number where this token comes from. |
Fields
| Edit this page View Sourceobj
A storage object for the data of this token.
Declaration
protected object obj
Field Value
Type | Description |
---|---|
object |
Properties
| Edit this page View SourceLineNumber
The line number where this token was found. This is base-1.
Declaration
public int LineNumber { get; }
Property Value
Type | Description |
---|---|
int |
Object
The Object stored by this token. This will be a primitive C# type.
Declaration
public object Object { get; }
Property Value
Type | Description |
---|---|
object |
StringValue
Return this token's value as a string.
Declaration
public virtual string StringValue { get; }
Property Value
Type | Description |
---|---|
string | This token's value as a string. |
UntermError
Whether or not there was an unterminated token problem when creating this token. See UntermErrorMessage for a message associated with the problem.
Declaration
public bool UntermError { get; set; }
Property Value
Type | Description |
---|---|
bool |
UntermErrorMsg
The error message if there was an unterminated token error creating this token.
Declaration
public string UntermErrorMsg { get; set; }
Property Value
Type | Description |
---|---|
string |
Methods
| Edit this page View SourceConvertToType(Type)
Create an object of the specified type corresponding to this token.
Declaration
public object ConvertToType(Type t)
Parameters
Type | Name | Description |
---|---|---|
Type | t | The type of object to create. |
Returns
Type | Description |
---|---|
object | The new object, or null for error. |
Equals(char)
Equals overload.
Declaration
public bool Equals(char c)
Parameters
Type | Name | Description |
---|---|---|
char | c | The char to compare to. |
Returns
Type | Description |
---|---|
bool | bool |
Equals(object)
Equals override.
Declaration
public override bool Equals(object other)
Parameters
Type | Name | Description |
---|---|---|
object | other | The object to compare to. |
Returns
Type | Description |
---|---|
bool | bool - true for equals, false otherwise. |
Overrides
| Edit this page View SourceEquals(string)
Equals overload.
Declaration
public bool Equals(string s)
Parameters
Type | Name | Description |
---|---|---|
string | s | The string to compare to. |
Returns
Type | Description |
---|---|
bool | bool |
GetHashCode()
Override. Returns the ToString().GetHashCode().
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | The hash code. |
Overrides
| Edit this page View SourceToDebugString()
Produce a string which includes the token type.
Declaration
public virtual string ToDebugString()
Returns
Type | Description |
---|---|
string |
ToLineString()
Produce a string which includes the line number.
Declaration
public string ToLineString()
Returns
Type | Description |
---|---|
string |
Operators
| Edit this page View Sourceoperator ==(Token, char)
Operator== overload. Compare a token and a char.
Declaration
public static bool operator ==(Token t, char c)
Parameters
Type | Name | Description |
---|---|---|
Token | t | The token to compare. |
char | c | The char. |
Returns
Type | Description |
---|---|
bool | bool |
operator ==(Token, object)
Operator== overload. Compare a token and an object.
Declaration
public static bool operator ==(Token t, object o)
Parameters
Type | Name | Description |
---|---|---|
Token | t | The token to compare. |
object | o | The other object. |
Returns
Type | Description |
---|---|
bool | bool |
operator ==(Token, string)
Operator== overload. Compare a token and a string.
Declaration
public static bool operator ==(Token t, string s)
Parameters
Type | Name | Description |
---|---|---|
Token | t | The token to compare. |
string | s | The string. |
Returns
Type | Description |
---|---|
bool | bool |
operator !=(Token, char)
Operator!= overload. Compare a token and a char.
Declaration
public static bool operator !=(Token t, char c)
Parameters
Type | Name | Description |
---|---|---|
Token | t | The token to compare. |
char | c | The char. |
Returns
Type | Description |
---|---|
bool | bool |
operator !=(Token, object)
Operator!= overload. Compare a token and an object.
Declaration
public static bool operator !=(Token t, object o)
Parameters
Type | Name | Description |
---|---|---|
Token | t | The token to compare. |
object | o | The other object. |
Returns
Type | Description |
---|---|
bool | bool |
operator !=(Token, string)
Operator!= overload. Compare a token and a string.
Declaration
public static bool operator !=(Token t, string s)
Parameters
Type | Name | Description |
---|---|---|
Token | t | The token to compare. |
string | s | The string. |
Returns
Type | Description |
---|---|
bool | bool |