summaryrefslogtreecommitdiffstats
path: root/Python/graminit.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1995-07-07 22:44:10 (GMT)
committerGuido van Rossum <guido@python.org>1995-07-07 22:44:10 (GMT)
commite40bddc3ef5321e6ceba4277bd344784724d4ba1 (patch)
tree96e57801047afad573023a213bdb54e2cc77cc9a /Python/graminit.c
parent872537cc86080d5f816c2e6f81906a7cb8c0a468 (diff)
downloadcpython-e40bddc3ef5321e6ceba4277bd344784724d4ba1.zip
cpython-e40bddc3ef5321e6ceba4277bd344784724d4ba1.tar.gz
cpython-e40bddc3ef5321e6ceba4277bd344784724d4ba1.tar.bz2
new grammar
Diffstat (limited to 'Python/graminit.c')
-rw-r--r--Python/graminit.c216
1 files changed, 142 insertions, 74 deletions
diff --git a/Python/graminit.c b/Python/graminit.c
index bdbb22f..3ad2723 100644
--- a/Python/graminit.c
+++ b/Python/graminit.c
@@ -97,32 +97,50 @@ static arc arcs_5_1[3] = {
{22, 4},
{0, 1},
};
-static arc arcs_5_2[1] = {
+static arc arcs_5_2[2] = {
{12, 5},
+ {23, 6},
};
static arc arcs_5_3[1] = {
- {21, 6},
+ {21, 7},
};
static arc arcs_5_4[3] = {
{19, 1},
{23, 2},
{0, 4},
};
-static arc arcs_5_5[1] = {
+static arc arcs_5_5[2] = {
+ {22, 8},
{0, 5},
};
-static arc arcs_5_6[2] = {
+static arc arcs_5_6[1] = {
+ {12, 9},
+};
+static arc arcs_5_7[2] = {
{22, 4},
- {0, 6},
+ {0, 7},
+};
+static arc arcs_5_8[1] = {
+ {23, 10},
+};
+static arc arcs_5_9[1] = {
+ {0, 9},
};
-static state states_5[7] = {
+static arc arcs_5_10[1] = {
+ {23, 6},
+};
+static state states_5[11] = {
{2, arcs_5_0},
{3, arcs_5_1},
- {1, arcs_5_2},
+ {2, arcs_5_2},
{1, arcs_5_3},
{3, arcs_5_4},
- {1, arcs_5_5},
- {2, arcs_5_6},
+ {2, arcs_5_5},
+ {1, arcs_5_6},
+ {2, arcs_5_7},
+ {1, arcs_5_8},
+ {1, arcs_5_9},
+ {1, arcs_5_10},
};
static arc arcs_6_0[2] = {
{12, 1},
@@ -320,15 +338,24 @@ static arc arcs_19_2[2] = {
static arc arcs_19_3[1] = {
{21, 4},
};
-static arc arcs_19_4[1] = {
+static arc arcs_19_4[2] = {
+ {22, 5},
{0, 4},
};
-static state states_19[5] = {
+static arc arcs_19_5[1] = {
+ {21, 6},
+};
+static arc arcs_19_6[1] = {
+ {0, 6},
+};
+static state states_19[7] = {
{1, arcs_19_0},
{1, arcs_19_1},
{2, arcs_19_2},
{1, arcs_19_3},
- {1, arcs_19_4},
+ {2, arcs_19_4},
+ {1, arcs_19_5},
+ {1, arcs_19_6},
};
static arc arcs_20_0[2] = {
{48, 1},
@@ -958,11 +985,11 @@ static arc arcs_47_0[3] = {
{51, 3},
};
static arc arcs_47_1[2] = {
- {9, 4},
+ {117, 4},
{18, 5},
};
static arc arcs_47_2[1] = {
- {117, 6},
+ {118, 6},
};
static arc arcs_47_3[1] = {
{12, 5},
@@ -1063,7 +1090,7 @@ static state states_51[5] = {
{2, arcs_51_4},
};
static arc arcs_52_0[1] = {
- {118, 1},
+ {119, 1},
};
static arc arcs_52_1[1] = {
{12, 2},
@@ -1097,115 +1124,154 @@ static state states_52[8] = {
{1, arcs_52_6},
{1, arcs_52_7},
};
-static dfa dfas[53] = {
+static arc arcs_53_0[1] = {
+ {120, 1},
+};
+static arc arcs_53_1[2] = {
+ {22, 2},
+ {0, 1},
+};
+static arc arcs_53_2[2] = {
+ {120, 1},
+ {0, 2},
+};
+static state states_53[3] = {
+ {1, arcs_53_0},
+ {2, arcs_53_1},
+ {2, arcs_53_2},
+};
+static arc arcs_54_0[1] = {
+ {21, 1},
+};
+static arc arcs_54_1[2] = {
+ {20, 2},
+ {0, 1},
+};
+static arc arcs_54_2[1] = {
+ {21, 3},
+};
+static arc arcs_54_3[1] = {
+ {0, 3},
+};
+static state states_54[4] = {
+ {1, arcs_54_0},
+ {2, arcs_54_1},
+ {1, arcs_54_2},
+ {1, arcs_54_3},
+};
+static dfa dfas[55] = {
{256, "single_input", 0, 3, states_0,
- "\004\030\001\000\260\360\265\200\034\200\000\000\060\122\136"},
+ "\004\030\001\000\260\360\265\200\034\200\000\000\060\122\236\000"},
{257, "file_input", 0, 2, states_1,
- "\204\030\001\000\260\360\265\200\034\200\000\000\060\122\136"},
+ "\204\030\001\000\260\360\265\200\034\200\000\000\060\122\236\000"},
{258, "eval_input", 0, 3, states_2,
- "\000\020\001\000\000\000\000\000\000\200\000\000\060\122\036"},
+ "\000\020\001\000\000\000\000\000\000\200\000\000\060\122\036\000"},
{259, "funcdef", 0, 6, states_3,
- "\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000"},
+ "\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
{260, "parameters", 0, 4, states_4,
- "\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000"},
- {261, "varargslist", 0, 7, states_5,
- "\000\020\201\000\000\000\000\000\000\000\000\000\000\000\000"},
+ "\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000"},
+ {261, "varargslist", 0, 11, states_5,
+ "\000\020\201\000\000\000\000\000\000\000\000\000\000\000\000\000"},
{262, "fpdef", 0, 4, states_6,
- "\000\020\001\000\000\000\000\000\000\000\000\000\000\000\000"},
+ "\000\020\001\000\000\000\000\000\000\000\000\000\000\000\000\000"},
{263, "fplist", 0, 3, states_7,
- "\000\020\001\000\000\000\000\000\000\000\000\000\000\000\000"},
+ "\000\020\001\000\000\000\000\000\000\000\000\000\000\000\000\000"},
{264, "stmt", 0, 2, states_8,
- "\000\030\001\000\260\360\265\200\034\200\000\000\060\122\136"},
+ "\000\030\001\000\260\360\265\200\034\200\000\000\060\122\236\000"},
{265, "simple_stmt", 0, 4, states_9,
- "\000\020\001\000\260\360\265\000\000\200\000\000\060\122\036"},
+ "\000\020\001\000\260\360\265\000\000\200\000\000\060\122\036\000"},
{266, "small_stmt", 0, 2, states_10,
- "\000\020\001\000\260\360\265\000\000\200\000\000\060\122\036"},
+ "\000\020\001\000\260\360\265\000\000\200\000\000\060\122\036\000"},
{267, "expr_stmt", 0, 2, states_11,
- "\000\020\001\000\000\000\000\000\000\200\000\000\060\122\036"},
+ "\000\020\001\000\000\000\000\000\000\200\000\000\060\122\036\000"},
{268, "print_stmt", 0, 3, states_12,
- "\000\000\000\000\020\000\000\000\000\000\000\000\000\000\000"},
+ "\000\000\000\000\020\000\000\000\000\000\000\000\000\000\000\000"},
{269, "del_stmt", 0, 3, states_13,
- "\000\000\000\000\040\000\000\000\000\000\000\000\000\000\000"},
+ "\000\000\000\000\040\000\000\000\000\000\000\000\000\000\000\000"},
{270, "pass_stmt", 0, 2, states_14,
- "\000\000\000\000\200\000\000\000\000\000\000\000\000\000\000"},
+ "\000\000\000\000\200\000\000\000\000\000\000\000\000\000\000\000"},
{271, "flow_stmt", 0, 2, states_15,
- "\000\000\000\000\000\360\000\000\000\000\000\000\000\000\000"},
+ "\000\000\000\000\000\360\000\000\000\000\000\000\000\000\000\000"},
{272, "break_stmt", 0, 2, states_16,
- "\000\000\000\000\000\020\000\000\000\000\000\000\000\000\000"},
+ "\000\000\000\000\000\020\000\000\000\000\000\000\000\000\000\000"},
{273, "continue_stmt", 0, 2, states_17,
- "\000\000\000\000\000\040\000\000\000\000\000\000\000\000\000"},
+ "\000\000\000\000\000\040\000\000\000\000\000\000\000\000\000\000"},
{274, "return_stmt", 0, 3, states_18,
- "\000\000\000\000\000\100\000\000\000\000\000\000\000\000\000"},
- {275, "raise_stmt", 0, 5, states_19,
- "\000\000\000\000\000\200\000\000\000\000\000\000\000\000\000"},
+ "\000\000\000\000\000\100\000\000\000\000\000\000\000\000\000\000"},
+ {275, "raise_stmt", 0, 7, states_19,
+ "\000\000\000\000\000\200\000\000\000\000\000\000\000\000\000\000"},
{276, "import_stmt", 0, 9, states_20,
- "\000\000\000\000\000\000\005\000\000\000\000\000\000\000\000"},
+ "\000\000\000\000\000\000\005\000\000\000\000\000\000\000\000\000"},
{277, "dotted_name", 0, 2, states_21,
- "\000\020\000\000\000\000\000\000\000\000\000\000\000\000\000"},
+ "\000\020\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
{278, "global_stmt", 0, 3, states_22,
- "\000\000\000\000\000\000\020\000\000\000\000\000\000\000\000"},
+ "\000\000\000\000\000\000\020\000\000\000\000\000\000\000\000\000"},
{279, "access_stmt", 0, 7, states_23,
- "\000\000\000\000\000\000\040\000\000\000\000\000\000\000\000"},
+ "\000\000\000\000\000\000\040\000\000\000\000\000\000\000\000\000"},
{280, "accesstype", 0, 2, states_24,
- "\000\020\000\000\000\000\000\000\000\000\000\000\000\000\000"},
+ "\000\020\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
{281, "exec_stmt", 0, 7, states_25,
- "\000\000\000\000\000\000\200\000\000\000\000\000\000\000\000"},
+ "\000\000\000\000\000\000\200\000\000\000\000\000\000\000\000\000"},
{282, "compound_stmt", 0, 2, states_26,
- "\000\010\000\000\000\000\000\200\034\000\000\000\000\000\100"},
+ "\000\010\000\000\000\000\000\200\034\000\000\000\000\000\200\000"},
{283, "if_stmt", 0, 8, states_27,
- "\000\000\000\000\000\000\000\200\000\000\000\000\000\000\000"},
+ "\000\000\000\000\000\000\000\200\000\000\000\000\000\000\000\000"},
{284, "while_stmt", 0, 8, states_28,
- "\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000"},
+ "\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000"},
{285, "for_stmt", 0, 10, states_29,
- "\000\000\000\000\000\000\000\000\010\000\000\000\000\000\000"},
+ "\000\000\000\000\000\000\000\000\010\000\000\000\000\000\000\000"},
{286, "try_stmt", 0, 10, states_30,
- "\000\000\000\000\000\000\000\000\020\000\000\000\000\000\000"},
+ "\000\000\000\000\000\000\000\000\020\000\000\000\000\000\000\000"},
{287, "except_clause", 0, 5, states_31,
- "\000\000\000\000\000\000\000\000\200\000\000\000\000\000\000"},
+ "\000\000\000\000\000\000\000\000\200\000\000\000\000\000\000\000"},
{288, "suite", 0, 5, states_32,
- "\004\020\001\000\260\360\265\000\000\200\000\000\060\122\036"},
+ "\004\020\001\000\260\360\265\000\000\200\000\000\060\122\036\000"},
{289, "test", 0, 4, states_33,
- "\000\020\001\000\000\000\000\000\000\200\000\000\060\122\036"},
+ "\000\020\001\000\000\000\000\000\000\200\000\000\060\122\036\000"},
{290, "and_test", 0, 2, states_34,
- "\000\020\001\000\000\000\000\000\000\200\000\000\060\122\016"},
+ "\000\020\001\000\000\000\000\000\000\200\000\000\060\122\016\000"},
{291, "not_test", 0, 3, states_35,
- "\000\020\001\000\000\000\000\000\000\200\000\000\060\122\016"},
+ "\000\020\001\000\000\000\000\000\000\200\000\000\060\122\016\000"},
{292, "comparison", 0, 2, states_36,
- "\000\020\001\000\000\000\000\000\000\000\000\000\060\122\016"},
+ "\000\020\001\000\000\000\000\000\000\000\000\000\060\122\016\000"},
{293, "comp_op", 0, 4, states_37,
- "\000\000\000\000\000\000\000\002\000\200\374\003\000\000\000"},
+ "\000\000\000\000\000\000\000\002\000\200\374\003\000\000\000\000"},
{294, "expr", 0, 2, states_38,
- "\000\020\001\000\000\000\000\000\000\000\000\000\060\122\016"},
+ "\000\020\001\000\000\000\000\000\000\000\000\000\060\122\016\000"},
{295, "xor_expr", 0, 2, states_39,
- "\000\020\001\000\000\000\000\000\000\000\000\000\060\122\016"},
+ "\000\020\001\000\000\000\000\000\000\000\000\000\060\122\016\000"},
{296, "and_expr", 0, 2, states_40,
- "\000\020\001\000\000\000\000\000\000\000\000\000\060\122\016"},
+ "\000\020\001\000\000\000\000\000\000\000\000\000\060\122\016\000"},
{297, "shift_expr", 0, 2, states_41,
- "\000\020\001\000\000\000\000\000\000\000\000\000\060\122\016"},
+ "\000\020\001\000\000\000\000\000\000\000\000\000\060\122\016\000"},
{298, "arith_expr", 0, 2, states_42,
- "\000\020\001\000\000\000\000\000\000\000\000\000\060\122\016"},
+ "\000\020\001\000\000\000\000\000\000\000\000\000\060\122\016\000"},
{299, "term", 0, 2, states_43,
- "\000\020\001\000\000\000\000\000\000\000\000\000\060\122\016"},
+ "\000\020\001\000\000\000\000\000\000\000\000\000\060\122\016\000"},
{300, "factor", 0, 4, states_44,
- "\000\020\001\000\000\000\000\000\000\000\000\000\060\122\016"},
+ "\000\020\001\000\000\000\000\000\000\000\000\000\060\122\016\000"},
{301, "atom", 0, 11, states_45,
- "\000\020\001\000\000\000\000\000\000\000\000\000\000\120\016"},
+ "\000\020\001\000\000\000\000\000\000\000\000\000\000\120\016\000"},
{302, "lambdef", 0, 5, states_46,
- "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\020"},
+ "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\020\000"},
{303, "trailer", 0, 7, states_47,
- "\000\000\001\000\000\000\010\000\000\000\000\000\000\020\000"},
+ "\000\000\001\000\000\000\010\000\000\000\000\000\000\020\000\000"},
{304, "subscript", 0, 4, states_48,
- "\000\120\001\000\000\000\000\000\000\200\000\000\060\122\036"},
+ "\000\120\001\000\000\000\000\000\000\200\000\000\060\122\036\000"},
{305, "exprlist", 0, 3, states_49,
- "\000\020\001\000\000\000\000\000\000\000\000\000\060\122\016"},
+ "\000\020\001\000\000\000\000\000\000\000\000\000\060\122\016\000"},
{306, "testlist", 0, 3, states_50,
- "\000\020\001\000\000\000\000\000\000\200\000\000\060\122\036"},
+ "\000\020\001\000\000\000\000\000\000\200\000\000\060\122\036\000"},
{307, "dictmaker", 0, 5, states_51,
- "\000\020\001\000\000\000\000\000\000\200\000\000\060\122\036"},
+ "\000\020\001\000\000\000\000\000\000\200\000\000\060\122\036\000"},
{308, "classdef", 0, 8, states_52,
- "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\100"},
+ "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\200\000"},
+ {309, "arglist", 0, 3, states_53,
+ "\000\020\001\000\000\000\000\000\000\200\000\000\060\122\036\000"},
+ {310, "argument", 0, 4, states_54,
+ "\000\020\001\000\000\000\000\000\000\200\000\000\060\122\036\000"},
};
-static label labels[119] = {
+static label labels[121] = {
{0, "EMPTY"},
{256, 0},
{4, 0},
@@ -1323,12 +1389,14 @@ static label labels[119] = {
{2, 0},
{3, 0},
{1, "lambda"},
+ {309, 0},
{304, 0},
{1, "class"},
+ {310, 0},
};
grammar gram = {
- 53,
+ 55,
dfas,
- {119, labels},
+ {121, labels},
256
};