Пример #1
0
 def p_interpreter_other(self, p):
     '''interpreter : comparision
                    | select
                    | array_selection
                    | func_call_stmt
                    | expression'''
     print Evaluator.visit(p[1])
Пример #2
0
 def run(self):
     while 1:
         try:
             s = raw_input('calc> ')
         except EOFError:
             break
         if not s: continue
         Evaluator.visit(yacc.parse(s))
Пример #3
0
 def p_interpreter_type(self, p):
     '''interpreter : type'''
     print p[1].type + ":", Evaluator.visit(p[1])