Enhanced C#
Language of your choice: library documentation
Static Public Member Functions | List of all members
Loyc.Syntax.Les.TokenExt Class Reference

Provides the Type() extension method required by Token and the ToString(Token) method to express an LES token as a string, for tokens that contain sufficient information to do so. More...


Source file:

Remarks

Provides the Type() extension method required by Token and the ToString(Token) method to express an LES token as a string, for tokens that contain sufficient information to do so.

Static Public Member Functions

static TokenType Type (this Token t)
 Converts t.TypeInt to TokenType. More...
 
static string ToString (Token t)
 Expresses a token as a string, using LES printers for identifiers and literals. More...
 

Member Function Documentation

static string Loyc.Syntax.Les.TokenExt.ToString ( Token  t)
inlinestatic

Expresses a token as a string, using LES printers for identifiers and literals.

Note that some Tokens do not contain enough information to reconstruct a useful token string, e.g. comment tokens do not store the comment but merely contain the location of the comment in the source code. For performance reasons, a Token does not have a reference to its source file, so this method cannot return the original string.

References Loyc.Syntax.Lexing.Token.Kind, Loyc.Syntax.Lexing.Token.Style, Loyc.Syntax.Lexing.Token.TypeInt, and Loyc.Syntax.Lexing.Token.Value.

Referenced by Loyc.Syntax.Lexing.Token.Is(), and Loyc.Syntax.Les.Les2Printer.IsNormalIdentifier().

static TokenType Loyc.Syntax.Les.TokenExt.Type ( this Token  t)
inlinestatic

Converts t.TypeInt to TokenType.

References Loyc.Syntax.Lexing.Token.TypeInt.