{-# OPTIONS_GHC -w #-}
{-# OPTIONS -XMagicHash -XBangPatterns -XTypeSynonymInstances -XFlexibleInstances -cpp #-}
#if __GLASGOW_HASKELL__ >= 710
{-# OPTIONS_GHC -XPartialTypeSignatures #-}
#endif
module Camfort.Specification.Units.Parser
( unitParser
, UnitParseError
) where
import Control.Monad.Except (throwError)
import Data.Char (isLetter, isNumber, isAlphaNum, toLower)
import Camfort.Specification.Parser (mkParser, SpecParser)
import Camfort.Specification.Units.Parser.Types
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
newtype HappyWrap4 = HappyWrap4 (UnitStatement)
happyIn4 :: (UnitStatement) -> (HappyAbsSyn )
happyIn4 :: UnitStatement -> HappyAbsSyn
happyIn4 UnitStatement
x = HappyWrap4 -> HappyAbsSyn
Happy_GHC_Exts.unsafeCoerce# (UnitStatement -> HappyWrap4
HappyWrap4 UnitStatement
x)
{-# INLINE happyIn4 #-}
happyOut4 :: (HappyAbsSyn ) -> HappyWrap4
happyOut4 :: HappyAbsSyn -> HappyWrap4
happyOut4 HappyAbsSyn
x = HappyAbsSyn -> HappyWrap4
Happy_GHC_Exts.unsafeCoerce# HappyAbsSyn
x
{-# INLINE happyOut4 #-}
newtype HappyWrap5 = HappyWrap5 (Maybe [String])
happyIn5 :: (Maybe [String]) -> (HappyAbsSyn )
happyIn5 :: Maybe [String] -> HappyAbsSyn
happyIn5 Maybe [String]
x = HappyWrap5 -> HappyAbsSyn
Happy_GHC_Exts.unsafeCoerce# (Maybe [String] -> HappyWrap5
HappyWrap5 Maybe [String]
x)
{-# INLINE happyIn5 #-}
happyOut5 :: (HappyAbsSyn ) -> HappyWrap5
happyOut5 :: HappyAbsSyn -> HappyWrap5
happyOut5 HappyAbsSyn
x = HappyAbsSyn -> HappyWrap5
Happy_GHC_Exts.unsafeCoerce# HappyAbsSyn
x
{-# INLINE happyOut5 #-}
newtype HappyWrap6 = HappyWrap6 ([String])
happyIn6 :: ([String]) -> (HappyAbsSyn )
happyIn6 :: [String] -> HappyAbsSyn
happyIn6 [String]
x = HappyWrap6 -> HappyAbsSyn
Happy_GHC_Exts.unsafeCoerce# ([String] -> HappyWrap6
HappyWrap6 [String]
x)
{-# INLINE happyIn6 #-}
happyOut6 :: (HappyAbsSyn ) -> HappyWrap6
happyOut6 :: HappyAbsSyn -> HappyWrap6
happyOut6 HappyAbsSyn
x = HappyAbsSyn -> HappyWrap6
Happy_GHC_Exts.unsafeCoerce# HappyAbsSyn
x
{-# INLINE happyOut6 #-}
newtype HappyWrap7 = HappyWrap7 (UnitOfMeasure)
happyIn7 :: (UnitOfMeasure) -> (HappyAbsSyn )
happyIn7 :: UnitOfMeasure -> HappyAbsSyn
happyIn7 UnitOfMeasure
x = HappyWrap7 -> HappyAbsSyn
Happy_GHC_Exts.unsafeCoerce# (UnitOfMeasure -> HappyWrap7
HappyWrap7 UnitOfMeasure
x)
{-# INLINE happyIn7 #-}
happyOut7 :: (HappyAbsSyn ) -> HappyWrap7
happyOut7 :: HappyAbsSyn -> HappyWrap7
happyOut7 HappyAbsSyn
x = HappyAbsSyn -> HappyWrap7
Happy_GHC_Exts.unsafeCoerce# HappyAbsSyn
x
{-# INLINE happyOut7 #-}
newtype HappyWrap8 = HappyWrap8 ([(String, UnitOfMeasure)])
happyIn8 :: ([(String, UnitOfMeasure)]) -> (HappyAbsSyn )
happyIn8 :: [(String, UnitOfMeasure)] -> HappyAbsSyn
happyIn8 [(String, UnitOfMeasure)]
x = HappyWrap8 -> HappyAbsSyn
Happy_GHC_Exts.unsafeCoerce# ([(String, UnitOfMeasure)] -> HappyWrap8
HappyWrap8 [(String, UnitOfMeasure)]
x)
{-# INLINE happyIn8 #-}
happyOut8 :: (HappyAbsSyn ) -> HappyWrap8
happyOut8 :: HappyAbsSyn -> HappyWrap8
happyOut8 HappyAbsSyn
x = HappyAbsSyn -> HappyWrap8
Happy_GHC_Exts.unsafeCoerce# HappyAbsSyn
x
{-# INLINE happyOut8 #-}
newtype HappyWrap9 = HappyWrap9 ((String, UnitOfMeasure))
happyIn9 :: ((String, UnitOfMeasure)) -> (HappyAbsSyn )
happyIn9 :: (String, UnitOfMeasure) -> HappyAbsSyn
happyIn9 (String, UnitOfMeasure)
x = HappyWrap9 -> HappyAbsSyn
Happy_GHC_Exts.unsafeCoerce# ((String, UnitOfMeasure) -> HappyWrap9
HappyWrap9 (String, UnitOfMeasure)
x)
{-# INLINE happyIn9 #-}
happyOut9 :: (HappyAbsSyn ) -> HappyWrap9
happyOut9 :: HappyAbsSyn -> HappyWrap9
happyOut9 HappyAbsSyn
x = HappyAbsSyn -> HappyWrap9
Happy_GHC_Exts.unsafeCoerce# HappyAbsSyn
x
{-# INLINE happyOut9 #-}
newtype HappyWrap10 = HappyWrap10 (UnitOfMeasure)
happyIn10 :: (UnitOfMeasure) -> (HappyAbsSyn )
happyIn10 :: UnitOfMeasure -> HappyAbsSyn
happyIn10 UnitOfMeasure
x = HappyWrap10 -> HappyAbsSyn
Happy_GHC_Exts.unsafeCoerce# (UnitOfMeasure -> HappyWrap10
HappyWrap10 UnitOfMeasure
x)
{-# INLINE happyIn10 #-}
happyOut10 :: (HappyAbsSyn ) -> HappyWrap10
happyOut10 :: HappyAbsSyn -> HappyWrap10
happyOut10 HappyAbsSyn
x = HappyAbsSyn -> HappyWrap10
Happy_GHC_Exts.unsafeCoerce# HappyAbsSyn
x
{-# INLINE happyOut10 #-}
newtype HappyWrap11 = HappyWrap11 (UnitOfMeasure)
happyIn11 :: (UnitOfMeasure) -> (HappyAbsSyn )
happyIn11 :: UnitOfMeasure -> HappyAbsSyn
happyIn11 UnitOfMeasure
x = HappyWrap11 -> HappyAbsSyn
Happy_GHC_Exts.unsafeCoerce# (UnitOfMeasure -> HappyWrap11
HappyWrap11 UnitOfMeasure
x)
{-# INLINE happyIn11 #-}
happyOut11 :: (HappyAbsSyn ) -> HappyWrap11
happyOut11 :: HappyAbsSyn -> HappyWrap11
happyOut11 HappyAbsSyn
x = HappyAbsSyn -> HappyWrap11
Happy_GHC_Exts.unsafeCoerce# HappyAbsSyn
x
{-# INLINE happyOut11 #-}
newtype HappyWrap12 = HappyWrap12 (UnitPower)
happyIn12 :: (UnitPower) -> (HappyAbsSyn )
happyIn12 :: UnitPower -> HappyAbsSyn
happyIn12 UnitPower
x = HappyWrap12 -> HappyAbsSyn
Happy_GHC_Exts.unsafeCoerce# (UnitPower -> HappyWrap12
HappyWrap12 UnitPower
x)
{-# INLINE happyIn12 #-}
happyOut12 :: (HappyAbsSyn ) -> HappyWrap12
happyOut12 :: HappyAbsSyn -> HappyWrap12
happyOut12 HappyAbsSyn
x = HappyAbsSyn -> HappyWrap12
Happy_GHC_Exts.unsafeCoerce# HappyAbsSyn
x
{-# INLINE happyOut12 #-}
newtype HappyWrap13 = HappyWrap13 (Integer)
happyIn13 :: (Integer) -> (HappyAbsSyn )
happyIn13 :: Integer -> HappyAbsSyn
happyIn13 Integer
x = HappyWrap13 -> HappyAbsSyn
Happy_GHC_Exts.unsafeCoerce# (Integer -> HappyWrap13
HappyWrap13 Integer
x)
{-# INLINE happyIn13 #-}
happyOut13 :: (HappyAbsSyn ) -> HappyWrap13
happyOut13 :: HappyAbsSyn -> HappyWrap13
happyOut13 HappyAbsSyn
x = HappyAbsSyn -> HappyWrap13
Happy_GHC_Exts.unsafeCoerce# HappyAbsSyn
x
{-# INLINE happyOut13 #-}
newtype HappyWrap14 = HappyWrap14 (String)
happyIn14 :: (String) -> (HappyAbsSyn )
happyIn14 :: String -> HappyAbsSyn
happyIn14 String
x = HappyWrap14 -> HappyAbsSyn
Happy_GHC_Exts.unsafeCoerce# (String -> HappyWrap14
HappyWrap14 String
x)
{-# INLINE happyIn14 #-}
happyOut14 :: (HappyAbsSyn ) -> HappyWrap14
happyOut14 :: HappyAbsSyn -> HappyWrap14
happyOut14 HappyAbsSyn
x = HappyAbsSyn -> HappyWrap14
Happy_GHC_Exts.unsafeCoerce# HappyAbsSyn
x
{-# INLINE happyOut14 #-}
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\x40\x00\x00\x00\x08\x00\x00\x00\x0e\x10\x00\x00\x00\x00\x00\x38\x50\x00\x00\x00\x03\x00\x40\x08\x01\x00\x00\x02\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x38\xc0\x00\x00\x00\x01\x00\x40\x08\x03\x00\x00\x40\x00\x00\x00\x00\x00\x00\x40\x00\x00\x0e\x10\x00\x00\x0b\x02\x00\x00\x04\x00\x00\x02\x08\x00\xe0\x00\x01\x00\x00\x00\x00\x00\x01\x04\x00\x20\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x04\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x60\x01\x00\x00\x00\x03\x00\x00\x00\x02\x00\x40\x00\x00\x80\x03\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x38\x40\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x44\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x0b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\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_parseUnit",String
"UNIT",String
"VARIABLE_ANNOTATION",String
"IDS",String
"UEXP",String
"RECORD_DECLS",String
"RECORD_DECL",String
"UEXP_LEVEL1",String
"UEXP_LEVEL2",String
"POW",String
"SIGNED_NUM",String
"NUM",String
"unit",String
"record",String
"id",String
"one",String
"num",String
"','",String
"'-'",String
"'*'",String
"'**'",String
"'/'",String
"'::'",String
"'='",String
"'('",String
"')'",String
"%eof"]
bit_start :: Int
bit_start = Int
st Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
29
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
29
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
28]
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#
"\x0a\x00\x11\x00\x06\x00\xf5\xff\x03\x00\x38\x00\x15\x00\x1c\x00\x0f\x00\x00\x00\x00\x00\x49\x00\xff\xff\x29\x00\x0c\x00\x2d\x00\x00\x00\x42\x00\x13\x00\x1a\x00\x44\x00\x0e\x00\x13\x00\x00\x00\x0e\x00\x4c\x00\x00\x00\x4a\x00\x48\x00\x48\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x1f\x00\x3c\x00\x45\x00\x4e\x00\x13\x00\x00\x00\x00\x00\x4b\x00\x13\x00\x00\x00\x4f\x00\x30\x00\x00\x00\x53\x00\x00\x00\x1f\x00\x00\x00\x00\x00\x00\x00\x4d\x00\x00\x00\x00\x00"#
happyGotoOffsets :: HappyAddr
happyGotoOffsets :: HappyAddr
happyGotoOffsets = Addr# -> HappyAddr
HappyA# Addr#
"\x57\x00\x00\x00\x2f\x00\x00\x00\x2f\x00\x58\x00\x51\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x31\x00\x00\x00\x51\x00\x00\x00\x00\x00\x00\x00\x25\x00\x37\x00\x00\x00\x55\x00\x31\x00\x00\x00\x56\x00\x5c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x50\x00\x3f\x00\x00\x00\x00\x00\x00\x00\x36\x00\x00\x00\x00\x00\x00\x00\x2a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x5d\x00\x00\x00\x41\x00\x00\x00\x00\x00\x00\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\x00\x00\x00\x00\x00\x00\xfb\xff\xf8\xff\xed\xff\x00\x00\xea\xff\xf7\xff\x00\x00\x00\x00\x00\x00\xf8\xff\xf7\xff\xf5\xff\x00\x00\x00\x00\x00\x00\xf0\xff\x00\x00\x00\x00\xfe\xff\x00\x00\x00\x00\xfc\xff\xf9\xff\xee\xff\xef\xff\xec\xff\xe9\xff\xe6\xff\xe3\xff\xe4\xff\x00\x00\x00\x00\x00\x00\x00\x00\xf2\xff\x00\x00\xf6\xff\xeb\xff\xfd\xff\x00\x00\xf4\xff\x00\x00\x00\x00\xe5\xff\x00\x00\xfa\xff\x00\x00\xe8\xff\xf1\xff\xf3\xff\x00\x00\xe7\xff"#
happyCheck :: HappyAddr
happyCheck :: HappyAddr
happyCheck = Addr# -> HappyAddr
HappyA# Addr#
"\xff\xff\x02\x00\x03\x00\x04\x00\x0f\x00\x02\x00\x03\x00\x04\x00\x02\x00\x03\x00\x04\x00\x01\x00\x0d\x00\x0e\x00\x0b\x00\x03\x00\x0d\x00\x03\x00\x01\x00\x0d\x00\x08\x00\x02\x00\x03\x00\x04\x00\x03\x00\x0d\x00\x0e\x00\x0d\x00\x0d\x00\x08\x00\x04\x00\x05\x00\x0d\x00\x07\x00\x0d\x00\x04\x00\x05\x00\x09\x00\x07\x00\x0d\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x03\x00\x0a\x00\x03\x00\x06\x00\x07\x00\x06\x00\x07\x00\x03\x00\x0a\x00\x0e\x00\x06\x00\x07\x00\x0e\x00\x08\x00\x09\x00\x0a\x00\x0a\x00\x0b\x00\x04\x00\x05\x00\x0a\x00\x0b\x00\x09\x00\x0a\x00\x09\x00\x0a\x00\x03\x00\x09\x00\x0c\x00\x03\x00\x06\x00\x09\x00\x03\x00\x0e\x00\x06\x00\x0a\x00\x03\x00\x00\x00\x07\x00\x01\x00\x0a\x00\x0e\x00\x07\x00\x07\x00\x02\x00\x02\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"#
happyTable :: HappyAddr
happyTable :: HappyAddr
happyTable = Addr# -> HappyAddr
HappyA# Addr#
"\x00\x00\x09\x00\x0a\x00\x10\x00\xff\xff\x09\x00\x0a\x00\x0b\x00\x09\x00\x0a\x00\x0b\x00\x05\x00\x0d\x00\x11\x00\x0c\x00\x0a\x00\x0d\x00\x0a\x00\x03\x00\x0d\x00\x16\x00\x09\x00\x0a\x00\x0b\x00\x0a\x00\x17\x00\x2b\x00\x17\x00\x13\x00\x16\x00\x22\x00\x23\x00\x0d\x00\x24\x00\x17\x00\x22\x00\x23\x00\x14\x00\x24\x00\x25\x00\x25\x00\x26\x00\x27\x00\x06\x00\x07\x00\x25\x00\x36\x00\x27\x00\x06\x00\x07\x00\x05\x00\x19\x00\x0d\x00\x06\x00\x07\x00\x0e\x00\x07\x00\x2b\x00\x34\x00\x2a\x00\x06\x00\x07\x00\x35\x00\x1e\x00\x1f\x00\x20\x00\x19\x00\x1a\x00\x22\x00\x23\x00\x19\x00\x2f\x00\x2f\x00\x20\x00\x37\x00\x20\x00\x12\x00\x14\x00\x29\x00\x1c\x00\x32\x00\x14\x00\x36\x00\x2e\x00\x2d\x00\x19\x00\x1c\x00\x03\x00\x14\x00\x17\x00\x30\x00\x39\x00\x1d\x00\x1c\x00\x1a\x00\x32\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\x00\x00"#
happyReduceArr :: Array
Int
(Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn)
happyReduceArr = (Int, Int)
-> [(Int,
Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn)]
-> Array
Int
(Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn)
forall i e. Ix i => (i, i) -> [(i, e)] -> Array i e
Happy_Data_Array.array (Int
1, Int
28) [
(Int
1 , Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce_1),
(Int
2 , Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce_2),
(Int
3 , Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce_3),
(Int
4 , Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce_4),
(Int
5 , Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce_5),
(Int
6 , Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce_6),
(Int
7 , Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce_7),
(Int
8 , Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce_8),
(Int
9 , Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce_9),
(Int
10 , Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce_10),
(Int
11 , Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce_11),
(Int
12 , Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce_12),
(Int
13 , Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce_13),
(Int
14 , Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce_14),
(Int
15 , Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce_15),
(Int
16 , Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce_16),
(Int
17 , Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce_17),
(Int
18 , Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce_18),
(Int
19 , Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce_19),
(Int
20 , Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce_20),
(Int
21 , Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce_21),
(Int
22 , Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce_22),
(Int
23 , Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce_23),
(Int
24 , Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce_24),
(Int
25 , Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce_25),
(Int
26 , Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce_26),
(Int
27 , Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce_27),
(Int
28 , Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce_28)
]
happy_n_terms :: Int
happy_n_terms = Int
16 :: Int
happy_n_nonterms :: Int
happy_n_nonterms = Int
11 :: Int
happyReduce_1 :: Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce_1 = Int#
-> (HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn)
-> Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happySpecReduce_3 Int#
0# HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn
forall p. HappyAbsSyn -> HappyAbsSyn -> p -> HappyAbsSyn
happyReduction_1
happyReduction_1 :: HappyAbsSyn -> HappyAbsSyn -> p -> HappyAbsSyn
happyReduction_1 HappyAbsSyn
happy_x_3
HappyAbsSyn
happy_x_2
p
happy_x_1
= case HappyAbsSyn -> HappyWrap7
happyOut7 HappyAbsSyn
happy_x_2 of { (HappyWrap7 UnitOfMeasure
happy_var_2) ->
case HappyAbsSyn -> HappyWrap5
happyOut5 HappyAbsSyn
happy_x_3 of { (HappyWrap5 Maybe [String]
happy_var_3) ->
UnitStatement -> HappyAbsSyn
happyIn4
(Maybe [String] -> UnitOfMeasure -> UnitStatement
UnitAssignment Maybe [String]
happy_var_3 UnitOfMeasure
happy_var_2
)}}
happyReduce_2 :: Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce_2 = Int#
-> Int#
-> (HappyStk HappyAbsSyn -> HappyStk HappyAbsSyn)
-> Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce Int#
5# Int#
0# HappyStk HappyAbsSyn -> HappyStk HappyAbsSyn
happyReduction_2
happyReduction_2 :: HappyStk HappyAbsSyn -> HappyStk HappyAbsSyn
happyReduction_2 (HappyAbsSyn
happy_x_5 `HappyStk`
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_3 of { (TId String
happy_var_3) ->
case HappyAbsSyn -> HappyWrap7
happyOut7 HappyAbsSyn
happy_x_5 of { (HappyWrap7 UnitOfMeasure
happy_var_5) ->
UnitStatement -> HappyAbsSyn
happyIn4
(String -> UnitOfMeasure -> UnitStatement
UnitAlias String
happy_var_3 UnitOfMeasure
happy_var_5
) HappyAbsSyn -> HappyStk HappyAbsSyn -> HappyStk HappyAbsSyn
forall a. a -> HappyStk a -> HappyStk a
`HappyStk` HappyStk HappyAbsSyn
happyRest}}
happyReduce_3 :: Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce_3 = Int#
-> (HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn)
-> Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happySpecReduce_2 Int#
1# HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn
forall p. HappyAbsSyn -> p -> HappyAbsSyn
happyReduction_3
happyReduction_3 :: HappyAbsSyn -> p -> HappyAbsSyn
happyReduction_3 HappyAbsSyn
happy_x_2
p
happy_x_1
= case HappyAbsSyn -> HappyWrap6
happyOut6 HappyAbsSyn
happy_x_2 of { (HappyWrap6 [String]
happy_var_2) ->
Maybe [String] -> HappyAbsSyn
happyIn5
([String] -> Maybe [String]
forall k1. k1 -> Maybe k1
Just [String]
happy_var_2
)}
happyReduce_4 :: Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce_4 = Int#
-> HappyAbsSyn
-> Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happySpecReduce_0 Int#
1# HappyAbsSyn
happyReduction_4
happyReduction_4 :: HappyAbsSyn
happyReduction_4 = Maybe [String] -> HappyAbsSyn
happyIn5
(Maybe [String]
forall k1. Maybe k1
Nothing
)
happyReduce_5 :: Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce_5 = Int#
-> (HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn)
-> Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happySpecReduce_3 Int#
2# HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn
forall p. HappyAbsSyn -> p -> HappyAbsSyn -> HappyAbsSyn
happyReduction_5
happyReduction_5 :: HappyAbsSyn -> p -> HappyAbsSyn -> HappyAbsSyn
happyReduction_5 HappyAbsSyn
happy_x_3
p
happy_x_2
HappyAbsSyn
happy_x_1
= case HappyAbsSyn -> Token
happyOutTok HappyAbsSyn
happy_x_1 of { (TId String
happy_var_1) ->
case HappyAbsSyn -> HappyWrap6
happyOut6 HappyAbsSyn
happy_x_3 of { (HappyWrap6 [String]
happy_var_3) ->
[String] -> HappyAbsSyn
happyIn6
(String
happy_var_1 String -> [String] -> [String]
forall k1. k1 -> [k1] -> [k1]
: [String]
happy_var_3
)}}
happyReduce_6 :: Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce_6 = Int#
-> (HappyAbsSyn -> HappyAbsSyn)
-> Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happySpecReduce_1 Int#
2# HappyAbsSyn -> HappyAbsSyn
happyReduction_6
happyReduction_6 :: HappyAbsSyn -> HappyAbsSyn
happyReduction_6 HappyAbsSyn
happy_x_1
= case HappyAbsSyn -> Token
happyOutTok HappyAbsSyn
happy_x_1 of { (TId String
happy_var_1) ->
[String] -> HappyAbsSyn
happyIn6
([String
happy_var_1]
)}
happyReduce_7 :: Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce_7 = Int#
-> (HappyAbsSyn -> HappyAbsSyn)
-> Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happySpecReduce_1 Int#
3# HappyAbsSyn -> HappyAbsSyn
happyReduction_7
happyReduction_7 :: HappyAbsSyn -> HappyAbsSyn
happyReduction_7 HappyAbsSyn
happy_x_1
= case HappyAbsSyn -> HappyWrap10
happyOut10 HappyAbsSyn
happy_x_1 of { (HappyWrap10 UnitOfMeasure
happy_var_1) ->
UnitOfMeasure -> HappyAbsSyn
happyIn7
(UnitOfMeasure
happy_var_1
)}
happyReduce_8 :: Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce_8 = Int#
-> (HappyAbsSyn -> HappyAbsSyn)
-> Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happySpecReduce_1 Int#
3# HappyAbsSyn -> HappyAbsSyn
forall p. p -> HappyAbsSyn
happyReduction_8
happyReduction_8 :: p -> HappyAbsSyn
happyReduction_8 p
happy_x_1
= UnitOfMeasure -> HappyAbsSyn
happyIn7
(UnitOfMeasure
Unitless
)
happyReduce_9 :: Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce_9 = Int#
-> (HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn)
-> Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happySpecReduce_3 Int#
3# HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn
forall p p p. p -> p -> p -> HappyAbsSyn
happyReduction_9
happyReduction_9 :: p -> p -> p -> HappyAbsSyn
happyReduction_9 p
happy_x_3
p
happy_x_2
p
happy_x_1
= UnitOfMeasure -> HappyAbsSyn
happyIn7
(UnitOfMeasure
Unitless
)
happyReduce_10 :: Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce_10 = Int#
-> (HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn)
-> Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happySpecReduce_2 Int#
3# HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn
forall p p. p -> p -> HappyAbsSyn
happyReduction_10
happyReduction_10 :: p -> p -> HappyAbsSyn
happyReduction_10 p
happy_x_2
p
happy_x_1
= UnitOfMeasure -> HappyAbsSyn
happyIn7
(UnitOfMeasure
Unitless
)
happyReduce_11 :: Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce_11 = Int#
-> Int#
-> (HappyStk HappyAbsSyn -> HappyStk HappyAbsSyn)
-> Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce Int#
4# Int#
3# HappyStk HappyAbsSyn -> HappyStk HappyAbsSyn
happyReduction_11
happyReduction_11 :: HappyStk HappyAbsSyn -> HappyStk HappyAbsSyn
happyReduction_11 (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 -> HappyWrap8
happyOut8 HappyAbsSyn
happy_x_3 of { (HappyWrap8 [(String, UnitOfMeasure)]
happy_var_3) ->
UnitOfMeasure -> HappyAbsSyn
happyIn7
([(String, UnitOfMeasure)] -> UnitOfMeasure
UnitRecord [(String, UnitOfMeasure)]
happy_var_3
) HappyAbsSyn -> HappyStk HappyAbsSyn -> HappyStk HappyAbsSyn
forall a. a -> HappyStk a -> HappyStk a
`HappyStk` HappyStk HappyAbsSyn
happyRest}
happyReduce_12 :: Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce_12 = Int#
-> (HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn)
-> Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happySpecReduce_3 Int#
4# HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn
forall p. HappyAbsSyn -> p -> HappyAbsSyn -> HappyAbsSyn
happyReduction_12
happyReduction_12 :: HappyAbsSyn -> p -> HappyAbsSyn -> HappyAbsSyn
happyReduction_12 HappyAbsSyn
happy_x_3
p
happy_x_2
HappyAbsSyn
happy_x_1
= case HappyAbsSyn -> HappyWrap9
happyOut9 HappyAbsSyn
happy_x_1 of { (HappyWrap9 (String, UnitOfMeasure)
happy_var_1) ->
case HappyAbsSyn -> HappyWrap8
happyOut8 HappyAbsSyn
happy_x_3 of { (HappyWrap8 [(String, UnitOfMeasure)]
happy_var_3) ->
[(String, UnitOfMeasure)] -> HappyAbsSyn
happyIn8
((String, UnitOfMeasure)
happy_var_1 (String, UnitOfMeasure)
-> [(String, UnitOfMeasure)] -> [(String, UnitOfMeasure)]
forall k1. k1 -> [k1] -> [k1]
: [(String, UnitOfMeasure)]
happy_var_3
)}}
happyReduce_13 :: Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce_13 = Int#
-> (HappyAbsSyn -> HappyAbsSyn)
-> Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happySpecReduce_1 Int#
4# HappyAbsSyn -> HappyAbsSyn
happyReduction_13
happyReduction_13 :: HappyAbsSyn -> HappyAbsSyn
happyReduction_13 HappyAbsSyn
happy_x_1
= case HappyAbsSyn -> HappyWrap9
happyOut9 HappyAbsSyn
happy_x_1 of { (HappyWrap9 (String, UnitOfMeasure)
happy_var_1) ->
[(String, UnitOfMeasure)] -> HappyAbsSyn
happyIn8
([(String, UnitOfMeasure)
happy_var_1]
)}
happyReduce_14 :: Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce_14 = Int#
-> (HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn)
-> Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happySpecReduce_3 Int#
5# HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn
forall p. HappyAbsSyn -> p -> HappyAbsSyn -> HappyAbsSyn
happyReduction_14
happyReduction_14 :: HappyAbsSyn -> p -> HappyAbsSyn -> HappyAbsSyn
happyReduction_14 HappyAbsSyn
happy_x_3
p
happy_x_2
HappyAbsSyn
happy_x_1
= case HappyAbsSyn -> HappyWrap7
happyOut7 HappyAbsSyn
happy_x_1 of { (HappyWrap7 UnitOfMeasure
happy_var_1) ->
case HappyAbsSyn -> Token
happyOutTok HappyAbsSyn
happy_x_3 of { (TId String
happy_var_3) ->
(String, UnitOfMeasure) -> HappyAbsSyn
happyIn9
((String
happy_var_3, UnitOfMeasure
happy_var_1)
)}}
happyReduce_15 :: Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce_15 = Int#
-> (HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn)
-> Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happySpecReduce_2 Int#
6# HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn
happyReduction_15
happyReduction_15 :: HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn
happyReduction_15 HappyAbsSyn
happy_x_2
HappyAbsSyn
happy_x_1
= case HappyAbsSyn -> HappyWrap10
happyOut10 HappyAbsSyn
happy_x_1 of { (HappyWrap10 UnitOfMeasure
happy_var_1) ->
case HappyAbsSyn -> HappyWrap11
happyOut11 HappyAbsSyn
happy_x_2 of { (HappyWrap11 UnitOfMeasure
happy_var_2) ->
UnitOfMeasure -> HappyAbsSyn
happyIn10
(UnitOfMeasure -> UnitOfMeasure -> UnitOfMeasure
UnitProduct UnitOfMeasure
happy_var_1 UnitOfMeasure
happy_var_2
)}}
happyReduce_16 :: Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce_16 = Int#
-> (HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn)
-> Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happySpecReduce_3 Int#
6# HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn
forall p. HappyAbsSyn -> p -> HappyAbsSyn -> HappyAbsSyn
happyReduction_16
happyReduction_16 :: HappyAbsSyn -> p -> HappyAbsSyn -> HappyAbsSyn
happyReduction_16 HappyAbsSyn
happy_x_3
p
happy_x_2
HappyAbsSyn
happy_x_1
= case HappyAbsSyn -> HappyWrap10
happyOut10 HappyAbsSyn
happy_x_1 of { (HappyWrap10 UnitOfMeasure
happy_var_1) ->
case HappyAbsSyn -> HappyWrap11
happyOut11 HappyAbsSyn
happy_x_3 of { (HappyWrap11 UnitOfMeasure
happy_var_3) ->
UnitOfMeasure -> HappyAbsSyn
happyIn10
(UnitOfMeasure -> UnitOfMeasure -> UnitOfMeasure
UnitProduct UnitOfMeasure
happy_var_1 UnitOfMeasure
happy_var_3
)}}
happyReduce_17 :: Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce_17 = Int#
-> (HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn)
-> Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happySpecReduce_3 Int#
6# HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn
forall p. HappyAbsSyn -> p -> HappyAbsSyn -> HappyAbsSyn
happyReduction_17
happyReduction_17 :: HappyAbsSyn -> p -> HappyAbsSyn -> HappyAbsSyn
happyReduction_17 HappyAbsSyn
happy_x_3
p
happy_x_2
HappyAbsSyn
happy_x_1
= case HappyAbsSyn -> HappyWrap7
happyOut7 HappyAbsSyn
happy_x_1 of { (HappyWrap7 UnitOfMeasure
happy_var_1) ->
case HappyAbsSyn -> HappyWrap11
happyOut11 HappyAbsSyn
happy_x_3 of { (HappyWrap11 UnitOfMeasure
happy_var_3) ->
UnitOfMeasure -> HappyAbsSyn
happyIn10
(UnitOfMeasure -> UnitOfMeasure -> UnitOfMeasure
UnitQuotient UnitOfMeasure
happy_var_1 UnitOfMeasure
happy_var_3
)}}
happyReduce_18 :: Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce_18 = Int#
-> (HappyAbsSyn -> HappyAbsSyn)
-> Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happySpecReduce_1 Int#
6# HappyAbsSyn -> HappyAbsSyn
happyReduction_18
happyReduction_18 :: HappyAbsSyn -> HappyAbsSyn
happyReduction_18 HappyAbsSyn
happy_x_1
= case HappyAbsSyn -> HappyWrap11
happyOut11 HappyAbsSyn
happy_x_1 of { (HappyWrap11 UnitOfMeasure
happy_var_1) ->
UnitOfMeasure -> HappyAbsSyn
happyIn10
(UnitOfMeasure
happy_var_1
)}
happyReduce_19 :: Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce_19 = Int#
-> (HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn)
-> Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happySpecReduce_3 Int#
7# HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn
forall p. HappyAbsSyn -> p -> HappyAbsSyn -> HappyAbsSyn
happyReduction_19
happyReduction_19 :: HappyAbsSyn -> p -> HappyAbsSyn -> HappyAbsSyn
happyReduction_19 HappyAbsSyn
happy_x_3
p
happy_x_2
HappyAbsSyn
happy_x_1
= case HappyAbsSyn -> HappyWrap11
happyOut11 HappyAbsSyn
happy_x_1 of { (HappyWrap11 UnitOfMeasure
happy_var_1) ->
case HappyAbsSyn -> HappyWrap12
happyOut12 HappyAbsSyn
happy_x_3 of { (HappyWrap12 UnitPower
happy_var_3) ->
UnitOfMeasure -> HappyAbsSyn
happyIn11
(UnitOfMeasure -> UnitPower -> UnitOfMeasure
UnitExponentiation UnitOfMeasure
happy_var_1 UnitPower
happy_var_3
)}}
happyReduce_20 :: Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce_20 = Int#
-> (HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn)
-> Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happySpecReduce_3 Int#
7# HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn
forall p p. p -> HappyAbsSyn -> p -> HappyAbsSyn
happyReduction_20
happyReduction_20 :: p -> HappyAbsSyn -> p -> HappyAbsSyn
happyReduction_20 p
happy_x_3
HappyAbsSyn
happy_x_2
p
happy_x_1
= case HappyAbsSyn -> HappyWrap10
happyOut10 HappyAbsSyn
happy_x_2 of { (HappyWrap10 UnitOfMeasure
happy_var_2) ->
UnitOfMeasure -> HappyAbsSyn
happyIn11
(UnitOfMeasure
happy_var_2
)}
happyReduce_21 :: Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce_21 = Int#
-> (HappyAbsSyn -> HappyAbsSyn)
-> Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happySpecReduce_1 Int#
7# HappyAbsSyn -> HappyAbsSyn
happyReduction_21
happyReduction_21 :: HappyAbsSyn -> HappyAbsSyn
happyReduction_21 HappyAbsSyn
happy_x_1
= case HappyAbsSyn -> Token
happyOutTok HappyAbsSyn
happy_x_1 of { (TId String
happy_var_1) ->
UnitOfMeasure -> HappyAbsSyn
happyIn11
(String -> UnitOfMeasure
UnitBasic String
happy_var_1
)}
happyReduce_22 :: Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce_22 = Int#
-> (HappyAbsSyn -> HappyAbsSyn)
-> Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happySpecReduce_1 Int#
8# HappyAbsSyn -> HappyAbsSyn
happyReduction_22
happyReduction_22 :: HappyAbsSyn -> HappyAbsSyn
happyReduction_22 HappyAbsSyn
happy_x_1
= case HappyAbsSyn -> HappyWrap13
happyOut13 HappyAbsSyn
happy_x_1 of { (HappyWrap13 Integer
happy_var_1) ->
UnitPower -> HappyAbsSyn
happyIn12
(Integer -> UnitPower
UnitPowerInteger Integer
happy_var_1
)}
happyReduce_23 :: Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce_23 = Int#
-> (HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn)
-> Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happySpecReduce_3 Int#
8# HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn
forall p p. p -> HappyAbsSyn -> p -> HappyAbsSyn
happyReduction_23
happyReduction_23 :: p -> HappyAbsSyn -> p -> HappyAbsSyn
happyReduction_23 p
happy_x_3
HappyAbsSyn
happy_x_2
p
happy_x_1
= case HappyAbsSyn -> HappyWrap13
happyOut13 HappyAbsSyn
happy_x_2 of { (HappyWrap13 Integer
happy_var_2) ->
UnitPower -> HappyAbsSyn
happyIn12
(Integer -> UnitPower
UnitPowerInteger Integer
happy_var_2
)}
happyReduce_24 :: Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce_24 = Int#
-> Int#
-> (HappyStk HappyAbsSyn -> HappyStk HappyAbsSyn)
-> Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce Int#
5# Int#
8# HappyStk HappyAbsSyn -> HappyStk HappyAbsSyn
happyReduction_24
happyReduction_24 :: HappyStk HappyAbsSyn -> HappyStk HappyAbsSyn
happyReduction_24 (HappyAbsSyn
happy_x_5 `HappyStk`
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 -> HappyWrap13
happyOut13 HappyAbsSyn
happy_x_2 of { (HappyWrap13 Integer
happy_var_2) ->
case HappyAbsSyn -> HappyWrap13
happyOut13 HappyAbsSyn
happy_x_4 of { (HappyWrap13 Integer
happy_var_4) ->
UnitPower -> HappyAbsSyn
happyIn12
(Integer -> Integer -> UnitPower
UnitPowerRational Integer
happy_var_2 Integer
happy_var_4
) HappyAbsSyn -> HappyStk HappyAbsSyn -> HappyStk HappyAbsSyn
forall a. a -> HappyStk a -> HappyStk a
`HappyStk` HappyStk HappyAbsSyn
happyRest}}
happyReduce_25 :: Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce_25 = Int#
-> (HappyAbsSyn -> HappyAbsSyn)
-> Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happySpecReduce_1 Int#
9# HappyAbsSyn -> HappyAbsSyn
happyReduction_25
happyReduction_25 :: HappyAbsSyn -> HappyAbsSyn
happyReduction_25 HappyAbsSyn
happy_x_1
= case HappyAbsSyn -> HappyWrap14
happyOut14 HappyAbsSyn
happy_x_1 of { (HappyWrap14 String
happy_var_1) ->
Integer -> HappyAbsSyn
happyIn13
(String -> Integer
forall a. Read a => String -> a
read String
happy_var_1
)}
happyReduce_26 :: Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce_26 = Int#
-> (HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn)
-> Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happySpecReduce_2 Int#
9# HappyAbsSyn -> HappyAbsSyn -> HappyAbsSyn
forall p. HappyAbsSyn -> p -> HappyAbsSyn
happyReduction_26
happyReduction_26 :: HappyAbsSyn -> p -> HappyAbsSyn
happyReduction_26 HappyAbsSyn
happy_x_2
p
happy_x_1
= case HappyAbsSyn -> HappyWrap14
happyOut14 HappyAbsSyn
happy_x_2 of { (HappyWrap14 String
happy_var_2) ->
Integer -> HappyAbsSyn
happyIn13
(String -> Integer
forall a. Read a => String -> a
read (String -> Integer) -> String -> Integer
forall a b. (a -> b) -> a -> b
$ Char
'-' Char -> String -> String
forall k1. k1 -> [k1] -> [k1]
: String
happy_var_2
)}
happyReduce_27 :: Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce_27 = Int#
-> (HappyAbsSyn -> HappyAbsSyn)
-> Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happySpecReduce_1 Int#
10# HappyAbsSyn -> HappyAbsSyn
happyReduction_27
happyReduction_27 :: HappyAbsSyn -> HappyAbsSyn
happyReduction_27 HappyAbsSyn
happy_x_1
= case HappyAbsSyn -> Token
happyOutTok HappyAbsSyn
happy_x_1 of { (TNum String
happy_var_1) ->
String -> HappyAbsSyn
happyIn14
(String
happy_var_1
)}
happyReduce_28 :: Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyReduce_28 = Int#
-> (HappyAbsSyn -> HappyAbsSyn)
-> Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happySpecReduce_1 Int#
10# HappyAbsSyn -> HappyAbsSyn
forall p. p -> HappyAbsSyn
happyReduction_28
happyReduction_28 :: p -> HappyAbsSyn
happyReduction_28 p
happy_x_1
= String -> HappyAbsSyn
happyIn14
(String
"1"
)
happyNewToken :: Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyNewToken Int#
action Happy_IntList
sts HappyStk HappyAbsSyn
stk [] =
Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyDoAction Int#
15# 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# -> UnitSpecParser HappyAbsSyn
cont Int#
i = Int#
-> Token
-> Int#
-> Happy_IntList
-> HappyStk HappyAbsSyn
-> [Token]
-> UnitSpecParser HappyAbsSyn
happyDoAction Int#
i Token
tk Int#
action Happy_IntList
sts HappyStk HappyAbsSyn
stk [Token]
tks in
case Token
tk of {
TId String
"unit" -> Int# -> UnitSpecParser HappyAbsSyn
cont Int#
1#;
Token
TRecord -> Int# -> UnitSpecParser HappyAbsSyn
cont Int#
2#;
TId String
happy_dollar_dollar -> Int# -> UnitSpecParser HappyAbsSyn
cont Int#
3#;
TNum String
"1" -> Int# -> UnitSpecParser HappyAbsSyn
cont Int#
4#;
TNum String
happy_dollar_dollar -> Int# -> UnitSpecParser HappyAbsSyn
cont Int#
5#;
Token
TComma -> Int# -> UnitSpecParser HappyAbsSyn
cont Int#
6#;
Token
TMinus -> Int# -> UnitSpecParser HappyAbsSyn
cont Int#
7#;
Token
TMult -> Int# -> UnitSpecParser HappyAbsSyn
cont Int#
8#;
Token
TExponentiation -> Int# -> UnitSpecParser HappyAbsSyn
cont Int#
9#;
Token
TDivision -> Int# -> UnitSpecParser HappyAbsSyn
cont Int#
10#;
Token
TDoubleColon -> Int# -> UnitSpecParser HappyAbsSyn
cont Int#
11#;
Token
TEqual -> Int# -> UnitSpecParser HappyAbsSyn
cont Int#
12#;
Token
TLeftPar -> Int# -> UnitSpecParser HappyAbsSyn
cont Int#
13#;
Token
TRightPar -> Int# -> UnitSpecParser HappyAbsSyn
cont Int#
14#;
Token
_ -> ([Token], [String]) -> UnitSpecParser HappyAbsSyn
forall a. ([Token], [String]) -> UnitSpecParser a
happyError' ((Token
tkToken -> [Token] -> [Token]
forall k1. k1 -> [k1] -> [k1]
:[Token]
tks), [])
}
happyError_ :: [String] -> Int# -> Token -> [Token] -> UnitSpecParser a
happyError_ [String]
explist Int#
15# Token
tk [Token]
tks = ([Token], [String]) -> UnitSpecParser a
forall a. ([Token], [String]) -> UnitSpecParser a
happyError' ([Token]
tks, [String]
explist)
happyError_ [String]
explist Int#
_ Token
tk [Token]
tks = ([Token], [String]) -> UnitSpecParser a
forall a. ([Token], [String]) -> UnitSpecParser a
happyError' ((Token
tkToken -> [Token] -> [Token]
forall k1. k1 -> [k1] -> [k1]
:[Token]
tks), [String]
explist)
happyThen :: () => UnitSpecParser a -> (a -> UnitSpecParser b) -> UnitSpecParser b
happyThen :: UnitSpecParser a -> (a -> UnitSpecParser b) -> UnitSpecParser b
happyThen = UnitSpecParser a -> (a -> UnitSpecParser b) -> UnitSpecParser b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
(>>=)
happyReturn :: () => a -> UnitSpecParser a
happyReturn :: a -> UnitSpecParser a
happyReturn = (a -> UnitSpecParser 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 -> UnitSpecParser a
happyReturn1 :: a -> b -> UnitSpecParser a
happyReturn1 = \a
a b
tks -> (a -> UnitSpecParser a
forall (m :: * -> *) a. Monad m => a -> m a
return) a
a
happyError' :: () => ([(Token)], [String]) -> UnitSpecParser a
happyError' :: ([Token], [String]) -> UnitSpecParser a
happyError' = (\([Token]
tokens, [String]
_) -> [Token] -> UnitSpecParser a
forall a. [Token] -> UnitSpecParser a
happyError [Token]
tokens)
parseUnit :: [Token] -> UnitSpecParser UnitStatement
parseUnit [Token]
tks = UnitSpecParser UnitStatement
happySomeParser where
happySomeParser :: UnitSpecParser UnitStatement
happySomeParser = UnitSpecParser HappyAbsSyn
-> (HappyAbsSyn -> UnitSpecParser UnitStatement)
-> UnitSpecParser UnitStatement
forall a b.
UnitSpecParser a -> (a -> UnitSpecParser b) -> UnitSpecParser b
happyThen (Int# -> [Token] -> UnitSpecParser HappyAbsSyn
happyParse Int#
0# [Token]
tks) (\HappyAbsSyn
x -> UnitStatement -> UnitSpecParser UnitStatement
forall a. a -> UnitSpecParser a
happyReturn (let {(HappyWrap4 UnitStatement
x') = HappyAbsSyn -> HappyWrap4
happyOut4 HappyAbsSyn
x} in UnitStatement
x'))
happySeq :: a -> b -> b
happySeq = a -> b -> b
forall a b. a -> b -> b
happyDontSeq
data UnitParseError
= NotAnIdentifier Char
| CouldNotParseSpecification [Token]
deriving (UnitParseError -> UnitParseError -> Bool
(UnitParseError -> UnitParseError -> Bool)
-> (UnitParseError -> UnitParseError -> Bool) -> Eq UnitParseError
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UnitParseError -> UnitParseError -> Bool
$c/= :: UnitParseError -> UnitParseError -> Bool
== :: UnitParseError -> UnitParseError -> Bool
$c== :: UnitParseError -> UnitParseError -> Bool
Eq)
instance Show UnitParseError where
show :: UnitParseError -> String
show (CouldNotParseSpecification [Token]
ts) =
String
"Could not parse specification at: \"" String -> String -> String
forall a. [a] -> [a] -> [a]
++ [Token] -> String
forall a. Show a => a -> String
show [Token]
ts String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"\"\n"
show (NotAnIdentifier Char
c) = String
"Invalid character in identifier: " String -> String -> String
forall a. [a] -> [a] -> [a]
++ Char -> String
forall a. Show a => a -> String
show Char
c
notAnIdentifier :: Char -> UnitParseError
notAnIdentifier :: Char -> UnitParseError
notAnIdentifier = Char -> UnitParseError
NotAnIdentifier
couldNotParseSpecification :: [Token] -> UnitParseError
couldNotParseSpecification :: [Token] -> UnitParseError
couldNotParseSpecification = [Token] -> UnitParseError
CouldNotParseSpecification
type UnitSpecParser a = Either UnitParseError a
data Token =
TUnit
| TComma
| TDoubleColon
| TExponentiation
| TDivision
| TMinus
| TMult
| TEqual
| TLeftPar
| TRightPar
| TRecord
| TId String
| TNum String
deriving (Int -> Token -> String -> String
[Token] -> String -> String
Token -> String
(Int -> Token -> String -> String)
-> (Token -> String) -> ([Token] -> String -> String) -> Show Token
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
showList :: [Token] -> String -> String
$cshowList :: [Token] -> String -> String
show :: Token -> String
$cshow :: Token -> String
showsPrec :: Int -> Token -> String -> String
$cshowsPrec :: Int -> Token -> String -> String
Show, Token -> Token -> Bool
(Token -> Token -> Bool) -> (Token -> Token -> Bool) -> Eq Token
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Token -> Token -> Bool
$c/= :: Token -> Token -> Bool
== :: Token -> Token -> Bool
$c== :: Token -> Token -> Bool
Eq)
addToTokens :: Token -> String -> UnitSpecParser [ Token ]
addToTokens :: Token -> String -> UnitSpecParser [Token]
addToTokens Token
tok String
rest = do
[Token]
tokens <- String -> UnitSpecParser [Token]
lexer String
rest
[Token] -> UnitSpecParser [Token]
forall (m :: * -> *) a. Monad m => a -> m a
return ([Token] -> UnitSpecParser [Token])
-> [Token] -> UnitSpecParser [Token]
forall a b. (a -> b) -> a -> b
$ Token
tok Token -> [Token] -> [Token]
forall k1. k1 -> [k1] -> [k1]
: [Token]
tokens
lexer :: String -> UnitSpecParser [ Token ]
lexer :: String -> UnitSpecParser [Token]
lexer [] = [Token] -> UnitSpecParser [Token]
forall a b. b -> Either a b
Right []
lexer [Char
'\n'] = [Token] -> UnitSpecParser [Token]
forall a b. b -> Either a b
Right []
lexer [Char
'\r', Char
'\n'] = [Token] -> UnitSpecParser [Token]
forall a b. b -> Either a b
Right []
lexer [Char
'\r'] = [Token] -> UnitSpecParser [Token]
forall a b. b -> Either a b
Right []
lexer (Char
' ':String
xs) = String -> UnitSpecParser [Token]
lexer String
xs
lexer (Char
'\t':String
xs) = String -> UnitSpecParser [Token]
lexer String
xs
lexer (Char
':':Char
':':String
xs) = Token -> String -> UnitSpecParser [Token]
addToTokens Token
TDoubleColon String
xs
lexer (Char
'*':Char
'*':String
xs) = Token -> String -> UnitSpecParser [Token]
addToTokens Token
TExponentiation String
xs
lexer (Char
',':String
xs) = Token -> String -> UnitSpecParser [Token]
addToTokens Token
TComma String
xs
lexer (Char
'/':String
xs) = Token -> String -> UnitSpecParser [Token]
addToTokens Token
TDivision String
xs
lexer (Char
'-':String
xs) = Token -> String -> UnitSpecParser [Token]
addToTokens Token
TMinus String
xs
lexer (Char
'*':String
xs) = Token -> String -> UnitSpecParser [Token]
addToTokens Token
TMult String
xs
lexer (Char
'=':String
xs) = Token -> String -> UnitSpecParser [Token]
addToTokens Token
TEqual String
xs
lexer (Char
'(':String
xs) = Token -> String -> UnitSpecParser [Token]
addToTokens Token
TLeftPar String
xs
lexer (Char
')':String
xs) = Token -> String -> UnitSpecParser [Token]
addToTokens Token
TRightPar String
xs
lexer (Char
x:String
xs)
| Char -> Bool
isLetter Char
x Bool -> Bool -> Bool
|| Char
x Char -> Char -> Bool
forall a. Eq a => a -> a -> Bool
== Char
'\'' = (Char -> Bool) -> (String -> Token) -> UnitSpecParser [Token]
aux (\ Char
c -> Char -> Bool
isAlphaNum Char
c Bool -> Bool -> Bool
|| Char
c Char -> String -> Bool
forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
`elem` [Char
'\'',Char
'_',Char
'-'])
(\ String
s -> if String
s String -> String -> Bool
forall a. Eq a => a -> a -> Bool
== String
"record" then Token
TRecord else String -> Token
TId String
s)
| Char -> Bool
isNumber Char
x = (Char -> Bool) -> (String -> Token) -> UnitSpecParser [Token]
aux Char -> Bool
isNumber String -> Token
TNum
| Bool
otherwise
= UnitParseError -> UnitSpecParser [Token]
forall e (m :: * -> *) a. MonadError e m => e -> m a
throwError (UnitParseError -> UnitSpecParser [Token])
-> UnitParseError -> UnitSpecParser [Token]
forall a b. (a -> b) -> a -> b
$ Char -> UnitParseError
notAnIdentifier Char
x
where
aux :: (Char -> Bool) -> (String -> Token) -> UnitSpecParser [Token]
aux Char -> Bool
p String -> Token
cons =
let (String
target, String
rest) = (Char -> Bool) -> String -> (String, String)
forall a. (a -> Bool) -> [a] -> ([a], [a])
span Char -> Bool
p String
xs
in String -> UnitSpecParser [Token]
lexer String
rest UnitSpecParser [Token]
-> ([Token] -> UnitSpecParser [Token]) -> UnitSpecParser [Token]
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (\[Token]
tokens -> [Token] -> UnitSpecParser [Token]
forall (m :: * -> *) a. Monad m => a -> m a
return ([Token] -> UnitSpecParser [Token])
-> [Token] -> UnitSpecParser [Token]
forall a b. (a -> b) -> a -> b
$ String -> Token
cons (Char
xChar -> String -> String
forall k1. k1 -> [k1] -> [k1]
:String
target) Token -> [Token] -> [Token]
forall k1. k1 -> [k1] -> [k1]
: [Token]
tokens)
unitParser :: SpecParser UnitParseError UnitStatement
unitParser :: SpecParser UnitParseError UnitStatement
unitParser = (String -> UnitSpecParser UnitStatement)
-> [String] -> SpecParser UnitParseError UnitStatement
forall e r. (String -> Either e r) -> [String] -> SpecParser e r
mkParser (\String
src -> do
[Token]
tokens <- String -> UnitSpecParser [Token]
lexer (String -> UnitSpecParser [Token])
-> String -> UnitSpecParser [Token]
forall a b. (a -> b) -> a -> b
$ (Char -> Char) -> String -> String
forall a b. (a -> b) -> [a] -> [b]
map Char -> Char
toLower String
src
[Token] -> UnitSpecParser UnitStatement
parseUnit [Token]
tokens) [String
"unit"]
happyError :: [ Token ] -> UnitSpecParser a
happyError :: [Token] -> UnitSpecParser a
happyError = UnitParseError -> UnitSpecParser a
forall e (m :: * -> *) a. MonadError e m => e -> m a
throwError (UnitParseError -> UnitSpecParser a)
-> ([Token] -> UnitParseError) -> [Token] -> UnitSpecParser a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Token] -> UnitParseError
couldNotParseSpecification
{-# 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
data Happy_IntList = HappyCons Happy_GHC_Exts.Int# Happy_IntList
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#
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 #-}