class xr_kind¶
Enumeration class: describes the kind of a (non-keyword) token.
The range of kinds associated with C and C++ programs includes type, namespace, function, variable, and so on.
xr_kind Members¶
| Constructors | none |
| Static Method | from_integer() |
| Methods | __cmp__(), __eq__(), __ge__(), __gt__(), __hash__(), __le__(), __lt__(), __ne__(), __repr__(), __str__(), as_integer(), name() |
| Attributes | BUILTIN, ENUM, FIELD, FILE, FUNC, FUNC_STATIC, LABEL, MACRO, METHOD, METHOD_STATIC, NAMESPACE, STRINGLIT, TAG, TLT, TLV, TYPE, VAR_GLOBAL, VAR_LOCAL, VAR_LOCAL_STATIC, VAR_PARAMETER, VAR_STATIC |
xr_kind Details¶
-
class
cs.xr_kind¶ Enumeration class: describes the kind of a (non-keyword) token.
-
static
from_integer(_inner)¶ Construct an instance from an integer representation.
Parameters: _inner (int) – The integer representation, as returned by xr_kind.as_integer().Return type: xr_kindRaises: result.ERROR_INVALID_ARGUMENTif_inneris not a valid integer representation for axr_kindinstance.Invariant: For
xr_kindx, xr_kind.from_integer(x.as_integer()) == x>>> xrk = xr_kind.FUNC_STATIC.as_integer() >>> xrk 3 >>> xr_kind.from_integer(xrk) <cs.xr_kind static function>
-
__cmp__(other)¶ Comparison function for
xr_kind, with respect to a stable overall ordering.Parameters: other ( xr_kind) – Thexr_kindobject to compare against.Return type: int Returns: An integer N such that: - N==0 if the two objects compare equal
- N<0 if
self< other - N>0 if
self> other
>>> xr_kind.TLV.__cmp__(xr_kind.TLT) 1
-
__eq__(b)¶ Equality operator for
xr_kind.Parameters: b ( xr_kind) – Thexr_kindobject to compare against.Return type: bool Returns: Trueifselfandbcompare equal,Falseotherwise.>>> xr_kind.VAR_LOCAL == xr_kind.LABEL False
-
__ge__(b)¶ Greater-than-or-equal operator for
xr_kind.Parameters: b ( xr_kind) – Thexr_kindobject to compare against.Return type: bool Returns: Trueifself>=b,Falseotherwise.>>> xr_kind.ENUM >= xr_kind.NAMESPACE True
-
__gt__(b)¶ Greater-than operator for
xr_kind.Parameters: b ( xr_kind) – Thexr_kindobject to compare against.Return type: bool Returns: Trueifself>b,Falseotherwise.>>> xr_kind.FUNC > xr_kind.BUILTIN False
-
__le__(b)¶ Less-than-or-equal operator for
xr_kind.Parameters: b ( xr_kind) – Thexr_kindobject to compare against.Return type: bool Returns: Trueifself<=b,Falseotherwise.>>> xr_kind.FILE <= xr_kind.TYPE False
-
__lt__(b)¶ Less-than operator for
xr_kind.Parameters: b ( xr_kind) – Thexr_kindobject to compare against.Return type: bool Returns: Trueifself<b,Falseotherwise.>>> xr_kind.STRINGLIT < xr_kind.LABEL True
-
__ne__(b)¶ Inequality operator for
xr_kind.Parameters: b ( xr_kind) – Thexr_kindobject to compare against.Return type: bool Returns: Falseifselfandbcompare equal,Trueotherwise.>>> xr_kind.TLV != xr_kind.FUNC True
-
__repr__()¶ Get a representation of a
xr_kindobject that includes information useful for debugging.Return type: str Returns: The string representation. >>> repr(xr_kind.FILE) '<cs.xr_kind file>'
-
__str__()¶ Get a simple string representation of a
xr_kindobject.Return type: str Returns: The string representation. >>> str(xr_kind.TLT) 'template type'
-
as_integer()¶ Get an integer representation of
self.Return type: int Returns: An integer suitable for use with xr_kind.from_integer().Invariant: For
xr_kindx, xr_kind.from_integer(x.as_integer()) == x>>> xrk = xr_kind.FUNC_STATIC.as_integer() >>> xrk 3 >>> xr_kind.from_integer(xrk) <cs.xr_kind static function>
-
name()¶ Get the name of a
xr_kindobject.Return type: str Returns: The name. >>> xr_kind.ENUM.name() 'enum'
-
BUILTIN¶ [C++ / GNU C only] builtin: the name of a
__builtin_*()function.>>> xr_kind.BUILTIN <cs.xr_kind builtin>
-
FUNC¶ a (non-static) function name.
>>> xr_kind.FUNC <cs.xr_kind function>
-
FUNC_STATIC¶ a static function name.
>>> xr_kind.FUNC_STATIC <cs.xr_kind static function>
-
METHOD¶ a (non-static) method method name.
>>> xr_kind.METHOD <cs.xr_kind method>
-
METHOD_STATIC¶ a static method name.
>>> xr_kind.METHOD_STATIC <cs.xr_kind static method>
-
STRINGLIT¶ -
>>> xr_kind.STRINGLIT <cs.xr_kind string literal>
-
TLT¶ [C++ only] template type parameter: the name of a type parameter for a template.
>>> xr_kind.TLT <cs.xr_kind template type>
-
TLV¶ [C++ only] template value parameter: the name of a value parameter for a template.
>>> xr_kind.TLV <cs.xr_kind template value>
-
VAR_GLOBAL¶ a global variable name.
>>> xr_kind.VAR_GLOBAL <cs.xr_kind global variable>
-
VAR_LOCAL¶ a local variable name.
>>> xr_kind.VAR_LOCAL <cs.xr_kind local variable>
-
VAR_LOCAL_STATIC¶ a locally-scoped static variable name.
>>> xr_kind.VAR_LOCAL_STATIC <cs.xr_kind local static variable>
-
VAR_STATIC¶ a static variable name.
>>> xr_kind.VAR_STATIC <cs.xr_kind file static variable>
-
static