class point_syntax_kind¶
Enumeration class: the syntax kind associated with a program point ( point ), indicating the kind of source code statement from which the point was generated.
The “bodies” of code keywords do not have syntax kinds, only conditions, exprs, etc. In the code:
for (i = 0; i < 10; ++i)
j = i;
The syntax kinds and elements are as follows.
Get a point’s syntax kind with point.get_syntax_kind().
Not to be confused with syntax_kind , which is a property of a span within a source file instance.
point_syntax_kind Members¶
| Constructors | none |
| Static Method | from_integer() |
| Methods | __cmp__(), __eq__(), __ge__(), __gt__(), __hash__(), __le__(), __lt__(), __ne__(), __repr__(), __str__(), as_integer(), name() |
| Attributes | ASM, BREAK, CASE, CATCH, CONTINUE, DO, ELSE, FOR, GOTO, IF, LABEL, NONE, RETURN, SWITCH, THROW, TRY, WHILE |
point_syntax_kind Details¶
-
class
cs.point_syntax_kind¶ Enumeration class: the syntax kind associated with a program point (
point), indicating the kind of source code statement from which the point was generated.-
static
from_integer(_inner)¶ Construct an instance from an integer representation.
Parameters: _inner (int) – The integer representation, as returned by point_syntax_kind.as_integer().Return type: point_syntax_kindRaises: result.ERROR_INVALID_ARGUMENTif_inneris not a valid integer representation for apoint_syntax_kindinstance.Invariant: For
point_syntax_kindx, point_syntax_kind.from_integer(x.as_integer()) == x>>> psk = point_syntax_kind.WHILE.as_integer() >>> psk 5 >>> point_syntax_kind.from_integer(psk) <cs.point_syntax_kind while>
-
__cmp__(other)¶ Comparison function for
point_syntax_kind, with respect to a stable overall ordering.Parameters: other ( point_syntax_kind) – Thepoint_syntax_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
>>> point_syntax_kind.SWITCH.__cmp__(point_syntax_kind.ASM) -1
-
__eq__(b)¶ Equality operator for
point_syntax_kind.Parameters: b ( point_syntax_kind) – Thepoint_syntax_kindobject to compare against.Return type: bool Returns: Trueifselfandbcompare equal,Falseotherwise.>>> point_syntax_kind.DO == point_syntax_kind.CASE False
-
__ge__(b)¶ Greater-than-or-equal operator for
point_syntax_kind.Parameters: b ( point_syntax_kind) – Thepoint_syntax_kindobject to compare against.Return type: bool Returns: Trueifself>=b,Falseotherwise.>>> point_syntax_kind.NONE >= point_syntax_kind.GOTO False
-
__gt__(b)¶ Greater-than operator for
point_syntax_kind.Parameters: b ( point_syntax_kind) – Thepoint_syntax_kindobject to compare against.Return type: bool Returns: Trueifself>b,Falseotherwise.>>> point_syntax_kind.LABEL > point_syntax_kind.WHILE True
-
__hash__()¶ Hash function for
point_syntax_kind.Return type: int >>> hash(point_syntax_kind.IF) 1
-
__le__(b)¶ Less-than-or-equal operator for
point_syntax_kind.Parameters: b ( point_syntax_kind) – Thepoint_syntax_kindobject to compare against.Return type: bool Returns: Trueifself<=b,Falseotherwise.>>> point_syntax_kind.FOR <= point_syntax_kind.TRY True
-
__lt__(b)¶ Less-than operator for
point_syntax_kind.Parameters: b ( point_syntax_kind) – Thepoint_syntax_kindobject to compare against.Return type: bool Returns: Trueifself<b,Falseotherwise.>>> point_syntax_kind.BREAK < point_syntax_kind.ELSE False
-
__ne__(b)¶ Inequality operator for
point_syntax_kind.Parameters: b ( point_syntax_kind) – Thepoint_syntax_kindobject to compare against.Return type: bool Returns: Falseifselfandbcompare equal,Trueotherwise.>>> point_syntax_kind.RETURN != point_syntax_kind.CATCH True
-
__repr__()¶ Get a representation of a
point_syntax_kindobject that includes information useful for debugging.Return type: str Returns: The string representation. >>> repr(point_syntax_kind.THROW) '<cs.point_syntax_kind throw>'
-
__str__()¶ Get a simple string representation of a
point_syntax_kindobject.Return type: str Returns: The string representation. >>> str(point_syntax_kind.LABEL) 'label'
-
as_integer()¶ Get an integer representation of
self.Return type: int Returns: An integer suitable for use with point_syntax_kind.from_integer().Invariant: For
point_syntax_kindx, point_syntax_kind.from_integer(x.as_integer()) == x>>> psk = point_syntax_kind.WHILE.as_integer() >>> psk 5 >>> point_syntax_kind.from_integer(psk) <cs.point_syntax_kind while>
-
name()¶ Get the name of a
point_syntax_kindobject.Return type: str Returns: The name. >>> point_syntax_kind.ELSE.name() 'else'
-
ASM¶ An
asmstatement.>>> point_syntax_kind.ASM <cs.point_syntax_kind asm>
-
BREAK¶ A
breakstatement.>>> point_syntax_kind.BREAK <cs.point_syntax_kind break>
-
CASE¶ A
caselabel (in aswitchstatement).>>> point_syntax_kind.CASE <cs.point_syntax_kind case>
-
CATCH¶ The formal parameter of a
catchclause.>>> point_syntax_kind.CATCH <cs.point_syntax_kind catch>
-
CONTINUE¶ A
continuestatement.>>> point_syntax_kind.CONTINUE <cs.point_syntax_kind continue>
-
DO¶ The controlling expression of a
do-whilestatement.>>> point_syntax_kind.DO <cs.point_syntax_kind do>
-
ELSE¶ An
elselabel.>>> point_syntax_kind.ELSE <cs.point_syntax_kind else>
-
FOR¶ An element of a
forloop header: initialization clause, termination condition, or step clause.>>> point_syntax_kind.FOR <cs.point_syntax_kind for>
-
GOTO¶ A
gotostatement.>>> point_syntax_kind.GOTO <cs.point_syntax_kind goto>
-
IF¶ An
ifcondition.>>> point_syntax_kind.IF <cs.point_syntax_kind if>
-
LABEL¶ A statement label.
>>> point_syntax_kind.LABEL <cs.point_syntax_kind label>
-
NONE¶ All other program points.
>>> point_syntax_kind.NONE <cs.point_syntax_kind none>
-
RETURN¶ A
returnstatement or expression.>>> point_syntax_kind.RETURN <cs.point_syntax_kind return>
-
SWITCH¶ The controlling expression of a
switchstatement.>>> point_syntax_kind.SWITCH <cs.point_syntax_kind switch>
-
THROW¶ A
throwexpression.>>> point_syntax_kind.THROW <cs.point_syntax_kind throw>
-
TRY¶ A
tryblock header.>>> point_syntax_kind.TRY <cs.point_syntax_kind try>
-
WHILE¶ The controlling expression of a
whilestatement.>>> point_syntax_kind.WHILE <cs.point_syntax_kind while>
-
static