chc.app.CExp module

Base class and subclasses:

chc.app.CExp.CExp(cd, ixval)

Base class for all expressions.

chc.app.CExp.CExpConst(cd, ixval)

Constant expression

chc.app.CExp.CExpLval(cd, ixval)

Lvalue expression.

chc.app.CExp.CExpSizeOf(cd, ixval)

Sizeof type expression.

chc.app.CExp.CExpSizeOfE(cd, ixval)

Sizeof expression expression

chc.app.CExp.CExpSizeOfStr(cd, ixval)

Sizeof string expression

chc.app.CExp.CExpAlignOf(cd, ixval)

Alignof type expression

chc.app.CExp.CExpAlignOfE(cd, ixval)

Align of expression expression

chc.app.CExp.CExpUnOp(cd, ixval)

Unary expression

chc.app.CExp.CExpBinOp(cd, ixval)

Binary expression

chc.app.CExp.CExpQuestion(cd, ixval)

Question expression.

chc.app.CExp.CExpCastE(cd, ixval)

Cast expression.

chc.app.CExp.CExpAddrOf(cd, ixval)

Address-of expression

chc.app.CExp.CExpAddrOfLabel(cd, ixval)

Address-of label expression

chc.app.CExp.CExpStartOf(cd, ixval)

Start-of expression

chc.app.CExp.CExpFnApp(cd, ixval)

Function application.

chc.app.CExp.CExpCnApp(cd, ixval)

Constant function application.

Object representation of CIL expression sum type.

class chc.app.CExp.CExp(cd: CDictionary, ixval: chc.util.IndexedTable.IndexedTableValue)[source]

Bases: chc.app.CDictionaryRecord.CDictionaryRecord

Base class for all expressions.

get_strings() List[str][source]
get_variable_uses(vid: int) int[source]
has_variable(vid: int) bool[source]
has_variable_op(vid: int, op: str) bool[source]
property is_addrof: bool
property is_alignof: bool
property is_alignofe: bool
property is_binop: bool
property is_caste: bool
property is_cn_app: bool
property is_constant: bool
property is_fn_app: bool
property is_lval: bool
property is_question: bool
property is_sizeof: bool
property is_sizeofe: bool
property is_sizeofstr: bool
property is_startof: bool
property is_unop: bool
to_dict() Dict[str, Any][source]
to_idict() Dict[str, Any][source]
class chc.app.CExp.CExpAddrOf(cd: CDictionary, ixval: chc.util.IndexedTable.IndexedTableValue)[source]

Bases: chc.app.CExp.CExp

Address-of expression

  • args[0]: index of lval in cdictionary

get_strings() List[str][source]
get_variable_uses(vid: int) int[source]
has_variable(vid: int) bool[source]
property is_addrof: bool
property lval: CLval
to_dict() Dict[str, object][source]
class chc.app.CExp.CExpAddrOfLabel(cd: CDictionary, ixval: chc.util.IndexedTable.IndexedTableValue)[source]

Bases: chc.app.CExp.CExp

Address-of label expression

  • args[0]: statement sid

property label_sid: int
to_dict() Dict[str, object][source]
class chc.app.CExp.CExpAlignOf(cd: CDictionary, ixval: chc.util.IndexedTable.IndexedTableValue)[source]

Bases: chc.app.CExp.CExp

Alignof type expression

  • args[0]: index of type in cdictionary

property is_alignof: bool
to_dict() Dict[str, Any][source]
property typ: CTyp
class chc.app.CExp.CExpAlignOfE(cd: CDictionary, ixval: chc.util.IndexedTable.IndexedTableValue)[source]

Bases: chc.app.CExp.CExp

Align of expression expression

  • args[0]: index of expression in cdictionary

property exp: chc.app.CExp.CExp
get_strings() List[str][source]
get_variable_uses(vid: int) int[source]
has_variable(vid: int) bool[source]
property is_alignofe: bool
to_dict() Dict[str, Any][source]
class chc.app.CExp.CExpBinOp(cd: CDictionary, ixval: chc.util.IndexedTable.IndexedTableValue)[source]

Bases: chc.app.CExp.CExp

Binary expression

  • tags[1]: binary operator

  • args[0]: index of exp1 in cdictionary

  • args[1]: index of exp2 in cdictionary

  • args[2]: index of typ in cdictionary

property exp1: chc.app.CExp.CExp
property exp2: chc.app.CExp.CExp
get_strings() List[str][source]
get_variable_uses(vid: int) int[source]
has_variable(vid: int) bool[source]
has_variable_op(vid: int, op: str) bool[source]
property is_binop: bool
property op: str
to_dict() Dict[str, Any][source]
property typ: CTyp
class chc.app.CExp.CExpCastE(cd: CDictionary, ixval: chc.util.IndexedTable.IndexedTableValue)[source]

Bases: chc.app.CExp.CExp

Cast expression.

  • args[0]: index of target type in cdictionary

  • args[1]: index of expression to be cast in cdictionary

