<s> """<STR_LIT>""" <EOL> TEST = """<STR_LIT>""" <EOL> import time <EOL> import ast <EOL> N = <NUM_LIT:1> <EOL> TEST = TEST * N <EOL> from lib2to3 import pygram , pgen2 , pytree <EOL> driver = pgen2 . driver . Driver ( pygram . python_grammar_no_print_statement , convert = pytree . convert ) <EOL> t0 = time . time ( ) <EOL> r1 = driver . parse_string ( TEST ) <EOL> t1 = time . time ( ) - t0 <EOL> t0 = time . time ( ) <EOL> r2 = ast . parse ( TEST ) <EOL> t2 = time . time ( ) - t0 <EOL> print ( repr ( r1 ) ) <EOL> print ( ) <EOL> print ( '<STR_LIT>' , t1 ) <EOL> print ( '<STR_LIT>' , t2 ) <EOL> print ( '<STR_LIT>' % ( t1 / t2 ) ) <EOL> from lib2to3 import pygram <EOL> symbols = [ ] <EOL> for name , nr in pygram . python_symbols . __dict__ . items ( ) : <EOL> symbols . append ( ( nr , name ) ) <EOL> symbols . sort ( ) <EOL> for nr , name in symbols : <EOL> print ( nr , name ) </s>
