{-# OPTIONS_GHC -w #-}
{-# OPTIONS -XMagicHash -XBangPatterns -XTypeSynonymInstances -XFlexibleInstances -cpp #-}
#if __GLASGOW_HASKELL__ >= 710
{-# OPTIONS_GHC -XPartialTypeSignatures #-}
#endif
module Data.Cfg.Bnf.Parser(parse) where
import qualified Data.Map as M
import Data.Cfg.Bnf.Scanner(scan)
import Data.Cfg.Bnf.Syntax
import Data.Cfg.Bnf.Token
import Data.Cfg.Cfg(Production, V(..), Vs)
import qualified Data.Array as Happy_Data_Array
import qualified Data.Bits as Bits
import qualified GHC.Exts as Happy_GHC_Exts
import Control.Applicative(Applicative(..))
import Control.Monad (ap)
newtype HappyAbsSyn = HappyAbsSyn HappyAny
#if __GLASGOW_HASKELL__ >= 607
type HappyAny = Happy_GHC_Exts.Any
#else
type HappyAny = forall a . a
#endif
happyIn4 :: (Grammar String String) -> (HappyAbsSyn )
happyIn4 :: Grammar String String -> HappyAbsSyn
happyIn4 Grammar String String
x = Grammar String String -> HappyAbsSyn
Happy_GHC_Exts.unsafeCoerce# Grammar String String
x
{-# INLINE happyIn4 #-}
happyOut4 :: (HappyAbsSyn ) -> (Grammar String String)
happyOut4 :: HappyAbsSyn -> Grammar String String
happyOut4 HappyAbsSyn
x = HappyAbsSyn -> Grammar String String
Happy_GHC_Exts.unsafeCoerce# HappyAbsSyn
x
{-# INLINE happyOut4 #-}
happyIn5 :: ([Production String String]) -> (HappyAbsSyn )
happyIn5 :: [Production String String] -> HappyAbsSyn
happyIn5 [Production String String]
x = [Production String String] -> HappyAbsSyn
Happy_GHC_Exts.unsafeCoerce# [Production String String]
x
{-# INLINE happyIn5 #-}
happyOut5 :: (HappyAbsSyn ) -> ([Production String String])
happyOut5 :: HappyAbsSyn -> [Production String String]
happyOut5 HappyAbsSyn
x = HappyAbsSyn -> [Production String String]
Happy_GHC_Exts.unsafeCoerce# HappyAbsSyn
x
{-# INLINE happyOut5 #-}
happyIn6 :: ([Production String String]) -> (HappyAbsSyn )
happyIn6 :: [Production String String] -> HappyAbsSyn
happyIn6 [Production String String]
x = [Production String String] -> HappyAbsSyn
Happy_GHC_Exts.unsafeCoerce# [Production String String]
x
{-# INLINE happyIn6 #-}
happyOut6 :: (HappyAbsSyn ) -> ([Production String String])
happyOut6 :: HappyAbsSyn -> [Production String String]
happyOut6 HappyAbsSyn
x = HappyAbsSyn -> [Production String String]
Happy_GHC_Exts.unsafeCoerce# HappyAbsSyn
x
{-# INLINE happyOut6 #-}
happyIn7 :: ([Vs String String]) -> (HappyAbsSyn )
happyIn7 :: [Vs String String] -> HappyAbsSyn
happyIn7 [Vs String String]
x = [Vs String String] -> HappyAbsSyn
Happy_GHC_Exts.unsafeCoerce# [Vs String String]
x
{-# INLINE happyIn7 #-}
happyOut7 :: (HappyAbsSyn ) -> ([Vs String String])
happyOut7 :: HappyAbsSyn -> [Vs String String]
happyOut7 HappyAbsSyn
x = HappyAbsSyn -> [Vs String String]
Happy_GHC_Exts.unsafeCoerce# HappyAbsSyn
x
{-# INLINE happyOut7 #-}
happyIn8 :: ([Vs String String]) -> (HappyAbsSyn )
happyIn8 :: [Vs String String] -> HappyAbsSyn
happyIn8 [Vs String String]
x = [Vs String String] -> HappyAbsSyn
Happy_GHC_Exts.unsafeCoerce# [Vs String String]
x
{-# INLINE happyIn8 #-}
happyOut8 :: (HappyAbsSyn ) -> ([Vs String String])
happyOut8 :: HappyAbsSyn -> [Vs String String]
happyOut8 HappyAbsSyn
x = HappyAbsSyn -> [Vs String String]
Happy_GHC_Exts.unsafeCoerce# HappyAbsSyn
x
{-# INLINE happyOut8 #-}
happyIn9 :: (Vs String String) -> (HappyAbsSyn )
happyIn9 :: Vs String String -> HappyAbsSyn
happyIn9 Vs String String
x = Vs String String -> HappyAbsSyn
Happy_GHC_Exts.unsafeCoerce# Vs String String
x
{-# INLINE happyIn9 #-}
happyOut9 :: (HappyAbsSyn ) -> (Vs String String)
happyOut9 :: HappyAbsSyn -> Vs String String
happyOut9 HappyAbsSyn
x = HappyAbsSyn -> Vs String String
Happy_GHC_Exts.unsafeCoerce# HappyAbsSyn
x
{-# INLINE happyOut9 #-}
happyIn10 :: (Vs String String) -> (HappyAbsSyn )
happyIn10 :: Vs String String -> HappyAbsSyn
happyIn10 Vs String String
x = Vs String String -> HappyAbsSyn
Happy_GHC_Exts.unsafeCoerce# Vs String String
x
{-# INLINE happyIn10 #-}
happyOut10 :: (HappyAbsSyn ) -> (Vs String String)
happyOut10 :: HappyAbsSyn -> Vs String String
happyOut10 HappyAbsSyn
x = HappyAbsSyn -> Vs String String
Happy_GHC_Exts.unsafeCoerce# HappyAbsSyn
x
{-# INLINE happyOut10 #-}
happyIn11 :: (V String String) -> (HappyAbsSyn )
happyIn11 :: V String String -> HappyAbsSyn
happyIn11 V String String
x = V String String -> HappyAbsSyn
Happy_GHC_Exts.unsafeCoerce# V String String
x
{-# INLINE happyIn11 #-}
happyOut11 :: (HappyAbsSyn ) -> (V String String)
happyOut11 :: HappyAbsSyn -> V String String
happyOut11 HappyAbsSyn
x = HappyAbsSyn -> V String String
Happy_GHC_Exts.unsafeCoerce# HappyAbsSyn
x
{-# INLINE happyOut11 #-}
happyInTok :: (Token) -> (HappyAbsSyn )
happyInTok :: Token -> HappyAbsSyn
happyInTok Token
x = Token -> HappyAbsSyn
Happy_GHC_Exts.unsafeCoerce# Token
x
{-# INLINE happyInTok #-}
happyOutTok :: (HappyAbsSyn ) -> (Token)
happyOutTok :: HappyAbsSyn -> Token
happyOutTok HappyAbsSyn
x = HappyAbsSyn -> Token
Happy_GHC_Exts.unsafeCoerce# HappyAbsSyn
x
{-# INLINE happyOutTok #-}
happyExpList :: HappyAddr
happyExpList :: HappyAddr
happyExpList = Addr# -> HappyAddr
HappyA# Addr#
"\x00\x10\x00\x20\x00\x40\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x08\x00\x40\x00\x00\x00\x80\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"#
{-# NOINLINE happyExpListPerState #-}
happyExpListPerState :: Int -> [String]
happyExpListPerState Int
st =
[String]
token_strs_expected
where token_strs :: [String]
token_strs = [String
"error",String
"%dummy",String
"%start_parseTokens",String
"grammar",String
"prods",String
"prod",String
"rhs",String
"alts",String
"alt",String
"terms",String
"term",String
"FULL_STOP",String
"LOWER_IDENTIFIER",String
"OR",String
"UPPER_IDENTIFIER",String
"YIELDS",String
"%eof"]
bit_start :: Int
bit_start = Int
st Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
17
bit_end :: Int
bit_end = (Int
st Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
1) Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
17
read_bit :: Int -> Bool
read_bit = HappyAddr -> Int -> Bool
readArrayBit HappyAddr
happyExpList
bits :: [Bool]
bits = (Int -> Bool) -> [Int] -> [Bool]
forall a b. (a -> b) -> [a] -> [b]
map Int -> Bool
read_bit [Int
bit_start..Int
bit_end Int -> Int -> Int
forall a. Num a => a -> a -> a
- Int
1]
bits_indexed :: [(Bool, Int)]
bits_indexed = [Bool] -> [Int] -> [(Bool, Int)]
forall a b. [a] -> [b] -> [(a, b)]
zip [Bool]
bits [Int
0..Int
16]
token_strs_expected :: [String]
token_strs_expected = ((Bool, Int) -> [String]) -> [(Bool, Int)] -> [String]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap (Bool, Int) -> [String]
f [(Bool, Int)]
bits_indexed
f :: (Bool, Int) -> [String]
f (Bool
False, Int
_) = []
f (Bool
True, Int
nr) = [[String]
token_strs [String] -> Int -> String
forall a. [a] -> Int -> a
!! Int
nr]
happyActOffsets :: HappyAddr
happyActOffsets :: HappyAddr
happyActOffsets = Addr# -> HappyAddr
HappyA# Addr#
"\x07\x00\x07\x00\x07\x00\x00\x00\x0b\x00\x09\x00\x00\x00\x00\x00\x10\x00\x0f\x00\x00\x00\x06\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"#
happyGotoOffsets :: HappyAddr
happyGotoOffsets :: HappyAddr
happyGotoOffsets = Addr# -> HappyAddr
HappyA# Addr#
"\x05\x00\x0a\x00\x11\x00\x00\x00\x00\x00\x00\x00\xfe\xff\x00\x00\x00\x00\x00\x00\x00\x00\x0d\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00"#
happyAdjustOffset :: Happy_GHC_Exts.Int# -> Happy_GHC_Exts.Int#
happyAdjustOffset :: Int# -> Int#
happyAdjustOffset Int#
off = Int#
off
happyDefActions :: HappyAddr
happyDefActions :: HappyAddr
happyDefActions = Addr# -> HappyAddr
HappyA# Addr#
"\x00\x00\x00\x00\xfe\xff\xfc\xff\x00\x00\x00\x00\xf5\xff\xfd\xff\x00\x00\xfa\xff\xf8\xff\xf7\xff\xf6\xff\xf3\xff\xf4\xff\xf5\xff\xfb\xff\xf9\xff"#
happyCheck :: HappyAddr
happyCheck :: HappyAddr
happyCheck = Addr# -> HappyAddr
HappyA# Addr#
"\xff\xff\x03\x00\x04\x00\x05\x00\x06\x00\x00\x00\x01\x00\x02\x00\x02\x00\x02\x00\x04\x00\x01\x00\x02\x00\x05\x00\x06\x00\x06\x00\x05\x00\x01\x00\x03\x00\x02\x00\x07\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"#
happyTable :: HappyAddr
happyTable :: HappyAddr
happyTable = Addr# -> HappyAddr
HappyA# Addr#
"\x00\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x05\x00\x02\x00\x03\x00\x0e\x00\x05\x00\x0f\x00\x02\x00\x03\x00\x11\x00\x0b\x00\xff\xff\x07\x00\x11\x00\x10\x00\x07\x00\x0c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"#
happyReduceArr :: Array
Int
(Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> HappyIdentity HappyAbsSyn)
happyReduceArr = (Int, Int)
-> [(Int,
Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> HappyIdentity HappyAbsSyn)]
-> Array
Int
(Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> HappyIdentity HappyAbsSyn)
forall i e. Ix i => (i, i) -> [(i, e)] -> Array i e
Happy_Data_Array.array (Int
1, Int
12) [
(Int
1 , Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> HappyIdentity HappyAbsSyn
happyReduce_1),
(Int
2 , Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> HappyIdentity HappyAbsSyn
happyReduce_2),
(Int
3 , Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> HappyIdentity HappyAbsSyn
happyReduce_3),
(Int
4 , Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> HappyIdentity HappyAbsSyn
happyReduce_4),
(Int
5 , Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> HappyIdentity HappyAbsSyn
happyReduce_5),
(Int
6 , Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> HappyIdentity HappyAbsSyn
happyReduce_6),
(Int
7 , Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> HappyIdentity HappyAbsSyn
happyReduce_7),
(Int
8 , Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> HappyIdentity HappyAbsSyn
happyReduce_8),
(Int
9 , Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> HappyIdentity HappyAbsSyn
happyReduce_9),
(Int
10 , Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> HappyIdentity HappyAbsSyn
happyReduce_10),
(Int
11 , Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> HappyIdentity HappyAbsSyn
happyReduce_11),
(Int
12 , Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> HappyIdentity HappyAbsSyn
happyReduce_12)
]
happy_n_terms :: Int
happy_n_terms = Int
7 :: Int
happy_n_nonterms :: Int
happy_n_nonterms = Int
8 :: Int
happyReduce_1 :: Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> HappyIdentity HappyAbsSyn
happyReduce_1 = Int#
-> (HappyAbsSyn -> HappyAbsSyn)
-> Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> HappyIdentity HappyAbsSyn
happySpecReduce_1 Int#
0# HappyAbsSyn -> HappyAbsSyn
happyReduction_1
happyReduction_1 :: HappyAbsSyn -> HappyAbsSyn
happyReduction_1 HappyAbsSyn
happy_x_1
= case HappyAbsSyn -> [Production String String]
happyOut5 HappyAbsSyn
happy_x_1 of { [Production String String]
happy_var_1 ->
Grammar String String -> HappyAbsSyn
happyIn4
([Production String String] -> Grammar String String
forall t nt. [Production t nt] -> Grammar t nt
Grammar [Production String String]
happy_var_1
)}
happyReduce_2 :: Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> HappyIdentity HappyAbsSyn
happyReduce_2 = Int#
-> (HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn)
-> Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> HappyIdentity HappyAbsSyn
happySpecReduce_2 Int#
1# HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn
happyReduction_2
happyReduction_2 :: HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn
happyReduction_2 HappyAbsSyn
happy_x_2
HappyAbsSyn
happy_x_1
= case HappyAbsSyn -> [Production String String]
happyOut5 HappyAbsSyn
happy_x_1 of { [Production String String]
happy_var_1 ->
case HappyAbsSyn -> [Production String String]
happyOut6 HappyAbsSyn
happy_x_2 of { [Production String String]
happy_var_2 ->
[Production String String] -> HappyAbsSyn
happyIn5
([Production String String]
happy_var_1 [Production String String]
-> [Production String String] -> [Production String String]
forall a. [a] -> [a] -> [a]
++ [Production String String]
happy_var_2
)}}
happyReduce_3 :: Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> HappyIdentity HappyAbsSyn
happyReduce_3 = Int#
-> (HappyAbsSyn -> HappyAbsSyn)
-> Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> HappyIdentity HappyAbsSyn
happySpecReduce_1 Int#
1# HappyAbsSyn -> HappyAbsSyn
happyReduction_3
happyReduction_3 :: HappyAbsSyn -> HappyAbsSyn
happyReduction_3 HappyAbsSyn
happy_x_1
= case HappyAbsSyn -> [Production String String]
happyOut6 HappyAbsSyn
happy_x_1 of { [Production String String]
happy_var_1 ->
[Production String String] -> HappyAbsSyn
happyIn5
([Production String String]
happy_var_1
)}
happyReduce_4 :: Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> HappyIdentity HappyAbsSyn
happyReduce_4 = Int#
-> Int#
-> (HappyStk HappyAbsSyn -> HappyStk HappyAbsSyn)
-> Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> HappyIdentity HappyAbsSyn
happyReduce Int#
4# Int#
2# HappyStk HappyAbsSyn -> HappyStk HappyAbsSyn
happyReduction_4
happyReduction_4 :: HappyStk HappyAbsSyn -> HappyStk HappyAbsSyn
happyReduction_4 (HappyAbsSyn
happy_x_4 `HappyStk`
HappyAbsSyn
happy_x_3 `HappyStk`
HappyAbsSyn
happy_x_2 `HappyStk`
HappyAbsSyn
happy_x_1 `HappyStk`
HappyStk HappyAbsSyn
happyRest)
= case HappyAbsSyn -> Token
happyOutTok HappyAbsSyn
happy_x_1 of { (Token TokenType
LOWER_IDENTIFIER String
happy_var_1) ->
case HappyAbsSyn -> [Vs String String]
happyOut7 HappyAbsSyn
happy_x_3 of { [Vs String String]
happy_var_3 ->
[Production String String] -> HappyAbsSyn
happyIn6
([ (String
happy_var_1, Vs String String
alt) | Vs String String
alt <- [Vs String String]
happy_var_3 ]
) HappyAbsSyn -> HappyStk HappyAbsSyn -> HappyStk HappyAbsSyn
forall a. a -> HappyStk a -> HappyStk a
`HappyStk` HappyStk HappyAbsSyn
happyRest}}
happyReduce_5 :: Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> HappyIdentity HappyAbsSyn
happyReduce_5 = Int#
-> (HappyAbsSyn -> HappyAbsSyn)
-> Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> HappyIdentity HappyAbsSyn
happySpecReduce_1 Int#
3# HappyAbsSyn -> HappyAbsSyn
happyReduction_5
happyReduction_5 :: HappyAbsSyn -> HappyAbsSyn
happyReduction_5 HappyAbsSyn
happy_x_1
= case HappyAbsSyn -> [Vs String String]
happyOut8 HappyAbsSyn
happy_x_1 of { [Vs String String]
happy_var_1 ->
[Vs String String] -> HappyAbsSyn
happyIn7
([Vs String String]
happy_var_1
)}
happyReduce_6 :: Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> HappyIdentity HappyAbsSyn
happyReduce_6 = Int#
-> (HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn)
-> Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> HappyIdentity HappyAbsSyn
happySpecReduce_3 Int#
4# HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn
forall p. HappyAbsSyn -> p -> HappyAbsSyn -> HappyAbsSyn
happyReduction_6
happyReduction_6 :: HappyAbsSyn -> p -> HappyAbsSyn -> HappyAbsSyn
happyReduction_6 HappyAbsSyn
happy_x_3
p
happy_x_2
HappyAbsSyn
happy_x_1
= case HappyAbsSyn -> [Vs String String]
happyOut8 HappyAbsSyn
happy_x_1 of { [Vs String String]
happy_var_1 ->
case HappyAbsSyn -> Vs String String
happyOut9 HappyAbsSyn
happy_x_3 of { Vs String String
happy_var_3 ->
[Vs String String] -> HappyAbsSyn
happyIn8
([Vs String String]
happy_var_1 [Vs String String] -> [Vs String String] -> [Vs String String]
forall a. [a] -> [a] -> [a]
++ [ Vs String String
happy_var_3 ]
)}}
happyReduce_7 :: Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> HappyIdentity HappyAbsSyn
happyReduce_7 = Int#
-> (HappyAbsSyn -> HappyAbsSyn)
-> Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> HappyIdentity HappyAbsSyn
happySpecReduce_1 Int#
4# HappyAbsSyn -> HappyAbsSyn
happyReduction_7
happyReduction_7 :: HappyAbsSyn -> HappyAbsSyn
happyReduction_7 HappyAbsSyn
happy_x_1
= case HappyAbsSyn -> Vs String String
happyOut9 HappyAbsSyn
happy_x_1 of { Vs String String
happy_var_1 ->
[Vs String String] -> HappyAbsSyn
happyIn8
([ Vs String String
happy_var_1 ]
)}
happyReduce_8 :: Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> HappyIdentity HappyAbsSyn
happyReduce_8 = Int#
-> (HappyAbsSyn -> HappyAbsSyn)
-> Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> HappyIdentity HappyAbsSyn
happySpecReduce_1 Int#
5# HappyAbsSyn -> HappyAbsSyn
happyReduction_8
happyReduction_8 :: HappyAbsSyn -> HappyAbsSyn
happyReduction_8 HappyAbsSyn
happy_x_1
= case HappyAbsSyn -> Vs String String
happyOut10 HappyAbsSyn
happy_x_1 of { Vs String String
happy_var_1 ->
Vs String String -> HappyAbsSyn
happyIn9
(Vs String String
happy_var_1
)}
happyReduce_9 :: Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> HappyIdentity HappyAbsSyn
happyReduce_9 = Int#
-> (HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn)
-> Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> HappyIdentity HappyAbsSyn
happySpecReduce_2 Int#
6# HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn
happyReduction_9
happyReduction_9 :: HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn
happyReduction_9 HappyAbsSyn
happy_x_2
HappyAbsSyn
happy_x_1
= case HappyAbsSyn -> Vs String String
happyOut10 HappyAbsSyn
happy_x_1 of { Vs String String
happy_var_1 ->
case HappyAbsSyn -> V String String
happyOut11 HappyAbsSyn
happy_x_2 of { V String String
happy_var_2 ->
Vs String String -> HappyAbsSyn
happyIn10
(Vs String String
happy_var_1 Vs String String -> Vs String String -> Vs String String
forall a. [a] -> [a] -> [a]
++ [ V String String
happy_var_2 ]
)}}
happyReduce_10 :: Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> HappyIdentity HappyAbsSyn
happyReduce_10 = Int#
-> HappyAbsSyn
-> Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> HappyIdentity HappyAbsSyn
happySpecReduce_0 Int#
6# HappyAbsSyn
happyReduction_10
happyReduction_10 :: HappyAbsSyn
happyReduction_10 = Vs String String -> HappyAbsSyn
happyIn10
([]
)
happyReduce_11 :: Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> HappyIdentity HappyAbsSyn
happyReduce_11 = Int#
-> (HappyAbsSyn -> HappyAbsSyn)
-> Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> HappyIdentity HappyAbsSyn
happySpecReduce_1 Int#
7# HappyAbsSyn -> HappyAbsSyn
happyReduction_11
happyReduction_11 :: HappyAbsSyn -> HappyAbsSyn
happyReduction_11 HappyAbsSyn
happy_x_1
= case HappyAbsSyn -> Token
happyOutTok HappyAbsSyn
happy_x_1 of { (Token TokenType
UPPER_IDENTIFIER String
happy_var_1) ->
V String String -> HappyAbsSyn
happyIn11
(String -> V String String
forall t nt. t -> V t nt
T String
happy_var_1
)}
happyReduce_12 :: Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> HappyIdentity HappyAbsSyn
happyReduce_12 = Int#
-> (HappyAbsSyn -> HappyAbsSyn)
-> Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> HappyIdentity HappyAbsSyn
happySpecReduce_1 Int#
7# HappyAbsSyn -> HappyAbsSyn
happyReduction_12
happyReduction_12 :: HappyAbsSyn -> HappyAbsSyn
happyReduction_12 HappyAbsSyn
happy_x_1
= case HappyAbsSyn -> Token
happyOutTok HappyAbsSyn
happy_x_1 of { (Token TokenType
LOWER_IDENTIFIER String
happy_var_1) ->
V String String -> HappyAbsSyn
happyIn11
(String -> V String String
forall t nt. nt -> V t nt
NT String
happy_var_1
)}
happyNewToken :: Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> HappyIdentity HappyAbsSyn
happyNewToken Int#
action Happy_IntList
sts HappyStk HappyAbsSyn
stk [] =
Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> HappyIdentity HappyAbsSyn
happyDoAction Int#
6# Token
forall a. a
notHappyAtAll Int#
action Happy_IntList
sts HappyStk HappyAbsSyn
stk []
happyNewToken Int#
action Happy_IntList
sts HappyStk HappyAbsSyn
stk (Token
tk:[Token]
tks) =
let cont :: Int# -> HappyIdentity HappyAbsSyn
cont Int#
i = Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> HappyIdentity HappyAbsSyn
happyDoAction Int#
i Token
tk Int#
action Happy_IntList
sts HappyStk HappyAbsSyn
stk [Token]
tks in
case Token
tk of {
Token TokenType
FULL_STOP String
happy_dollar_dollar -> Int# -> HappyIdentity HappyAbsSyn
cont Int#
1#;
Token TokenType
LOWER_IDENTIFIER String
happy_dollar_dollar -> Int# -> HappyIdentity HappyAbsSyn
cont Int#
2#;
Token TokenType
OR String
happy_dollar_dollar -> Int# -> HappyIdentity HappyAbsSyn
cont Int#
3#;
Token TokenType
UPPER_IDENTIFIER String
happy_dollar_dollar -> Int# -> HappyIdentity HappyAbsSyn
cont Int#
4#;
Token TokenType
YIELDS String
happy_dollar_dollar -> Int# -> HappyIdentity HappyAbsSyn
cont Int#
5#;
Token
_ -> ([Token], [String]) -> HappyIdentity HappyAbsSyn
forall a. ([Token], [String]) -> HappyIdentity a
happyError' ((Token
tkToken -> [Token] -> [Token]
forall k1. k1 -> [k1] -> [k1]
:[Token]
tks), [])
}
happyError_ :: [String] -> Int# -> Token -> [Token] -> HappyIdentity a
happyError_ [String]
explist Int#
6# Token
tk [Token]
tks = ([Token], [String]) -> HappyIdentity a
forall a. ([Token], [String]) -> HappyIdentity a
happyError' ([Token]
tks, [String]
explist)
happyError_ [String]
explist Int#
_ Token
tk [Token]
tks = ([Token], [String]) -> HappyIdentity a
forall a. ([Token], [String]) -> HappyIdentity a
happyError' ((Token
tkToken -> [Token] -> [Token]
forall k1. k1 -> [k1] -> [k1]
:[Token]
tks), [String]
explist)
newtype HappyIdentity a = HappyIdentity a
happyIdentity :: a -> HappyIdentity a
happyIdentity = a -> HappyIdentity a
forall a. a -> HappyIdentity a
HappyIdentity
happyRunIdentity :: HappyIdentity a -> a
happyRunIdentity (HappyIdentity a
a) = a
a
instance Functor HappyIdentity where
fmap :: (a -> b) -> HappyIdentity a -> HappyIdentity b
fmap a -> b
f (HappyIdentity a
a) = b -> HappyIdentity b
forall a. a -> HappyIdentity a
HappyIdentity (a -> b
f a
a)
instance Applicative HappyIdentity where
pure :: a -> HappyIdentity a
pure = a -> HappyIdentity a
forall a. a -> HappyIdentity a
HappyIdentity
<*> :: HappyIdentity (a -> b) -> HappyIdentity a -> HappyIdentity b
(<*>) = HappyIdentity (a -> b) -> HappyIdentity a -> HappyIdentity b
forall (m :: * -> *) a b. Monad m => m (a -> b) -> m a -> m b
ap
instance Monad HappyIdentity where
return :: a -> HappyIdentity a
return = a -> HappyIdentity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure
(HappyIdentity a
p) >>= :: HappyIdentity a -> (a -> HappyIdentity b) -> HappyIdentity b
>>= a -> HappyIdentity b
q = a -> HappyIdentity b
q a
p
happyThen :: () => HappyIdentity a -> (a -> HappyIdentity b) -> HappyIdentity b
happyThen :: HappyIdentity a -> (a -> HappyIdentity b) -> HappyIdentity b
happyThen = HappyIdentity a -> (a -> HappyIdentity b) -> HappyIdentity b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
(>>=)
happyReturn :: () => a -> HappyIdentity a
happyReturn :: a -> HappyIdentity a
happyReturn = (a -> HappyIdentity a
forall (m :: * -> *) a. Monad m => a -> m a
return)
happyThen1 :: m t -> (t -> t -> m b) -> t -> m b
happyThen1 m t
m t -> t -> m b
k t
tks = m t -> (t -> m b) -> m b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
(>>=) m t
m (\t
a -> t -> t -> m b
k t
a t
tks)
happyReturn1 :: () => a -> b -> HappyIdentity a
happyReturn1 :: a -> b -> HappyIdentity a
happyReturn1 = \a
a b
tks -> (a -> HappyIdentity a
forall (m :: * -> *) a. Monad m => a -> m a
return) a
a
happyError' :: () => ([(Token)], [String]) -> HappyIdentity a
happyError' :: ([Token], [String]) -> HappyIdentity a
happyError' = a -> HappyIdentity a
forall a. a -> HappyIdentity a
HappyIdentity (a -> HappyIdentity a)
-> (([Token], [String]) -> a)
-> ([Token], [String])
-> HappyIdentity a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (\([Token]
tokens, [String]
_) -> [Token] -> a
forall a. [Token] -> a
parseError [Token]
tokens)
parseTokens :: [Token] -> Grammar String String
parseTokens [Token]
tks = HappyIdentity (Grammar String String) -> Grammar String String
forall a. HappyIdentity a -> a
happyRunIdentity HappyIdentity (Grammar String String)
happySomeParser where
happySomeParser :: HappyIdentity (Grammar String String)
happySomeParser = HappyIdentity HappyAbsSyn
-> (HappyAbsSyn -> HappyIdentity (Grammar String String))
-> HappyIdentity (Grammar String String)
forall a b.
HappyIdentity a -> (a -> HappyIdentity b) -> HappyIdentity b
happyThen (Int# -> [Token] -> HappyIdentity HappyAbsSyn
happyParse Int#
0# [Token]
tks) (\HappyAbsSyn
x -> Grammar String String -> HappyIdentity (Grammar String String)
forall a. a -> HappyIdentity a
happyReturn (HappyAbsSyn -> Grammar String String
happyOut4 HappyAbsSyn
x))
happySeq :: a -> b -> b
happySeq = a -> b -> b
forall a b. a -> b -> b
happyDontSeq
parseError :: [Token] -> a
parseError :: [Token] -> a
parseError [Token]
ts = String -> a
forall a. HasCallStack => String -> a
error (String -> a) -> String -> a
forall a b. (a -> b) -> a -> b
$ String
"parseError at: " String -> String -> String
forall a. [a] -> [a] -> [a]
++ [Token] -> String
forall a. Show a => a -> String
show [Token]
ts
parse :: String -> Grammar String String
parse :: String -> Grammar String String
parse = [Token] -> Grammar String String
parseTokens ([Token] -> Grammar String String)
-> (String -> [Token]) -> String -> Grammar String String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> [Token]
scan
parseTokens :: [Token] -> Grammar String String
{-# LINE 1 "templates/GenericTemplate.hs" #-}
{-# LINE 1 "templates/GenericTemplate.hs" #-}
{-# LINE 1 "<built-in>" #-}
{-# LINE 1 "<command-line>" #-}
{-# LINE 10 "<command-line>" #-}
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 17 "/usr/include/stdc-predef.h" 3 4
{-# LINE 10 "<command-line>" #-}
{-# LINE 1 "/opt/ghc/8.6.3/lib/ghc-8.6.3/include/ghcversion.h" #-}
{-# LINE 10 "<command-line>" #-}
{-# LINE 1 "/tmp/ghc780_0/ghc_2.h" #-}
{-# LINE 10 "<command-line>" #-}
{-# LINE 1 "templates/GenericTemplate.hs" #-}
#if __GLASGOW_HASKELL__ > 706
#define LT(n,m) ((Happy_GHC_Exts.tagToEnum# (n Happy_GHC_Exts.<# m)) :: Bool)
#define GTE(n,m) ((Happy_GHC_Exts.tagToEnum# (n Happy_GHC_Exts.>=# m)) :: Bool)
#define EQ(n,m) ((Happy_GHC_Exts.tagToEnum# (n Happy_GHC_Exts.==# m)) :: Bool)
#else
#define LT(n,m) (n Happy_GHC_Exts.<# m)
#define GTE(n,m) (n Happy_GHC_Exts.>=# m)
#define EQ(n,m) (n Happy_GHC_Exts.==# m)
#endif
{-# LINE 43 "templates/GenericTemplate.hs" #-}
data Happy_IntList = HappyCons Happy_GHC_Exts.Int# Happy_IntList
{-# LINE 65 "templates/GenericTemplate.hs" #-}
{-# LINE 75 "templates/GenericTemplate.hs" #-}
{-# LINE 84 "templates/GenericTemplate.hs" #-}
infixr 9 `HappyStk`
data HappyStk a = HappyStk a (HappyStk a)
happyParse start_state = happyNewToken start_state notHappyAtAll notHappyAtAll
happyAccept 0# tk st sts (_ `HappyStk` ans `HappyStk` _) =
happyReturn1 ans
happyAccept j tk st sts (HappyStk ans _) =
(happyTcHack j (happyTcHack st)) (happyReturn1 ans)
happyDoAction i tk st
=
case action of
0# ->
happyFail (happyExpListPerState ((Happy_GHC_Exts.I# (st)) :: Int)) i tk st
-1# ->
happyAccept i tk st
n | LT(n,(0# :: Happy_GHC_Exts.Int#)) ->
(happyReduceArr Happy_Data_Array.! rule) i tk st
where rule = (Happy_GHC_Exts.I# ((Happy_GHC_Exts.negateInt# ((n Happy_GHC_Exts.+# (1# :: Happy_GHC_Exts.Int#))))))
n ->
happyShift new_state i tk st
where new_state = (n Happy_GHC_Exts.-# (1# :: Happy_GHC_Exts.Int#))
where off = happyAdjustOffset (indexShortOffAddr happyActOffsets st)
off_i = (off Happy_GHC_Exts.+# i)
check = if GTE(off_i,(0# :: Happy_GHC_Exts.Int#))
then EQ(indexShortOffAddr happyCheck off_i, i)
else False
action
| check = indexShortOffAddr happyTable off_i
| otherwise = indexShortOffAddr happyDefActions st
indexShortOffAddr (HappyA# arr) off =
Happy_GHC_Exts.narrow16Int# i
where
i = Happy_GHC_Exts.word2Int# (Happy_GHC_Exts.or# (Happy_GHC_Exts.uncheckedShiftL# high 8#) low)
high = Happy_GHC_Exts.int2Word# (Happy_GHC_Exts.ord# (Happy_GHC_Exts.indexCharOffAddr# arr (off' Happy_GHC_Exts.+# 1#)))
low = Happy_GHC_Exts.int2Word# (Happy_GHC_Exts.ord# (Happy_GHC_Exts.indexCharOffAddr# arr off'))
off' = off Happy_GHC_Exts.*# 2#
{-# INLINE happyLt #-}
happyLt x y = LT(x,y)
readArrayBit arr bit =
Bits.testBit (Happy_GHC_Exts.I# (indexShortOffAddr arr ((unbox_int bit) `Happy_GHC_Exts.iShiftRA#` 4#))) (bit `mod` 16)
where unbox_int (Happy_GHC_Exts.I# x) = x
data HappyAddr = HappyA# Happy_GHC_Exts.Addr#
{-# LINE 180 "templates/GenericTemplate.hs" #-}
happyShift new_state 0# tk st sts stk@(x `HappyStk` _) =
let i = (case Happy_GHC_Exts.unsafeCoerce# x of { (Happy_GHC_Exts.I# (i)) -> i }) in
happyDoAction i tk new_state (HappyCons (st) (sts)) (stk)
happyShift new_state i tk st sts stk =
happyNewToken new_state (HappyCons (st) (sts)) ((happyInTok (tk))`HappyStk`stk)
happySpecReduce_0 i fn 0# tk st sts stk
= happyFail [] 0# tk st sts stk
happySpecReduce_0 nt fn j tk st@((action)) sts stk
= happyGoto nt j tk st (HappyCons (st) (sts)) (fn `HappyStk` stk)
happySpecReduce_1 i fn 0# tk st sts stk
= happyFail [] 0# tk st sts stk
happySpecReduce_1 nt fn j tk _ sts@((HappyCons (st@(action)) (_))) (v1`HappyStk`stk')
= let r = fn v1 in
happySeq r (happyGoto nt j tk st sts (r `HappyStk` stk'))
happySpecReduce_2 i fn 0# tk st sts stk
= happyFail [] 0# tk st sts stk
happySpecReduce_2 nt fn j tk _ (HappyCons (_) (sts@((HappyCons (st@(action)) (_))))) (v1`HappyStk`v2`HappyStk`stk')
= let r = fn v1 v2 in
happySeq r (happyGoto nt j tk st sts (r `HappyStk` stk'))
happySpecReduce_3 i fn 0# tk st sts stk
= happyFail [] 0# tk st sts stk
happySpecReduce_3 nt fn j tk _ (HappyCons (_) ((HappyCons (_) (sts@((HappyCons (st@(action)) (_))))))) (v1`HappyStk`v2`HappyStk`v3`HappyStk`stk')
= let r = fn v1 v2 v3 in
happySeq r (happyGoto nt j tk st sts (r `HappyStk` stk'))
happyReduce k i fn 0# tk st sts stk
= happyFail [] 0# tk st sts stk
happyReduce k nt fn j tk st sts stk
= case happyDrop (k Happy_GHC_Exts.-# (1# :: Happy_GHC_Exts.Int#)) sts of
sts1@((HappyCons (st1@(action)) (_))) ->
let r = fn stk in
happyDoSeq r (happyGoto nt j tk st1 sts1 r)
happyMonadReduce k nt fn 0# tk st sts stk
= happyFail [] 0# tk st sts stk
happyMonadReduce k nt fn j tk st sts stk =
case happyDrop k (HappyCons (st) (sts)) of
sts1@((HappyCons (st1@(action)) (_))) ->
let drop_stk = happyDropStk k stk in
happyThen1 (fn stk tk) (\r -> happyGoto nt j tk st1 sts1 (r `HappyStk` drop_stk))
happyMonad2Reduce k nt fn 0# tk st sts stk
= happyFail [] 0# tk st sts stk
happyMonad2Reduce k nt fn j tk st sts stk =
case happyDrop k (HappyCons (st) (sts)) of
sts1@((HappyCons (st1@(action)) (_))) ->
let drop_stk = happyDropStk k stk
off = happyAdjustOffset (indexShortOffAddr happyGotoOffsets st1)
off_i = (off Happy_GHC_Exts.+# nt)
new_state = indexShortOffAddr happyTable off_i
in
happyThen1 (fn stk tk) (\r -> happyNewToken new_state sts1 (r `HappyStk` drop_stk))
happyDrop 0# l = l
happyDrop n (HappyCons (_) (t)) = happyDrop (n Happy_GHC_Exts.-# (1# :: Happy_GHC_Exts.Int#)) t
happyDropStk 0# l = l
happyDropStk n (x `HappyStk` xs) = happyDropStk (n Happy_GHC_Exts.-# (1#::Happy_GHC_Exts.Int#)) xs
happyGoto nt j tk st =
happyDoAction j tk new_state
where off = happyAdjustOffset (indexShortOffAddr happyGotoOffsets st)
off_i = (off Happy_GHC_Exts.+# nt)
new_state = indexShortOffAddr happyTable off_i
happyFail explist 0# tk old_st _ stk@(x `HappyStk` _) =
let i = (case Happy_GHC_Exts.unsafeCoerce# x of { (Happy_GHC_Exts.I# (i)) -> i }) in
happyError_ explist i tk
happyFail explist i tk (action) sts stk =
happyDoAction 0# tk action sts ( (Happy_GHC_Exts.unsafeCoerce# (Happy_GHC_Exts.I# (i))) `HappyStk` stk)
notHappyAtAll :: a
notHappyAtAll = error "Internal Happy error\n"
happyTcHack :: Happy_GHC_Exts.Int# -> a -> a
happyTcHack x y = y
{-# INLINE happyTcHack #-}
happyDoSeq, happyDontSeq :: a -> b -> b
happyDoSeq a b = a `seq` b
happyDontSeq a b = b
{-# NOINLINE happyDoAction #-}
{-# NOINLINE happyTable #-}
{-# NOINLINE happyCheck #-}
{-# NOINLINE happyActOffsets #-}
{-# NOINLINE happyGotoOffsets #-}
{-# NOINLINE happyDefActions #-}
{-# NOINLINE happyShift #-}
{-# NOINLINE happySpecReduce_0 #-}
{-# NOINLINE happySpecReduce_1 #-}
{-# NOINLINE happySpecReduce_2 #-}
{-# NOINLINE happySpecReduce_3 #-}
{-# NOINLINE happyReduce #-}
{-# NOINLINE happyMonadReduce #-}
{-# NOINLINE happyGoto #-}
{-# NOINLINE happyFail #-}