当前位置: 首页>>代码示例>>Python>>正文


Python Interpreter.set_value_obj_from_num10方法代码示例

本文整理汇总了Python中Interpreter.Interpreter.set_value_obj_from_num10方法的典型用法代码示例。如果您正苦于以下问题:Python Interpreter.set_value_obj_from_num10方法的具体用法?Python Interpreter.set_value_obj_from_num10怎么用?Python Interpreter.set_value_obj_from_num10使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Interpreter.Interpreter的用法示例。


在下文中一共展示了Interpreter.set_value_obj_from_num10方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: a7

# 需要导入模块: from Interpreter import Interpreter [as 别名]
# 或者: from Interpreter.Interpreter import set_value_obj_from_num10 [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)
开发者ID:nikialeksey,项目名称:SyntaxAnalis,代码行数:47,代码来源:DescendingAnalyse.py


注:本文中的Interpreter.Interpreter.set_value_obj_from_num10方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。