1{-# OPTIONS_GHC -w #-} 2{-# OPTIONS -XMagicHash -XBangPatterns -XTypeSynonymInstances -XFlexibleInstances -cpp #-} 3#if __GLASGOW_HASKELL__ >= 710 4{-# OPTIONS_GHC -XPartialTypeSignatures #-} 5#endif 6{-# OPTIONS_GHC -w #-} 7module AttrGrammarParser (agParser) where 8import ParseMonad 9import AttrGrammar 10import qualified Data.Array as Happy_Data_Array 11import qualified Data.Bits as Bits 12import qualified GHC.Exts as Happy_GHC_Exts 13import Control.Applicative(Applicative(..)) 14import Control.Monad (ap) 15 16-- parser produced by Happy Version 1.19.12 17 18newtype HappyAbsSyn = HappyAbsSyn HappyAny 19#if __GLASGOW_HASKELL__ >= 607 20type HappyAny = Happy_GHC_Exts.Any 21#else 22type HappyAny = forall a . a 23#endif 24newtype HappyWrap4 = HappyWrap4 ([AgRule]) 25happyIn4 :: ([AgRule]) -> (HappyAbsSyn ) 26happyIn4 x = Happy_GHC_Exts.unsafeCoerce# (HappyWrap4 x) 27{-# INLINE happyIn4 #-} 28happyOut4 :: (HappyAbsSyn ) -> HappyWrap4 29happyOut4 x = Happy_GHC_Exts.unsafeCoerce# x 30{-# INLINE happyOut4 #-} 31newtype HappyWrap5 = HappyWrap5 ([AgRule]) 32happyIn5 :: ([AgRule]) -> (HappyAbsSyn ) 33happyIn5 x = Happy_GHC_Exts.unsafeCoerce# (HappyWrap5 x) 34{-# INLINE happyIn5 #-} 35happyOut5 :: (HappyAbsSyn ) -> HappyWrap5 36happyOut5 x = Happy_GHC_Exts.unsafeCoerce# x 37{-# INLINE happyOut5 #-} 38newtype HappyWrap6 = HappyWrap6 (AgRule) 39happyIn6 :: (AgRule) -> (HappyAbsSyn ) 40happyIn6 x = Happy_GHC_Exts.unsafeCoerce# (HappyWrap6 x) 41{-# INLINE happyIn6 #-} 42happyOut6 :: (HappyAbsSyn ) -> HappyWrap6 43happyOut6 x = Happy_GHC_Exts.unsafeCoerce# x 44{-# INLINE happyOut6 #-} 45newtype HappyWrap7 = HappyWrap7 ([AgToken]) 46happyIn7 :: ([AgToken]) -> (HappyAbsSyn ) 47happyIn7 x = Happy_GHC_Exts.unsafeCoerce# (HappyWrap7 x) 48{-# INLINE happyIn7 #-} 49happyOut7 :: (HappyAbsSyn ) -> HappyWrap7 50happyOut7 x = Happy_GHC_Exts.unsafeCoerce# x 51{-# INLINE happyOut7 #-} 52newtype HappyWrap8 = HappyWrap8 ([AgToken]) 53happyIn8 :: ([AgToken]) -> (HappyAbsSyn ) 54happyIn8 x = Happy_GHC_Exts.unsafeCoerce# (HappyWrap8 x) 55{-# INLINE happyIn8 #-} 56happyOut8 :: (HappyAbsSyn ) -> HappyWrap8 57happyOut8 x = Happy_GHC_Exts.unsafeCoerce# x 58{-# INLINE happyOut8 #-} 59happyInTok :: (AgToken) -> (HappyAbsSyn ) 60happyInTok x = Happy_GHC_Exts.unsafeCoerce# x 61{-# INLINE happyInTok #-} 62happyOutTok :: (HappyAbsSyn ) -> (AgToken) 63happyOutTok x = Happy_GHC_Exts.unsafeCoerce# x 64{-# INLINE happyOutTok #-} 65 66 67happyExpList :: HappyAddr 68happyExpList = HappyA# "\x00\xf0\x00\xc0\x03\x00\x00\x00\x01\x00\xe9\x01\x20\x00\x80\x00\x00\x02\x00\x00\x00\xa4\x07\x90\x1e\x40\x7a\x00\x00\x00\xb4\x07\x90\x1e\x40\x7a\x00\xe9\x01\xa4\x07\x90\x1e\x00\x3c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x40\x7b\x00\xed\x01\xb4\x07\xd0\x1e\x40\x7b\x00\xe9\x01\xb4\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\xe9\x01\x00\x00\xd0\x1e\x00\x00\x00\x00"# 69 70{-# NOINLINE happyExpListPerState #-} 71happyExpListPerState st = 72 token_strs_expected 73 where token_strs = ["error","%dummy","%start_agParser","agParser","rules","rule","code","code0","\"{\"","\"}\"","\";\"","\"=\"","where","selfRef","subRef","rightRef","unknown","%eof"] 74 bit_start = st * 18 75 bit_end = (st + 1) * 18 76 read_bit = readArrayBit happyExpList 77 bits = map read_bit [bit_start..bit_end - 1] 78 bits_indexed = zip bits [0..17] 79 token_strs_expected = concatMap f bits_indexed 80 f (False, _) = [] 81 f (True, nr) = [token_strs !! nr] 82 83happyActOffsets :: HappyAddr 84happyActOffsets = HappyA# "\x0f\x00\x0f\x00\x00\x00\xfe\xff\x0a\x00\xff\xff\x02\x00\x19\x00\x05\x00\x0a\x00\x0a\x00\x0a\x00\x00\x00\x01\x00\x0a\x00\x0a\x00\x0a\x00\x0a\x00\x0a\x00\x0f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1c\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x0a\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1d\x00\x0a\x00\x00\x00\x01\x00\x00\x00\x00\x00"# 85 86happyGotoOffsets :: HappyAddr 87happyGotoOffsets = HappyA# "\x18\x00\x0b\x00\x00\x00\x00\x00\x1e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1f\x00\x20\x00\x21\x00\x00\x00\x22\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x1a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x29\x00\x2a\x00\x2b\x00\x2c\x00\x2d\x00\x2f\x00\x30\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x32\x00\x00\x00\x33\x00\x00\x00\x00\x00"# 88 89happyAdjustOffset :: Happy_GHC_Exts.Int# -> Happy_GHC_Exts.Int# 90happyAdjustOffset off = off 91 92happyDefActions :: HappyAddr 93happyDefActions = HappyA# "\xfb\xff\x00\x00\xfe\xff\xfc\xff\xf0\xff\x00\x00\x00\x00\x00\x00\x00\x00\xf0\xff\xf0\xff\xf0\xff\xf7\xff\xe8\xff\xf0\xff\xf0\xff\xf0\xff\xf0\xff\xf0\xff\xfb\xff\xfd\xff\xf1\xff\xf2\xff\xf3\xff\xf4\xff\xf5\xff\x00\x00\xe8\xff\xe8\xff\xe8\xff\xe8\xff\xe8\xff\xf0\xff\xe8\xff\xfa\xff\xf9\xff\xf8\xff\xe9\xff\xea\xff\xeb\xff\xec\xff\xee\xff\xed\xff\x00\x00\xf0\xff\xf6\xff\xe8\xff\xef\xff"# 94 95happyCheck :: HappyAddr 96happyCheck = HappyA# "\xff\xff\x03\x00\x01\x00\x04\x00\x03\x00\x04\x00\x04\x00\x06\x00\x07\x00\x08\x00\x09\x00\x01\x00\x01\x00\x02\x00\x04\x00\x0a\x00\x06\x00\x07\x00\x08\x00\x09\x00\x05\x00\x06\x00\x07\x00\x08\x00\x00\x00\x01\x00\x02\x00\x01\x00\x02\x00\x04\x00\x02\x00\x02\x00\xff\xff\x03\x00\x03\x00\x03\x00\x03\x00\xff\xff\x04\x00\x03\x00\x03\x00\x03\x00\x03\x00\x03\x00\xff\xff\x04\x00\x04\x00\x04\x00\x04\x00\x04\x00\x03\x00\xff\xff\x04\x00\x03\x00\xff\xff\x04\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"# 97 98happyTable :: HappyAddr 99happyTable = HappyA# "\x00\x00\x14\x00\x1c\x00\x0c\x00\x1d\x00\x1e\x00\x0b\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x0e\x00\x02\x00\x03\x00\x0f\x00\xff\xff\x10\x00\x11\x00\x12\x00\x13\x00\x05\x00\x06\x00\x07\x00\x08\x00\x08\x00\x02\x00\x03\x00\x14\x00\x03\x00\x0a\x00\x2d\x00\x2f\x00\x00\x00\x0c\x00\x24\x00\x23\x00\x22\x00\x00\x00\x1a\x00\x19\x00\x18\x00\x17\x00\x16\x00\x15\x00\x00\x00\x2b\x00\x2a\x00\x29\x00\x28\x00\x27\x00\x26\x00\x00\x00\x25\x00\x2d\x00\x00\x00\x2f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"# 100 101happyReduceArr = Happy_Data_Array.array (1, 23) [ 102 (1 , happyReduce_1), 103 (2 , happyReduce_2), 104 (3 , happyReduce_3), 105 (4 , happyReduce_4), 106 (5 , happyReduce_5), 107 (6 , happyReduce_6), 108 (7 , happyReduce_7), 109 (8 , happyReduce_8), 110 (9 , happyReduce_9), 111 (10 , happyReduce_10), 112 (11 , happyReduce_11), 113 (12 , happyReduce_12), 114 (13 , happyReduce_13), 115 (14 , happyReduce_14), 116 (15 , happyReduce_15), 117 (16 , happyReduce_16), 118 (17 , happyReduce_17), 119 (18 , happyReduce_18), 120 (19 , happyReduce_19), 121 (20 , happyReduce_20), 122 (21 , happyReduce_21), 123 (22 , happyReduce_22), 124 (23 , happyReduce_23) 125 ] 126 127happy_n_terms = 11 :: Int 128happy_n_nonterms = 5 :: Int 129 130happyReduce_1 :: () => Happy_GHC_Exts.Int# -> AgToken -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn ) -> P (HappyAbsSyn ) 131happyReduce_1 = happySpecReduce_1 0# happyReduction_1 132happyReduction_1 happy_x_1 133 = case happyOut5 happy_x_1 of { (HappyWrap5 happy_var_1) -> 134 happyIn4 135 (happy_var_1 136 )} 137 138happyReduce_2 :: () => Happy_GHC_Exts.Int# -> AgToken -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn ) -> P (HappyAbsSyn ) 139happyReduce_2 = happySpecReduce_3 1# happyReduction_2 140happyReduction_2 happy_x_3 141 happy_x_2 142 happy_x_1 143 = case happyOut6 happy_x_1 of { (HappyWrap6 happy_var_1) -> 144 case happyOut5 happy_x_3 of { (HappyWrap5 happy_var_3) -> 145 happyIn5 146 (happy_var_1 : happy_var_3 147 )}} 148 149happyReduce_3 :: () => Happy_GHC_Exts.Int# -> AgToken -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn ) -> P (HappyAbsSyn ) 150happyReduce_3 = happySpecReduce_1 1# happyReduction_3 151happyReduction_3 happy_x_1 152 = case happyOut6 happy_x_1 of { (HappyWrap6 happy_var_1) -> 153 happyIn5 154 (happy_var_1 : [] 155 )} 156 157happyReduce_4 :: () => Happy_GHC_Exts.Int# -> AgToken -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn ) -> P (HappyAbsSyn ) 158happyReduce_4 = happySpecReduce_0 1# happyReduction_4 159happyReduction_4 = happyIn5 160 ([] 161 ) 162 163happyReduce_5 :: () => Happy_GHC_Exts.Int# -> AgToken -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn ) -> P (HappyAbsSyn ) 164happyReduce_5 = happySpecReduce_3 2# happyReduction_5 165happyReduction_5 happy_x_3 166 happy_x_2 167 happy_x_1 168 = case happyOutTok happy_x_1 of { happy_var_1 -> 169 case happyOut7 happy_x_3 of { (HappyWrap7 happy_var_3) -> 170 happyIn6 171 (SelfAssign (selfRefVal happy_var_1) happy_var_3 172 )}} 173 174happyReduce_6 :: () => Happy_GHC_Exts.Int# -> AgToken -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn ) -> P (HappyAbsSyn ) 175happyReduce_6 = happySpecReduce_3 2# happyReduction_6 176happyReduction_6 happy_x_3 177 happy_x_2 178 happy_x_1 179 = case happyOutTok happy_x_1 of { happy_var_1 -> 180 case happyOut7 happy_x_3 of { (HappyWrap7 happy_var_3) -> 181 happyIn6 182 (SubAssign (subRefVal happy_var_1) happy_var_3 183 )}} 184 185happyReduce_7 :: () => Happy_GHC_Exts.Int# -> AgToken -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn ) -> P (HappyAbsSyn ) 186happyReduce_7 = happySpecReduce_3 2# happyReduction_7 187happyReduction_7 happy_x_3 188 happy_x_2 189 happy_x_1 190 = case happyOutTok happy_x_1 of { happy_var_1 -> 191 case happyOut7 happy_x_3 of { (HappyWrap7 happy_var_3) -> 192 happyIn6 193 (RightmostAssign (rightRefVal happy_var_1) happy_var_3 194 )}} 195 196happyReduce_8 :: () => Happy_GHC_Exts.Int# -> AgToken -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn ) -> P (HappyAbsSyn ) 197happyReduce_8 = happySpecReduce_2 2# happyReduction_8 198happyReduction_8 happy_x_2 199 happy_x_1 200 = case happyOut7 happy_x_2 of { (HappyWrap7 happy_var_2) -> 201 happyIn6 202 (Conditional happy_var_2 203 )} 204 205happyReduce_9 :: () => Happy_GHC_Exts.Int# -> AgToken -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn ) -> P (HappyAbsSyn ) 206happyReduce_9 = happyReduce 4# 3# happyReduction_9 207happyReduction_9 (happy_x_4 `HappyStk` 208 happy_x_3 `HappyStk` 209 happy_x_2 `HappyStk` 210 happy_x_1 `HappyStk` 211 happyRest) 212 = case happyOutTok happy_x_1 of { happy_var_1 -> 213 case happyOut8 happy_x_2 of { (HappyWrap8 happy_var_2) -> 214 case happyOutTok happy_x_3 of { happy_var_3 -> 215 case happyOut7 happy_x_4 of { (HappyWrap7 happy_var_4) -> 216 happyIn7 217 ([happy_var_1] ++ happy_var_2 ++ [happy_var_3] ++ happy_var_4 218 ) `HappyStk` happyRest}}}} 219 220happyReduce_10 :: () => Happy_GHC_Exts.Int# -> AgToken -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn ) -> P (HappyAbsSyn ) 221happyReduce_10 = happySpecReduce_2 3# happyReduction_10 222happyReduction_10 happy_x_2 223 happy_x_1 224 = case happyOutTok happy_x_1 of { happy_var_1 -> 225 case happyOut7 happy_x_2 of { (HappyWrap7 happy_var_2) -> 226 happyIn7 227 (happy_var_1 : happy_var_2 228 )}} 229 230happyReduce_11 :: () => Happy_GHC_Exts.Int# -> AgToken -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn ) -> P (HappyAbsSyn ) 231happyReduce_11 = happySpecReduce_2 3# happyReduction_11 232happyReduction_11 happy_x_2 233 happy_x_1 234 = case happyOutTok happy_x_1 of { happy_var_1 -> 235 case happyOut7 happy_x_2 of { (HappyWrap7 happy_var_2) -> 236 happyIn7 237 (happy_var_1 : happy_var_2 238 )}} 239 240happyReduce_12 :: () => Happy_GHC_Exts.Int# -> AgToken -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn ) -> P (HappyAbsSyn ) 241happyReduce_12 = happySpecReduce_2 3# happyReduction_12 242happyReduction_12 happy_x_2 243 happy_x_1 244 = case happyOutTok happy_x_1 of { happy_var_1 -> 245 case happyOut7 happy_x_2 of { (HappyWrap7 happy_var_2) -> 246 happyIn7 247 (happy_var_1 : happy_var_2 248 )}} 249 250happyReduce_13 :: () => Happy_GHC_Exts.Int# -> AgToken -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn ) -> P (HappyAbsSyn ) 251happyReduce_13 = happySpecReduce_2 3# happyReduction_13 252happyReduction_13 happy_x_2 253 happy_x_1 254 = case happyOutTok happy_x_1 of { happy_var_1 -> 255 case happyOut7 happy_x_2 of { (HappyWrap7 happy_var_2) -> 256 happyIn7 257 (happy_var_1 : happy_var_2 258 )}} 259 260happyReduce_14 :: () => Happy_GHC_Exts.Int# -> AgToken -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn ) -> P (HappyAbsSyn ) 261happyReduce_14 = happySpecReduce_2 3# happyReduction_14 262happyReduction_14 happy_x_2 263 happy_x_1 264 = case happyOutTok happy_x_1 of { happy_var_1 -> 265 case happyOut7 happy_x_2 of { (HappyWrap7 happy_var_2) -> 266 happyIn7 267 (happy_var_1 : happy_var_2 268 )}} 269 270happyReduce_15 :: () => Happy_GHC_Exts.Int# -> AgToken -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn ) -> P (HappyAbsSyn ) 271happyReduce_15 = happySpecReduce_0 3# happyReduction_15 272happyReduction_15 = happyIn7 273 ([] 274 ) 275 276happyReduce_16 :: () => Happy_GHC_Exts.Int# -> AgToken -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn ) -> P (HappyAbsSyn ) 277happyReduce_16 = happyReduce 4# 4# happyReduction_16 278happyReduction_16 (happy_x_4 `HappyStk` 279 happy_x_3 `HappyStk` 280 happy_x_2 `HappyStk` 281 happy_x_1 `HappyStk` 282 happyRest) 283 = case happyOutTok happy_x_1 of { happy_var_1 -> 284 case happyOut8 happy_x_2 of { (HappyWrap8 happy_var_2) -> 285 case happyOutTok happy_x_3 of { happy_var_3 -> 286 case happyOut8 happy_x_4 of { (HappyWrap8 happy_var_4) -> 287 happyIn8 288 ([happy_var_1] ++ happy_var_2 ++ [happy_var_3] ++ happy_var_4 289 ) `HappyStk` happyRest}}}} 290 291happyReduce_17 :: () => Happy_GHC_Exts.Int# -> AgToken -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn ) -> P (HappyAbsSyn ) 292happyReduce_17 = happySpecReduce_2 4# happyReduction_17 293happyReduction_17 happy_x_2 294 happy_x_1 295 = case happyOutTok happy_x_1 of { happy_var_1 -> 296 case happyOut8 happy_x_2 of { (HappyWrap8 happy_var_2) -> 297 happyIn8 298 (happy_var_1 : happy_var_2 299 )}} 300 301happyReduce_18 :: () => Happy_GHC_Exts.Int# -> AgToken -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn ) -> P (HappyAbsSyn ) 302happyReduce_18 = happySpecReduce_2 4# happyReduction_18 303happyReduction_18 happy_x_2 304 happy_x_1 305 = case happyOutTok happy_x_1 of { happy_var_1 -> 306 case happyOut8 happy_x_2 of { (HappyWrap8 happy_var_2) -> 307 happyIn8 308 (happy_var_1 : happy_var_2 309 )}} 310 311happyReduce_19 :: () => Happy_GHC_Exts.Int# -> AgToken -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn ) -> P (HappyAbsSyn ) 312happyReduce_19 = happySpecReduce_2 4# happyReduction_19 313happyReduction_19 happy_x_2 314 happy_x_1 315 = case happyOutTok happy_x_1 of { happy_var_1 -> 316 case happyOut8 happy_x_2 of { (HappyWrap8 happy_var_2) -> 317 happyIn8 318 (happy_var_1 : happy_var_2 319 )}} 320 321happyReduce_20 :: () => Happy_GHC_Exts.Int# -> AgToken -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn ) -> P (HappyAbsSyn ) 322happyReduce_20 = happySpecReduce_2 4# happyReduction_20 323happyReduction_20 happy_x_2 324 happy_x_1 325 = case happyOutTok happy_x_1 of { happy_var_1 -> 326 case happyOut8 happy_x_2 of { (HappyWrap8 happy_var_2) -> 327 happyIn8 328 (happy_var_1 : happy_var_2 329 )}} 330 331happyReduce_21 :: () => Happy_GHC_Exts.Int# -> AgToken -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn ) -> P (HappyAbsSyn ) 332happyReduce_21 = happySpecReduce_2 4# happyReduction_21 333happyReduction_21 happy_x_2 334 happy_x_1 335 = case happyOutTok happy_x_1 of { happy_var_1 -> 336 case happyOut7 happy_x_2 of { (HappyWrap7 happy_var_2) -> 337 happyIn8 338 (happy_var_1 : happy_var_2 339 )}} 340 341happyReduce_22 :: () => Happy_GHC_Exts.Int# -> AgToken -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn ) -> P (HappyAbsSyn ) 342happyReduce_22 = happySpecReduce_2 4# happyReduction_22 343happyReduction_22 happy_x_2 344 happy_x_1 345 = case happyOutTok happy_x_1 of { happy_var_1 -> 346 case happyOut8 happy_x_2 of { (HappyWrap8 happy_var_2) -> 347 happyIn8 348 (happy_var_1 : happy_var_2 349 )}} 350 351happyReduce_23 :: () => Happy_GHC_Exts.Int# -> AgToken -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn ) -> P (HappyAbsSyn ) 352happyReduce_23 = happySpecReduce_0 4# happyReduction_23 353happyReduction_23 = happyIn8 354 ([] 355 ) 356 357happyNewToken action sts stk 358 = agLexer(\tk -> 359 let cont i = happyDoAction i tk action sts stk in 360 case tk of { 361 AgTok_EOF -> happyDoAction 10# tk action sts stk; 362 AgTok_LBrace -> cont 1#; 363 AgTok_RBrace -> cont 2#; 364 AgTok_Semicolon -> cont 3#; 365 AgTok_Eq -> cont 4#; 366 AgTok_Where -> cont 5#; 367 AgTok_SelfRef _ -> cont 6#; 368 AgTok_SubRef _ -> cont 7#; 369 AgTok_RightmostRef _ -> cont 8#; 370 AgTok_Unknown _ -> cont 9#; 371 _ -> happyError' (tk, []) 372 }) 373 374happyError_ explist 10# tk = happyError' (tk, explist) 375happyError_ explist _ tk = happyError' (tk, explist) 376 377happyThen :: () => P a -> (a -> P b) -> P b 378happyThen = (>>=) 379happyReturn :: () => a -> P a 380happyReturn = (return) 381happyParse :: () => Happy_GHC_Exts.Int# -> P (HappyAbsSyn ) 382 383happyNewToken :: () => Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn ) -> P (HappyAbsSyn ) 384 385happyDoAction :: () => Happy_GHC_Exts.Int# -> AgToken -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn ) -> P (HappyAbsSyn ) 386 387happyReduceArr :: () => Happy_Data_Array.Array Int (Happy_GHC_Exts.Int# -> AgToken -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn ) -> P (HappyAbsSyn )) 388 389happyThen1 :: () => P a -> (a -> P b) -> P b 390happyThen1 = happyThen 391happyReturn1 :: () => a -> P a 392happyReturn1 = happyReturn 393happyError' :: () => ((AgToken), [String]) -> P a 394happyError' tk = (\(tokens, explist) -> happyError) tk 395agParser = happySomeParser where 396 happySomeParser = happyThen (happyParse 0#) (\x -> happyReturn (let {(HappyWrap4 x') = happyOut4 x} in x')) 397 398happySeq = happyDontSeq 399 400 401happyError :: P a 402happyError = failP ("Parse error\n") 403{-# LINE 1 "templates/GenericTemplate.hs" #-} 404-- $Id: GenericTemplate.hs,v 1.26 2005/01/14 14:47:22 simonmar Exp $ 405 406 407 408 409 410 411 412 413 414 415 416 417 418-- Do not remove this comment. Required to fix CPP parsing when using GCC and a clang-compiled alex. 419#if __GLASGOW_HASKELL__ > 706 420#define LT(n,m) ((Happy_GHC_Exts.tagToEnum# (n Happy_GHC_Exts.<# m)) :: Bool) 421#define GTE(n,m) ((Happy_GHC_Exts.tagToEnum# (n Happy_GHC_Exts.>=# m)) :: Bool) 422#define EQ(n,m) ((Happy_GHC_Exts.tagToEnum# (n Happy_GHC_Exts.==# m)) :: Bool) 423#else 424#define LT(n,m) (n Happy_GHC_Exts.<# m) 425#define GTE(n,m) (n Happy_GHC_Exts.>=# m) 426#define EQ(n,m) (n Happy_GHC_Exts.==# m) 427#endif 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447data Happy_IntList = HappyCons Happy_GHC_Exts.Int# Happy_IntList 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488infixr 9 `HappyStk` 489data HappyStk a = HappyStk a (HappyStk a) 490 491----------------------------------------------------------------------------- 492-- starting the parse 493 494happyParse start_state = happyNewToken start_state notHappyAtAll notHappyAtAll 495 496----------------------------------------------------------------------------- 497-- Accepting the parse 498 499-- If the current token is ERROR_TOK, it means we've just accepted a partial 500-- parse (a %partial parser). We must ignore the saved token on the top of 501-- the stack in this case. 502happyAccept 0# tk st sts (_ `HappyStk` ans `HappyStk` _) = 503 happyReturn1 ans 504happyAccept j tk st sts (HappyStk ans _) = 505 (happyTcHack j (happyTcHack st)) (happyReturn1 ans) 506 507----------------------------------------------------------------------------- 508-- Arrays only: do the next action 509 510 511 512happyDoAction i tk st 513 = {- nothing -} 514 case action of 515 0# -> {- nothing -} 516 happyFail (happyExpListPerState ((Happy_GHC_Exts.I# (st)) :: Int)) i tk st 517 -1# -> {- nothing -} 518 happyAccept i tk st 519 n | LT(n,(0# :: Happy_GHC_Exts.Int#)) -> {- nothing -} 520 (happyReduceArr Happy_Data_Array.! rule) i tk st 521 where rule = (Happy_GHC_Exts.I# ((Happy_GHC_Exts.negateInt# ((n Happy_GHC_Exts.+# (1# :: Happy_GHC_Exts.Int#)))))) 522 n -> {- nothing -} 523 happyShift new_state i tk st 524 where new_state = (n Happy_GHC_Exts.-# (1# :: Happy_GHC_Exts.Int#)) 525 where off = happyAdjustOffset (indexShortOffAddr happyActOffsets st) 526 off_i = (off Happy_GHC_Exts.+# i) 527 check = if GTE(off_i,(0# :: Happy_GHC_Exts.Int#)) 528 then EQ(indexShortOffAddr happyCheck off_i, i) 529 else False 530 action 531 | check = indexShortOffAddr happyTable off_i 532 | otherwise = indexShortOffAddr happyDefActions st 533 534 535 536 537indexShortOffAddr (HappyA# arr) off = 538 Happy_GHC_Exts.narrow16Int# i 539 where 540 i = Happy_GHC_Exts.word2Int# (Happy_GHC_Exts.or# (Happy_GHC_Exts.uncheckedShiftL# high 8#) low) 541 high = Happy_GHC_Exts.int2Word# (Happy_GHC_Exts.ord# (Happy_GHC_Exts.indexCharOffAddr# arr (off' Happy_GHC_Exts.+# 1#))) 542 low = Happy_GHC_Exts.int2Word# (Happy_GHC_Exts.ord# (Happy_GHC_Exts.indexCharOffAddr# arr off')) 543 off' = off Happy_GHC_Exts.*# 2# 544 545 546 547 548{-# INLINE happyLt #-} 549happyLt x y = LT(x,y) 550 551 552readArrayBit arr bit = 553 Bits.testBit (Happy_GHC_Exts.I# (indexShortOffAddr arr ((unbox_int bit) `Happy_GHC_Exts.iShiftRA#` 4#))) (bit `mod` 16) 554 where unbox_int (Happy_GHC_Exts.I# x) = x 555 556 557 558 559 560 561data HappyAddr = HappyA# Happy_GHC_Exts.Addr# 562 563 564----------------------------------------------------------------------------- 565-- HappyState data type (not arrays) 566 567 568 569 570 571 572 573 574 575 576 577 578 579----------------------------------------------------------------------------- 580-- Shifting a token 581 582happyShift new_state 0# tk st sts stk@(x `HappyStk` _) = 583 let i = (case Happy_GHC_Exts.unsafeCoerce# x of { (Happy_GHC_Exts.I# (i)) -> i }) in 584-- trace "shifting the error token" $ 585 happyDoAction i tk new_state (HappyCons (st) (sts)) (stk) 586 587happyShift new_state i tk st sts stk = 588 happyNewToken new_state (HappyCons (st) (sts)) ((happyInTok (tk))`HappyStk`stk) 589 590-- happyReduce is specialised for the common cases. 591 592happySpecReduce_0 i fn 0# tk st sts stk 593 = happyFail [] 0# tk st sts stk 594happySpecReduce_0 nt fn j tk st@((action)) sts stk 595 = happyGoto nt j tk st (HappyCons (st) (sts)) (fn `HappyStk` stk) 596 597happySpecReduce_1 i fn 0# tk st sts stk 598 = happyFail [] 0# tk st sts stk 599happySpecReduce_1 nt fn j tk _ sts@((HappyCons (st@(action)) (_))) (v1`HappyStk`stk') 600 = let r = fn v1 in 601 happySeq r (happyGoto nt j tk st sts (r `HappyStk` stk')) 602 603happySpecReduce_2 i fn 0# tk st sts stk 604 = happyFail [] 0# tk st sts stk 605happySpecReduce_2 nt fn j tk _ (HappyCons (_) (sts@((HappyCons (st@(action)) (_))))) (v1`HappyStk`v2`HappyStk`stk') 606 = let r = fn v1 v2 in 607 happySeq r (happyGoto nt j tk st sts (r `HappyStk` stk')) 608 609happySpecReduce_3 i fn 0# tk st sts stk 610 = happyFail [] 0# tk st sts stk 611happySpecReduce_3 nt fn j tk _ (HappyCons (_) ((HappyCons (_) (sts@((HappyCons (st@(action)) (_))))))) (v1`HappyStk`v2`HappyStk`v3`HappyStk`stk') 612 = let r = fn v1 v2 v3 in 613 happySeq r (happyGoto nt j tk st sts (r `HappyStk` stk')) 614 615happyReduce k i fn 0# tk st sts stk 616 = happyFail [] 0# tk st sts stk 617happyReduce k nt fn j tk st sts stk 618 = case happyDrop (k Happy_GHC_Exts.-# (1# :: Happy_GHC_Exts.Int#)) sts of 619 sts1@((HappyCons (st1@(action)) (_))) -> 620 let r = fn stk in -- it doesn't hurt to always seq here... 621 happyDoSeq r (happyGoto nt j tk st1 sts1 r) 622 623happyMonadReduce k nt fn 0# tk st sts stk 624 = happyFail [] 0# tk st sts stk 625happyMonadReduce k nt fn j tk st sts stk = 626 case happyDrop k (HappyCons (st) (sts)) of 627 sts1@((HappyCons (st1@(action)) (_))) -> 628 let drop_stk = happyDropStk k stk in 629 happyThen1 (fn stk tk) (\r -> happyGoto nt j tk st1 sts1 (r `HappyStk` drop_stk)) 630 631happyMonad2Reduce k nt fn 0# tk st sts stk 632 = happyFail [] 0# tk st sts stk 633happyMonad2Reduce k nt fn j tk st sts stk = 634 case happyDrop k (HappyCons (st) (sts)) of 635 sts1@((HappyCons (st1@(action)) (_))) -> 636 let drop_stk = happyDropStk k stk 637 638 off = happyAdjustOffset (indexShortOffAddr happyGotoOffsets st1) 639 off_i = (off Happy_GHC_Exts.+# nt) 640 new_state = indexShortOffAddr happyTable off_i 641 642 643 644 645 in 646 happyThen1 (fn stk tk) (\r -> happyNewToken new_state sts1 (r `HappyStk` drop_stk)) 647 648happyDrop 0# l = l 649happyDrop n (HappyCons (_) (t)) = happyDrop (n Happy_GHC_Exts.-# (1# :: Happy_GHC_Exts.Int#)) t 650 651happyDropStk 0# l = l 652happyDropStk n (x `HappyStk` xs) = happyDropStk (n Happy_GHC_Exts.-# (1#::Happy_GHC_Exts.Int#)) xs 653 654----------------------------------------------------------------------------- 655-- Moving to a new state after a reduction 656 657 658happyGoto nt j tk st = 659 {- nothing -} 660 happyDoAction j tk new_state 661 where off = happyAdjustOffset (indexShortOffAddr happyGotoOffsets st) 662 off_i = (off Happy_GHC_Exts.+# nt) 663 new_state = indexShortOffAddr happyTable off_i 664 665 666 667 668----------------------------------------------------------------------------- 669-- Error recovery (ERROR_TOK is the error token) 670 671-- parse error if we are in recovery and we fail again 672happyFail explist 0# tk old_st _ stk@(x `HappyStk` _) = 673 let i = (case Happy_GHC_Exts.unsafeCoerce# x of { (Happy_GHC_Exts.I# (i)) -> i }) in 674-- trace "failing" $ 675 happyError_ explist i tk 676 677{- We don't need state discarding for our restricted implementation of 678 "error". In fact, it can cause some bogus parses, so I've disabled it 679 for now --SDM 680 681-- discard a state 682happyFail ERROR_TOK tk old_st CONS(HAPPYSTATE(action),sts) 683 (saved_tok `HappyStk` _ `HappyStk` stk) = 684-- trace ("discarding state, depth " ++ show (length stk)) $ 685 DO_ACTION(action,ERROR_TOK,tk,sts,(saved_tok`HappyStk`stk)) 686-} 687 688-- Enter error recovery: generate an error token, 689-- save the old token and carry on. 690happyFail explist i tk (action) sts stk = 691-- trace "entering error recovery" $ 692 happyDoAction 0# tk action sts ((Happy_GHC_Exts.unsafeCoerce# (Happy_GHC_Exts.I# (i))) `HappyStk` stk) 693 694-- Internal happy errors: 695 696notHappyAtAll :: a 697notHappyAtAll = error "Internal Happy error\n" 698 699----------------------------------------------------------------------------- 700-- Hack to get the typechecker to accept our action functions 701 702 703happyTcHack :: Happy_GHC_Exts.Int# -> a -> a 704happyTcHack x y = y 705{-# INLINE happyTcHack #-} 706 707 708----------------------------------------------------------------------------- 709-- Seq-ing. If the --strict flag is given, then Happy emits 710-- happySeq = happyDoSeq 711-- otherwise it emits 712-- happySeq = happyDontSeq 713 714happyDoSeq, happyDontSeq :: a -> b -> b 715happyDoSeq a b = a `seq` b 716happyDontSeq a b = b 717 718----------------------------------------------------------------------------- 719-- Don't inline any functions from the template. GHC has a nasty habit 720-- of deciding to inline happyGoto everywhere, which increases the size of 721-- the generated parser quite a bit. 722 723 724{-# NOINLINE happyDoAction #-} 725{-# NOINLINE happyTable #-} 726{-# NOINLINE happyCheck #-} 727{-# NOINLINE happyActOffsets #-} 728{-# NOINLINE happyGotoOffsets #-} 729{-# NOINLINE happyDefActions #-} 730 731{-# NOINLINE happyShift #-} 732{-# NOINLINE happySpecReduce_0 #-} 733{-# NOINLINE happySpecReduce_1 #-} 734{-# NOINLINE happySpecReduce_2 #-} 735{-# NOINLINE happySpecReduce_3 #-} 736{-# NOINLINE happyReduce #-} 737{-# NOINLINE happyMonadReduce #-} 738{-# NOINLINE happyGoto #-} 739{-# NOINLINE happyFail #-} 740 741-- end of Happy Template. 742