C# Class Rhino.Token

This class implements the JavaScript scanner.
This class implements the JavaScript scanner. It is based on the C source files jsscan.c and jsscan.h in the jsref package.
显示文件 Open project: hazzik/Rhino.Net Class Usage Examples

Public Methods

Method Description
IsValidToken ( int code ) : bool

Return true if the passed code is a valid Token constant.

Return true if the passed code is a valid Token constant.

KeywordToName ( int token ) : string

Convert a keyword token to a name string for use with the Context.FEATURE_RESERVED_KEYWORD_AS_IDENTIFIER feature.

Name ( int token ) : string

Returns a name for the token.

Returns a name for the token. If Rhino is compiled with certain hardcoded debugging flags in this file, it calls #typeToName ; otherwise it returns a string whose value is the token number.

TypeToName ( int token ) : string

Always returns a human-readable string for the token name.

Always returns a human-readable string for the token name. For instance, FINALLY has the name "FINALLY".

Method Details

IsValidToken() public static method

Return true if the passed code is a valid Token constant.
Return true if the passed code is a valid Token constant.
public static IsValidToken ( int code ) : bool
code int a potential token code
return bool

KeywordToName() public static method

Convert a keyword token to a name string for use with the Context.FEATURE_RESERVED_KEYWORD_AS_IDENTIFIER feature.
public static KeywordToName ( int token ) : string
token int A token
return string

Name() public static method

Returns a name for the token.
Returns a name for the token. If Rhino is compiled with certain hardcoded debugging flags in this file, it calls #typeToName ; otherwise it returns a string whose value is the token number.
public static Name ( int token ) : string
token int
return string

TypeToName() public static method

Always returns a human-readable string for the token name.
Always returns a human-readable string for the token name. For instance, FINALLY has the name "FINALLY".
public static TypeToName ( int token ) : string
token int the token code
return string