def get_identifier_value(str, tag_uses):
underscore_pos = string.find(str, "_")
result = -1
if (underscore_pos > 0):
tag_str = str[0:underscore_pos]
id_str = str[underscore_pos + 1:len(str)]
(tag_type, id_no) = get_id_value(tag_str,id_str,tag_uses)
if (tag_type > 0):
if (id_no < 0):
print "Error: Unable to find object:" + str
else:
result = id_no | (tag_type << op_num_value_bits)
else:
print "Error: Unrecognized tag:" +tag_str + "in object:" + str
else:
print "Error: Invalid object:" +str + ".Variables should start with $ sign and references should start with a tag"
return result
评论列表
文章目录