Module Expr Str Import alias ImportFrom alias alias alias ImportFrom alias ImportFrom alias alias alias ImportFrom alias alias alias alias ImportFrom alias alias Assign NameStore Call AttributeLoad Call AttributeLoad Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr attr attr Str attr keyword Str FunctionDef arguments args defaults body Assign TupleStore NameStore NameStore NameStore Call NameLoad NameLoad decorator_list FunctionDef arguments args defaults body Assign TupleStore NameStore NameStore NameStore Call NameLoad Str Assign NameStore Call NameLoad NameLoad NameLoad Assign NameStore SubscriptLoad Call AttributeLoad Call NameLoad Str attr Call NameLoad Index Num Assign NameStore SubscriptLoad Call AttributeLoad Call NameLoad Str attr Call NameLoad Index Num Assign NameStore SubscriptLoad Call AttributeLoad Call NameLoad Str attr Call NameLoad Index Num Assign NameStore SubscriptLoad Call AttributeLoad Call NameLoad Str attr Call NameLoad Index Num Assign NameStore SubscriptLoad Call AttributeLoad Call NameLoad Str attr Call NameLoad Index Num Assign NameStore SubscriptLoad Call AttributeLoad Call NameLoad Str attr Call NameLoad Index Num Assign NameStore SubscriptLoad Call AttributeLoad Call NameLoad Str attr Call NameLoad Index Num Assign NameStore SubscriptLoad Call AttributeLoad Call NameLoad Str attr Call NameLoad Index Num Assign NameStore SubscriptLoad Call AttributeLoad Call NameLoad Str attr Call NameLoad Index Num Assign NameStore SubscriptLoad Call AttributeLoad Call NameLoad Str attr Call NameLoad Index Num Assign NameStore SubscriptLoad Call AttributeLoad Call NameLoad Str attr Call NameLoad Index Num Assign NameStore SubscriptLoad Call AttributeLoad Call NameLoad Str attr Call NameLoad Index Num Assign NameStore SubscriptLoad Call AttributeLoad Call NameLoad Str attr Call NameLoad Index Num Assign NameStore SubscriptLoad Call AttributeLoad Call NameLoad Str attr Call NameLoad Index Num Assign NameStore SubscriptLoad Call AttributeLoad Call NameLoad Str attr Call NameLoad Index Num Assign NameStore SubscriptLoad Call AttributeLoad Call NameLoad Str attr Call NameLoad Index Num Assign NameStore SubscriptLoad Call AttributeLoad Call NameLoad Str attr Call NameLoad Index Num Assign NameStore SubscriptLoad Call AttributeLoad Call NameLoad Str attr Call NameLoad Index Num Assign NameStore SubscriptLoad Call AttributeLoad Call NameLoad Str attr Call NameLoad Index Num Assign NameStore SubscriptLoad Call AttributeLoad Call NameLoad Str attr Call NameLoad Index Num decorator_list FunctionDef arguments args defaults body Assign TupleStore NameStore NameStore NameStore Call NameLoad Str Assign NameStore Call NameLoad NameLoad NameLoad Assign NameStore SubscriptLoad Call AttributeLoad Call NameLoad Str attr Call NameLoad Index Num decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam defaults body ImportFrom alias Assign TupleStore NameStore NameStore NameStore Call NameLoad NameLoad Assign AttributeStore NameLoad attr Call NameLoad Assign AttributeStore NameLoad attr Call NameLoad NameLoad AttributeLoad SubscriptLoad NameLoad Index Num attr Assign AttributeStore NameLoad attr NameLoad Assign TupleStore NameStore NameStore Call NameLoad NameLoad Assign AttributeStore NameLoad attr Call NameLoad Call NameLoad NameLoad Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Import alias alias Assign NameStore Num Assign NameStore AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr For NameStore Call AttributeLoad NameLoad attr NameLoad body Assign TupleStore NameStore NameStore TupleStore NameStore NameStore NameStore NameStore NameLoad AugAssignSub NameStore Num AugAssignAdd NameStore Call NameLoad NameLoad Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad If CompareEq NameLoad Str body Assign NameStore NameStore Str orelse If CompareEq NameLoad Str body Continue orelse If CompareEq NameLoad Str body Continue TryExcept body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad keyword NameLoad If CompareEq Call NameLoad NameLoad Num body Expr Yield SubscriptLoad NameLoad Index Num Continue handlers ExceptHandler type NameLoad body Pass Expr Yield Call NameLoad NameLoad NameLoad Call NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad AttributeLoad NameLoad attr NameLoad Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad Call AttributeLoad Call AttributeLoad Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr attr attr attr Str attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list decorator_list
N/A N/A  test file to experiment with a an adapted CPython grammar  N/A py pypy.rlib.parsing.lexer Lexer SourcePos Token pypy.rlib.parsing.deterministic LexerError pypy.rlib.parsing.tree Nonterminal Symbol RPythonVisitor pypy.rlib.parsing.parsing PackratParser Symbol ParseError Rule pypy.rlib.parsing.ebnfparse parse_ebnf make_parse_function N/A grammar N/A N/A N/A N/A N/A N/A N/A N/A N/A py magic autopath dirpath join pygrammar.txt read mode rt test_parse_grammar N/A N/A N/A N/A N/A N/A _ rules ToAST N/A parse_ebnf grammar N/A test_parse_python_args N/A N/A N/A N/A N/A N/A regexs rules ToAST N/A parse_ebnf 
IGNORE: " ";
NAME: "[a-zA-Z_]*";
NUMBER: "0|[1-9][0-9]*";
parameters: ["("] >varargslist<? [")"];
varargslist: (fpdef ("=" test)? [","])* star_or_starstarargs |
             fpdef ("=" test)? ([","] fpdef ("=" test)?)* [","]?;
