Module Import alias alias alias alias Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str ImportFrom alias Assign NameStore Str Assign NameStore Str Assign NameStore Str FunctionDef arguments args defaults body With Call NameLoad NameLoad NameStore body Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr For NameStore AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr body If UnaryOpNot Call NameLoad NameLoad AttributeLoad NameLoad attr body Continue If UnaryOpNot AttributeLoad NameLoad attr body Continue Assert CompareEq Call NameLoad AttributeLoad NameLoad attr Num Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num If UnaryOpNot Call NameLoad NameLoad AttributeLoad NameLoad attr body Continue Assign NameStore AttributeLoad NameLoad attr If UnaryOpNot Call NameLoad NameLoad AttributeLoad NameLoad attr body Continue Assert CompareEq AttributeLoad NameLoad attr Str Assign NameStore AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index Num attr Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Str Num Expr Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad ListLoad attr Call NameLoad Call AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args defaults body Assign NameStore Dict Str Str Str Str For NameStore AttributeLoad AttributeLoad NameLoad attr attr body Assign TupleStore NameStore NameStore TupleLoad AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr Assign SubscriptStore NameLoad Index AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr For NameStore AttributeLoad NameLoad attr body Assign SubscriptStore NameLoad Index Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args defaults body Assign TupleStore NameStore NameStore TupleLoad Call NameLoad Call NameLoad Assign TupleStore NameStore NameStore TupleLoad ListLoad ListLoad Num Num For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr body Assign SubscriptStore NameLoad Index Num Call NameLoad SubscriptLoad NameLoad Index Num Call NameLoad NameLoad For TupleStore NameStore NameStore Call NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad For TupleStore NameStore NameStore Call NameLoad NameLoad body If CompareEq Call AttributeLoad NameLoad attr NameLoad body Assign SubscriptStore NameLoad Index NameLoad BinOpAdd BinOpAdd Str SubscriptLoad NameLoad Index NameLoad Str Assign NameStore Call AttributeLoad Str attr NameLoad Assign SubscriptStore NameLoad Index Num Call NameLoad SubscriptLoad NameLoad Index Num Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr TupleLoad IfExp UnaryOpNot NameLoad NameLoad Str NameLoad Assign NameStore Call AttributeLoad Str attr TupleLoad Str BinOpMult Str BinOpAdd SubscriptLoad NameLoad Index Num Num Str BinOpMult Str BinOpAdd SubscriptLoad NameLoad Index Num Num Str Assign NameStore BinOpMod Str Call NameLoad NameLoad Print BinOpMult Str Call NameLoad NameLoad Print NameLoad Print BinOpMult Str Call NameLoad NameLoad Print Print NameLoad Print For TupleStore NameStore NameStore Call NameLoad NameLoad body Print NameLoad Print BinOpMod NameLoad NameLoad Print NameLoad decorator_list If CompareEq NameLoad Str body Expr Call NameLoad
N/A N/A ast _ast sys collections N/A N/A N/A N/A sys path append .. runac parser N/A TITLE Language grammar N/A PARSER_FILE ../runac/parser.py N/A INTRO The table below (which is generated from the parser's source code)
can serve as a guide to Runa's grammar.
Code literals in rules represent regular expressions.
The special INDENT and DEDENT tokens are inserted by a secondary pass,
after the initial tokenization of source code;
they represent the increase and decrease of the indentation level. get_rules N/A N/A N/A N/A N/A N/A open PARSER_FILE f N/A N/A src N/A N/A f read N/A rules N/A N/A collections OrderedDict N/A node N/A N/A N/A ast parse src body N/A N/A N/A N/A isinstance node N/A _ast FunctionDef N/A N/A N/A N/A N/A node decorator_list N/A N/A N/A N/A N/A len N/A node decorator_list 1 N/A decorator N/A N/A node decorator_list N/A 0 N/A N/A N/A isinstance decorator N/A _ast Call N/A N/A N/A func N/A decorator func N/A N/A N/A isinstance func N/A _ast Attribute N/A N/A N/A N/A N/A func attr production N/A ln N/A N/A N/A decorator args N/A 0 s N/A N/A name match N/A N/A ln split  :  1 N/A N/A N/A N/A N/A rules setdefault name N/A append N/A tuple N/A N/A match split N/A rules N/A get_tokens N/A N/A N/A N/A N/A tokens N/A INDENT DEDENT INDENT DEDENT N/A rule N/A N/A parser LEXER rules N/A N/A N/A name pattern N/A N/A rule name N/A N/A rule re pattern N/A N/A tokens N/A N/A rule name N/A N/A rule re pattern N/A word N/A parser NAME_LIKE N/A N/A N/A tokens N/A N/A N/A word upper word N/A tokens N/A main N/A N/A N/A N/A N/A N/A rules tokens N/A N/A get_rules N/A get_tokens N/A N/A lines columns N/A N/A N/A 0 0 N/A N/A name expands N/A N/A rules iteritems N/A N/A N/A columns N/A 0 N/A max N/A columns N/A 0 N/A len name N/A N/A i expand N/A enumerate expands N/A N/A bits N/A list expand N/A N/A idx s N/A enumerate expand N/A N/A N/A N/A N/A s upper s N/A N/A N/A bits N/A idx N/A N/A `` N/A tokens N/A s `` N/A defn N/A N/A join bits N/A N/A columns N/A 1 N/A max N/A columns N/A 1 N/A len defn N/A N/A N/A lines append N/A N/A N/A i name defn N/A separator N/A N/A join N/A + N/A - N/A N/A columns N/A 0 2 + N/A - N/A N/A columns N/A 1 2 + N/A fmt N/A | %%-%is | %%-%is | N/A tuple columns N/A N/A * N/A len TITLE N/A TITLE N/A N/A * N/A len TITLE N/A N/A INTRO N/A N/A N/A i ln N/A enumerate lines N/A N/A separator N/A N/A fmt ln N/A separator N/A N/A N/A __name__ __main__ N/A N/A N/A main