CS代写 {-# OPTIONS_GHC -w #-}

{-# OPTIONS_GHC -w #-}
module Parser (parseExpr) where
import Prelude hiding (LT, GT, EQ)
import Common

Copyright By PowCoder代写 加微信 powcoder

import Source
import Tokens
import qualified Data.Array as Happy_Data_Array
import qualified Data.Bits as Bits
import Control.Applicative(Applicative(..))
import Control.Monad (ap)

— parser produced by 1.20.0

data HappyAbsSyn t4 t5 t6 t7 t8 t9
= HappyTerminal (Token)
| HappyErrorToken Prelude.Int
| HappyAbsSyn4 t4
| HappyAbsSyn5 t5
| HappyAbsSyn6 t6
| HappyAbsSyn7 t7
| HappyAbsSyn8 t8
| HappyAbsSyn9 t9

happyExpList :: Happy_Data_Array.Array Prelude.Int Prelude.Int
happyExpList = Happy_Data_Array.listArray (0,350) ([53760,402,49165,61,0,0,1024,0,16,0,0,0,0,0,0,0,0,0,4096,32,0,4096,0,0,64,0,0,0,0,0,0,0,0,0,0,53248,402,49164,9,37586,3329,15808,4096,0,0,0,37586,3329,15808,0,16,0,0,0,0,0,0,0,0,0,37584,3073,2496,53248,402,49164,9,37584,3073,2496,0,16,0,0,32768,0,0,53760,402,49165,61,0,0,0,4096,0,0,0,37586,3329,15808,0,0,0,0,0,0,0,0,0,0,0,37586,3329,15808,0,4096,0,0,0,2,0,0,64,0,0,0,8,0,0,32,0,0,0,0,0,0,16384,0,0,16,0,0,53760,402,49165,61,16,0,0,53248,402,49164,9,37584,3073,2496,53248,402,49164,9,37584,3073,2496,53248,402,49164,9,37584,3073,2496,53248,402,49164,9,37584,3073,2496,53248,402,49164,9,37584,3073,2496,53248,402,49164,9,37584,3073,2496,53248,402,49164,9,37584,3073,2496,4096,0,0,0,8192,0,0,0,15,2048,0,3840,0,8,0,0,0,0,3840,61440,59,0,15,14832,0,3840,61440,56,0,15,14336,0,3840,0,56,0,15,14336,0,3840,0,56,0,0,2048,0,0,0,8,0,12,2048,0,3072,0,8,0,32768,0,0,8192,0,0,0,16384,0,0,37586,3329,15808,0,0,0,0,37586,3329,15808,0,0,0,0,0,0,0,53760,402,49165,61,8192,0,0,0,32,0,0,16384,0,0,0,0,0,0,0,0,0,53760,402,49165,61,0,0,0,0,0,0,0,0,16,0,0,0,0,2,0,4,0,53760,402,49165,61,0,0,0,53760,402,49165,61,32768,0,0,53760,402,49165,61,0,0,0,0,1024,0,0,37586,3329,15808,53760,402,49165,61,16,0,0,0,1024,0,0,0,512,0,0,0,0,0,0,0,0,0,0,0,0,37586,3329,15808,0,64,0,0,0,0,0,0,0,0,0,37586,3329,15808,0,0,0,0,0

{-# NOINLINE happyExpListPerState #-}
happyExpListPerState st =
token_strs_expected
where token_strs = [“error”,”%dummy”,”%start_parser”,”Exp”,”Oper”,”App”,”Methods”,”Method”,”Elements”,”var”,”vars”,”and”,”id”,”label”,”int”,”string”,”‘+'”,”‘-‘”,”‘*'”,”‘/'”,”‘(‘”,”‘)'”,”‘}'”,”‘{‘”,”‘[‘”,”‘]'”,”‘;'”,”‘:'”,”‘,'”,”‘.'”,”‘='”,”‘:='”,”if”,”else”,”true”,”false”,”‘<'","'<='","'>‘”,”‘>='”,”‘=='”,”‘&&'”,”‘||'”,”‘!!'”,”‘++'”,”‘\\\\'”,”‘#'”,”‘?'”,”‘!'”,”‘=>'”,”fun”,”clone”,”class”,”new”,”rec”,”%eof”]
bit_start = st Prelude.* 56
bit_end = (st Prelude.+ 1) Prelude.* 56
read_bit = readArrayBit happyExpList
bits = Prelude.map read_bit [bit_start..bit_end Prelude.- 1]
bits_indexed = Prelude.zip bits [0..55]
token_strs_expected = Prelude.concatMap f bits_indexed
f (Prelude.False, _) = []
f (Prelude.True, nr) = [token_strs Prelude.!! nr]

action_0 (10) = happyShift action_6
action_0 (13) = happyShift action_7
action_0 (15) = happyShift action_8
action_0 (16) = happyShift action_9
action_0 (18) = happyShift action_10
action_0 (21) = happyShift action_11
action_0 (24) = happyShift action_12
action_0 (25) = happyShift action_13
action_0 (33) = happyShift action_14
action_0 (35) = happyShift action_15
action_0 (36) = happyShift action_16
action_0 (47) = happyShift action_17
action_0 (48) = happyShift action_18
action_0 (49) = happyShift action_19
action_0 (51) = happyShift action_2
action_0 (52) = happyShift action_20
action_0 (53) = happyShift action_21
action_0 (54) = happyShift action_22
action_0 (4) = happyGoto action_3
action_0 (5) = happyGoto action_4
action_0 (6) = happyGoto action_5
action_0 _ = happyFail (happyExpListPerState 0)

action_1 (51) = happyShift action_2
action_1 _ = happyFail (happyExpListPerState 1)

action_2 (21) = happyShift action_54
action_2 _ = happyFail (happyExpListPerState 2)

action_3 (56) = happyAccept
action_3 _ = happyFail (happyExpListPerState 3)

action_4 (17) = happyShift action_40
action_4 (18) = happyShift action_41
action_4 (19) = happyShift action_42
action_4 (20) = happyShift action_43
action_4 (37) = happyShift action_44
action_4 (38) = happyShift action_45
action_4 (39) = happyShift action_46
action_4 (40) = happyShift action_47
action_4 (41) = happyShift action_48
action_4 (42) = happyShift action_49
action_4 (43) = happyShift action_50
action_4 (44) = happyShift action_51
action_4 (45) = happyShift action_52
action_4 (46) = happyShift action_53
action_4 _ = happyReduce_7

action_5 (21) = happyShift action_38
action_5 (30) = happyShift action_39
action_5 _ = happyReduce_27

action_6 (13) = happyShift action_36
action_6 (55) = happyShift action_37
action_6 _ = happyFail (happyExpListPerState 6)

action_7 _ = happyReduce_33

action_8 _ = happyReduce_34

action_9 _ = happyReduce_35

action_10 (13) = happyShift action_7
action_10 (15) = happyShift action_8
action_10 (16) = happyShift action_9
action_10 (18) = happyShift action_10
action_10 (21) = happyShift action_11
action_10 (24) = happyShift action_12
action_10 (25) = happyShift action_13
action_10 (35) = happyShift action_15
action_10 (36) = happyShift action_16
action_10 (47) = happyShift action_17
action_10 (48) = happyShift action_18
action_10 (49) = happyShift action_19
action_10 (52) = happyShift action_20
action_10 (5) = happyGoto action_35
action_10 (6) = happyGoto action_5
action_10 _ = happyFail (happyExpListPerState 10)

action_11 (10) = happyShift action_6
action_11 (13) = happyShift action_7
action_11 (15) = happyShift action_8
action_11 (16) = happyShift action_9
action_11 (18) = happyShift action_10
action_11 (21) = happyShift action_11
action_11 (24) = happyShift action_12
action_11 (25) = happyShift action_13
action_11 (33) = happyShift action_14
action_11 (35) = happyShift action_15
action_11 (36) = happyShift action_16
action_11 (47) = happyShift action_17
action_11 (48) = happyShift action_18
action_11 (49) = happyShift action_19
action_11 (51) = happyShift action_2
action_11 (52) = happyShift action_20
action_11 (53) = happyShift action_21
action_11 (54) = happyShift action_22
action_11 (4) = happyGoto action_34
action_11 (5) = happyGoto action_4
action_11 (6) = happyGoto action_5
action_11 _ = happyFail (happyExpListPerState 11)

action_12 (13) = happyShift action_33
action_12 (7) = happyGoto action_32
action_12 _ = happyFail (happyExpListPerState 12)

action_13 (10) = happyShift action_6
action_13 (13) = happyShift action_7
action_13 (15) = happyShift action_8
action_13 (16) = happyShift action_9
action_13 (18) = happyShift action_10
action_13 (21) = happyShift action_11
action_13 (24) = happyShift action_12
action_13 (25) = happyShift action_13
action_13 (33) = happyShift action_14
action_13 (35) = happyShift action_15
action_13 (36) = happyShift action_16
action_13 (47) = happyShift action_17
action_13 (48) = happyShift action_18
action_13 (49) = happyShift action_19
action_13 (51) = happyShift action_2
action_13 (52) = happyShift action_20
action_13 (53) = happyShift action_21
action_13 (54) = happyShift action_22
action_13 (4) = happyGoto action_30
action_13 (5) = happyGoto action_4
action_13 (6) = happyGoto action_5
action_13 (9) = happyGoto action_31
action_13 _ = happyFail (happyExpListPerState 13)

action_14 (21) = happyShift action_29
action_14 _ = happyFail (happyExpListPerState 14)

action_15 _ = happyReduce_36

action_16 _ = happyReduce_37

action_17 (13) = happyShift action_7
action_17 (15) = happyShift action_8
action_17 (16) = happyShift action_9
action_17 (18) = happyShift action_10
action_17 (21) = happyShift action_11
action_17 (24) = happyShift action_12
action_17 (25) = happyShift action_13
action_17 (35) = happyShift action_15
action_17 (36) = happyShift action_16
action_17 (47) = happyShift action_17
action_17 (48) = happyShift action_18
action_17 (49) = happyShift action_19
action_17 (52) = happyShift action_20
action_17 (5) = happyGoto action_28
action_17 (6) = happyGoto action_5
action_17 _ = happyFail (happyExpListPerState 17)

action_18 (13) = happyShift action_7
action_18 (15) = happyShift action_8
action_18 (16) = happyShift action_9
action_18 (18) = happyShift action_10
action_18 (21) = happyShift action_11
action_18 (24) = happyShift action_12
action_18 (25) = happyShift action_13
action_18 (35) = happyShift action_15
action_18 (36) = happyShift action_16
action_18 (47) = happyShift action_17
action_18 (48) = happyShift action_18
action_18 (49) = happyShift action_19
action_18 (52) = happyShift action_20
action_18 (5) = happyGoto action_27
action_18 (6) = happyGoto action_5
action_18 _ = happyFail (happyExpListPerState 18)

action_19 (13) = happyShift action_7
action_19 (15) = happyShift action_8
action_19 (16) = happyShift action_9
action_19 (18) = happyShift action_10
action_19 (21) = happyShift action_11
action_19 (24) = happyShift action_12
action_19 (25) = happyShift action_13
action_19 (35) = happyShift action_15
action_19 (36) = happyShift action_16
action_19 (47) = happyShift action_17
action_19 (48) = happyShift action_18
action_19 (49) = happyShift action_19
action_19 (52) = happyShift action_20
action_19 (5) = happyGoto action_26
action_19 (6) = happyGoto action_5
action_19 _ = happyFail (happyExpListPerState 19)

action_20 (21) = happyShift action_25
action_20 _ = happyFail (happyExpListPerState 20)

action_21 (24) = happyShift action_24
action_21 _ = happyFail (happyExpListPerState 21)

action_22 (10) = happyShift action_6
action_22 (13) = happyShift action_7
action_22 (15) = happyShift action_8
action_22 (16) = happyShift action_9
action_22 (18) = happyShift action_10
action_22 (21) = happyShift action_11
action_22 (24) = happyShift action_12
action_22 (25) = happyShift action_13
action_22 (33) = happyShift action_14
action_22 (35) = happyShift action_15
action_22 (36) = happyShift action_16
action_22 (47) = happyShift action_17
action_22 (48) = happyShift action_18
action_22 (49) = happyShift action_19
action_22 (51) = happyShift action_2
action_22 (52) = happyShift action_20
action_22 (53) = happyShift action_21
action_22 (54) = happyShift action_22
action_22 (4) = happyGoto action_23
action_22 (5) = happyGoto action_4
action_22 (6) = happyGoto action_5
action_22 _ = happyFail (happyExpListPerState 22)

action_23 _ = happyReduce_6

action_24 (13) = happyShift action_33
action_24 (7) = happyGoto action_81
action_24 _ = happyFail (happyExpListPerState 24)

action_25 (10) = happyShift action_6
action_25 (13) = happyShift action_7
action_25 (15) = happyShift action_8
action_25 (16) = happyShift action_9
action_25 (18) = happyShift action_10
action_25 (21) = happyShift action_11
action_25 (24) = happyShift action_12
action_25 (25) = happyShift action_13
action_25 (33) = happyShift action_14
action_25 (35) = happyShift action_15
action_25 (36) = happyShift action_16
action_25 (47) = happyShift action_17
action_25 (48) = happyShift action_18
action_25 (49) = happyShift action_19
action_25 (51) = happyShift action_2
action_25 (52) = happyShift action_20
action_25 (53) = happyShift action_21
action_25 (54) = happyShift action_22
action_25 (4) = happyGoto action_80
action_25 (5) = happyGoto action_4
action_25 (6) = happyGoto action_5
action_25 _ = happyFail (happyExpListPerState 25)

action_26 _ = happyReduce_23

action_27 _ = happyReduce_25

action_28 _ = happyReduce_24

action_29 (10) = happyShift action_6
action_29 (13) = happyShift action_7
action_29 (15) = happyShift action_8
action_29 (16) = happyShift action_9
action_29 (18) = happyShift action_10
action_29 (21) = happyShift action_11
action_29 (24) = happyShift action_12
action_29 (25) = happyShift action_13
action_29 (33) = happyShift action_14
action_29 (35) = happyShift action_15
action_29 (36) = happyShift action_16
action_29 (47) = happyShift action_17
action_29 (48) = happyShift action_18
action_29 (49) = happyShift action_19
action_29 (51) = happyShift action_2
action_29 (52) = happyShift action_20
action_29 (53) = happyShift action_21
action_29 (54) = happyShift action_22
action_29 (4) = happyGoto action_79
action_29 (5) = happyGoto action_4
action_29 (6) = happyGoto action_5
action_29 _ = happyFail (happyExpListPerState 29)

action_30 (29) = happyShift action_78
action_30 _ = happyReduce_44

action_31 (26) = happyShift action_77
action_31 _ = happyFail (happyExpListPerState 31)

action_32 (23) = happyShift action_76
action_32 _ = happyFail (happyExpListPerState 32)

action_33 (28) = happyShift action_75
action_33 _ = happyFail (happyExpListPerState 33)

action_34 (22) = happyShift action_74
action_34 _ = happyFail (happyExpListPerState 34)

action_35 _ = happyReduce_22

action_36 (31) = happyShift action_73
action_36 _ = happyFail (happyExpListPerState 36)

action_37 (13) = happyShift action_72
action_37 _ = happyFail (happyExpListPerState 37)

action_38 (10) = happyShift action_6
action_38 (13) = happyShift action_7
action_38 (15) = happyShift action_8
action_38 (16) = happyShift action_9
action_38 (18) = happyShift action_10
action_38 (21) = happyShift action_11
action_38 (24) = happyShift action_12
action_38 (25) = happyShift action_13
action_38 (33) = happyShift action_14
action_38 (35) = happyShift action_15
action_38 (36) = happyShift action_16
action_38 (47) = happyShift action_17
action_38 (48) = happyShift action_18
action_38 (49) = happyShift action_19
action_38 (51) = happyShift action_2
action_38 (52) = happyShift action_20
action_38 (53) = happyShift action_21
action_38 (54) = happyShift action_22
action_38 (4) = happyGoto action_71
action_38 (5) = happyGoto action_4
action_38 (6) = happyGoto action_5
action_38 _ = happyFail (happyExpListPerState 38)

action_39 (13) = happyShift action_70
action_39 _ = happyFail (happyExpListPerState 39)

action_40 (13) = happyShift action_7
action_40 (15) = happyShift action_8
action_40 (16) = happyShift action_9
action_40 (18) = happyShift action_10
action_40 (21) = happyShift action_11
action_40 (24) = happyShift action_12
action_40 (25) = happyShift action_13
action_40 (35) = happyShift action_15
action_40 (36) = happyShift action_16
action_40 (47) = happyShift action_17
action_40 (48) = happyShift action_18
action_40 (49) = happyShift action_19
action_40 (52) = happyShift action_20
action_40 (5) = happyGoto action_69
action_40 (6) = happyGoto action_5
action_40 _ = happyFail (happyExpListPerState 40)

action_41 (13) = happyShift action_7
action_41 (15) = happyShift action_8
action_41 (16) = happyShift action_9
action_41 (18) = happyShift action_10
action_41 (21) = happyShift action_11
action_41 (24) = happyShift action_12
action_41 (25) = happyShift action_13
action_41 (35) = happyShift action_15
action_41 (36) = happyShift action_16
action_41 (47) = happyShift action_17
action_41 (48) = happyShift action_18
action_41 (49) = happyShift action_19
action_41 (52) = happyShift action_20
action_41 (5) = happyGoto action_68
action_41 (6) = happyGoto action_5
action_41 _ = happyFail (happyExpListPerState 41)

action_42 (13) = happyShift action_7
action_42 (15) = happyShift action_8
action_42 (16) = happyShift action_9
action_42 (18) = happyShift action_10
action_42 (21) = happyShift action_11
action_42 (24) = happyShift action_12
action_42 (25) = happyShift action_13
action_42 (35) = happyShift action_15
action_42 (36) = happyShift action_16
action_42 (47) = happyShift action_17
action_42 (48) = happyShift action_18
action_42 (49) = happyShift action_19
action_42 (52) = happyShift action_20
action_42 (5) = happyGoto action_67
action_42 (6) = happyGoto action_5
action_42 _ = happyFail (happyExpListPerState 42)

action_43 (13) = happyShift action_7
action_43 (15) = happyShift action_8
action_43 (16) = happyShift action_9
action_43 (18) = happyShift action_10
action_43 (21) = happyShift action_11
action_43 (24) = happyShift action_12
action_43 (25) = happyShift action_13
action_43 (35) = happyShift action_15
action_43 (36) = happyShift action_16
action_43 (47) = happyShift action_17
action_43 (48) = happyShift action_18
action_43 (49) = happyShift action_19
action_43 (52) = happyShift action_20
action_43 (5) = happyGoto action_66
action_43 (6) = happyGoto action_5
action_43 _ = happyFail (happyExpListPerState 43)

action_44 (13) = happyShift action_7
action_44 (15) = happyShift action_8
action_44 (16) = happyShift action_9
action_44 (18) = happyShift action_10
action_44 (21) = happyShift action_11
action_44 (24) = happyShift action_12
action_44 (25) = happyShift action_13
action_44 (35) = happyShift action_15
action_44 (36) = happyShift action_16
action_44 (47) = happyShift action_17
action_44 (48) = happyShift action_18
action_44 (49) = happyShift action_19
action_44 (52) = happyShift action_20
action_44 (5) = happyGoto action_65
action_44 (6) = happyGoto action_5
action_44 _ = happyFail (happyExpListPerState 44)

action_45 (13) = happyShift action_7
action_45 (15) = happyShift action_8
action_45 (16) = happyShift action_9
action_45 (18) = happyShift action_10
action_45 (21) = happyShift action_11
action_45 (24) = happyShift action_12
action_45 (25) = happyShift action_13
action_45 (35) = happyShift action_15
action_45 (36) = happyShift action_16
action_45 (47) = happyShift action_17
action_45 (48) = happyShift action_18
action_45 (49) = happyShift action_19
action_45 (52) = happyShift action_20
action_45 (5) = happyGoto action_64
action_45 (6) = happyGoto action_5
action_45 _ = happyFail (happyExpListPerState 45)

action_46 (13) = happyShift action_7
action_46 (15) = happyShift action_8
action_46 (16) = happyShift action_9
action_46 (18) = happyShift action_10
action_46 (21) = happyShift action_11
action_46 (24) = happyShift action_12
action_46 (25) = happyShift action_13
action_46 (35) = happyShift action_15
action_46 (36) = happyShift action_16
action_46 (47) = happyShift action_17
action_46 (48) = happyShift action_18
action_46 (49) = happyShift action_19
action_46 (52) = happyShift action_20
action_46 (5) = happyGoto action_63
action_46 (6) = happyGoto action_5
action_46 _ = happyFail (happyExpListPerState 46)

action_47 (13) = happyShift action_7
action_47 (15) = happyShift action_8
action_47 (16) = happyShift action_9
action_47 (18) = happyShift action_10
action_47 (21) = happyShift action_11
action_47 (24) = happyShift action_12
action_47 (25) = happyShift action_13
action_47 (35) = happyShift action_15
action_47 (36) = happyShift action_16
action_47 (47) = happyShift action_17
action_47 (48) = happyShift action_18
action_47 (49) = happyShift action_19
action_47 (52) = happyShift action_20
action_47 (5) = happyGoto action_62
action_47 (6) = happyGoto action_5
action_47 _ = happyFail (happyExpListPerState 47)

action_48 (13) = happyShift action_7
action_48 (15) = happyShift action_8
action_48 (16) = happyShift action_9
action_48 (18) = happyShift action_10
action_48 (21) = happyShift action_11
action_48 (24) = happyShift action_12
action_48 (25) = happyShift action_13
action_48 (35) = happyShift action_15
action_48 (36) = happyShift action_16
action_48 (47) = happyShift action_17
action_48 (48) = happyShift action_18
action_48 (49) = happyShift action_19
action_48 (52) = happyShift action_20
action_48 (5) = happyGoto action_61
action_48 (6) = happyGoto action_5
action_48 _ = happyFail (happyExpListPerState 48)

action_49 (13) = happyShift action_7
action_49 (15) = happyShift action_8
action_49 (16) = happyShift action_9
action_49 (18) = happyShift action_10
action_49 (21) = happyShift action_11
action_49 (24) = happyShift action_12
action_49 (25) = happyShift action_13
action_49 (35) = happyShift action_15
action_49 (36) = happyShift action_16
action_49 (47) = happyShift action_17
action_49 (48) = happyShift action_18
action_49 (49) = happyShift action_19
action_49 (52) = happyShift action_20
action_49 (5) = happyGoto action_60
action_49 (6) = happyGoto action_5
action_49 _ = happyFail (happyExpListPerState 49)

action_50 (13) = happyShift action_7
action_50 (15) = happyShift action_8
action_50 (16) = happyShift action_9
action_50 (18) = happyShift action_10
action_50 (21) = happyShift action_11

程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com