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
def _get_false(): v = CValue() v.is_null = False v.type = TraceConverter.JAVA_BOOLEAN v.value = TraceConverter.FALSE_CONSTANT return v
def _get_null(): v = CValue() v.is_null = True v.type = None v.value = None return v
def _get_obj(objId, objType): v = CValue() v.is_null = False v.type = objType v.value = objId return v
def _get_int(intValue): v = CValue() v.is_null = False v.type = TraceConverter.JAVA_INT v.value = intValue return v