1
{-# OPTIONS -fglasgow-exts -cpp #-}
2
module Parser (ourParser,AbsSyn) where
6
#if __GLASGOW_HASKELL__ >= 503
11
#if __GLASGOW_HASKELL__ >= 503
17
-- parser produced by Happy Version 1.16
19
newtype HappyAbsSyn = HappyAbsSyn (() -> ())
20
happyIn4 :: (AbsSyn) -> (HappyAbsSyn )
21
happyIn4 x = unsafeCoerce# x
22
{-# INLINE happyIn4 #-}
23
happyOut4 :: (HappyAbsSyn ) -> (AbsSyn)
24
happyOut4 x = unsafeCoerce# x
25
{-# INLINE happyOut4 #-}
26
happyIn5 :: ([(String, [([String],String,Int,Maybe String)], Maybe String)]) -> (HappyAbsSyn )
27
happyIn5 x = unsafeCoerce# x
28
{-# INLINE happyIn5 #-}
29
happyOut5 :: (HappyAbsSyn ) -> ([(String, [([String],String,Int,Maybe String)], Maybe String)])
30
happyOut5 x = unsafeCoerce# x
31
{-# INLINE happyOut5 #-}
32
happyIn6 :: ((String, [([String],String,Int,Maybe String)], Maybe String)) -> (HappyAbsSyn )
33
happyIn6 x = unsafeCoerce# x
34
{-# INLINE happyIn6 #-}
35
happyOut6 :: (HappyAbsSyn ) -> ((String, [([String],String,Int,Maybe String)], Maybe String))
36
happyOut6 x = unsafeCoerce# x
37
{-# INLINE happyOut6 #-}
38
happyIn7 :: ([([String],String,Int,Maybe String)]) -> (HappyAbsSyn )
39
happyIn7 x = unsafeCoerce# x
40
{-# INLINE happyIn7 #-}
41
happyOut7 :: (HappyAbsSyn ) -> ([([String],String,Int,Maybe String)])
42
happyOut7 x = unsafeCoerce# x
43
{-# INLINE happyOut7 #-}
44
happyIn8 :: (([String],String,Int,Maybe String)) -> (HappyAbsSyn )
45
happyIn8 x = unsafeCoerce# x
46
{-# INLINE happyIn8 #-}
47
happyOut8 :: (HappyAbsSyn ) -> (([String],String,Int,Maybe String))
48
happyOut8 x = unsafeCoerce# x
49
{-# INLINE happyOut8 #-}
50
happyIn9 :: (Maybe String) -> (HappyAbsSyn )
51
happyIn9 x = unsafeCoerce# x
52
{-# INLINE happyIn9 #-}
53
happyOut9 :: (HappyAbsSyn ) -> (Maybe String)
54
happyOut9 x = unsafeCoerce# x
55
{-# INLINE happyOut9 #-}
56
happyIn10 :: ([Directive String]) -> (HappyAbsSyn )
57
happyIn10 x = unsafeCoerce# x
58
{-# INLINE happyIn10 #-}
59
happyOut10 :: (HappyAbsSyn ) -> ([Directive String])
60
happyOut10 x = unsafeCoerce# x
61
{-# INLINE happyOut10 #-}
62
happyIn11 :: (Directive String) -> (HappyAbsSyn )
63
happyIn11 x = unsafeCoerce# x
64
{-# INLINE happyIn11 #-}
65
happyOut11 :: (HappyAbsSyn ) -> (Directive String)
66
happyOut11 x = unsafeCoerce# x
67
{-# INLINE happyOut11 #-}
68
happyIn12 :: (Maybe String) -> (HappyAbsSyn )
69
happyIn12 x = unsafeCoerce# x
70
{-# INLINE happyIn12 #-}
71
happyOut12 :: (HappyAbsSyn ) -> (Maybe String)
72
happyOut12 x = unsafeCoerce# x
73
{-# INLINE happyOut12 #-}
74
happyIn13 :: ([(String,String)]) -> (HappyAbsSyn )
75
happyIn13 x = unsafeCoerce# x
76
{-# INLINE happyIn13 #-}
77
happyOut13 :: (HappyAbsSyn ) -> ([(String,String)])
78
happyOut13 x = unsafeCoerce# x
79
{-# INLINE happyOut13 #-}
80
happyIn14 :: ((String,String)) -> (HappyAbsSyn )
81
happyIn14 x = unsafeCoerce# x
82
{-# INLINE happyIn14 #-}
83
happyOut14 :: (HappyAbsSyn ) -> ((String,String))
84
happyOut14 x = unsafeCoerce# x
85
{-# INLINE happyOut14 #-}
86
happyIn15 :: ([String]) -> (HappyAbsSyn )
87
happyIn15 x = unsafeCoerce# x
88
{-# INLINE happyIn15 #-}
89
happyOut15 :: (HappyAbsSyn ) -> ([String])
90
happyOut15 x = unsafeCoerce# x
91
{-# INLINE happyOut15 #-}
92
happyIn16 :: (Maybe String) -> (HappyAbsSyn )
93
happyIn16 x = unsafeCoerce# x
94
{-# INLINE happyIn16 #-}
95
happyOut16 :: (HappyAbsSyn ) -> (Maybe String)
96
happyOut16 x = unsafeCoerce# x
97
{-# INLINE happyOut16 #-}
98
happyInTok :: Token -> (HappyAbsSyn )
99
happyInTok x = unsafeCoerce# x
100
{-# INLINE happyInTok #-}
101
happyOutTok :: (HappyAbsSyn ) -> Token
102
happyOutTok x = unsafeCoerce# x
103
{-# INLINE happyOutTok #-}
105
happyActOffsets :: HappyAddr
106
happyActOffsets = HappyA# "\x59\x00\x59\x00\x1f\x00\x00\x00\x51\x00\xff\xff\x00\x00\x54\x00\x5d\x00\x5a\x00\x58\x00\x53\x00\x00\x00\x52\x00\x57\x00\x57\x00\x57\x00\x50\x00\x4f\x00\x56\x00\x4c\x00\x00\x00\x4b\x00\x00\x00\x00\x00\x00\x00\x55\x00\x00\x00\x00\x00\x49\x00\x44\x00\x4e\x00\x4e\x00\x00\x00\x4d\x00\x43\x00\x00\x00\x00\x00\x4a\x00\x0f\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x41\x00\x00\x00\x00\x00\x40\x00\x48\x00\x3f\x00\x00\x00\x00\x00\x0a\x00\x00\x00\x3c\x00\x3e\x00\x00\x00\x3b\x00\x47\x00\x46\x00\x3a\x00\x45\x00\x00\x00\x45\x00\x00\x00\x00\x00\x31\x00\x00\x00\x00\x00\x00\x00"#
108
happyGotoOffsets :: HappyAddr
109
happyGotoOffsets = HappyA# "\x12\x00\x28\x00\x39\x00\x00\x00\x00\x00\x3d\x00\x00\x00\x00\x00\x34\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x38\x00\x37\x00\x36\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11\x00\x0e\x00\x00\x00\x32\x00\x00\x00\x00\x00\x00\x00\x35\x00\x29\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\x00\x00\x00\x00\x00\x00\x00\x2d\x00\x00\x00\x14\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"#
111
happyDefActions :: HappyAddr
112
happyDefActions = HappyA# "\xd7\xff\x00\x00\x00\x00\xd8\xff\x00\x00\x00\x00\xf1\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xec\xff\x00\x00\xd9\xff\xd9\xff\xd9\xff\x00\x00\x00\x00\x00\x00\x00\x00\xe1\xff\x00\x00\xe2\xff\xe3\xff\xe5\xff\xd9\xff\xe4\xff\xe6\xff\xea\xff\x00\x00\xde\xff\xde\xff\xef\xff\xdc\xff\x00\x00\xf0\xff\xf2\xff\x00\x00\xd7\xff\xfc\xff\x00\x00\xdb\xff\xdd\xff\xee\xff\xdf\xff\xed\xff\xeb\xff\xe9\xff\xda\xff\xe0\xff\xe8\xff\xd9\xff\x00\x00\xfd\xff\xfe\xff\x00\x00\xf9\xff\xf7\xff\xf3\xff\xe7\xff\x00\x00\x00\x00\xd9\xff\x00\x00\xd9\xff\xfb\xff\xd9\xff\xf8\xff\xf4\xff\xf5\xff\xf6\xff\xfa\xff"#
114
happyCheck :: HappyAddr
115
happyCheck = HappyA# "\xff\xff\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x01\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x01\x00\x05\x00\x00\x00\x03\x00\x04\x00\x16\x00\x08\x00\x03\x00\x04\x00\x08\x00\x13\x00\x0b\x00\x15\x00\x13\x00\x0c\x00\x0b\x00\x11\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x02\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x03\x00\x04\x00\x03\x00\x04\x00\x0c\x00\x0c\x00\x01\x00\x02\x00\x0b\x00\x0b\x00\x0b\x00\x09\x00\x0a\x00\x09\x00\x0a\x00\x06\x00\x07\x00\x0b\x00\x0b\x00\x0b\x00\x07\x00\x14\x00\x01\x00\x01\x00\x01\x00\x01\x00\x0c\x00\x01\x00\x11\x00\x13\x00\x01\x00\x01\x00\x11\x00\x11\x00\x11\x00\x17\x00\x11\x00\x11\x00\x01\x00\x01\x00\x01\x00\x01\x00\x11\x00\x01\x00\x11\x00\x11\x00\x01\x00\xff\xff\x11\x00\xff\xff\x12\x00\x11\x00\x11\x00\x11\x00\xff\xff\xff\xff\xff\xff\x18\x00\x11\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"#
117
happyTable :: HappyAddr
118
happyTable = HappyA# "\x00\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x41\x00\x12\x00\x13\x00\x14\x00\x15\x00\x2a\x00\x3d\x00\x04\x00\x48\x00\x3a\x00\x27\x00\x2c\x00\x42\x00\x3a\x00\x2e\x00\x35\x00\x3b\x00\x36\x00\x42\x00\x02\x00\x3b\x00\x04\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x36\x00\x12\x00\x13\x00\x14\x00\x15\x00\x44\x00\x3a\x00\x39\x00\x3a\x00\x02\x00\x37\x00\x27\x00\x28\x00\x3b\x00\x31\x00\x3b\x00\x2b\x00\x22\x00\x21\x00\x22\x00\x05\x00\x06\x00\x19\x00\x1b\x00\x1c\x00\x25\x00\x48\x00\x1b\x00\x1b\x00\x46\x00\x1b\x00\x3f\x00\x2a\x00\x47\x00\x44\x00\x24\x00\x2e\x00\x39\x00\x3d\x00\x34\x00\x40\x00\x2b\x00\x30\x00\x1b\x00\x17\x00\x1b\x00\x20\x00\x31\x00\x21\x00\x33\x00\x16\x00\x24\x00\x00\x00\x18\x00\x00\x00\x19\x00\x1e\x00\x1f\x00\x25\x00\x00\x00\x00\x00\x00\x00\xff\xff\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"#
120
happyReduceArr = array (1, 40) [
130
(10 , happyReduce_10),
131
(11 , happyReduce_11),
132
(12 , happyReduce_12),
133
(13 , happyReduce_13),
134
(14 , happyReduce_14),
135
(15 , happyReduce_15),
136
(16 , happyReduce_16),
137
(17 , happyReduce_17),
138
(18 , happyReduce_18),
139
(19 , happyReduce_19),
140
(20 , happyReduce_20),
141
(21 , happyReduce_21),
142
(22 , happyReduce_22),
143
(23 , happyReduce_23),
144
(24 , happyReduce_24),
145
(25 , happyReduce_25),
146
(26 , happyReduce_26),
147
(27 , happyReduce_27),
148
(28 , happyReduce_28),
149
(29 , happyReduce_29),
150
(30 , happyReduce_30),
151
(31 , happyReduce_31),
152
(32 , happyReduce_32),
153
(33 , happyReduce_33),
154
(34 , happyReduce_34),
155
(35 , happyReduce_35),
156
(36 , happyReduce_36),
157
(37 , happyReduce_37),
158
(38 , happyReduce_38),
159
(39 , happyReduce_39),
160
(40 , happyReduce_40)
163
happy_n_terms = 25 :: Int
164
happy_n_nonterms = 13 :: Int
166
happyReduce_1 = happyReduce 5# 0# happyReduction_1
167
happyReduction_1 (happy_x_5 `HappyStk`
173
= case happyOut16 happy_x_1 of { happy_var_1 ->
174
case happyOut10 happy_x_2 of { happy_var_2 ->
175
case happyOut5 happy_x_4 of { happy_var_4 ->
176
case happyOut16 happy_x_5 of { happy_var_5 ->
178
(AbsSyn happy_var_1 (reverse happy_var_2) (reverse happy_var_4) happy_var_5
179
) `HappyStk` happyRest}}}}
181
happyReduce_2 = happySpecReduce_2 1# happyReduction_2
182
happyReduction_2 happy_x_2
184
= case happyOut5 happy_x_1 of { happy_var_1 ->
185
case happyOut6 happy_x_2 of { happy_var_2 ->
187
(happy_var_2 : happy_var_1
190
happyReduce_3 = happySpecReduce_1 1# happyReduction_3
191
happyReduction_3 happy_x_1
192
= case happyOut6 happy_x_1 of { happy_var_1 ->
197
happyReduce_4 = happyReduce 5# 2# happyReduction_4
198
happyReduction_4 (happy_x_5 `HappyStk`
204
= case happyOutTok happy_x_1 of { (TokenInfo happy_var_1 TokId) ->
205
case happyOutTok happy_x_3 of { (TokenInfo happy_var_3 TokCodeQuote) ->
206
case happyOut7 happy_x_5 of { happy_var_5 ->
208
((happy_var_1,happy_var_5,Just happy_var_3)
209
) `HappyStk` happyRest}}}
211
happyReduce_5 = happyReduce 6# 2# happyReduction_5
212
happyReduction_5 (happy_x_6 `HappyStk`
219
= case happyOutTok happy_x_1 of { (TokenInfo happy_var_1 TokId) ->
220
case happyOutTok happy_x_3 of { (TokenInfo happy_var_3 TokCodeQuote) ->
221
case happyOut7 happy_x_6 of { happy_var_6 ->
223
((happy_var_1,happy_var_6,Just happy_var_3)
224
) `HappyStk` happyRest}}}
226
happyReduce_6 = happySpecReduce_3 2# happyReduction_6
227
happyReduction_6 happy_x_3
230
= case happyOutTok happy_x_1 of { (TokenInfo happy_var_1 TokId) ->
231
case happyOut7 happy_x_3 of { happy_var_3 ->
233
((happy_var_1,happy_var_3,Nothing)
236
happyReduce_7 = happySpecReduce_3 3# happyReduction_7
237
happyReduction_7 happy_x_3
240
= case happyOut8 happy_x_1 of { happy_var_1 ->
241
case happyOut7 happy_x_3 of { happy_var_3 ->
243
(happy_var_1 : happy_var_3
246
happyReduce_8 = happySpecReduce_1 3# happyReduction_8
247
happyReduction_8 happy_x_1
248
= case happyOut8 happy_x_1 of { happy_var_1 ->
253
happyReduce_9 = happyMonadReduce 4# 4# happyReduction_9
254
happyReduction_9 (happy_x_4 `HappyStk`
259
= happyThen (case happyOut15 happy_x_1 of { happy_var_1 ->
260
case happyOut9 happy_x_2 of { happy_var_2 ->
261
case happyOutTok happy_x_3 of { (TokenInfo happy_var_3 TokCodeQuote) ->
262
( lineP >>= \l -> return (happy_var_1,happy_var_3,l,happy_var_2))}}}
263
) (\r -> happyReturn (happyIn8 r))
265
happyReduce_10 = happyMonadReduce 3# 4# happyReduction_10
266
happyReduction_10 (happy_x_3 `HappyStk`
270
= happyThen (case happyOut15 happy_x_1 of { happy_var_1 ->
271
case happyOut9 happy_x_2 of { happy_var_2 ->
272
case happyOutTok happy_x_3 of { (TokenInfo happy_var_3 TokCodeQuote) ->
273
( lineP >>= \l -> return (happy_var_1,happy_var_3,l,happy_var_2))}}}
274
) (\r -> happyReturn (happyIn8 r))
276
happyReduce_11 = happySpecReduce_2 5# happyReduction_11
277
happyReduction_11 happy_x_2
279
= case happyOutTok happy_x_2 of { (TokenInfo happy_var_2 TokId) ->
284
happyReduce_12 = happySpecReduce_0 5# happyReduction_12
285
happyReduction_12 = happyIn9
289
happyReduce_13 = happySpecReduce_2 6# happyReduction_13
290
happyReduction_13 happy_x_2
292
= case happyOut10 happy_x_1 of { happy_var_1 ->
293
case happyOut11 happy_x_2 of { happy_var_2 ->
295
(happy_var_2 : happy_var_1
298
happyReduce_14 = happySpecReduce_1 6# happyReduction_14
299
happyReduction_14 happy_x_1
300
= case happyOut11 happy_x_1 of { happy_var_1 ->
305
happyReduce_15 = happySpecReduce_2 7# happyReduction_15
306
happyReduction_15 happy_x_2
308
= case happyOutTok happy_x_2 of { (TokenInfo happy_var_2 TokCodeQuote) ->
310
(TokenType happy_var_2
313
happyReduce_16 = happySpecReduce_2 7# happyReduction_16
314
happyReduction_16 happy_x_2
316
= case happyOut13 happy_x_2 of { happy_var_2 ->
318
(TokenSpec happy_var_2
321
happyReduce_17 = happySpecReduce_3 7# happyReduction_17
322
happyReduction_17 happy_x_3
325
= case happyOutTok happy_x_2 of { (TokenInfo happy_var_2 TokId) ->
326
case happyOut12 happy_x_3 of { happy_var_3 ->
328
(TokenName happy_var_2 happy_var_3 False
331
happyReduce_18 = happySpecReduce_3 7# happyReduction_18
332
happyReduction_18 happy_x_3
335
= case happyOutTok happy_x_2 of { (TokenInfo happy_var_2 TokId) ->
336
case happyOut12 happy_x_3 of { happy_var_3 ->
338
(TokenName happy_var_2 happy_var_3 True
341
happyReduce_19 = happySpecReduce_1 7# happyReduction_19
342
happyReduction_19 happy_x_1
344
(TokenImportedIdentity
347
happyReduce_20 = happySpecReduce_3 7# happyReduction_20
348
happyReduction_20 happy_x_3
351
= case happyOutTok happy_x_2 of { (TokenInfo happy_var_2 TokCodeQuote) ->
352
case happyOutTok happy_x_3 of { (TokenInfo happy_var_3 TokCodeQuote) ->
354
(TokenLexer happy_var_2 happy_var_3
357
happyReduce_21 = happySpecReduce_2 7# happyReduction_21
358
happyReduction_21 happy_x_2
360
= case happyOutTok happy_x_2 of { (TokenInfo happy_var_2 TokCodeQuote) ->
362
(TokenMonad "()" happy_var_2 ">>=" "return"
365
happyReduce_22 = happySpecReduce_3 7# happyReduction_22
366
happyReduction_22 happy_x_3
369
= case happyOutTok happy_x_2 of { (TokenInfo happy_var_2 TokCodeQuote) ->
370
case happyOutTok happy_x_3 of { (TokenInfo happy_var_3 TokCodeQuote) ->
372
(TokenMonad happy_var_2 happy_var_3 ">>=" "return"
375
happyReduce_23 = happyReduce 4# 7# happyReduction_23
376
happyReduction_23 (happy_x_4 `HappyStk`
381
= case happyOutTok happy_x_2 of { (TokenInfo happy_var_2 TokCodeQuote) ->
382
case happyOutTok happy_x_3 of { (TokenInfo happy_var_3 TokCodeQuote) ->
383
case happyOutTok happy_x_4 of { (TokenInfo happy_var_4 TokCodeQuote) ->
385
(TokenMonad "()" happy_var_2 happy_var_3 happy_var_4
386
) `HappyStk` happyRest}}}
388
happyReduce_24 = happyReduce 5# 7# happyReduction_24
389
happyReduction_24 (happy_x_5 `HappyStk`
395
= case happyOutTok happy_x_2 of { (TokenInfo happy_var_2 TokCodeQuote) ->
396
case happyOutTok happy_x_3 of { (TokenInfo happy_var_3 TokCodeQuote) ->
397
case happyOutTok happy_x_4 of { (TokenInfo happy_var_4 TokCodeQuote) ->
398
case happyOutTok happy_x_5 of { (TokenInfo happy_var_5 TokCodeQuote) ->
400
(TokenMonad happy_var_2 happy_var_3 happy_var_4 happy_var_5
401
) `HappyStk` happyRest}}}}
403
happyReduce_25 = happySpecReduce_2 7# happyReduction_25
404
happyReduction_25 happy_x_2
406
= case happyOut15 happy_x_2 of { happy_var_2 ->
408
(TokenNonassoc happy_var_2
411
happyReduce_26 = happySpecReduce_2 7# happyReduction_26
412
happyReduction_26 happy_x_2
414
= case happyOut15 happy_x_2 of { happy_var_2 ->
416
(TokenRight happy_var_2
419
happyReduce_27 = happySpecReduce_2 7# happyReduction_27
420
happyReduction_27 happy_x_2
422
= case happyOut15 happy_x_2 of { happy_var_2 ->
424
(TokenLeft happy_var_2
427
happyReduce_28 = happySpecReduce_2 7# happyReduction_28
428
happyReduction_28 happy_x_2
430
= case happyOutTok happy_x_2 of { (TokenNum happy_var_2 TokNum) ->
432
(TokenExpect happy_var_2
435
happyReduce_29 = happySpecReduce_2 7# happyReduction_29
436
happyReduction_29 happy_x_2
438
= case happyOutTok happy_x_2 of { (TokenInfo happy_var_2 TokCodeQuote) ->
440
(TokenError happy_var_2
443
happyReduce_30 = happySpecReduce_2 7# happyReduction_30
444
happyReduction_30 happy_x_2
446
= case happyOutTok happy_x_2 of { (TokenInfo happy_var_2 TokCodeQuote) ->
448
(TokenAttributetype happy_var_2
451
happyReduce_31 = happySpecReduce_3 7# happyReduction_31
452
happyReduction_31 happy_x_3
455
= case happyOutTok happy_x_2 of { (TokenInfo happy_var_2 TokId) ->
456
case happyOutTok happy_x_3 of { (TokenInfo happy_var_3 TokCodeQuote) ->
458
(TokenAttribute happy_var_2 happy_var_3
461
happyReduce_32 = happySpecReduce_1 8# happyReduction_32
462
happyReduction_32 happy_x_1
463
= case happyOutTok happy_x_1 of { (TokenInfo happy_var_1 TokId) ->
468
happyReduce_33 = happySpecReduce_0 8# happyReduction_33
469
happyReduction_33 = happyIn12
473
happyReduce_34 = happySpecReduce_2 9# happyReduction_34
474
happyReduction_34 happy_x_2
476
= case happyOut14 happy_x_1 of { happy_var_1 ->
477
case happyOut13 happy_x_2 of { happy_var_2 ->
479
(happy_var_1:happy_var_2
482
happyReduce_35 = happySpecReduce_1 9# happyReduction_35
483
happyReduction_35 happy_x_1
484
= case happyOut14 happy_x_1 of { happy_var_1 ->
489
happyReduce_36 = happySpecReduce_2 10# happyReduction_36
490
happyReduction_36 happy_x_2
492
= case happyOutTok happy_x_1 of { (TokenInfo happy_var_1 TokId) ->
493
case happyOutTok happy_x_2 of { (TokenInfo happy_var_2 TokCodeQuote) ->
495
((happy_var_1,happy_var_2)
498
happyReduce_37 = happySpecReduce_2 11# happyReduction_37
499
happyReduction_37 happy_x_2
501
= case happyOutTok happy_x_1 of { (TokenInfo happy_var_1 TokId) ->
502
case happyOut15 happy_x_2 of { happy_var_2 ->
504
(happy_var_1 : happy_var_2
507
happyReduce_38 = happySpecReduce_0 11# happyReduction_38
508
happyReduction_38 = happyIn15
512
happyReduce_39 = happySpecReduce_1 12# happyReduction_39
513
happyReduction_39 happy_x_1
514
= case happyOutTok happy_x_1 of { (TokenInfo happy_var_1 TokCodeQuote) ->
519
happyReduce_40 = happySpecReduce_0 12# happyReduction_40
520
happyReduction_40 = happyIn16
524
happyNewToken action sts stk
526
let cont i = happyDoAction i tk action sts stk in
528
TokenEOF -> happyDoAction 24# tk action sts stk;
529
TokenInfo happy_dollar_dollar TokId -> cont 1#;
530
TokenKW TokSpecId_TokenType -> cont 2#;
531
TokenKW TokSpecId_Token -> cont 3#;
532
TokenKW TokSpecId_Name -> cont 4#;
533
TokenKW TokSpecId_Partial -> cont 5#;
534
TokenKW TokSpecId_Lexer -> cont 6#;
535
TokenKW TokSpecId_ImportedIdentity -> cont 7#;
536
TokenKW TokSpecId_Monad -> cont 8#;
537
TokenKW TokSpecId_Nonassoc -> cont 9#;
538
TokenKW TokSpecId_Left -> cont 10#;
539
TokenKW TokSpecId_Right -> cont 11#;
540
TokenKW TokSpecId_Prec -> cont 12#;
541
TokenKW TokSpecId_Expect -> cont 13#;
542
TokenKW TokSpecId_Error -> cont 14#;
543
TokenKW TokSpecId_Attribute -> cont 15#;
544
TokenKW TokSpecId_Attributetype -> cont 16#;
545
TokenInfo happy_dollar_dollar TokCodeQuote -> cont 17#;
546
TokenNum happy_dollar_dollar TokNum -> cont 18#;
547
TokenKW TokColon -> cont 19#;
548
TokenKW TokSemiColon -> cont 20#;
549
TokenKW TokDoubleColon -> cont 21#;
550
TokenKW TokDoublePercent -> cont 22#;
551
TokenKW TokBar -> cont 23#;
555
happyError_ tk = happyError' tk
557
happyThen :: () => P a -> (a -> P b) -> P b
559
happyReturn :: () => a -> P a
560
happyReturn = (return)
561
happyThen1 = happyThen
562
happyReturn1 :: () => a -> P a
563
happyReturn1 = happyReturn
564
happyError' :: () => Token -> P a
565
happyError' tk = (\token -> happyError) tk
567
ourParser = happySomeParser where
568
happySomeParser = happyThen (happyParse 0#) (\x -> happyReturn (happyOut4 x))
570
happySeq = happyDontSeq
574
happyError = lineP >>= \l -> fail (show l ++ ": Parse error\n")
575
{-# LINE 1 "GenericTemplate.hs" #-}
576
{-# LINE 1 "<built-in>" #-}
577
{-# LINE 1 "<command line>" #-}
578
{-# LINE 1 "GenericTemplate.hs" #-}
579
-- Id: GenericTemplate.hs,v 1.26 2005/01/14 14:47:22 simonmar Exp
581
{-# LINE 28 "GenericTemplate.hs" #-}
584
data Happy_IntList = HappyCons Int# Happy_IntList
590
{-# LINE 49 "GenericTemplate.hs" #-}
592
{-# LINE 59 "GenericTemplate.hs" #-}
594
{-# LINE 68 "GenericTemplate.hs" #-}
597
data HappyStk a = HappyStk a (HappyStk a)
599
-----------------------------------------------------------------------------
600
-- starting the parse
602
happyParse start_state = happyNewToken start_state notHappyAtAll notHappyAtAll
604
-----------------------------------------------------------------------------
605
-- Accepting the parse
607
-- If the current token is 0#, it means we've just accepted a partial
608
-- parse (a %partial parser). We must ignore the saved token on the top of
609
-- the stack in this case.
610
happyAccept 0# tk st sts (_ `HappyStk` ans `HappyStk` _) =
612
happyAccept j tk st sts (HappyStk ans _) =
613
(happyTcHack j (happyTcHack st)) (happyReturn1 ans)
615
-----------------------------------------------------------------------------
616
-- Arrays only: do the next action
620
happyDoAction i tk st
629
n | (n <# (0# :: Int#)) -> {- nothing -}
631
(happyReduceArr ! rule) i tk st
632
where rule = (I# ((negateInt# ((n +# (1# :: Int#))))))
636
happyShift new_state i tk st
637
where new_state = (n -# (1# :: Int#))
638
where off = indexShortOffAddr happyActOffsets st
640
check = if (off_i >=# (0# :: Int#))
641
then (indexShortOffAddr happyCheck off_i ==# i)
643
action | check = indexShortOffAddr happyTable off_i
644
| otherwise = indexShortOffAddr happyDefActions st
646
{-# LINE 127 "GenericTemplate.hs" #-}
649
indexShortOffAddr (HappyA# arr) off =
650
#if __GLASGOW_HASKELL__ > 500
652
#elif __GLASGOW_HASKELL__ == 500
655
(i `iShiftL#` 16#) `iShiftRA#` 16#
658
#if __GLASGOW_HASKELL__ >= 503
659
i = word2Int# ((high `uncheckedShiftL#` 8#) `or#` low)
661
i = word2Int# ((high `shiftL#` 8#) `or#` low)
663
high = int2Word# (ord# (indexCharOffAddr# arr (off' +# 1#)))
664
low = int2Word# (ord# (indexCharOffAddr# arr off'))
671
data HappyAddr = HappyA# Addr#
676
-----------------------------------------------------------------------------
677
-- HappyState data type (not arrays)
679
{-# LINE 170 "GenericTemplate.hs" #-}
681
-----------------------------------------------------------------------------
684
happyShift new_state 0# tk st sts stk@(x `HappyStk` _) =
685
let i = (case unsafeCoerce# x of { (I# (i)) -> i }) in
686
-- trace "shifting the error token" $
687
happyDoAction i tk new_state (HappyCons (st) (sts)) (stk)
689
happyShift new_state i tk st sts stk =
690
happyNewToken new_state (HappyCons (st) (sts)) ((happyInTok (tk))`HappyStk`stk)
692
-- happyReduce is specialised for the common cases.
694
happySpecReduce_0 i fn 0# tk st sts stk
695
= happyFail 0# tk st sts stk
696
happySpecReduce_0 nt fn j tk st@((action)) sts stk
697
= happyGoto nt j tk st (HappyCons (st) (sts)) (fn `HappyStk` stk)
699
happySpecReduce_1 i fn 0# tk st sts stk
700
= happyFail 0# tk st sts stk
701
happySpecReduce_1 nt fn j tk _ sts@((HappyCons (st@(action)) (_))) (v1`HappyStk`stk')
703
happySeq r (happyGoto nt j tk st sts (r `HappyStk` stk'))
705
happySpecReduce_2 i fn 0# tk st sts stk
706
= happyFail 0# tk st sts stk
707
happySpecReduce_2 nt fn j tk _ (HappyCons (_) (sts@((HappyCons (st@(action)) (_))))) (v1`HappyStk`v2`HappyStk`stk')
708
= let r = fn v1 v2 in
709
happySeq r (happyGoto nt j tk st sts (r `HappyStk` stk'))
711
happySpecReduce_3 i fn 0# tk st sts stk
712
= happyFail 0# tk st sts stk
713
happySpecReduce_3 nt fn j tk _ (HappyCons (_) ((HappyCons (_) (sts@((HappyCons (st@(action)) (_))))))) (v1`HappyStk`v2`HappyStk`v3`HappyStk`stk')
714
= let r = fn v1 v2 v3 in
715
happySeq r (happyGoto nt j tk st sts (r `HappyStk` stk'))
717
happyReduce k i fn 0# tk st sts stk
718
= happyFail 0# tk st sts stk
719
happyReduce k nt fn j tk st sts stk
720
= case happyDrop (k -# (1# :: Int#)) sts of
721
sts1@((HappyCons (st1@(action)) (_))) ->
722
let r = fn stk in -- it doesn't hurt to always seq here...
723
happyDoSeq r (happyGoto nt j tk st1 sts1 r)
725
happyMonadReduce k nt fn 0# tk st sts stk
726
= happyFail 0# tk st sts stk
727
happyMonadReduce k nt fn j tk st sts stk =
728
happyThen1 (fn stk tk) (\r -> happyGoto nt j tk st1 sts1 (r `HappyStk` drop_stk))
729
where sts1@((HappyCons (st1@(action)) (_))) = happyDrop k (HappyCons (st) (sts))
730
drop_stk = happyDropStk k stk
732
happyMonad2Reduce k nt fn 0# tk st sts stk
733
= happyFail 0# tk st sts stk
734
happyMonad2Reduce k nt fn j tk st sts stk =
735
happyThen1 (fn stk tk) (\r -> happyNewToken new_state sts1 (r `HappyStk` drop_stk))
736
where sts1@((HappyCons (st1@(action)) (_))) = happyDrop k (HappyCons (st) (sts))
737
drop_stk = happyDropStk k stk
739
off = indexShortOffAddr happyGotoOffsets st1
741
new_state = indexShortOffAddr happyTable off_i
747
happyDrop n (HappyCons (_) (t)) = happyDrop (n -# (1# :: Int#)) t
749
happyDropStk 0# l = l
750
happyDropStk n (x `HappyStk` xs) = happyDropStk (n -# (1#::Int#)) xs
752
-----------------------------------------------------------------------------
753
-- Moving to a new state after a reduction
756
happyGoto nt j tk st =
758
happyDoAction j tk new_state
759
where off = indexShortOffAddr happyGotoOffsets st
761
new_state = indexShortOffAddr happyTable off_i
766
-----------------------------------------------------------------------------
767
-- Error recovery (0# is the error token)
769
-- parse error if we are in recovery and we fail again
770
happyFail 0# tk old_st _ stk =
774
{- We don't need state discarding for our restricted implementation of
775
"error". In fact, it can cause some bogus parses, so I've disabled it
779
happyFail 0# tk old_st (HappyCons ((action)) (sts))
780
(saved_tok `HappyStk` _ `HappyStk` stk) =
781
-- trace ("discarding state, depth " ++ show (length stk)) $
782
happyDoAction 0# tk action sts ((saved_tok`HappyStk`stk))
785
-- Enter error recovery: generate an error token,
786
-- save the old token and carry on.
787
happyFail i tk (action) sts stk =
788
-- trace "entering error recovery" $
789
happyDoAction 0# tk action sts ( (unsafeCoerce# (I# (i))) `HappyStk` stk)
791
-- Internal happy errors:
793
notHappyAtAll = error "Internal Happy error\n"
795
-----------------------------------------------------------------------------
796
-- Hack to get the typechecker to accept our action functions
799
happyTcHack :: Int# -> a -> a
801
{-# INLINE happyTcHack #-}
804
-----------------------------------------------------------------------------
805
-- Seq-ing. If the --strict flag is given, then Happy emits
806
-- happySeq = happyDoSeq
807
-- otherwise it emits
808
-- happySeq = happyDontSeq
810
happyDoSeq, happyDontSeq :: a -> b -> b
811
happyDoSeq a b = a `seq` b
814
-----------------------------------------------------------------------------
815
-- Don't inline any functions from the template. GHC has a nasty habit
816
-- of deciding to inline happyGoto everywhere, which increases the size of
817
-- the generated parser quite a bit.
820
{-# NOINLINE happyDoAction #-}
821
{-# NOINLINE happyTable #-}
822
{-# NOINLINE happyCheck #-}
823
{-# NOINLINE happyActOffsets #-}
824
{-# NOINLINE happyGotoOffsets #-}
825
{-# NOINLINE happyDefActions #-}
827
{-# NOINLINE happyShift #-}
828
{-# NOINLINE happySpecReduce_0 #-}
829
{-# NOINLINE happySpecReduce_1 #-}
830
{-# NOINLINE happySpecReduce_2 #-}
831
{-# NOINLINE happySpecReduce_3 #-}
832
{-# NOINLINE happyReduce #-}
833
{-# NOINLINE happyMonadReduce #-}
834
{-# NOINLINE happyGoto #-}
835
{-# NOINLINE happyFail #-}
837
-- end of Happy Template.