blob: e9f42455b484d268e4e66a3ec4b85fca89f64911 [file] [log] [blame]
Guido van Rossumf70e43a1991-02-19 12:39:46 +00001/***********************************************************
Guido van Rossumb9f8d6e1995-01-04 19:08:09 +00002Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam,
3The Netherlands.
Guido van Rossumf70e43a1991-02-19 12:39:46 +00004
5 All Rights Reserved
6
Guido van Rossumd266eb41996-10-25 14:44:06 +00007Permission to use, copy, modify, and distribute this software and its
8documentation for any purpose and without fee is hereby granted,
Guido van Rossumf70e43a1991-02-19 12:39:46 +00009provided that the above copyright notice appear in all copies and that
Guido van Rossumd266eb41996-10-25 14:44:06 +000010both that copyright notice and this permission notice appear in
Guido van Rossumf70e43a1991-02-19 12:39:46 +000011supporting documentation, and that the names of Stichting Mathematisch
Guido van Rossumd266eb41996-10-25 14:44:06 +000012Centrum or CWI or Corporation for National Research Initiatives or
13CNRI not be used in advertising or publicity pertaining to
14distribution of the software without specific, written prior
15permission.
Guido van Rossumf70e43a1991-02-19 12:39:46 +000016
Guido van Rossumd266eb41996-10-25 14:44:06 +000017While CWI is the initial source for this software, a modified version
18is made available by the Corporation for National Research Initiatives
19(CNRI) at the Internet address ftp://ftp.python.org.
20
21STICHTING MATHEMATISCH CENTRUM AND CNRI DISCLAIM ALL WARRANTIES WITH
22REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
23MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH
24CENTRUM OR CNRI BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
25DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
26PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
27TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
28PERFORMANCE OF THIS SOFTWARE.
Guido van Rossumf70e43a1991-02-19 12:39:46 +000029
30******************************************************************/
31
Guido van Rossum3f5da241990-12-20 15:06:42 +000032#include "pgenheaders.h"
Guido van Rossum85a5fbb1990-10-14 12:07:46 +000033#include "metagrammar.h"
34#include "grammar.h"
Guido van Rossum3f5da241990-12-20 15:06:42 +000035#include "pgen.h"
Guido van Rossum85a5fbb1990-10-14 12:07:46 +000036static arc arcs_0_0[3] = {
37 {2, 0},
38 {3, 0},
39 {4, 1},
40};
41static arc arcs_0_1[1] = {
42 {0, 1},
43};
44static state states_0[2] = {
45 {3, arcs_0_0},
46 {1, arcs_0_1},
47};
48static arc arcs_1_0[1] = {
49 {5, 1},
50};
51static arc arcs_1_1[1] = {
52 {6, 2},
53};
54static arc arcs_1_2[1] = {
55 {7, 3},
56};
57static arc arcs_1_3[1] = {
58 {3, 4},
59};
60static arc arcs_1_4[1] = {
61 {0, 4},
62};
63static 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};
70static arc arcs_2_0[1] = {
71 {8, 1},
72};
73static arc arcs_2_1[2] = {
74 {9, 0},
75 {0, 1},
76};
77static state states_2[2] = {
78 {1, arcs_2_0},
79 {2, arcs_2_1},
80};
81static arc arcs_3_0[1] = {
82 {10, 1},
83};
84static arc arcs_3_1[2] = {
85 {10, 1},
86 {0, 1},
87};
88static state states_3[2] = {
89 {1, arcs_3_0},
90 {2, arcs_3_1},
91};
92static arc arcs_4_0[2] = {
93 {11, 1},
94 {13, 2},
95};
96static arc arcs_4_1[1] = {
97 {7, 3},
98};
99static arc arcs_4_2[3] = {
100 {14, 4},
101 {15, 4},
102 {0, 2},
103};
104static arc arcs_4_3[1] = {
105 {12, 4},
106};
107static arc arcs_4_4[1] = {
108 {0, 4},
109};
110static 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};
117static arc arcs_5_0[3] = {
118 {5, 1},
119 {16, 1},
120 {17, 2},
121};
122static arc arcs_5_1[1] = {
123 {0, 1},
124};
125static arc arcs_5_2[1] = {
126 {7, 3},
127};
128static arc arcs_5_3[1] = {
129 {18, 1},
130};
131static 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};
137static 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};
151static 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};
Guido van Rossum86bea461997-04-29 21:03:06 +0000172static grammar _PyParser_Grammar = {
Guido van Rossum85a5fbb1990-10-14 12:07:46 +0000173 6,
174 dfas,
175 {19, labels},
176 256
177};
178
179grammar *
180meta_grammar()
181{
Guido van Rossum86bea461997-04-29 21:03:06 +0000182 return &_PyParser_Grammar;
Guido van Rossum85a5fbb1990-10-14 12:07:46 +0000183}