Mercurial > cpython-lru_cache-weakref
annotate Parser/metagrammar.c @ 5817:48b94de85bf3 legacy-trunk
Extensive changes by AMK.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Thu, 17 Jul 1997 16:29:42 +0000 |
| parents | 1c9a84e0981d |
| children | 916fb024ce94 |
| rev | line source |
|---|---|
| 145 | 1 /*********************************************************** |
|
2060
146890653a57
Added 1995 to copyright message.
Guido van Rossum <guido@python.org>
parents:
1848
diff
changeset
|
2 Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, |
|
146890653a57
Added 1995 to copyright message.
Guido van Rossum <guido@python.org>
parents:
1848
diff
changeset
|
3 The Netherlands. |
| 145 | 4 |
| 5 All Rights Reserved | |
| 6 | |
|
4503
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
2060
diff
changeset
|
7 Permission to use, copy, modify, and distribute this software and its |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
2060
diff
changeset
|
8 documentation for any purpose and without fee is hereby granted, |
| 145 | 9 provided that the above copyright notice appear in all copies and that |
|
4503
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
2060
diff
changeset
|
10 both that copyright notice and this permission notice appear in |
| 145 | 11 supporting documentation, and that the names of Stichting Mathematisch |
|
4503
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
2060
diff
changeset
|
12 Centrum or CWI or Corporation for National Research Initiatives or |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
2060
diff
changeset
|
13 CNRI not be used in advertising or publicity pertaining to |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
2060
diff
changeset
|
14 distribution of the software without specific, written prior |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
2060
diff
changeset
|
15 permission. |
| 145 | 16 |
|
4503
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
2060
diff
changeset
|
17 While CWI is the initial source for this software, a modified version |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
2060
diff
changeset
|
18 is made available by the Corporation for National Research Initiatives |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
2060
diff
changeset
|
19 (CNRI) at the Internet address ftp://ftp.python.org. |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
2060
diff
changeset
|
20 |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
2060
diff
changeset
|
21 STICHTING MATHEMATISCH CENTRUM AND CNRI DISCLAIM ALL WARRANTIES WITH |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
2060
diff
changeset
|
22 REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
2060
diff
changeset
|
23 MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
2060
diff
changeset
|
24 CENTRUM OR CNRI BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
2060
diff
changeset
|
25 DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
2060
diff
changeset
|
26 PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
2060
diff
changeset
|
27 TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
2060
diff
changeset
|
28 PERFORMANCE OF THIS SOFTWARE. |
| 145 | 29 |
| 30 ******************************************************************/ | |
| 31 | |
| 86 | 32 #include "pgenheaders.h" |
| 6 | 33 #include "metagrammar.h" |
| 34 #include "grammar.h" | |
| 86 | 35 #include "pgen.h" |
| 6 | 36 static arc arcs_0_0[3] = { |
| 37 {2, 0}, | |
| 38 {3, 0}, | |
| 39 {4, 1}, | |
| 40 }; | |
| 41 static arc arcs_0_1[1] = { | |
| 42 {0, 1}, | |
| 43 }; | |
| 44 static state states_0[2] = { | |
| 45 {3, arcs_0_0}, | |
| 46 {1, arcs_0_1}, | |
| 47 }; | |
| 48 static arc arcs_1_0[1] = { | |
| 49 {5, 1}, | |
| 50 }; | |
| 51 static arc arcs_1_1[1] = { | |
| 52 {6, 2}, | |
| 53 }; | |
| 54 static arc arcs_1_2[1] = { | |
| 55 {7, 3}, | |
| 56 }; | |
| 57 static arc arcs_1_3[1] = { | |
| 58 {3, 4}, | |
| 59 }; | |
| 60 static arc arcs_1_4[1] = { | |
| 61 {0, 4}, | |
| 62 }; | |
| 63 static state states_1[5] = { | |
| 64 {1, arcs_1_0}, | |
| 65 {1, arcs_1_1}, | |
| 66 {1, arcs_1_2}, | |
| 67 {1, arcs_1_3}, | |
| 68 {1, arcs_1_4}, | |
| 69 }; | |
| 70 static arc arcs_2_0[1] = { | |
| 71 {8, 1}, | |
| 72 }; | |
| 73 static arc arcs_2_1[2] = { | |
| 74 {9, 0}, | |
| 75 {0, 1}, | |
| 76 }; | |
| 77 static state states_2[2] = { | |
| 78 {1, arcs_2_0}, | |
| 79 {2, arcs_2_1}, | |
| 80 }; | |
| 81 static arc arcs_3_0[1] = { | |
| 82 {10, 1}, | |
| 83 }; | |
| 84 static arc arcs_3_1[2] = { | |
| 85 {10, 1}, | |
| 86 {0, 1}, | |
| 87 }; | |
| 88 static state states_3[2] = { | |
| 89 {1, arcs_3_0}, | |
| 90 {2, arcs_3_1}, | |
| 91 }; | |
| 92 static arc arcs_4_0[2] = { | |
| 93 {11, 1}, | |
| 94 {13, 2}, | |
| 95 }; | |
| 96 static arc arcs_4_1[1] = { | |
| 97 {7, 3}, | |
| 98 }; | |
| 99 static arc arcs_4_2[3] = { | |
| 100 {14, 4}, | |
| 101 {15, 4}, | |
| 102 {0, 2}, | |
| 103 }; | |
| 104 static arc arcs_4_3[1] = { | |
| 105 {12, 4}, | |
| 106 }; | |
| 107 static arc arcs_4_4[1] = { | |
| 108 {0, 4}, | |
| 109 }; | |
| 110 static state states_4[5] = { | |
| 111 {2, arcs_4_0}, | |
| 112 {1, arcs_4_1}, | |
| 113 {3, arcs_4_2}, | |
| 114 {1, arcs_4_3}, | |
| 115 {1, arcs_4_4}, | |
| 116 }; | |
| 117 static arc arcs_5_0[3] = { | |
| 118 {5, 1}, | |
| 119 {16, 1}, | |
| 120 {17, 2}, | |
| 121 }; | |
| 122 static arc arcs_5_1[1] = { | |
| 123 {0, 1}, | |
| 124 }; | |
| 125 static arc arcs_5_2[1] = { | |
| 126 {7, 3}, | |
| 127 }; | |
| 128 static arc arcs_5_3[1] = { | |
| 129 {18, 1}, | |
| 130 }; | |
| 131 static state states_5[4] = { | |
| 132 {3, arcs_5_0}, | |
| 133 {1, arcs_5_1}, | |
| 134 {1, arcs_5_2}, | |
| 135 {1, arcs_5_3}, | |
| 136 }; | |
| 137 static dfa dfas[6] = { | |
| 138 {256, "MSTART", 0, 2, states_0, | |
| 139 "\070\000\000"}, | |
| 140 {257, "RULE", 0, 5, states_1, | |
| 141 "\040\000\000"}, | |
| 142 {258, "RHS", 0, 2, states_2, | |
| 143 "\040\010\003"}, | |
| 144 {259, "ALT", 0, 2, states_3, | |
| 145 "\040\010\003"}, | |
| 146 {260, "ITEM", 0, 5, states_4, | |
| 147 "\040\010\003"}, | |
| 148 {261, "ATOM", 0, 4, states_5, | |
| 149 "\040\000\003"}, | |
| 150 }; | |
| 151 static label labels[19] = { | |
| 152 {0, "EMPTY"}, | |
| 153 {256, 0}, | |
| 154 {257, 0}, | |
| 155 {4, 0}, | |
| 156 {0, 0}, | |
| 157 {1, 0}, | |
| 158 {11, 0}, | |
| 159 {258, 0}, | |
| 160 {259, 0}, | |
| 161 {18, 0}, | |
| 162 {260, 0}, | |
| 163 {9, 0}, | |
| 164 {10, 0}, | |
| 165 {261, 0}, | |
| 166 {16, 0}, | |
| 167 {14, 0}, | |
| 168 {3, 0}, | |
| 169 {7, 0}, | |
| 170 {8, 0}, | |
| 171 }; | |
|
5379
1c9a84e0981d
Another directory quickly renamed.
Guido van Rossum <guido@python.org>
parents:
4503
diff
changeset
|
172 static grammar _PyParser_Grammar = { |
| 6 | 173 6, |
| 174 dfas, | |
| 175 {19, labels}, | |
| 176 256 | |
| 177 }; | |
| 178 | |
| 179 grammar * | |
| 180 meta_grammar() | |
| 181 { | |
|
5379
1c9a84e0981d
Another directory quickly renamed.
Guido van Rossum <guido@python.org>
parents:
4503
diff
changeset
|
182 return &_PyParser_Grammar; |
| 6 | 183 } |
