C# Class RTools.Util.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.
ファイルを表示 Open project: PaulMineau/AIMA.Net Class Usage Examples

Protected Properties

Property Type Description
lineNumber int
obj object

Public Methods

Method Description
ConvertToType ( Type t ) : Object

Create an object of the specified type corresponding to this token.

Equals ( char c ) : bool

Equals overload.

Equals ( object other ) : bool

Equals override.

Equals ( string s ) : bool

Equals overload.

GetHashCode ( ) : int

Override. Returns the ToString().GetHashCode().

ToDebugString ( ) : string

Produce a string which includes the token type.

ToLineString ( ) : string

Produce a string which includes the line number.

Token ( int line ) : System

Construct a Token with the specified line number.

operator ( ) : bool

Operator== overload. Compare a token and an object.

Method Details

ConvertToType() public method

Create an object of the specified type corresponding to this token.
public ConvertToType ( Type t ) : Object
t System.Type The type of object to create.
return Object

Equals() public method

Equals overload.
public Equals ( char c ) : bool
c char The char to compare to.
return bool

Equals() public method

Equals override.
public Equals ( object other ) : bool
other object The object to compare to.
return bool

Equals() public method

Equals overload.
public Equals ( string s ) : bool
s string The string to compare to.
return bool

GetHashCode() public method

Override. Returns the ToString().GetHashCode().
public GetHashCode ( ) : int
return int

ToDebugString() public method

Produce a string which includes the token type.
public ToDebugString ( ) : string
return string

ToLineString() public method

Produce a string which includes the line number.
public ToLineString ( ) : string
return string

Token() public method

Construct a Token with the specified line number.
public Token ( int line ) : System
line int The line number where this /// token comes from.
return System

operator() public static method

Operator== overload. Compare a token and an object.
public static operator ( ) : bool
return bool

Property Details

lineNumber protected_oe property

The line number in the input stream where this token originated. This is base-1.
protected int lineNumber
return int

obj protected_oe property

A storage object for the data of this token.
protected object obj
return object