star_or_starstarargs:  "*" NAME [","] "**" NAME | "*" NAME | "**" NAME;
fpdef: <NAME> | "(" <fplist> ")";
fplist: fpdef ([","] fpdef)* [","]?;
test: NUMBER;
     N/A parse N/A make_parse_function regexs rules N/A t N/A N/A N/A N/A parse (a) visit N/A ToAST N/A 0 N/A t N/A N/A N/A N/A parse (a,) visit N/A ToAST N/A 0 N/A t N/A N/A N/A N/A parse (a,b,c,d) visit N/A ToAST N/A 0 N/A t N/A N/A N/A N/A parse (a,b,c,d,) visit N/A ToAST N/A 0 N/A t N/A N/A N/A N/A parse ((a, b, c),b,c,d,) visit N/A ToAST N/A 0 N/A t N/A N/A N/A N/A parse ((a, b, (d, e, (f, g))), b, *args, **kwargs) visit N/A ToAST N/A 0 N/A t N/A N/A N/A N/A parse ((a, b, c),b,c,d,*args) visit N/A ToAST N/A 0 N/A t N/A N/A N/A N/A parse ((a, b, c),b,c,d,**kwargs) visit N/A ToAST N/A 0 N/A t N/A N/A N/A N/A parse ((a, b, c),b,c,d,*args, **args) visit N/A ToAST N/A 0 N/A t N/A N/A N/A N/A parse () visit N/A ToAST N/A 0 N/A t N/A N/A N/A N/A parse (*args, **args) visit N/A ToAST N/A 0 N/A t N/A N/A N/A N/A parse (a=1) visit N/A ToAST N/A 0 N/A t N/A N/A N/A N/A parse (a=2,) visit N/A ToAST N/A 0 N/A t N/A N/A N/A N/A parse (a,b,c,d=3) visit N/A ToAST N/A 0 N/A t N/A N/A N/A N/A parse (a,b,c,d=4,) visit N/A ToAST N/A 0 N/A t N/A N/A N/A N/A parse ((a, b, c),b,c,(c, d)=1,) visit N/A ToAST N/A 0 N/A t N/A N/A N/A N/A parse ((a, b, c),b,c,d=1,*args) visit N/A ToAST N/A 0 N/A t N/A N/A N/A N/A parse ((a, b, c),b,c,d=2,**kwargs) visit N/A ToAST N/A 0 N/A t N/A N/A N/A N/A parse ((a, b, c),b,c,(c, d)=4,*args, **args) visit N/A ToAST N/A 0 N/A t N/A N/A N/A N/A parse (self, a, b, args) visit N/A ToAST N/A 0 N/A test_parse_funcdef N/A N/A N/A N/A N/A N/A regexs rules ToAST N/A parse_ebnf 
IGNORE: " ";
NAME: "[a-zA-Z_]*";
NUMBER: "0|[1-9][0-9]*";
funcdef: "def" NAME parameters ":" suite;
parameters: ["("] >varargslist< [")"] | ["("] [")"];
varargslist: (fpdef ("=" test)? ",")* star_or_starstarargs |
             fpdef ("=" test)? ("," fpdef ("=" test)?)* ","?;
