C# Class Lex.Token

Show file Open project: YourLocalFax/OLD-Score Class Usage Examples

Public Properties

Property Type Description
span Span
type TokenType

Public Methods

Method Description
ToString ( ) : string

Returns a more debug friendly representation of this token.

Private Methods

Method Description
New ( TokenType type, Span span, string image ) : Token

Create a new token. This is basically an alias for the private constructor. The only resong for the existence of this method is consistency with the other means of constructing a token.

NewBuiltinTyName ( Span span, string name ) : Token

Returns a new token for a builtin type name.

NewChar ( Span span, uint value ) : Token

Returns a new token for a character literal.

NewFloat ( Span span, double value, string image, string suffix ) : Token

Returns a new token for a float literal.

NewIdentifier ( Span span, string image ) : Token

Returns a new token for an identifier.

NewIdentifierOperator ( Span span, string image ) : Token

Returns a new token for an identifier operator.

NewInteger ( Span span, ulong value, string image, string suffix ) : Token

Returns a new token for an integer literal.

NewKeyword ( TokenType keyword, Span span, string image ) : Token

Returns a new token for a keyword.

NewOperator ( Span span, string image ) : Token

Returns a new token for an operator.

NewOperator ( TokenType type, Span span, string image ) : Token

Returns a new token for a specific reserved operator.

NewString ( Span span, string value, bool verbatim, bool cstr ) : Token

Returns a new token for a string literal.

NewSymbol ( Span span, string image ) : Token

Returns a new token for a symbol.

Token ( TokenType type, Span span, string image, string>.Func dbg = null ) : System

Method Details

ToString() public method

Returns a more debug friendly representation of this token.
public ToString ( ) : string
return string

Property Details

span public property

Where in the source file this token is.
public Span span
return Span

type public property

The type of this token.
public TokenType type
return TokenType