本文整理汇总了Python中Interpreter.Interpreter.set_value_obj_from_num16方法的典型用法代码示例。如果您正苦于以下问题:Python Interpreter.set_value_obj_from_num16方法的具体用法?Python Interpreter.set_value_obj_from_num16怎么用?Python Interpreter.set_value_obj_from_num16使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Interpreter.Interpreter
的用法示例。
在下文中一共展示了Interpreter.set_value_obj_from_num16方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: a7
# 需要导入模块: from Interpreter import Interpreter [as 别名]
# 或者: from Interpreter.Interpreter import set_value_obj_from_num16 [as 别名]
def a7(self, value_obj, interpreter_flag=False):
Interpreter.interpreter_flag = interpreter_flag
sc = self.scanner
old_pointer = sc.get_pointer()
lexeme_open_bracket = sc.next_lexeme()
fun_name = sc.lexeme
if lexeme_open_bracket == lId.TOpen:
self.expression(value_obj, interpreter_flag=Interpreter.interpreter_flag)
lexeme_close_bracket = sc.next_lexeme()
if lexeme_close_bracket != lId.TClose:
raise SyntaxExceptionCharacter(sc.get_pointer_line(), sc.get_pointer_position(), ")", sc.lexeme)
elif sc.next_lexeme() == lId.TOpen:
sc.set_pointer(old_pointer)
self.call_function(interpreter_flag=Interpreter.interpreter_flag)
if Interpreter.interpreter_flag:
# Interpreter
node = self.semantic_tree.get_function_node(fun_name)
value_obj.value = node.value
value_obj.type = node.type_data
# Interpreter
else:
sc.set_pointer(old_pointer)
lexeme_operand = sc.next_lexeme()
if lexeme_operand != lId.TId and lexeme_operand != lId.TNum10 and lexeme_operand != lId.TNum16:
raise SyntaxExceptionOperand(sc.get_pointer_line(), sc.get_pointer_position(), sc.lexeme)
if Interpreter.interpreter_flag:
# semantic
if lexeme_operand == lId.TId:
if not self.semantic_tree.is_describe_var_early(sc.get_pointer_line(), sc.get_pointer_position(), sc.lexeme):
raise SemanticExceptionUndescribeVar(sc.get_pointer_line(), sc.get_pointer_position(), sc.lexeme)
# semantic
if Interpreter.interpreter_flag:
# Interpreter
if lexeme_operand == lId.TId:
_value_obj = self.semantic_tree.get_variable_value_obj(sc.lexeme)
value_obj.value = _value_obj.value
value_obj.type = _value_obj.type
elif lexeme_operand == lId.TNum10:
Interpreter.set_value_obj_from_num10(value_obj, sc.lexeme)
else:
Interpreter.set_value_obj_from_num16(value_obj, sc.lexeme)