property exp: chc.app.CExp.CExp
get_strings() List[str][source]
get_variable_uses(vid: int) int[source]
has_variable(vid: int) bool[source]
property is_caste: bool
to_dict() Dict[str, object][source]
property typ: CTyp
class chc.app.CExp.CExpCnApp(cd: CDictionary, ixval: chc.util.IndexedTable.IndexedTableValue)[source]

Bases: chc.app.CExp.CExp

Constant function application.

  • tags[0]: name

  • args[0]: index of result type in cdictionary

  • args[1..]: indices of arguments (optional) in cdictionary

property arguments: List[Optional[chc.app.CExp.CExp]]
has_variable(vid: int) bool[source]
property is_cn_app: bool
property name: str
property typ: CTyp
class chc.app.CExp.CExpConst(cd: CDictionary, ixval: chc.util.IndexedTable.IndexedTableValue)[source]

Bases: chc.app.CExp.CExp

Constant expression

  • args[0]: constant

property constant: CConst
get_strings() List[str][source]
property is_constant: bool
to_dict() Dict[str, Any][source]
class chc.app.CExp.CExpFnApp(cd: CDictionary, ixval: chc.util.IndexedTable.IndexedTableValue)[source]

Bases: chc.app.CExp.CExp

Function application.

  • tags[1]: filename

  • args[0]: line number

  • args[1]: byte number

  • args[2]: index of target function expression in cdictionary

  • args[3..]: indices of arguments (optional) in cdictionary

property arguments: List[Optional[chc.app.CExp.CExp]]
property exp: chc.app.CExp.CExp
has_variable(vid: int) bool[source]
property is_fn_app: bool
class chc.app.CExp.CExpLval(cd: CDictionary, ixval: chc.util.IndexedTable.IndexedTableValue)[source]

Bases: chc.app.CExp.CExp

Lvalue expression.

  • args[0]: index of lval in cdictionary

get_strings() List[str][source]
get_variable_uses(vid: int) int[source]
has_variable(vid: int) bool[source]
property is_lval: bool
property lval: CLval
to_dict() Dict[str, Any][source]
class chc.app.CExp.CExpQuestion(cd: CDictionary, ixval: chc.util.IndexedTable.IndexedTableValue)[source]

Bases: chc.app.CExp.CExp

Question expression.

  • args[0]: index of conditional expression in cdictionary

  • args[1]: index of if-true expression in cdictionary

  • args[2]: index of if-false expression in cdictionary

  • args[3]: index of result type in cdictionary

property condition: chc.app.CExp.CExp
property false_exp: chc.app.CExp.CExp
get_strings() List[str][source]
get_variable_uses(vid: int) int[source]
has_variable(vid: int) bool[source]
property is_question: bool
to_dict() Dict[str, object][source]
property true_exp: chc.app.CExp.CExp
property typ: CTyp
class chc.app.CExp.CExpSizeOf(cd: CDictionary, ixval: chc.util.IndexedTable.IndexedTableValue)[source]

Bases: chc.app.CExp.CExp

Sizeof type expression.

  • args[0]: index of target type in cdictionary

property is_sizeof: bool
to_dict() Dict[str, Any][source]
property typ: CTyp
class chc.app.CExp.CExpSizeOfE(cd: CDictionary, ixval: chc.util.IndexedTable.IndexedTableValue)[source]

Bases: chc.app.CExp.CExp

Sizeof expression expression

  • args[0]: exp

property exp: chc.app.CExp.CExp
get_strings() List[str][source]
get_variable_uses(vid: int) int[source]
property is_sizeofe: bool
to_dict() Dict[str, Any][source]
class chc.app.CExp.CExpSizeOfStr(cd: CDictionary, ixval: chc.util.IndexedTable.IndexedTableValue)[source]

Bases: chc.app.CExp.CExp

Sizeof string expression

  • args[0]:index of string in the string table

get_strings() List[str][source]
property is_sizeofstr: bool
property stringvalue: str
to_dict() Dict[str, Any][source]
class chc.app.CExp.CExpStartOf(cd: CDictionary, ixval: chc.util.IndexedTable.IndexedTableValue)[source]

Bases: chc.app.CExp.CExp

Start-of expression

  • args[0]: index of lval in cdictionary

get_strings() List[str][source]
get_variable_uses(vid: int) int[source]
has_variable(vid: int) bool[source]
property is_startof: bool
property lval: CLval
to_dict() Dict[str, Any][source]
class chc.app.CExp.CExpUnOp(cd: CDictionary, ixval: chc.util.IndexedTable.IndexedTableValue)[source]

Bases: chc.app.CExp.CExp

Unary expression

  • tags[1]: unary operator

  • args[0]: index of subexpression in cdictionary

  • args[1]: index of result type in cdictionary

property exp: chc.app.CExp.CExp
get_strings() List[str][source]
get_variable_uses(vid: int) int[source]
has_variable(vid: int) bool[source]
property is_unop: bool
property op: str
to_dict() Dict[str, Any][source]
property typ: CTyp