star_or_starstarargs:  "*" NAME "," "**" NAME | "*" NAME | "**" NAME;
fpdef: NAME | "(" fplist ")";
fplist: fpdef ("," fpdef)* ","?;
test: NUMBER;
suite: simple_stmt | ["NEWLINE"] ["INDENT"] stmt+ ["DEDENT"];
simple_stmt: stmt;
stmt: "pass";
     N/A parse N/A make_parse_function regexs rules N/A t N/A N/A N/A N/A parse def f(a): NEWLINE INDENT pass DEDENT visit N/A ToAST N/A 0 N/A TestParser N/A object N/A setup_class N/A N/A cls N/A N/A pypy.rlib.parsing.parsing PackratParser N/A N/A regexs rules ToAST N/A parse_ebnf grammar N/A N/A cls ToAST N/A ToAST N/A N/A cls parser N/A PackratParser rules N/A N/A rules N/A 0 nonterminal N/A N/A cls regexs regexs N/A N/A names regexs N/A zip regexs N/A N/A cls lexer N/A Lexer N/A list regexs N/A list names N/A parse N/A N/A self source N/A N/A N/A tokens N/A list N/A N/A self tokenize source N/A s N/A N/A N/A self parser parse tokens N/A s N/A tokenize N/A N/A self source N/A N/A N/A tokenize cStringIO N/A pos 0 N/A readline N/A N/A N/A cStringIO StringIO source readline N/A token N/A N/A tokenize generate_tokens readline N/A N/A N/A typ s N/A row col _ line token N/A row 1 N/A pos N/A len s N/A typ N/A N/A tokenize tok_name N/A typ N/A N/A typ ENDMARKER N/A N/A typ s EOF N/A N/A N/A typ NL N/A N/A N/A N/A N/A typ COMMENT N/A N/A N/A N/A N/A tokens N/A N/A N/A self lexer tokenize s eof False N/A N/A N/A len tokens 1 N/A N/A N/A N/A tokens N/A 0 N/A N/A N/A N/A LexerError N/A N/A N/A N/A N/A Token typ s N/A SourcePos pos row col N/A test_simple N/A N/A self N/A N/A N/A t N/A N/A self parse 
def f(x, null=0):
    if x >= null:
        return null + x
    else:
        pass
        return null - x
         N/A t N/A N/A N/A self ToAST transform t N/A test_class N/A N/A self N/A N/A N/A t N/A N/A self parse 
class A(object):
    def __init__(self, a, b, *args):
        self.a = a
        self.b = b
        if args:
            self.len = len(args)
            self.args = [a, b] + list(args)

    def diagonal(self):
        return (self.a ** 2 + self.b ** 2) ** 0.5
         N/A t N/A N/A N/A self ToAST transform t N/A test_while N/A N/A self N/A N/A N/A t N/A N/A self parse 
def f(x, null=0):
    i = null
    result = 0
    while i < x:
        result += i
        i += 1
        if result % 625 == 13:
            break
    else:
        return result - 15
    return result
         N/A t N/A N/A N/A self ToAST transform t N/A test_comment N/A N/A self N/A N/A N/A t N/A N/A self parse 
def f(x):
    # this does some fancy stuff
    return x
 N/A t N/A N/A N/A self ToAST transform t N/A test_parse_print N/A N/A self N/A N/A N/A t N/A N/A self parse 
print >> f, a, b, c,
print >> f, a, b
print >> f
print 
print 1
print 1, 2
print 1, 2,  
 N/A t N/A N/A N/A self ToAST transform t N/A test_assignment N/A N/A self N/A N/A N/A t N/A N/A self parse 
a = 1
a = b = c
(a, b) = c
a += 1
b //= 3
 N/A t N/A N/A N/A self ToAST transform t N/A test_lists N/A N/A self N/A N/A N/A t N/A N/A self parse 
l0 = [1, 2, [3, 4, [5, []]]]
l1 = [i for i in range(10)]
l1 = [i for i in range(10) if i ** 2 % 3 == 0]
l2 = [ ]
l3 = [     ]
l4 = []
 N/A t N/A N/A N/A self ToAST transform t N/A test_dicts N/A N/A self N/A N/A N/A t N/A N/A self parse 
{1: 2, 2: {1: 3},}
{}
 N/A t N/A N/A N/A self ToAST transform t N/A test_calls N/A N/A self N/A N/A N/A t N/A N/A self parse 
f(a)(b)(c)
f() ** 2
f(x) * 2
f(x, y, z, *args) + 2
f(x, y, abc=34, *arg, **kwargs)
 N/A t N/A N/A N/A self ToAST transform t N/A test_trailers N/A N/A self N/A N/A N/A N/A N/A N/A py test skip in progress N/A t N/A N/A self parse 
(a + b).foo[1 + i - j:](32, *args)
 N/A t N/A N/A N/A self ToAST transform t N/A test_errors N/A N/A self N/A N/A N/A source 
def f(x):
    if a:
        pass
    else:
        pass
        else:
            pass
 N/A excinfo N/A N/A N/A py test raises ParseError N/A self parse source N/A error N/A N/A excinfo value errorinformation N/A msg N/A N/A N/A excinfo value nice_error_message <stdin> source N/A test_precedence N/A N/A self N/A N/A N/A source 
a = 1 - 2 - 3
 N/A t N/A N/A self parse source N/A t N/A N/A N/A self ToAST transform t N/A test_parse_this N/A N/A self N/A N/A N/A s N/A N/A N/A N/A N/A py magic autopath read N/A t N/A N/A self parse s N/A t N/A N/A N/A self ToAST transform t N/A test_parsing N/A N/A self N/A N/A N/A s N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A py magic autopath dirpath dirpath join parsing.py read N/A t N/A N/A self parse s N/A t N/A N/A N/A self ToAST transform t N/A N/A