1;---------------------
  2; LALR(1) parse tables
  3;---------------------
  4;
  5; Suitable for input to the Common Lisp program 
  6;
  7;     LR(1)AndLALR(1)Parser.lsp
  8;
  9
 10; TERMINALS
 11;
 12
 13(INTEGER PERIOD ^ BACKSLASH $)
 14
 15;  PRODUCTIONS
 16;
 17;  Productions are numbered starting with 1.
 18;  All alternates were expanded into separate productions.
 19
 20(
 21  ( (1)   (S -> INTEGER INTEGER FACTORIZATION) )
 22  ( (2)   (FACTORIZATION -> FACTORIZATION PERIOD FACTOR) )
 23  ( (3)   (FACTORIZATION -> FACTOR) )
 24  ( (4)   (FACTOR -> BIGINTEGER ^ BIGINTEGER) )
 25  ( (5)   (FACTOR -> BIGINTEGER) )
 26  ( (6)   (BIGINTEGER -> BIGINTEGER BACKSLASH INTEGER) )
 27  ( (7)   (BIGINTEGER -> INTEGER) )
 28)
 29
 30;  GOTO GRAPH
 31;                 
 32;  Not needed for the parser, but here for reference and debugging.
 33; **********
 34;  Goto graph of the LR(1) or LALR(1) grammar of the form
 35;                
 36; (
 37;   (                     <-- List of links.
 38;       (6 |a| 4)         <-- Transition in Goto graph from state 6 to
 39;                             state 4 on symbol a.
 40;       (1 |a| 2)         <-- Transition from state 1 to state 2 on a.
 41;   )
 42;                   
 43;   (                     <-- List of sets of items.
 44;       ( 0                                <-- State number 0.
 45;         3668                             <-- Hash value of core.
 46;         (
 47;            (SP -> DOT S           |,|  $)  ----+
 48;            ( S -> DOT S |a| S |b| |,|  $)      |
 49;            ( S -> DOT EPSILON     |,|  $)      +---- Set of items for state 0
 50;            ( S -> DOT S |a| S |b| |,| |a|)     |
 51;            ( S -> DOT EPSILON     |,| |a|)     |
 52;         )                                  ----+
 53;       ) 
 54
 55(
 56    (
 57        (-1 NIL 0)
 58        (0 S 1)
 59        (0 INTEGER 2)
 60        (2 INTEGER 3)
 61        (3 INTEGER 4)
 62        (3 FACTORIZATION 5)
 63        (3 FACTOR 6)
 64        (3 BIGINTEGER 7)
 65        (5 PERIOD 8)
 66        (7 ^ 9)
 67        (7 BACKSLASH 10)
 68        (8 INTEGER 4)
 69        (8 FACTOR 11)
 70        (8 BIGINTEGER 7)
 71        (9 INTEGER 4)
 72        (9 BIGINTEGER 13)
 73        (10 INTEGER 14)
 74        (13 BACKSLASH 10)
 75    )
 76    (
 77        (1
 78        1752
 79            (SP -> S DOT |,| $)
 80        )
 81        (0
 82        3968
 83            (SP -> DOT S |,| $)
 84            (S -> DOT INTEGER INTEGER FACTORIZATION |,| $)
 85        )
 86        (2
 87        4356
 88            (S -> INTEGER DOT INTEGER FACTORIZATION |,| $)
 89        )
 90        (4
 91        4800
 92            (BIGINTEGER -> INTEGER DOT |,| ^)
 93            (BIGINTEGER -> INTEGER DOT |,| $)
 94            (BIGINTEGER -> INTEGER DOT |,| PERIOD)
 95            (BIGINTEGER -> INTEGER DOT |,| BACKSLASH)
 96        )
 97        (6
 98        5322
 99            (FACTORIZATION -> FACTOR DOT |,| $)
100            (FACTORIZATION -> FACTOR DOT |,| PERIOD)
101        )
102        (10
103        10374
104            (BIGINTEGER -> BIGINTEGER BACKSLASH DOT INTEGER |,| ^)
105            (BIGINTEGER -> BIGINTEGER BACKSLASH DOT INTEGER |,| $)
106            (BIGINTEGER -> BIGINTEGER BACKSLASH DOT INTEGER |,| PERIOD)
107            (BIGINTEGER -> BIGINTEGER BACKSLASH DOT INTEGER |,| BACKSLASH)
108        )
109        (9
110        13932
111            (FACTOR -> BIGINTEGER ^ DOT BIGINTEGER |,| $)
112            (FACTOR -> BIGINTEGER ^ DOT BIGINTEGER |,| PERIOD)
113            (BIGINTEGER -> DOT BIGINTEGER BACKSLASH INTEGER |,| $)
114            (BIGINTEGER -> DOT INTEGER |,| $)
115            (BIGINTEGER -> DOT BIGINTEGER BACKSLASH INTEGER |,| PERIOD)
116            (BIGINTEGER -> DOT INTEGER |,| PERIOD)
117            (BIGINTEGER -> DOT BIGINTEGER BACKSLASH INTEGER |,| BACKSLASH)
118            (BIGINTEGER -> DOT INTEGER |,| BACKSLASH)
119        )
120        (14
121        14940
122            (BIGINTEGER -> BIGINTEGER BACKSLASH INTEGER DOT |,| ^)
123            (BIGINTEGER -> BIGINTEGER BACKSLASH INTEGER DOT |,| $)
124            (BIGINTEGER -> BIGINTEGER BACKSLASH INTEGER DOT |,| PERIOD)
125            (BIGINTEGER -> BIGINTEGER BACKSLASH INTEGER DOT |,| BACKSLASH)
126        )
127        (11
128        16070
129            (FACTORIZATION -> FACTORIZATION PERIOD FACTOR DOT |,| $)
130            (FACTORIZATION -> FACTORIZATION PERIOD FACTOR DOT |,| PERIOD)
131        )
132        (7
133        16564
134            (FACTOR -> BIGINTEGER DOT ^ BIGINTEGER |,| $)
135            (FACTOR -> BIGINTEGER DOT |,| $)
136            (FACTOR -> BIGINTEGER DOT ^ BIGINTEGER |,| PERIOD)
137            (FACTOR -> BIGINTEGER DOT |,| PERIOD)
138            (BIGINTEGER -> BIGINTEGER DOT BACKSLASH INTEGER |,| ^)
139            (BIGINTEGER -> BIGINTEGER DOT BACKSLASH INTEGER |,| $)
140            (BIGINTEGER -> BIGINTEGER DOT BACKSLASH INTEGER |,| PERIOD)
141            (BIGINTEGER -> BIGINTEGER DOT BACKSLASH INTEGER |,| BACKSLASH)
142        )
143        (13
144        18363
145            (FACTOR -> BIGINTEGER ^ BIGINTEGER DOT |,| $)
146            (FACTOR -> BIGINTEGER ^ BIGINTEGER DOT |,| PERIOD)
147            (BIGINTEGER -> BIGINTEGER DOT BACKSLASH INTEGER |,| $)
148            (BIGINTEGER -> BIGINTEGER DOT BACKSLASH INTEGER |,| PERIOD)
149            (BIGINTEGER -> BIGINTEGER DOT BACKSLASH INTEGER |,| BACKSLASH)
150        )
151        (5
152        20156
153            (S -> INTEGER INTEGER FACTORIZATION DOT |,| $)
154            (FACTORIZATION -> FACTORIZATION DOT PERIOD FACTOR |,| $)
155            (FACTORIZATION -> FACTORIZATION DOT PERIOD FACTOR |,| PERIOD)
156        )
157        (8
158        23693
159            (FACTORIZATION -> FACTORIZATION PERIOD DOT FACTOR |,| $)
160            (FACTORIZATION -> FACTORIZATION PERIOD DOT FACTOR |,| PERIOD)
161            (FACTOR -> DOT BIGINTEGER ^ BIGINTEGER |,| $)
162            (FACTOR -> DOT BIGINTEGER |,| $)
163            (FACTOR -> DOT BIGINTEGER ^ BIGINTEGER |,| PERIOD)
164            (FACTOR -> DOT BIGINTEGER |,| PERIOD)
165            (BIGINTEGER -> DOT BIGINTEGER BACKSLASH INTEGER |,| ^)
166            (BIGINTEGER -> DOT INTEGER |,| ^)
167            (BIGINTEGER -> DOT BIGINTEGER BACKSLASH INTEGER |,| $)
168            (BIGINTEGER -> DOT INTEGER |,| $)
169            (BIGINTEGER -> DOT BIGINTEGER BACKSLASH INTEGER |,| PERIOD)
170            (BIGINTEGER -> DOT INTEGER |,| PERIOD)
171            (BIGINTEGER -> DOT BIGINTEGER BACKSLASH INTEGER |,| BACKSLASH)
172            (BIGINTEGER -> DOT INTEGER |,| BACKSLASH)
173        )
174        (3
175        26701
176            (S -> INTEGER INTEGER DOT FACTORIZATION |,| $)
177            (FACTORIZATION -> DOT FACTORIZATION PERIOD FACTOR |,| $)
178            (FACTORIZATION -> DOT FACTOR |,| $)
179            (FACTORIZATION -> DOT FACTORIZATION PERIOD FACTOR |,| PERIOD)
180            (FACTORIZATION -> DOT FACTOR |,| PERIOD)
181            (FACTOR -> DOT BIGINTEGER ^ BIGINTEGER |,| $)
182            (FACTOR -> DOT BIGINTEGER |,| $)
183            (FACTOR -> DOT BIGINTEGER ^ BIGINTEGER |,| PERIOD)
184            (FACTOR -> DOT BIGINTEGER |,| PERIOD)
185            (BIGINTEGER -> DOT BIGINTEGER BACKSLASH INTEGER |,| ^)
186            (BIGINTEGER -> DOT INTEGER |,| ^)
187            (BIGINTEGER -> DOT BIGINTEGER BACKSLASH INTEGER |,| $)
188            (BIGINTEGER -> DOT INTEGER |,| $)
189            (BIGINTEGER -> DOT BIGINTEGER BACKSLASH INTEGER |,| PERIOD)
190            (BIGINTEGER -> DOT INTEGER |,| PERIOD)
191            (BIGINTEGER -> DOT BIGINTEGER BACKSLASH INTEGER |,| BACKSLASH)
192            (BIGINTEGER -> DOT INTEGER |,| BACKSLASH)
193        )
194    )
195)
196
197;  ACTION TABLE
198;
199;  (state
200;         (item)
201;         ...
202
203(
204    ( (0) 
205        (
206            (INTEGER (S 2))
207            (DEFAULT (ERROR))
208        )
209    )
210    ( (1) 
211        (
212            ($ (ACC NIL))
213            (DEFAULT (ERROR))
214        )
215    )
216    ( (2) 
217        (
218            (INTEGER (S 3))
219            (DEFAULT (ERROR))
220        )
221    )
222    ( (3) 
223        (
224            (INTEGER (S 4))
225            (DEFAULT (ERROR))
226        )
227    )
228    ( (4) 
229        (
230            (^ (R 7))
231            ($ (R 7))
232            (PERIOD (R 7))
233            (BACKSLASH (R 7))
234            (DEFAULT (ERROR))
235        )
236    )
237    ( (5) 
238        (
239            ($ (R 1))
240            (PERIOD (S 8))
241            (DEFAULT (ERROR))
242        )
243    )
244    ( (6) 
245        (
246            ($ (R 3))
247            (PERIOD (R 3))
248            (DEFAULT (ERROR))
249        )
250    )
251    ( (7) 
252        (
253            (^ (S 9))
254            ($ (R 5))
255            (PERIOD (R 5))
256            (BACKSLASH (S 10))
257            (DEFAULT (ERROR))
258        )
259    )
260    ( (8) 
261        (
262            (INTEGER (S 4))
263            (DEFAULT (ERROR))
264        )
265    )
266    ( (9) 
267        (
268            (INTEGER (S 4))
269            (DEFAULT (ERROR))
270        )
271    )
272    ( (10) 
273        (
274            (INTEGER (S 14))
275            (DEFAULT (ERROR))
276        )
277    )
278    ( (11) 
279        (
280            ($ (R 2))
281            (PERIOD (R 2))
282            (DEFAULT (ERROR))
283        )
284    )
285    ( (13) 
286        (
287            ($ (R 4))
288            (PERIOD (R 4))
289            (BACKSLASH (S 10))
290            (DEFAULT (ERROR))
291        )
292    )
293    ( (14) 
294        (
295            (^ (R 6))
296            ($ (R 6))
297            (PERIOD (R 6))
298            (BACKSLASH (R 6))
299            (DEFAULT (ERROR))
300        )
301    )
302)
303
304;  GOTO TABLE
305;
306;  (state
307;         (item)
308;         ...
309
310(
311    ( (0) 
312        (
313            (S 1)
314            (DEFAULT (ERROR))
315        )
316    )
317    ( (3) 
318        (
319            (FACTORIZATION 5)
320            (FACTOR 6)
321            (BIGINTEGER 7)
322            (DEFAULT (ERROR))
323        )
324    )
325    ( (8) 
326        (
327            (FACTOR 11)
328            (BIGINTEGER 7)
329            (DEFAULT (ERROR))
330        )
331    )
332    ( (9) 
333        (
334            (BIGINTEGER 13)
335            (DEFAULT (ERROR))
336        )
337    )
338)
339
340
341;  ERROR MESSAGE TABLE
342;
343;  If the action table has an error state, the other non-error
344;  actions show which symbol was failed to appear next on the input.
345;
346;  The user can modify these minimal error messages.
347
348
349
350(
351
352    ((0) ("error - expecting one of the symbols INTEGER")) 
353    ((1) ("error - expecting one of the symbols $")) 
354    ((2) ("error - expecting one of the symbols INTEGER")) 
355    ((3) ("error - expecting one of the symbols INTEGER")) 
356    ((4) ("error - expecting one of the symbols BACKSLASH PERIOD $ ^")) 
357    ((5) ("error - expecting one of the symbols PERIOD $")) 
358    ((6) ("error - expecting one of the symbols PERIOD $")) 
359    ((7) ("error - expecting one of the symbols BACKSLASH PERIOD $ ^")) 
360    ((8) ("error - expecting one of the symbols INTEGER")) 
361    ((9) ("error - expecting one of the symbols INTEGER")) 
362    ((10) ("error - expecting one of the symbols INTEGER")) 
363    ((11) ("error - expecting one of the symbols PERIOD $")) 
364    ((13) ("error - expecting one of the symbols BACKSLASH PERIOD $")) 
365    ((14) ("error - expecting one of the symbols BACKSLASH PERIOD $ ^")) 
366)