Guido van Rossum | f70e43a | 1991-02-19 12:39:46 +0000 | [diff] [blame] | 1 | |
Guido van Rossum | 3f5da24 | 1990-12-20 15:06:42 +0000 | [diff] [blame] | 2 | #include "pgenheaders.h" |
Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 3 | #include "metagrammar.h" |
| 4 | #include "grammar.h" |
Guido van Rossum | 3f5da24 | 1990-12-20 15:06:42 +0000 | [diff] [blame] | 5 | #include "pgen.h" |
Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 6 | static arc arcs_0_0[3] = { |
Antoine Pitrou | c83ea13 | 2010-05-09 14:46:46 +0000 | [diff] [blame] | 7 | {2, 0}, |
| 8 | {3, 0}, |
| 9 | {4, 1}, |
Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 10 | }; |
| 11 | static arc arcs_0_1[1] = { |
Antoine Pitrou | c83ea13 | 2010-05-09 14:46:46 +0000 | [diff] [blame] | 12 | {0, 1}, |
Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 13 | }; |
| 14 | static state states_0[2] = { |
Antoine Pitrou | c83ea13 | 2010-05-09 14:46:46 +0000 | [diff] [blame] | 15 | {3, arcs_0_0}, |
| 16 | {1, arcs_0_1}, |
Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 17 | }; |
| 18 | static arc arcs_1_0[1] = { |
Antoine Pitrou | c83ea13 | 2010-05-09 14:46:46 +0000 | [diff] [blame] | 19 | {5, 1}, |
Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 20 | }; |
| 21 | static arc arcs_1_1[1] = { |
Antoine Pitrou | c83ea13 | 2010-05-09 14:46:46 +0000 | [diff] [blame] | 22 | {6, 2}, |
Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 23 | }; |
| 24 | static arc arcs_1_2[1] = { |
Antoine Pitrou | c83ea13 | 2010-05-09 14:46:46 +0000 | [diff] [blame] | 25 | {7, 3}, |
Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 26 | }; |
| 27 | static arc arcs_1_3[1] = { |
Antoine Pitrou | c83ea13 | 2010-05-09 14:46:46 +0000 | [diff] [blame] | 28 | {3, 4}, |
Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 29 | }; |
| 30 | static arc arcs_1_4[1] = { |
Antoine Pitrou | c83ea13 | 2010-05-09 14:46:46 +0000 | [diff] [blame] | 31 | {0, 4}, |
Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 32 | }; |
| 33 | static state states_1[5] = { |
Antoine Pitrou | c83ea13 | 2010-05-09 14:46:46 +0000 | [diff] [blame] | 34 | {1, arcs_1_0}, |
| 35 | {1, arcs_1_1}, |
| 36 | {1, arcs_1_2}, |
| 37 | {1, arcs_1_3}, |
| 38 | {1, arcs_1_4}, |
Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 39 | }; |
| 40 | static arc arcs_2_0[1] = { |
Antoine Pitrou | c83ea13 | 2010-05-09 14:46:46 +0000 | [diff] [blame] | 41 | {8, 1}, |
Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 42 | }; |
| 43 | static arc arcs_2_1[2] = { |
Antoine Pitrou | c83ea13 | 2010-05-09 14:46:46 +0000 | [diff] [blame] | 44 | {9, 0}, |
| 45 | {0, 1}, |
Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 46 | }; |
| 47 | static state states_2[2] = { |
Antoine Pitrou | c83ea13 | 2010-05-09 14:46:46 +0000 | [diff] [blame] | 48 | {1, arcs_2_0}, |
| 49 | {2, arcs_2_1}, |
Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 50 | }; |
| 51 | static arc arcs_3_0[1] = { |
Antoine Pitrou | c83ea13 | 2010-05-09 14:46:46 +0000 | [diff] [blame] | 52 | {10, 1}, |
Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 53 | }; |
| 54 | static arc arcs_3_1[2] = { |
Antoine Pitrou | c83ea13 | 2010-05-09 14:46:46 +0000 | [diff] [blame] | 55 | {10, 1}, |
| 56 | {0, 1}, |
Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 57 | }; |
| 58 | static state states_3[2] = { |
Antoine Pitrou | c83ea13 | 2010-05-09 14:46:46 +0000 | [diff] [blame] | 59 | {1, arcs_3_0}, |
| 60 | {2, arcs_3_1}, |
Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 61 | }; |
| 62 | static arc arcs_4_0[2] = { |
Antoine Pitrou | c83ea13 | 2010-05-09 14:46:46 +0000 | [diff] [blame] | 63 | {11, 1}, |
| 64 | {13, 2}, |
Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 65 | }; |
| 66 | static arc arcs_4_1[1] = { |
Antoine Pitrou | c83ea13 | 2010-05-09 14:46:46 +0000 | [diff] [blame] | 67 | {7, 3}, |
Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 68 | }; |
| 69 | static arc arcs_4_2[3] = { |
Antoine Pitrou | c83ea13 | 2010-05-09 14:46:46 +0000 | [diff] [blame] | 70 | {14, 4}, |
| 71 | {15, 4}, |
| 72 | {0, 2}, |
Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 73 | }; |
| 74 | static arc arcs_4_3[1] = { |
Antoine Pitrou | c83ea13 | 2010-05-09 14:46:46 +0000 | [diff] [blame] | 75 | {12, 4}, |
Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 76 | }; |
| 77 | static arc arcs_4_4[1] = { |
Antoine Pitrou | c83ea13 | 2010-05-09 14:46:46 +0000 | [diff] [blame] | 78 | {0, 4}, |
Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 79 | }; |
| 80 | static state states_4[5] = { |
Antoine Pitrou | c83ea13 | 2010-05-09 14:46:46 +0000 | [diff] [blame] | 81 | {2, arcs_4_0}, |
| 82 | {1, arcs_4_1}, |
| 83 | {3, arcs_4_2}, |
| 84 | {1, arcs_4_3}, |
| 85 | {1, arcs_4_4}, |
Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 86 | }; |
| 87 | static arc arcs_5_0[3] = { |
Antoine Pitrou | c83ea13 | 2010-05-09 14:46:46 +0000 | [diff] [blame] | 88 | {5, 1}, |
| 89 | {16, 1}, |
| 90 | {17, 2}, |
Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 91 | }; |
| 92 | static arc arcs_5_1[1] = { |
Antoine Pitrou | c83ea13 | 2010-05-09 14:46:46 +0000 | [diff] [blame] | 93 | {0, 1}, |
Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 94 | }; |
| 95 | static arc arcs_5_2[1] = { |
Antoine Pitrou | c83ea13 | 2010-05-09 14:46:46 +0000 | [diff] [blame] | 96 | {7, 3}, |
Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 97 | }; |
| 98 | static arc arcs_5_3[1] = { |
Antoine Pitrou | c83ea13 | 2010-05-09 14:46:46 +0000 | [diff] [blame] | 99 | {18, 1}, |
Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 100 | }; |
| 101 | static state states_5[4] = { |
Antoine Pitrou | c83ea13 | 2010-05-09 14:46:46 +0000 | [diff] [blame] | 102 | {3, arcs_5_0}, |
| 103 | {1, arcs_5_1}, |
| 104 | {1, arcs_5_2}, |
| 105 | {1, arcs_5_3}, |
Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 106 | }; |
| 107 | static dfa dfas[6] = { |
Antoine Pitrou | c83ea13 | 2010-05-09 14:46:46 +0000 | [diff] [blame] | 108 | {256, "MSTART", 0, 2, states_0, |
| 109 | "\070\000\000"}, |
| 110 | {257, "RULE", 0, 5, states_1, |
| 111 | "\040\000\000"}, |
| 112 | {258, "RHS", 0, 2, states_2, |
| 113 | "\040\010\003"}, |
| 114 | {259, "ALT", 0, 2, states_3, |
| 115 | "\040\010\003"}, |
| 116 | {260, "ITEM", 0, 5, states_4, |
| 117 | "\040\010\003"}, |
| 118 | {261, "ATOM", 0, 4, states_5, |
| 119 | "\040\000\003"}, |
Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 120 | }; |
| 121 | static label labels[19] = { |
Antoine Pitrou | c83ea13 | 2010-05-09 14:46:46 +0000 | [diff] [blame] | 122 | {0, "EMPTY"}, |
| 123 | {256, 0}, |
| 124 | {257, 0}, |
| 125 | {4, 0}, |
| 126 | {0, 0}, |
| 127 | {1, 0}, |
| 128 | {11, 0}, |
| 129 | {258, 0}, |
| 130 | {259, 0}, |
| 131 | {18, 0}, |
| 132 | {260, 0}, |
| 133 | {9, 0}, |
| 134 | {10, 0}, |
| 135 | {261, 0}, |
| 136 | {16, 0}, |
| 137 | {14, 0}, |
| 138 | {3, 0}, |
| 139 | {7, 0}, |
| 140 | {8, 0}, |
Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 141 | }; |
Guido van Rossum | 86bea46 | 1997-04-29 21:03:06 +0000 | [diff] [blame] | 142 | static grammar _PyParser_Grammar = { |
Antoine Pitrou | c83ea13 | 2010-05-09 14:46:46 +0000 | [diff] [blame] | 143 | 6, |
| 144 | dfas, |
| 145 | {19, labels}, |
| 146 | 256 |
Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 147 | }; |
| 148 | |
| 149 | grammar * |
Thomas Wouters | 23c9e00 | 2000-07-22 19:20:54 +0000 | [diff] [blame] | 150 | meta_grammar(void) |
Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 151 | { |
Antoine Pitrou | c83ea13 | 2010-05-09 14:46:46 +0000 | [diff] [blame] | 152 | return &_PyParser_Grammar; |
Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 153 | } |
Guido van Rossum | d3ab37f | 2003-04-17 14:55:42 +0000 | [diff] [blame] | 154 | |
| 155 | grammar * |
| 156 | Py_meta_grammar(void) |
| 157 | { |
| 158 | return meta_grammar(); |
| 159 | } |