class symbol_kind

Enumeration class: the kind of a symbol .

symbol_kind Details

class cs.symbol_kind

Enumeration class: the kind of a symbol .

static from_integer(_inner)

Construct an instance from an integer representation.

Parameters:_inner (int) – The integer representation, as returned by symbol_kind.as_integer().
Return type:symbol_kind
Raises:result.ERROR_INVALID_ARGUMENT if _inner is not a valid integer representation for a symbol_kind instance.

Invariant: For symbol_kind x, symbol_kind.from_integer(x.as_integer()) == x

>>> sk = symbol_kind.SUBOBJ.as_integer()
>>> sk
10
>>> symbol_kind.from_integer(sk)
<cs.symbol_kind subobj>
__cmp__(other)

Comparison function for symbol_kind , with respect to a stable overall ordering.

Parameters:other (symbol_kind) – The symbol_kind object 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
>>> symbol_kind.INTERMEDIATE.__cmp__(symbol_kind.RESULT)
-1
__eq__(b)

Equality operator for symbol_kind .

Parameters:b (symbol_kind) – The symbol_kind object to compare against.
Return type:bool
Returns:True if self and b compare equal, False otherwise.
>>> symbol_kind.HEAP == symbol_kind.STRING
False
__ge__(b)

Greater-than-or-equal operator for symbol_kind .

Parameters:b (symbol_kind) – The symbol_kind object to compare against.
Return type:bool
Returns:True if self >= b , False otherwise.
>>> symbol_kind.INTERNAL >= symbol_kind.USER
True
__gt__(b)

Greater-than operator for symbol_kind .

Parameters:b (symbol_kind) – The symbol_kind object to compare against.
Return type:bool
Returns:True if self > b , False otherwise.
>>> symbol_kind.PARAM > symbol_kind.LABEL
False
__hash__()

Hash function for symbol_kind .

Return type:int
>>> hash(symbol_kind.RETURN)
3
__le__(b)

Less-than-or-equal operator for symbol_kind .

Parameters:b (symbol_kind) – The symbol_kind object to compare against.
Return type:bool
Returns:True if self <= b , False otherwise.
>>> symbol_kind.SUBOBJ <= symbol_kind.INTERNAL
False
__lt__(b)

Less-than operator for symbol_kind .

Parameters:b (symbol_kind) – The symbol_kind object to compare against.
Return type:bool
Returns:True if self < b , False otherwise.
>>> symbol_kind.PARAM < symbol_kind.USER
False
__ne__(b)

Inequality operator for symbol_kind .

Parameters:b (symbol_kind) – The symbol_kind object to compare against.
Return type:bool
Returns:False if self and b compare equal, True otherwise.
>>> symbol_kind.INTERMEDIATE != symbol_kind.FUNCTION
True
__repr__()

Get a representation of a symbol_kind object that includes information useful for debugging.

Return type:str
Returns:The string representation.
>>> repr(symbol_kind.SUBOBJ)
'<cs.symbol_kind subobj>'
__str__()

Get a simple string representation of a symbol_kind object.

Return type:str
Returns:The string representation.
>>> str(symbol_kind.LABEL)
'label'
as_integer()

Get an integer representation of self.

Return type:int
Returns:An integer suitable for use with symbol_kind.from_integer().

Invariant: For symbol_kind x, symbol_kind.from_integer(x.as_integer()) == x

>>> sk = symbol_kind.SUBOBJ.as_integer()
>>> sk
10
>>> symbol_kind.from_integer(sk)
<cs.symbol_kind subobj>
name()

Get the name of a symbol_kind object.

Return type:str
Returns:The name.
>>> symbol_kind.RESULT.name()
'result'
FUNCTION

Kind function.

>>> symbol_kind.FUNCTION
<cs.symbol_kind function>
HEAP

Kind heap.

>>> symbol_kind.HEAP
<cs.symbol_kind heap>
INTERMEDIATE

Kind intermediate.

>>> symbol_kind.INTERMEDIATE
<cs.symbol_kind intermediate>
INTERNAL

Kind internal.

>>> symbol_kind.INTERNAL
<cs.symbol_kind internal>
LABEL

Kind label.

>>> symbol_kind.LABEL
<cs.symbol_kind label>
PARAM

Kind param.

>>> symbol_kind.PARAM
<cs.symbol_kind param>
RESULT

Kind result.

>>> symbol_kind.RESULT
<cs.symbol_kind result>
RETURN

Kind return.

>>> symbol_kind.RETURN
<cs.symbol_kind return>
STRING

Kind string.

>>> symbol_kind.STRING
<cs.symbol_kind string>
SUBOBJ

Kind subobj.

>>> symbol_kind.SUBOBJ
<cs.symbol_kind subobj>
USER

Kind user.

>>> symbol_kind.USER
<cs.symbol_kind user>