Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
elif version == 1.6:
import uncompyle6.parsers.parse16 as parse16
if compile_mode == 'exec':
p = parse16.Python16Parser(debug_parser)
else:
p = parse16.Python16ParserSingle(debug_parser)
elif version == 2.1:
import uncompyle6.parsers.parse21 as parse21
if compile_mode == 'exec':
p = parse21.Python21Parser(debug_parser)
else:
p = parse21.Python21ParserSingle(debug_parser)
elif version == 2.2:
import uncompyle6.parsers.parse22 as parse22
if compile_mode == 'exec':
p = parse22.Python22Parser(debug_parser)
else:
p = parse22.Python22ParserSingle(debug_parser)
elif version == 2.3:
import uncompyle6.parsers.parse23 as parse23
if compile_mode == 'exec':
p = parse23.Python23Parser(debug_parser)
else:
p = parse23.Python23ParserSingle(debug_parser)
elif version == 2.4:
import uncompyle6.parsers.parse24 as parse24
if compile_mode == 'exec':
p = parse24.Python24Parser(debug_parser)
else:
p = parse24.Python24ParserSingle(debug_parser)
elif version == 2.5:
import uncompyle6.parsers.parse25 as parse25
def __init__(self, debug_parser=PARSER_DEFAULT_DEBUG):
super(Python22Parser, self).__init__(debug_parser)
self.customized = {}
def __init__(self, debug_parser=PARSER_DEFAULT_DEBUG):
super(Python22Parser, self).__init__(debug_parser)
self.customized = {}
def customize_grammar_rules(self, tokens, customize):
super(Python22Parser, self).customize_grammar_rules(tokens, customize)
self.remove_rules("""
kvlist ::= kvlist kv2
""")
returns
POP_BLOCK COME_FROM
for ::= SETUP_LOOP expr for_iter store
l_stmts_opt _jump_back
POP_BLOCK COME_FROM
expr ::= conditional
conditional ::= expr jmp_false expr JUMP_ABSOLUTE expr
"""
def p_import21(self, args):
'''
alias ::= IMPORT_NAME_CONT store
'''
class Python21ParserSingle(Python22Parser, PythonParserSingle):
pass
if __name__ == '__main__':
# Check grammar
p = Python21Parser()
p.check_grammar()
p.dump_grammar()
# Copyright (c) 2016-2017 Rocky Bernstein
# Copyright (c) 2000-2002 by hartmut Goebel
from spark_parser import DEFAULT_DEBUG as PARSER_DEFAULT_DEBUG
from uncompyle6.parser import PythonParserSingle
from uncompyle6.parsers.parse22 import Python22Parser
class Python21Parser(Python22Parser):
def __init__(self, debug_parser=PARSER_DEFAULT_DEBUG):
super(Python22Parser, self).__init__(debug_parser)
self.customized = {}
def p_forstmt21(self, args):
"""
for ::= SETUP_LOOP expr for_iter store
returns
POP_BLOCK COME_FROM
for ::= SETUP_LOOP expr for_iter store
l_stmts_opt _jump_back
POP_BLOCK COME_FROM
expr ::= conditional
conditional ::= expr jmp_false expr JUMP_ABSOLUTE expr
# PRINT_ITEM_CONT for PRINT_ITEM
print_items_stmt ::= expr PRINT_ITEM_CONT print_items_opt
'''
def customize_grammar_rules(self, tokens, customize):
super(Python22Parser, self).customize_grammar_rules(tokens, customize)
self.remove_rules("""
kvlist ::= kvlist kv2
""")
class Python22ParserSingle(Python23Parser, PythonParserSingle):
pass
if __name__ == '__main__':
# Check grammar
p = Python22Parser()
p.check_grammar()
p.dump_grammar()
# Copyright (c) 2016-2017 Rocky Bernstein
# Copyright (c) 2000-2002 by hartmut Goebel
from spark_parser import DEFAULT_DEBUG as PARSER_DEFAULT_DEBUG
from uncompyle6.parser import PythonParserSingle
from uncompyle6.parsers.parse22 import Python22Parser
class Python21Parser(Python22Parser):
def __init__(self, debug_parser=PARSER_DEFAULT_DEBUG):
super(Python22Parser, self).__init__(debug_parser)
self.customized = {}
def p_forstmt21(self, args):
"""
for ::= SETUP_LOOP expr for_iter store
returns
POP_BLOCK COME_FROM
for ::= SETUP_LOOP expr for_iter store
l_stmts_opt _jump_back
POP_BLOCK COME_FROM
expr ::= conditional
conditional ::= expr jmp_false expr JUMP_ABSOLUTE expr