Beispiel #1
0
    def specnode2traceval(spec_node):
        node_type = get_node_type(spec_node)
        assert (node_type in const_nodes or ID == node_type)

        if NULL == node_type:
            v = CValue()
            v.is_null = True
            v.type = None
            v.value = None
            v.object_id = None
            return v
        elif TRUE == node_type:
            v = CValue()
            v.is_null = False
            v.type = TraceConverter.JAVA_BOOLEAN
            v.value = TraceConverter.TRUE_CONSTANT
            v.object_id = None
            return v
        elif FALSE == node_type:
            v = CValue()
            v.is_null = False
            v.type = TraceConverter.JAVA_BOOLEAN
            v.value = TraceConverter.FALSE_CONSTANT
            v.object_id = None
            return v
        elif STRING == node_type:
            v = CValue()
            v.is_null = False
            v.type = TraceConverter.JAVA_STRING
            v.value = get_id_val(spec_node)
            v.object_id = None
            return v
        elif INT == node_type:
            v = CValue()
            v.is_null = False
            v.type = TraceConverter.JAVA_INT
            v.value = get_id_val(spec_node)
            v.object_id = None
            return v
        elif FLOAT == node_type:
            v = CValue()
            v.is_null = False
            v.type = TraceConverter.JAVA_FLOAT
            v.value = get_id_val(spec_node)
            v.object_id = None
            return v
        elif ID == node_type:
            v = CValue()
            v.is_null = False
            v.type = "java.lang.Object"
            v.value = None
            v.object_id = get_id_val(spec_node)
            return v

        assert False
Beispiel #2
0
 def _get_obj(objId, objType):
     v = CValue()
     v.is_null = False
     v.type = objType
     v.object_id = objId
     return v