C# Класс CSE.Exps.LiteralExp

Used to parse literal expressions
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
IsIntType ( CseObject data ) : bool

Determines if value passed in is an integral-type

NarrowIntType ( CseObject xdata ) : CseObject

Changes the given integral-type object to the smallest integral data type that can contain its value. If xdata has a CompileTimeType that is unsigned, then the smallest unsigned integral type is used. Otherwise the smallest signed type is used. The only current exception to this is byte vs. sbyte as they are considered special cases and therefore, regardless if the original type is unsigned or not, byte is always attempted in place of sbyte.

ParseEscSeqs ( string &data, bool isVerbatim ) : void

Parses escape sequences found in char or string literals

Приватные методы

Метод Описание
IsUnsignedType ( CseObject xdata ) : bool

Determines whether the xdata's CompileTimeType is an unsigned integral type or not

ParseBool ( string data ) : CseObject

Parses bool literals

ParseChar ( string data ) : CseObject

Parses char literals

ParseEType ( string data ) : CseObject

Parses literals that contain the exponential 'e' character

ParseFloatType ( string data, bool hasSuffix ) : CseObject

Parses float-type literals

ParseFloatType ( string data, string suffix ) : CseObject

Parses float-type literals

ParseIntType ( string data, bool hasSuffix ) : CseObject

Parses integral-type literals

ParseIntType ( string data, string suffix ) : CseObject

Parses integral-type literals

ParseStr ( string data ) : CseObject

Parses string literals

Описание методов

IsIntType() публичный статический Метод

Determines if value passed in is an integral-type
public static IsIntType ( CseObject data ) : bool
data CseObject Value to examine
Результат bool

NarrowIntType() публичный статический Метод

Changes the given integral-type object to the smallest integral data type that can contain its value. If xdata has a CompileTimeType that is unsigned, then the smallest unsigned integral type is used. Otherwise the smallest signed type is used. The only current exception to this is byte vs. sbyte as they are considered special cases and therefore, regardless if the original type is unsigned or not, byte is always attempted in place of sbyte.
public static NarrowIntType ( CseObject xdata ) : CseObject
xdata CseObject Integral-type value to narrow
Результат CseObject

ParseEscSeqs() публичный статический Метод

Parses escape sequences found in char or string literals
public static ParseEscSeqs ( string &data, bool isVerbatim ) : void
data string String containing the literal that may have escape sequences
isVerbatim bool /// Used to tell if the literal passed is a verbatim string. /// True if data represents verbatim string, false otherwise ///
Результат void