blob: 12c5d5b73d2ebba3ca67cc360c8254a7284c1d7d [file] [log] [blame]
Guido van Rossumf70e43a1991-02-19 12:39:46 +00001/***********************************************************
2Copyright 1991 by Stichting Mathematisch Centrum, Amsterdam, The
3Netherlands.
4
5 All Rights Reserved
6
7Permission to use, copy, modify, and distribute this software and its
8documentation for any purpose and without fee is hereby granted,
9provided that the above copyright notice appear in all copies and that
10both that copyright notice and this permission notice appear in
11supporting documentation, and that the names of Stichting Mathematisch
12Centrum or CWI not be used in advertising or publicity pertaining to
13distribution of the software without specific, written prior permission.
14
15STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
16THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
17FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
18FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
19WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
20ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
21OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22
23******************************************************************/
24
Guido van Rossum3f5da241990-12-20 15:06:42 +000025#include "pgenheaders.h"
Guido van Rossum85a5fbb1990-10-14 12:07:46 +000026#include "metagrammar.h"
27#include "grammar.h"
Guido van Rossum3f5da241990-12-20 15:06:42 +000028#include "pgen.h"
Guido van Rossum85a5fbb1990-10-14 12:07:46 +000029static arc arcs_0_0[3] = {
30 {2, 0},
31 {3, 0},
32 {4, 1},
33};
34static arc arcs_0_1[1] = {
35 {0, 1},
36};
37static state states_0[2] = {
38 {3, arcs_0_0},
39 {1, arcs_0_1},
40};
41static arc arcs_1_0[1] = {
42 {5, 1},
43};
44static arc arcs_1_1[1] = {
45 {6, 2},
46};
47static arc arcs_1_2[1] = {
48 {7, 3},
49};
50static arc arcs_1_3[1] = {
51 {3, 4},
52};
53static arc arcs_1_4[1] = {
54 {0, 4},
55};
56static state states_1[5] = {
57 {1, arcs_1_0},
58 {1, arcs_1_1},
59 {1, arcs_1_2},
60 {1, arcs_1_3},
61 {1, arcs_1_4},
62};
63static arc arcs_2_0[1] = {
64 {8, 1},
65};
66static arc arcs_2_1[2] = {
67 {9, 0},
68 {0, 1},
69};
70static state states_2[2] = {
71 {1, arcs_2_0},
72 {2, arcs_2_1},
73};
74static arc arcs_3_0[1] = {
75 {10, 1},
76};
77static arc arcs_3_1[2] = {
78 {10, 1},
79 {0, 1},
80};
81static state states_3[2] = {
82 {1, arcs_3_0},
83 {2, arcs_3_1},
84};
85static arc arcs_4_0[2] = {
86 {11, 1},
87 {13, 2},
88};
89static arc arcs_4_1[1] = {
90 {7, 3},
91};
92static arc arcs_4_2[3] = {
93 {14, 4},
94 {15, 4},
95 {0, 2},
96};
97static arc arcs_4_3[1] = {
98 {12, 4},
99};
100static arc arcs_4_4[1] = {
101 {0, 4},
102};
103static state states_4[5] = {
104 {2, arcs_4_0},
105 {1, arcs_4_1},
106 {3, arcs_4_2},
107 {1, arcs_4_3},
108 {1, arcs_4_4},
109};
110static arc arcs_5_0[3] = {
111 {5, 1},
112 {16, 1},
113 {17, 2},
114};
115static arc arcs_5_1[1] = {
116 {0, 1},
117};
118static arc arcs_5_2[1] = {
119 {7, 3},
120};
121static arc arcs_5_3[1] = {
122 {18, 1},
123};
124static state states_5[4] = {
125 {3, arcs_5_0},
126 {1, arcs_5_1},
127 {1, arcs_5_2},
128 {1, arcs_5_3},
129};
130static dfa dfas[6] = {
131 {256, "MSTART", 0, 2, states_0,
132 "\070\000\000"},
133 {257, "RULE", 0, 5, states_1,
134 "\040\000\000"},
135 {258, "RHS", 0, 2, states_2,
136 "\040\010\003"},
137 {259, "ALT", 0, 2, states_3,
138 "\040\010\003"},
139 {260, "ITEM", 0, 5, states_4,
140 "\040\010\003"},
141 {261, "ATOM", 0, 4, states_5,
142 "\040\000\003"},
143};
144static label labels[19] = {
145 {0, "EMPTY"},
146 {256, 0},
147 {257, 0},
148 {4, 0},
149 {0, 0},
150 {1, 0},
151 {11, 0},
152 {258, 0},
153 {259, 0},
154 {18, 0},
155 {260, 0},
156 {9, 0},
157 {10, 0},
158 {261, 0},
159 {16, 0},
160 {14, 0},
161 {3, 0},
162 {7, 0},
163 {8, 0},
164};
165static grammar gram = {
166 6,
167 dfas,
168 {19, labels},
169 256
170};
171
172grammar *
173meta_grammar()
174{
175 return &gram;
176}