From 240f1c125557fee1982ec96693994509433c7fb2 Mon Sep 17 00:00:00 2001 From: AYM1607 Date: Sun, 28 Apr 2019 04:52:42 -0500 Subject: [PATCH] Created a unique pointer for every multi dimensional variable, added support for print statements --- final_lang/fort.py | 42 +- final_lang/parser.out | 1021 ++++++++++++++++++++----------------- final_lang/parsetab.py | 215 ++++---- final_lang/test3.fort | 8 +- final_lang/test3.fort.out | 14 +- 5 files changed, 706 insertions(+), 594 deletions(-) diff --git a/final_lang/fort.py b/final_lang/fort.py index f63bc9e..b82a60f 100644 --- a/final_lang/fort.py +++ b/final_lang/fort.py @@ -22,11 +22,9 @@ typesStack = [] jumpsStack = [] exitsStack = [] avail = [] -for i in range(49): +for i in range(50): avail.append('$' + str(i)) -indirectPointer = '$49' - # Operations related to the table of symbols symbols = {} # Our variables start at direction 50, the temps take the first 49 directions. @@ -58,7 +56,9 @@ def addSymbol(name, symbolType): 'dimension1': globalDimension1, 'dimension2': globalDimension2, } - currentIndex += globalDimensionalSize + if globalDimensionalSize != 1: + symbols[name]['indirectPointer'] = f'${currentIndex + globalDimensionalSize}' + currentIndex += 1 if globalDimensionalSize == 1 else globalDimensionalSize + 1 # Returns the last item of a list without deleting it. @@ -83,7 +83,7 @@ def isTemp(operand): def isDirection(operand): if type(operand) is not str: return False - if "$" in operand: + if "$" in operand or "*" in operand: return True return False @@ -281,7 +281,7 @@ def p_S(p): S : Dimensional action_7 equals EA action_8 | id parens | read RDimensional - | print RDimOrString + | print RDimOrString action_35 | if action_16 Relif ElseOrEmpty end if action_20 | do id action_24 equals EA action_25 coma EA action_26 IntOrEmpty then B action_29 end do | do then action_21 B action_22 end do @@ -330,8 +330,8 @@ def p_RDimOrString(p): def p_DimOrString(p): ''' - DimOrString : Dimensional - | string + DimOrString : Dimensional action_1 action_33 + | string action_34 ''' @@ -462,6 +462,7 @@ def p_action_1(p): dimension1 = symbols[p[-1]]['dimension1'] dimension2 = symbols[p[-1]]['dimension2'] if dimension2 is not 0: + indirectPointer = symbols[p[-1]]['indirectPointer'] if isDirection(globalIndex1) or isDirection(globalIndex2): resultQuadruplets.append(f'* {globalIndex1} {dimension1} {indirectPointer}\n') quadrupletIndex += 1 @@ -474,6 +475,7 @@ def p_action_1(p): direction += globalIndex2 + (globalIndex1 * dimension1) operandsStack.append(f'${direction}') elif dimension1 is not 0: + indirectPointer = symbols[p[-1]]['indirectPointer'] if isDirection(globalIndex1): resultQuadruplets.append(f'+ {direction} {globalIndex1} {indirectPointer}\n') quadrupletIndex += 1 @@ -571,6 +573,7 @@ def p_action_7(p): dimension1 = symbols[p[-1]]['dimension1'] dimension2 = symbols[p[-1]]['dimension2'] if dimension2 is not 0: + indirectPointer = symbols[p[-1]]['indirectPointer'] if isDirection(globalIndex1) or isDirection(globalIndex2): resultQuadruplets.append(f'* {globalIndex1} {dimension1} {indirectPointer}\n') quadrupletIndex += 1 @@ -583,6 +586,7 @@ def p_action_7(p): direction += globalIndex2 + (globalIndex1 * dimension1) operandsStack.append(f'${direction}') elif dimension1 is not 0: + indirectPointer = symbols[p[-1]]['indirectPointer'] if isDirection(globalIndex1): resultQuadruplets.append(f'+ {direction} {globalIndex1} {indirectPointer}\n') quadrupletIndex += 1 @@ -910,6 +914,28 @@ def p_action_32(p): globalDimension2 = 0 globalDimensionalSize = 1 +def p_action_33(p): + "action_33 :" + global quadrupletIndex + operand1 = operandsStack.pop() + typesStack.pop() + resultQuadruplets.append(f'print {operand1}\n') + quadrupletIndex += 1 + + +def p_action_34(p): + "action_34 :" + global quadrupletIndex + resultQuadruplets.append(f'print {p[-1]}\n') + quadrupletIndex += 1 + + +def p_action_35(p): + "action_35 :" + global quadrupletIndex + resultQuadruplets.append('print "\\n"\n') + quadrupletIndex += 1 + def p_action_setDim1(p): "action_setDim1 :" diff --git a/final_lang/parser.out b/final_lang/parser.out index f6efb45..ddaa7d7 100644 --- a/final_lang/parser.out +++ b/final_lang/parser.out @@ -20,7 +20,7 @@ Rule 14 B -> Rule 15 S -> Dimensional action_7 equals EA action_8 Rule 16 S -> id parens Rule 17 S -> read RDimensional -Rule 18 S -> print RDimOrString +Rule 18 S -> print RDimOrString action_35 Rule 19 S -> if action_16 Relif ElseOrEmpty end if action_20 Rule 20 S -> do id action_24 equals EA action_25 coma EA action_26 IntOrEmpty then B action_29 end do Rule 21 S -> do then action_21 B action_22 end do @@ -36,8 +36,8 @@ Rule 30 RDimensional -> Dimensional Rule 31 RDimensional -> RDimensional coma Dimensional Rule 32 RDimOrString -> DimOrString Rule 33 RDimOrString -> RDimOrString coma DimOrString -Rule 34 DimOrString -> Dimensional -Rule 35 DimOrString -> string +Rule 34 DimOrString -> Dimensional action_1 action_33 +Rule 35 DimOrString -> string action_34 Rule 36 Relif -> openParen EL closedParen action_17 then B Rule 37 Relif -> Relif elif action_18 openParen EL closedParen action_17 then B Rule 38 ElseOrEmpty -> else action_19 B @@ -104,8 +104,11 @@ Rule 98 action_29 -> Rule 99 action_30 -> Rule 100 action_31 -> Rule 101 action_32 -> -Rule 102 action_setDim1 -> -Rule 103 action_setDim2 -> +Rule 102 action_33 -> +Rule 103 action_34 -> +Rule 104 action_35 -> +Rule 105 action_setDim1 -> +Rule 106 action_setDim2 -> Terminals, with rules where they appear @@ -178,7 +181,7 @@ S : 13 SumOrSub : 43 Tipo : 2 V : 1 2 -action_1 : 59 +action_1 : 34 59 action_10 : 53 action_11 : 55 action_12 : 55 @@ -205,6 +208,9 @@ action_3 : 43 action_30 : 8 9 action_31 : 9 action_32 : 2 +action_33 : 34 +action_34 : 35 +action_35 : 18 action_4 : 43 action_5 : 47 action_6 : 47 @@ -338,7 +344,7 @@ state 9 (15) S -> . Dimensional action_7 equals EA action_8 (16) S -> . id parens (17) S -> . read RDimensional - (18) S -> . print RDimOrString + (18) S -> . print RDimOrString action_35 (19) S -> . if action_16 Relif ElseOrEmpty end if action_20 (20) S -> . do id action_24 equals EA action_25 coma EA action_26 IntOrEmpty then B action_29 end do (21) S -> . do then action_21 B action_22 end do @@ -441,11 +447,11 @@ state 17 state 18 - (18) S -> print . RDimOrString + (18) S -> print . RDimOrString action_35 (32) RDimOrString -> . DimOrString (33) RDimOrString -> . RDimOrString coma DimOrString - (34) DimOrString -> . Dimensional - (35) DimOrString -> . string + (34) DimOrString -> . Dimensional action_1 action_33 + (35) DimOrString -> . string action_34 (25) Dimensional -> . id DimensionsOrEmpty string shift and go to state 37 @@ -698,21 +704,23 @@ state 33 state 34 - (18) S -> print RDimOrString . + (18) S -> print RDimOrString . action_35 (33) RDimOrString -> RDimOrString . coma DimOrString + (104) action_35 -> . - end reduce using rule 18 (S -> print RDimOrString .) - id reduce using rule 18 (S -> print RDimOrString .) - read reduce using rule 18 (S -> print RDimOrString .) - print reduce using rule 18 (S -> print RDimOrString .) - if reduce using rule 18 (S -> print RDimOrString .) - do reduce using rule 18 (S -> print RDimOrString .) - swap reduce using rule 18 (S -> print RDimOrString .) - exit reduce using rule 18 (S -> print RDimOrString .) - elif reduce using rule 18 (S -> print RDimOrString .) - else reduce using rule 18 (S -> print RDimOrString .) - coma shift and go to state 59 + coma shift and go to state 60 + end reduce using rule 104 (action_35 -> .) + id reduce using rule 104 (action_35 -> .) + read reduce using rule 104 (action_35 -> .) + print reduce using rule 104 (action_35 -> .) + if reduce using rule 104 (action_35 -> .) + do reduce using rule 104 (action_35 -> .) + swap reduce using rule 104 (action_35 -> .) + exit reduce using rule 104 (action_35 -> .) + elif reduce using rule 104 (action_35 -> .) + else reduce using rule 104 (action_35 -> .) + action_35 shift and go to state 59 state 35 @@ -733,37 +741,41 @@ state 35 state 36 - (34) DimOrString -> Dimensional . + (34) DimOrString -> Dimensional . action_1 action_33 + (69) action_1 -> . - coma reduce using rule 34 (DimOrString -> Dimensional .) - end reduce using rule 34 (DimOrString -> Dimensional .) - id reduce using rule 34 (DimOrString -> Dimensional .) - read reduce using rule 34 (DimOrString -> Dimensional .) - print reduce using rule 34 (DimOrString -> Dimensional .) - if reduce using rule 34 (DimOrString -> Dimensional .) - do reduce using rule 34 (DimOrString -> Dimensional .) - swap reduce using rule 34 (DimOrString -> Dimensional .) - exit reduce using rule 34 (DimOrString -> Dimensional .) - elif reduce using rule 34 (DimOrString -> Dimensional .) - else reduce using rule 34 (DimOrString -> Dimensional .) + coma reduce using rule 69 (action_1 -> .) + end reduce using rule 69 (action_1 -> .) + id reduce using rule 69 (action_1 -> .) + read reduce using rule 69 (action_1 -> .) + print reduce using rule 69 (action_1 -> .) + if reduce using rule 69 (action_1 -> .) + do reduce using rule 69 (action_1 -> .) + swap reduce using rule 69 (action_1 -> .) + exit reduce using rule 69 (action_1 -> .) + elif reduce using rule 69 (action_1 -> .) + else reduce using rule 69 (action_1 -> .) + action_1 shift and go to state 61 state 37 - (35) DimOrString -> string . + (35) DimOrString -> string . action_34 + (103) action_34 -> . - coma reduce using rule 35 (DimOrString -> string .) - end reduce using rule 35 (DimOrString -> string .) - id reduce using rule 35 (DimOrString -> string .) - read reduce using rule 35 (DimOrString -> string .) - print reduce using rule 35 (DimOrString -> string .) - if reduce using rule 35 (DimOrString -> string .) - do reduce using rule 35 (DimOrString -> string .) - swap reduce using rule 35 (DimOrString -> string .) - exit reduce using rule 35 (DimOrString -> string .) - elif reduce using rule 35 (DimOrString -> string .) - else reduce using rule 35 (DimOrString -> string .) + coma reduce using rule 103 (action_34 -> .) + end reduce using rule 103 (action_34 -> .) + id reduce using rule 103 (action_34 -> .) + read reduce using rule 103 (action_34 -> .) + print reduce using rule 103 (action_34 -> .) + if reduce using rule 103 (action_34 -> .) + do reduce using rule 103 (action_34 -> .) + swap reduce using rule 103 (action_34 -> .) + exit reduce using rule 103 (action_34 -> .) + elif reduce using rule 103 (action_34 -> .) + else reduce using rule 103 (action_34 -> .) + action_34 shift and go to state 62 state 38 @@ -771,9 +783,9 @@ state 38 (36) Relif -> . openParen EL closedParen action_17 then B (37) Relif -> . Relif elif action_18 openParen EL closedParen action_17 then B - openParen shift and go to state 61 + openParen shift and go to state 64 - Relif shift and go to state 60 + Relif shift and go to state 63 state 39 @@ -782,7 +794,7 @@ state 39 equals reduce using rule 93 (action_24 -> .) - action_24 shift and go to state 62 + action_24 shift and go to state 65 state 40 @@ -798,13 +810,13 @@ state 40 exit reduce using rule 90 (action_21 -> .) end reduce using rule 90 (action_21 -> .) - action_21 shift and go to state 63 + action_21 shift and go to state 66 state 41 (22) S -> swap Dimensional . coma Dimensional - coma shift and go to state 64 + coma shift and go to state 67 state 42 @@ -830,7 +842,7 @@ state 43 (15) S -> . Dimensional action_7 equals EA action_8 (16) S -> . id parens (17) S -> . read RDimensional - (18) S -> . print RDimOrString + (18) S -> . print RDimOrString action_35 (19) S -> . if action_16 Relif ElseOrEmpty end if action_20 (20) S -> . do id action_24 equals EA action_25 coma EA action_26 IntOrEmpty then B action_29 end do (21) S -> . do then action_21 B action_22 end do @@ -839,7 +851,7 @@ state 43 (24) S -> . id openParen closedParen (25) Dimensional -> . id DimensionsOrEmpty - end shift and go to state 65 + end shift and go to state 68 id shift and go to state 13 read shift and go to state 17 print shift and go to state 18 @@ -857,7 +869,7 @@ state 44 (5) Rid -> Rid . coma id (68) action_addSymbols -> . - coma shift and go to state 67 + coma shift and go to state 70 integer reduce using rule 68 (action_addSymbols -> .) real reduce using rule 68 (action_addSymbols -> .) subroutine reduce using rule 68 (action_addSymbols -> .) @@ -870,7 +882,7 @@ state 44 swap reduce using rule 68 (action_addSymbols -> .) exit reduce using rule 68 (action_addSymbols -> .) - action_addSymbols shift and go to state 66 + action_addSymbols shift and go to state 69 state 45 @@ -895,7 +907,7 @@ state 46 (8) Dim -> openBra int action_30 . closedBra (9) Dim -> openBra int action_30 . closedBra openBra int action_31 closedBra - closedBra shift and go to state 68 + closedBra shift and go to state 71 state 47 @@ -917,7 +929,7 @@ state 47 rea shift and go to state 55 id shift and go to state 33 - EA shift and go to state 69 + EA shift and go to state 72 MultDiv shift and go to state 50 EAParens shift and go to state 51 EItem shift and go to state 52 @@ -943,17 +955,17 @@ state 49 (26) DimensionsOrEmpty -> openParen EA . action_setDim1 ComaEAOrEmpty closedParen (43) EA -> EA . SumOrSub action_3 MultDiv action_4 - (102) action_setDim1 -> . + (105) action_setDim1 -> . (44) SumOrSub -> . plus (45) SumOrSub -> . minus - coma reduce using rule 102 (action_setDim1 -> .) - closedParen reduce using rule 102 (action_setDim1 -> .) - plus shift and go to state 72 - minus shift and go to state 73 + coma reduce using rule 105 (action_setDim1 -> .) + closedParen reduce using rule 105 (action_setDim1 -> .) + plus shift and go to state 75 + minus shift and go to state 76 - action_setDim1 shift and go to state 70 - SumOrSub shift and go to state 71 + action_setDim1 shift and go to state 73 + SumOrSub shift and go to state 74 state 50 @@ -977,10 +989,10 @@ state 50 elif reduce using rule 42 (EA -> MultDiv .) else reduce using rule 42 (EA -> MultDiv .) then reduce using rule 42 (EA -> MultDiv .) - mul shift and go to state 75 - div shift and go to state 76 + mul shift and go to state 78 + div shift and go to state 79 - MDSymbols shift and go to state 74 + MDSymbols shift and go to state 77 state 51 @@ -1059,7 +1071,7 @@ state 53 and reduce using rule 69 (action_1 -> .) or reduce using rule 69 (action_1 -> .) - action_1 shift and go to state 77 + action_1 shift and go to state 80 state 54 @@ -1092,7 +1104,7 @@ state 54 and reduce using rule 70 (action_2 -> .) or reduce using rule 70 (action_2 -> .) - action_2 shift and go to state 78 + action_2 shift and go to state 81 state 55 @@ -1125,7 +1137,7 @@ state 55 and reduce using rule 71 (action_2_rea -> .) or reduce using rule 71 (action_2_rea -> .) - action_2_rea shift and go to state 79 + action_2_rea shift and go to state 82 state 56 @@ -1147,7 +1159,7 @@ state 56 id shift and go to state 33 Dimensional shift and go to state 53 - EA shift and go to state 80 + EA shift and go to state 83 MultDiv shift and go to state 50 EAParens shift and go to state 51 EItem shift and go to state 52 @@ -1159,7 +1171,7 @@ state 57 id shift and go to state 33 - Dimensional shift and go to state 81 + Dimensional shift and go to state 84 state 58 @@ -1188,31 +1200,83 @@ state 58 state 59 + (18) S -> print RDimOrString action_35 . + + end reduce using rule 18 (S -> print RDimOrString action_35 .) + id reduce using rule 18 (S -> print RDimOrString action_35 .) + read reduce using rule 18 (S -> print RDimOrString action_35 .) + print reduce using rule 18 (S -> print RDimOrString action_35 .) + if reduce using rule 18 (S -> print RDimOrString action_35 .) + do reduce using rule 18 (S -> print RDimOrString action_35 .) + swap reduce using rule 18 (S -> print RDimOrString action_35 .) + exit reduce using rule 18 (S -> print RDimOrString action_35 .) + elif reduce using rule 18 (S -> print RDimOrString action_35 .) + else reduce using rule 18 (S -> print RDimOrString action_35 .) + + +state 60 + (33) RDimOrString -> RDimOrString coma . DimOrString - (34) DimOrString -> . Dimensional - (35) DimOrString -> . string + (34) DimOrString -> . Dimensional action_1 action_33 + (35) DimOrString -> . string action_34 (25) Dimensional -> . id DimensionsOrEmpty string shift and go to state 37 id shift and go to state 33 - DimOrString shift and go to state 82 + DimOrString shift and go to state 85 Dimensional shift and go to state 36 -state 60 +state 61 + + (34) DimOrString -> Dimensional action_1 . action_33 + (102) action_33 -> . + + coma reduce using rule 102 (action_33 -> .) + end reduce using rule 102 (action_33 -> .) + id reduce using rule 102 (action_33 -> .) + read reduce using rule 102 (action_33 -> .) + print reduce using rule 102 (action_33 -> .) + if reduce using rule 102 (action_33 -> .) + do reduce using rule 102 (action_33 -> .) + swap reduce using rule 102 (action_33 -> .) + exit reduce using rule 102 (action_33 -> .) + elif reduce using rule 102 (action_33 -> .) + else reduce using rule 102 (action_33 -> .) + + action_33 shift and go to state 86 + +state 62 + + (35) DimOrString -> string action_34 . + + coma reduce using rule 35 (DimOrString -> string action_34 .) + end reduce using rule 35 (DimOrString -> string action_34 .) + id reduce using rule 35 (DimOrString -> string action_34 .) + read reduce using rule 35 (DimOrString -> string action_34 .) + print reduce using rule 35 (DimOrString -> string action_34 .) + if reduce using rule 35 (DimOrString -> string action_34 .) + do reduce using rule 35 (DimOrString -> string action_34 .) + swap reduce using rule 35 (DimOrString -> string action_34 .) + exit reduce using rule 35 (DimOrString -> string action_34 .) + elif reduce using rule 35 (DimOrString -> string action_34 .) + else reduce using rule 35 (DimOrString -> string action_34 .) + + +state 63 (19) S -> if action_16 Relif . ElseOrEmpty end if action_20 (37) Relif -> Relif . elif action_18 openParen EL closedParen action_17 then B (38) ElseOrEmpty -> . else action_19 B (39) ElseOrEmpty -> . - elif shift and go to state 84 - else shift and go to state 85 + elif shift and go to state 88 + else shift and go to state 89 end reduce using rule 39 (ElseOrEmpty -> .) - ElseOrEmpty shift and go to state 83 + ElseOrEmpty shift and go to state 87 -state 61 +state 64 (36) Relif -> openParen . EL closedParen action_17 then B (52) EL -> . AND @@ -1227,26 +1291,26 @@ state 61 (61) EItem -> . rea action_2_rea (25) Dimensional -> . id DimensionsOrEmpty - openParen shift and go to state 86 - not shift and go to state 91 + openParen shift and go to state 90 + not shift and go to state 95 int shift and go to state 54 rea shift and go to state 55 id shift and go to state 33 - EL shift and go to state 87 - AND shift and go to state 88 - Equality shift and go to state 89 - EItem shift and go to state 90 + EL shift and go to state 91 + AND shift and go to state 92 + Equality shift and go to state 93 + EItem shift and go to state 94 Dimensional shift and go to state 53 -state 62 +state 65 (20) S -> do id action_24 . equals EA action_25 coma EA action_26 IntOrEmpty then B action_29 end do - equals shift and go to state 92 + equals shift and go to state 96 -state 63 +state 66 (21) S -> do then action_21 . B action_22 end do (13) B -> . B S @@ -1261,25 +1325,25 @@ state 63 exit reduce using rule 14 (B -> .) end reduce using rule 14 (B -> .) - B shift and go to state 93 + B shift and go to state 97 -state 64 +state 67 (22) S -> swap Dimensional coma . Dimensional (25) Dimensional -> . id DimensionsOrEmpty id shift and go to state 33 - Dimensional shift and go to state 94 + Dimensional shift and go to state 98 -state 65 +state 68 (11) F -> F subroutine id B end . subroutine - subroutine shift and go to state 95 + subroutine shift and go to state 99 -state 66 +state 69 (2) V -> V Tipo Dim doubleColon Rid action_addSymbols . action_32 (101) action_32 -> . @@ -1296,49 +1360,49 @@ state 66 swap reduce using rule 101 (action_32 -> .) exit reduce using rule 101 (action_32 -> .) - action_32 shift and go to state 96 + action_32 shift and go to state 100 -state 67 +state 70 (5) Rid -> Rid coma . id - id shift and go to state 97 + id shift and go to state 101 -state 68 +state 71 (8) Dim -> openBra int action_30 closedBra . (9) Dim -> openBra int action_30 closedBra . openBra int action_31 closedBra doubleColon reduce using rule 8 (Dim -> openBra int action_30 closedBra .) - openBra shift and go to state 98 + openBra shift and go to state 102 -state 69 +state 72 (51) EAParens -> openParen EA . closedParen (43) EA -> EA . SumOrSub action_3 MultDiv action_4 (44) SumOrSub -> . plus (45) SumOrSub -> . minus - closedParen shift and go to state 99 - plus shift and go to state 72 - minus shift and go to state 73 + closedParen shift and go to state 103 + plus shift and go to state 75 + minus shift and go to state 76 - SumOrSub shift and go to state 71 + SumOrSub shift and go to state 74 -state 70 +state 73 (26) DimensionsOrEmpty -> openParen EA action_setDim1 . ComaEAOrEmpty closedParen (28) ComaEAOrEmpty -> . coma EA action_setDim2 (29) ComaEAOrEmpty -> . - coma shift and go to state 101 + coma shift and go to state 105 closedParen reduce using rule 29 (ComaEAOrEmpty -> .) - ComaEAOrEmpty shift and go to state 100 + ComaEAOrEmpty shift and go to state 104 -state 71 +state 74 (43) EA -> EA SumOrSub . action_3 MultDiv action_4 (72) action_3 -> . @@ -1348,9 +1412,9 @@ state 71 rea reduce using rule 72 (action_3 -> .) id reduce using rule 72 (action_3 -> .) - action_3 shift and go to state 102 + action_3 shift and go to state 106 -state 72 +state 75 (44) SumOrSub -> plus . @@ -1360,7 +1424,7 @@ state 72 id reduce using rule 44 (SumOrSub -> plus .) -state 73 +state 76 (45) SumOrSub -> minus . @@ -1370,7 +1434,7 @@ state 73 id reduce using rule 45 (SumOrSub -> minus .) -state 74 +state 77 (47) MultDiv -> MultDiv MDSymbols . action_5 EAParens action_6 (74) action_5 -> . @@ -1380,9 +1444,9 @@ state 74 rea reduce using rule 74 (action_5 -> .) id reduce using rule 74 (action_5 -> .) - action_5 shift and go to state 103 + action_5 shift and go to state 107 -state 75 +state 78 (48) MDSymbols -> mul . @@ -1392,7 +1456,7 @@ state 75 id reduce using rule 48 (MDSymbols -> mul .) -state 76 +state 79 (49) MDSymbols -> div . @@ -1402,7 +1466,7 @@ state 76 id reduce using rule 49 (MDSymbols -> div .) -state 77 +state 80 (59) EItem -> Dimensional action_1 . @@ -1433,7 +1497,7 @@ state 77 or reduce using rule 59 (EItem -> Dimensional action_1 .) -state 78 +state 81 (60) EItem -> int action_2 . @@ -1464,7 +1528,7 @@ state 78 or reduce using rule 60 (EItem -> int action_2 .) -state 79 +state 82 (61) EItem -> rea action_2_rea . @@ -1495,7 +1559,7 @@ state 79 or reduce using rule 61 (EItem -> rea action_2_rea .) -state 80 +state 83 (15) S -> Dimensional action_7 equals EA . action_8 (43) EA -> EA . SumOrSub action_3 MultDiv action_4 @@ -1513,13 +1577,13 @@ state 80 exit reduce using rule 77 (action_8 -> .) elif reduce using rule 77 (action_8 -> .) else reduce using rule 77 (action_8 -> .) - plus shift and go to state 72 - minus shift and go to state 73 + plus shift and go to state 75 + minus shift and go to state 76 - action_8 shift and go to state 104 - SumOrSub shift and go to state 71 + action_8 shift and go to state 108 + SumOrSub shift and go to state 74 -state 81 +state 84 (31) RDimensional -> RDimensional coma Dimensional . @@ -1536,7 +1600,7 @@ state 81 else reduce using rule 31 (RDimensional -> RDimensional coma Dimensional .) -state 82 +state 85 (33) RDimOrString -> RDimOrString coma DimOrString . @@ -1553,23 +1617,40 @@ state 82 else reduce using rule 33 (RDimOrString -> RDimOrString coma DimOrString .) -state 83 +state 86 + + (34) DimOrString -> Dimensional action_1 action_33 . + + coma reduce using rule 34 (DimOrString -> Dimensional action_1 action_33 .) + end reduce using rule 34 (DimOrString -> Dimensional action_1 action_33 .) + id reduce using rule 34 (DimOrString -> Dimensional action_1 action_33 .) + read reduce using rule 34 (DimOrString -> Dimensional action_1 action_33 .) + print reduce using rule 34 (DimOrString -> Dimensional action_1 action_33 .) + if reduce using rule 34 (DimOrString -> Dimensional action_1 action_33 .) + do reduce using rule 34 (DimOrString -> Dimensional action_1 action_33 .) + swap reduce using rule 34 (DimOrString -> Dimensional action_1 action_33 .) + exit reduce using rule 34 (DimOrString -> Dimensional action_1 action_33 .) + elif reduce using rule 34 (DimOrString -> Dimensional action_1 action_33 .) + else reduce using rule 34 (DimOrString -> Dimensional action_1 action_33 .) + + +state 87 (19) S -> if action_16 Relif ElseOrEmpty . end if action_20 - end shift and go to state 105 + end shift and go to state 109 -state 84 +state 88 (37) Relif -> Relif elif . action_18 openParen EL closedParen action_17 then B (87) action_18 -> . openParen reduce using rule 87 (action_18 -> .) - action_18 shift and go to state 106 + action_18 shift and go to state 110 -state 85 +state 89 (38) ElseOrEmpty -> else . action_19 B (88) action_19 -> . @@ -1583,9 +1664,9 @@ state 85 exit reduce using rule 88 (action_19 -> .) end reduce using rule 88 (action_19 -> .) - action_19 shift and go to state 107 + action_19 shift and go to state 111 -state 86 +state 90 (57) Equality -> openParen . EL closedParen (52) EL -> . AND @@ -1600,28 +1681,28 @@ state 86 (61) EItem -> . rea action_2_rea (25) Dimensional -> . id DimensionsOrEmpty - openParen shift and go to state 86 - not shift and go to state 91 + openParen shift and go to state 90 + not shift and go to state 95 int shift and go to state 54 rea shift and go to state 55 id shift and go to state 33 - EL shift and go to state 108 - AND shift and go to state 88 - Equality shift and go to state 89 - EItem shift and go to state 90 + EL shift and go to state 112 + AND shift and go to state 92 + Equality shift and go to state 93 + EItem shift and go to state 94 Dimensional shift and go to state 53 -state 87 +state 91 (36) Relif -> openParen EL . closedParen action_17 then B (53) EL -> EL . or action_10 AND action_9 - closedParen shift and go to state 109 - or shift and go to state 110 + closedParen shift and go to state 113 + or shift and go to state 114 -state 88 +state 92 (52) EL -> AND . (55) AND -> AND . and action_12 Equality action_11 @@ -1629,12 +1710,12 @@ state 88 ! shift/reduce conflict for and resolved as shift closedParen reduce using rule 52 (EL -> AND .) or reduce using rule 52 (EL -> AND .) - and shift and go to state 111 + and shift and go to state 115 ! and [ reduce using rule 52 (EL -> AND .) ] -state 89 +state 93 (54) AND -> Equality . @@ -1643,7 +1724,7 @@ state 89 or reduce using rule 54 (AND -> Equality .) -state 90 +state 94 (56) Equality -> EItem . EQSymbols action_13 EItem action_14 (62) EQSymbols -> . less @@ -1653,16 +1734,16 @@ state 90 (66) EQSymbols -> . lessEquals (67) EQSymbols -> . moreEquals - less shift and go to state 113 - more shift and go to state 114 - doubleEquals shift and go to state 115 - notEquals shift and go to state 116 - lessEquals shift and go to state 117 - moreEquals shift and go to state 118 + less shift and go to state 117 + more shift and go to state 118 + doubleEquals shift and go to state 119 + notEquals shift and go to state 120 + lessEquals shift and go to state 121 + moreEquals shift and go to state 122 - EQSymbols shift and go to state 112 + EQSymbols shift and go to state 116 -state 91 +state 95 (58) Equality -> not . EL action_15 (52) EL -> . AND @@ -1677,179 +1758,21 @@ state 91 (61) EItem -> . rea action_2_rea (25) Dimensional -> . id DimensionsOrEmpty - openParen shift and go to state 86 - not shift and go to state 91 + openParen shift and go to state 90 + not shift and go to state 95 int shift and go to state 54 rea shift and go to state 55 id shift and go to state 33 - EL shift and go to state 119 - AND shift and go to state 88 - Equality shift and go to state 89 - EItem shift and go to state 90 + EL shift and go to state 123 + AND shift and go to state 92 + Equality shift and go to state 93 + EItem shift and go to state 94 Dimensional shift and go to state 53 -state 92 - - (20) S -> do id action_24 equals . EA action_25 coma EA action_26 IntOrEmpty then B action_29 end do - (42) EA -> . MultDiv - (43) EA -> . EA SumOrSub action_3 MultDiv action_4 - (46) MultDiv -> . EAParens - (47) MultDiv -> . MultDiv MDSymbols action_5 EAParens action_6 - (50) EAParens -> . EItem - (51) EAParens -> . openParen EA closedParen - (59) EItem -> . Dimensional action_1 - (60) EItem -> . int action_2 - (61) EItem -> . rea action_2_rea - (25) Dimensional -> . id DimensionsOrEmpty - - openParen shift and go to state 47 - int shift and go to state 54 - rea shift and go to state 55 - id shift and go to state 33 - - EA shift and go to state 120 - MultDiv shift and go to state 50 - EAParens shift and go to state 51 - EItem shift and go to state 52 - Dimensional shift and go to state 53 - -state 93 - - (21) S -> do then action_21 B . action_22 end do - (13) B -> B . S - (91) action_22 -> . - (15) S -> . Dimensional action_7 equals EA action_8 - (16) S -> . id parens - (17) S -> . read RDimensional - (18) S -> . print RDimOrString - (19) S -> . if action_16 Relif ElseOrEmpty end if action_20 - (20) S -> . do id action_24 equals EA action_25 coma EA action_26 IntOrEmpty then B action_29 end do - (21) S -> . do then action_21 B action_22 end do - (22) S -> . swap Dimensional coma Dimensional - (23) S -> . exit action_23 - (24) S -> . id openParen closedParen - (25) Dimensional -> . id DimensionsOrEmpty - - end reduce using rule 91 (action_22 -> .) - id shift and go to state 13 - read shift and go to state 17 - print shift and go to state 18 - if shift and go to state 19 - do shift and go to state 20 - swap shift and go to state 21 - exit shift and go to state 22 - - action_22 shift and go to state 121 - S shift and go to state 15 - Dimensional shift and go to state 16 - -state 94 - - (22) S -> swap Dimensional coma Dimensional . - - end reduce using rule 22 (S -> swap Dimensional coma Dimensional .) - id reduce using rule 22 (S -> swap Dimensional coma Dimensional .) - read reduce using rule 22 (S -> swap Dimensional coma Dimensional .) - print reduce using rule 22 (S -> swap Dimensional coma Dimensional .) - if reduce using rule 22 (S -> swap Dimensional coma Dimensional .) - do reduce using rule 22 (S -> swap Dimensional coma Dimensional .) - swap reduce using rule 22 (S -> swap Dimensional coma Dimensional .) - exit reduce using rule 22 (S -> swap Dimensional coma Dimensional .) - elif reduce using rule 22 (S -> swap Dimensional coma Dimensional .) - else reduce using rule 22 (S -> swap Dimensional coma Dimensional .) - - -state 95 - - (11) F -> F subroutine id B end subroutine . - - subroutine reduce using rule 11 (F -> F subroutine id B end subroutine .) - end reduce using rule 11 (F -> F subroutine id B end subroutine .) - id reduce using rule 11 (F -> F subroutine id B end subroutine .) - read reduce using rule 11 (F -> F subroutine id B end subroutine .) - print reduce using rule 11 (F -> F subroutine id B end subroutine .) - if reduce using rule 11 (F -> F subroutine id B end subroutine .) - do reduce using rule 11 (F -> F subroutine id B end subroutine .) - swap reduce using rule 11 (F -> F subroutine id B end subroutine .) - exit reduce using rule 11 (F -> F subroutine id B end subroutine .) - - state 96 - (2) V -> V Tipo Dim doubleColon Rid action_addSymbols action_32 . - - integer reduce using rule 2 (V -> V Tipo Dim doubleColon Rid action_addSymbols action_32 .) - real reduce using rule 2 (V -> V Tipo Dim doubleColon Rid action_addSymbols action_32 .) - subroutine reduce using rule 2 (V -> V Tipo Dim doubleColon Rid action_addSymbols action_32 .) - end reduce using rule 2 (V -> V Tipo Dim doubleColon Rid action_addSymbols action_32 .) - id reduce using rule 2 (V -> V Tipo Dim doubleColon Rid action_addSymbols action_32 .) - read reduce using rule 2 (V -> V Tipo Dim doubleColon Rid action_addSymbols action_32 .) - print reduce using rule 2 (V -> V Tipo Dim doubleColon Rid action_addSymbols action_32 .) - if reduce using rule 2 (V -> V Tipo Dim doubleColon Rid action_addSymbols action_32 .) - do reduce using rule 2 (V -> V Tipo Dim doubleColon Rid action_addSymbols action_32 .) - swap reduce using rule 2 (V -> V Tipo Dim doubleColon Rid action_addSymbols action_32 .) - exit reduce using rule 2 (V -> V Tipo Dim doubleColon Rid action_addSymbols action_32 .) - - -state 97 - - (5) Rid -> Rid coma id . - - coma reduce using rule 5 (Rid -> Rid coma id .) - integer reduce using rule 5 (Rid -> Rid coma id .) - real reduce using rule 5 (Rid -> Rid coma id .) - subroutine reduce using rule 5 (Rid -> Rid coma id .) - end reduce using rule 5 (Rid -> Rid coma id .) - id reduce using rule 5 (Rid -> Rid coma id .) - read reduce using rule 5 (Rid -> Rid coma id .) - print reduce using rule 5 (Rid -> Rid coma id .) - if reduce using rule 5 (Rid -> Rid coma id .) - do reduce using rule 5 (Rid -> Rid coma id .) - swap reduce using rule 5 (Rid -> Rid coma id .) - exit reduce using rule 5 (Rid -> Rid coma id .) - - -state 98 - - (9) Dim -> openBra int action_30 closedBra openBra . int action_31 closedBra - - int shift and go to state 122 - - -state 99 - - (51) EAParens -> openParen EA closedParen . - - mul reduce using rule 51 (EAParens -> openParen EA closedParen .) - div reduce using rule 51 (EAParens -> openParen EA closedParen .) - plus reduce using rule 51 (EAParens -> openParen EA closedParen .) - minus reduce using rule 51 (EAParens -> openParen EA closedParen .) - coma reduce using rule 51 (EAParens -> openParen EA closedParen .) - closedParen reduce using rule 51 (EAParens -> openParen EA closedParen .) - end reduce using rule 51 (EAParens -> openParen EA closedParen .) - id reduce using rule 51 (EAParens -> openParen EA closedParen .) - read reduce using rule 51 (EAParens -> openParen EA closedParen .) - print reduce using rule 51 (EAParens -> openParen EA closedParen .) - if reduce using rule 51 (EAParens -> openParen EA closedParen .) - do reduce using rule 51 (EAParens -> openParen EA closedParen .) - swap reduce using rule 51 (EAParens -> openParen EA closedParen .) - exit reduce using rule 51 (EAParens -> openParen EA closedParen .) - elif reduce using rule 51 (EAParens -> openParen EA closedParen .) - else reduce using rule 51 (EAParens -> openParen EA closedParen .) - then reduce using rule 51 (EAParens -> openParen EA closedParen .) - - -state 100 - - (26) DimensionsOrEmpty -> openParen EA action_setDim1 ComaEAOrEmpty . closedParen - - closedParen shift and go to state 123 - - -state 101 - - (28) ComaEAOrEmpty -> coma . EA action_setDim2 + (20) S -> do id action_24 equals . EA action_25 coma EA action_26 IntOrEmpty then B action_29 end do (42) EA -> . MultDiv (43) EA -> . EA SumOrSub action_3 MultDiv action_4 (46) MultDiv -> . EAParens @@ -1872,8 +1795,166 @@ state 101 EItem shift and go to state 52 Dimensional shift and go to state 53 +state 97 + + (21) S -> do then action_21 B . action_22 end do + (13) B -> B . S + (91) action_22 -> . + (15) S -> . Dimensional action_7 equals EA action_8 + (16) S -> . id parens + (17) S -> . read RDimensional + (18) S -> . print RDimOrString action_35 + (19) S -> . if action_16 Relif ElseOrEmpty end if action_20 + (20) S -> . do id action_24 equals EA action_25 coma EA action_26 IntOrEmpty then B action_29 end do + (21) S -> . do then action_21 B action_22 end do + (22) S -> . swap Dimensional coma Dimensional + (23) S -> . exit action_23 + (24) S -> . id openParen closedParen + (25) Dimensional -> . id DimensionsOrEmpty + + end reduce using rule 91 (action_22 -> .) + id shift and go to state 13 + read shift and go to state 17 + print shift and go to state 18 + if shift and go to state 19 + do shift and go to state 20 + swap shift and go to state 21 + exit shift and go to state 22 + + action_22 shift and go to state 125 + S shift and go to state 15 + Dimensional shift and go to state 16 + +state 98 + + (22) S -> swap Dimensional coma Dimensional . + + end reduce using rule 22 (S -> swap Dimensional coma Dimensional .) + id reduce using rule 22 (S -> swap Dimensional coma Dimensional .) + read reduce using rule 22 (S -> swap Dimensional coma Dimensional .) + print reduce using rule 22 (S -> swap Dimensional coma Dimensional .) + if reduce using rule 22 (S -> swap Dimensional coma Dimensional .) + do reduce using rule 22 (S -> swap Dimensional coma Dimensional .) + swap reduce using rule 22 (S -> swap Dimensional coma Dimensional .) + exit reduce using rule 22 (S -> swap Dimensional coma Dimensional .) + elif reduce using rule 22 (S -> swap Dimensional coma Dimensional .) + else reduce using rule 22 (S -> swap Dimensional coma Dimensional .) + + +state 99 + + (11) F -> F subroutine id B end subroutine . + + subroutine reduce using rule 11 (F -> F subroutine id B end subroutine .) + end reduce using rule 11 (F -> F subroutine id B end subroutine .) + id reduce using rule 11 (F -> F subroutine id B end subroutine .) + read reduce using rule 11 (F -> F subroutine id B end subroutine .) + print reduce using rule 11 (F -> F subroutine id B end subroutine .) + if reduce using rule 11 (F -> F subroutine id B end subroutine .) + do reduce using rule 11 (F -> F subroutine id B end subroutine .) + swap reduce using rule 11 (F -> F subroutine id B end subroutine .) + exit reduce using rule 11 (F -> F subroutine id B end subroutine .) + + +state 100 + + (2) V -> V Tipo Dim doubleColon Rid action_addSymbols action_32 . + + integer reduce using rule 2 (V -> V Tipo Dim doubleColon Rid action_addSymbols action_32 .) + real reduce using rule 2 (V -> V Tipo Dim doubleColon Rid action_addSymbols action_32 .) + subroutine reduce using rule 2 (V -> V Tipo Dim doubleColon Rid action_addSymbols action_32 .) + end reduce using rule 2 (V -> V Tipo Dim doubleColon Rid action_addSymbols action_32 .) + id reduce using rule 2 (V -> V Tipo Dim doubleColon Rid action_addSymbols action_32 .) + read reduce using rule 2 (V -> V Tipo Dim doubleColon Rid action_addSymbols action_32 .) + print reduce using rule 2 (V -> V Tipo Dim doubleColon Rid action_addSymbols action_32 .) + if reduce using rule 2 (V -> V Tipo Dim doubleColon Rid action_addSymbols action_32 .) + do reduce using rule 2 (V -> V Tipo Dim doubleColon Rid action_addSymbols action_32 .) + swap reduce using rule 2 (V -> V Tipo Dim doubleColon Rid action_addSymbols action_32 .) + exit reduce using rule 2 (V -> V Tipo Dim doubleColon Rid action_addSymbols action_32 .) + + +state 101 + + (5) Rid -> Rid coma id . + + coma reduce using rule 5 (Rid -> Rid coma id .) + integer reduce using rule 5 (Rid -> Rid coma id .) + real reduce using rule 5 (Rid -> Rid coma id .) + subroutine reduce using rule 5 (Rid -> Rid coma id .) + end reduce using rule 5 (Rid -> Rid coma id .) + id reduce using rule 5 (Rid -> Rid coma id .) + read reduce using rule 5 (Rid -> Rid coma id .) + print reduce using rule 5 (Rid -> Rid coma id .) + if reduce using rule 5 (Rid -> Rid coma id .) + do reduce using rule 5 (Rid -> Rid coma id .) + swap reduce using rule 5 (Rid -> Rid coma id .) + exit reduce using rule 5 (Rid -> Rid coma id .) + + state 102 + (9) Dim -> openBra int action_30 closedBra openBra . int action_31 closedBra + + int shift and go to state 126 + + +state 103 + + (51) EAParens -> openParen EA closedParen . + + mul reduce using rule 51 (EAParens -> openParen EA closedParen .) + div reduce using rule 51 (EAParens -> openParen EA closedParen .) + plus reduce using rule 51 (EAParens -> openParen EA closedParen .) + minus reduce using rule 51 (EAParens -> openParen EA closedParen .) + coma reduce using rule 51 (EAParens -> openParen EA closedParen .) + closedParen reduce using rule 51 (EAParens -> openParen EA closedParen .) + end reduce using rule 51 (EAParens -> openParen EA closedParen .) + id reduce using rule 51 (EAParens -> openParen EA closedParen .) + read reduce using rule 51 (EAParens -> openParen EA closedParen .) + print reduce using rule 51 (EAParens -> openParen EA closedParen .) + if reduce using rule 51 (EAParens -> openParen EA closedParen .) + do reduce using rule 51 (EAParens -> openParen EA closedParen .) + swap reduce using rule 51 (EAParens -> openParen EA closedParen .) + exit reduce using rule 51 (EAParens -> openParen EA closedParen .) + elif reduce using rule 51 (EAParens -> openParen EA closedParen .) + else reduce using rule 51 (EAParens -> openParen EA closedParen .) + then reduce using rule 51 (EAParens -> openParen EA closedParen .) + + +state 104 + + (26) DimensionsOrEmpty -> openParen EA action_setDim1 ComaEAOrEmpty . closedParen + + closedParen shift and go to state 127 + + +state 105 + + (28) ComaEAOrEmpty -> coma . EA action_setDim2 + (42) EA -> . MultDiv + (43) EA -> . EA SumOrSub action_3 MultDiv action_4 + (46) MultDiv -> . EAParens + (47) MultDiv -> . MultDiv MDSymbols action_5 EAParens action_6 + (50) EAParens -> . EItem + (51) EAParens -> . openParen EA closedParen + (59) EItem -> . Dimensional action_1 + (60) EItem -> . int action_2 + (61) EItem -> . rea action_2_rea + (25) Dimensional -> . id DimensionsOrEmpty + + openParen shift and go to state 47 + int shift and go to state 54 + rea shift and go to state 55 + id shift and go to state 33 + + EA shift and go to state 128 + MultDiv shift and go to state 50 + EAParens shift and go to state 51 + EItem shift and go to state 52 + Dimensional shift and go to state 53 + +state 106 + (43) EA -> EA SumOrSub action_3 . MultDiv action_4 (46) MultDiv -> . EAParens (47) MultDiv -> . MultDiv MDSymbols action_5 EAParens action_6 @@ -1889,12 +1970,12 @@ state 102 rea shift and go to state 55 id shift and go to state 33 - MultDiv shift and go to state 125 + MultDiv shift and go to state 129 EAParens shift and go to state 51 EItem shift and go to state 52 Dimensional shift and go to state 53 -state 103 +state 107 (47) MultDiv -> MultDiv MDSymbols action_5 . EAParens action_6 (50) EAParens -> . EItem @@ -1909,11 +1990,11 @@ state 103 rea shift and go to state 55 id shift and go to state 33 - EAParens shift and go to state 126 + EAParens shift and go to state 130 EItem shift and go to state 52 Dimensional shift and go to state 53 -state 104 +state 108 (15) S -> Dimensional action_7 equals EA action_8 . @@ -1929,21 +2010,21 @@ state 104 else reduce using rule 15 (S -> Dimensional action_7 equals EA action_8 .) -state 105 +state 109 (19) S -> if action_16 Relif ElseOrEmpty end . if action_20 - if shift and go to state 127 + if shift and go to state 131 -state 106 +state 110 (37) Relif -> Relif elif action_18 . openParen EL closedParen action_17 then B - openParen shift and go to state 128 + openParen shift and go to state 132 -state 107 +state 111 (38) ElseOrEmpty -> else action_19 . B (13) B -> . B S @@ -1958,27 +2039,27 @@ state 107 exit reduce using rule 14 (B -> .) end reduce using rule 14 (B -> .) - B shift and go to state 129 + B shift and go to state 133 -state 108 +state 112 (57) Equality -> openParen EL . closedParen (53) EL -> EL . or action_10 AND action_9 - closedParen shift and go to state 130 - or shift and go to state 110 + closedParen shift and go to state 134 + or shift and go to state 114 -state 109 +state 113 (36) Relif -> openParen EL closedParen . action_17 then B (86) action_17 -> . then reduce using rule 86 (action_17 -> .) - action_17 shift and go to state 131 + action_17 shift and go to state 135 -state 110 +state 114 (53) EL -> EL or . action_10 AND action_9 (79) action_10 -> . @@ -1989,9 +2070,9 @@ state 110 rea reduce using rule 79 (action_10 -> .) id reduce using rule 79 (action_10 -> .) - action_10 shift and go to state 132 + action_10 shift and go to state 136 -state 111 +state 115 (55) AND -> AND and . action_12 Equality action_11 (81) action_12 -> . @@ -2002,9 +2083,9 @@ state 111 rea reduce using rule 81 (action_12 -> .) id reduce using rule 81 (action_12 -> .) - action_12 shift and go to state 133 + action_12 shift and go to state 137 -state 112 +state 116 (56) Equality -> EItem EQSymbols . action_13 EItem action_14 (82) action_13 -> . @@ -2013,9 +2094,9 @@ state 112 rea reduce using rule 82 (action_13 -> .) id reduce using rule 82 (action_13 -> .) - action_13 shift and go to state 134 + action_13 shift and go to state 138 -state 113 +state 117 (62) EQSymbols -> less . @@ -2024,7 +2105,7 @@ state 113 id reduce using rule 62 (EQSymbols -> less .) -state 114 +state 118 (63) EQSymbols -> more . @@ -2033,7 +2114,7 @@ state 114 id reduce using rule 63 (EQSymbols -> more .) -state 115 +state 119 (64) EQSymbols -> doubleEquals . @@ -2042,7 +2123,7 @@ state 115 id reduce using rule 64 (EQSymbols -> doubleEquals .) -state 116 +state 120 (65) EQSymbols -> notEquals . @@ -2051,7 +2132,7 @@ state 116 id reduce using rule 65 (EQSymbols -> notEquals .) -state 117 +state 121 (66) EQSymbols -> lessEquals . @@ -2060,7 +2141,7 @@ state 117 id reduce using rule 66 (EQSymbols -> lessEquals .) -state 118 +state 122 (67) EQSymbols -> moreEquals . @@ -2069,22 +2150,22 @@ state 118 id reduce using rule 67 (EQSymbols -> moreEquals .) -state 119 +state 123 (58) Equality -> not EL . action_15 (53) EL -> EL . or action_10 AND action_9 (84) action_15 -> . ! shift/reduce conflict for or resolved as shift - or shift and go to state 110 + or shift and go to state 114 and reduce using rule 84 (action_15 -> .) closedParen reduce using rule 84 (action_15 -> .) ! or [ reduce using rule 84 (action_15 -> .) ] - action_15 shift and go to state 135 + action_15 shift and go to state 139 -state 120 +state 124 (20) S -> do id action_24 equals EA . action_25 coma EA action_26 IntOrEmpty then B action_29 end do (43) EA -> EA . SumOrSub action_3 MultDiv action_4 @@ -2093,29 +2174,29 @@ state 120 (45) SumOrSub -> . minus coma reduce using rule 94 (action_25 -> .) - plus shift and go to state 72 - minus shift and go to state 73 + plus shift and go to state 75 + minus shift and go to state 76 - action_25 shift and go to state 136 - SumOrSub shift and go to state 71 + action_25 shift and go to state 140 + SumOrSub shift and go to state 74 -state 121 +state 125 (21) S -> do then action_21 B action_22 . end do - end shift and go to state 137 + end shift and go to state 141 -state 122 +state 126 (9) Dim -> openBra int action_30 closedBra openBra int . action_31 closedBra (100) action_31 -> . closedBra reduce using rule 100 (action_31 -> .) - action_31 shift and go to state 138 + action_31 shift and go to state 142 -state 123 +state 127 (26) DimensionsOrEmpty -> openParen EA action_setDim1 ComaEAOrEmpty closedParen . @@ -2147,22 +2228,22 @@ state 123 or reduce using rule 26 (DimensionsOrEmpty -> openParen EA action_setDim1 ComaEAOrEmpty closedParen .) -state 124 +state 128 (28) ComaEAOrEmpty -> coma EA . action_setDim2 (43) EA -> EA . SumOrSub action_3 MultDiv action_4 - (103) action_setDim2 -> . + (106) action_setDim2 -> . (44) SumOrSub -> . plus (45) SumOrSub -> . minus - closedParen reduce using rule 103 (action_setDim2 -> .) - plus shift and go to state 72 - minus shift and go to state 73 + closedParen reduce using rule 106 (action_setDim2 -> .) + plus shift and go to state 75 + minus shift and go to state 76 - action_setDim2 shift and go to state 139 - SumOrSub shift and go to state 71 + action_setDim2 shift and go to state 143 + SumOrSub shift and go to state 74 -state 125 +state 129 (43) EA -> EA SumOrSub action_3 MultDiv . action_4 (47) MultDiv -> MultDiv . MDSymbols action_5 EAParens action_6 @@ -2185,13 +2266,13 @@ state 125 elif reduce using rule 73 (action_4 -> .) else reduce using rule 73 (action_4 -> .) then reduce using rule 73 (action_4 -> .) - mul shift and go to state 75 - div shift and go to state 76 + mul shift and go to state 78 + div shift and go to state 79 - action_4 shift and go to state 140 - MDSymbols shift and go to state 74 + action_4 shift and go to state 144 + MDSymbols shift and go to state 77 -state 126 +state 130 (47) MultDiv -> MultDiv MDSymbols action_5 EAParens . action_6 (75) action_6 -> . @@ -2214,9 +2295,9 @@ state 126 else reduce using rule 75 (action_6 -> .) then reduce using rule 75 (action_6 -> .) - action_6 shift and go to state 141 + action_6 shift and go to state 145 -state 127 +state 131 (19) S -> if action_16 Relif ElseOrEmpty end if . action_20 (89) action_20 -> . @@ -2232,9 +2313,9 @@ state 127 elif reduce using rule 89 (action_20 -> .) else reduce using rule 89 (action_20 -> .) - action_20 shift and go to state 142 + action_20 shift and go to state 146 -state 128 +state 132 (37) Relif -> Relif elif action_18 openParen . EL closedParen action_17 then B (52) EL -> . AND @@ -2249,26 +2330,26 @@ state 128 (61) EItem -> . rea action_2_rea (25) Dimensional -> . id DimensionsOrEmpty - openParen shift and go to state 86 - not shift and go to state 91 + openParen shift and go to state 90 + not shift and go to state 95 int shift and go to state 54 rea shift and go to state 55 id shift and go to state 33 - EL shift and go to state 143 - AND shift and go to state 88 - Equality shift and go to state 89 - EItem shift and go to state 90 + EL shift and go to state 147 + AND shift and go to state 92 + Equality shift and go to state 93 + EItem shift and go to state 94 Dimensional shift and go to state 53 -state 129 +state 133 (38) ElseOrEmpty -> else action_19 B . (13) B -> B . S (15) S -> . Dimensional action_7 equals EA action_8 (16) S -> . id parens (17) S -> . read RDimensional - (18) S -> . print RDimOrString + (18) S -> . print RDimOrString action_35 (19) S -> . if action_16 Relif ElseOrEmpty end if action_20 (20) S -> . do id action_24 equals EA action_25 coma EA action_26 IntOrEmpty then B action_29 end do (21) S -> . do then action_21 B action_22 end do @@ -2289,7 +2370,7 @@ state 129 S shift and go to state 15 Dimensional shift and go to state 16 -state 130 +state 134 (57) Equality -> openParen EL closedParen . @@ -2298,14 +2379,14 @@ state 130 or reduce using rule 57 (Equality -> openParen EL closedParen .) -state 131 +state 135 (36) Relif -> openParen EL closedParen action_17 . then B - then shift and go to state 144 + then shift and go to state 148 -state 132 +state 136 (53) EL -> EL or action_10 . AND action_9 (54) AND -> . Equality @@ -2318,18 +2399,18 @@ state 132 (61) EItem -> . rea action_2_rea (25) Dimensional -> . id DimensionsOrEmpty - openParen shift and go to state 86 - not shift and go to state 91 + openParen shift and go to state 90 + not shift and go to state 95 int shift and go to state 54 rea shift and go to state 55 id shift and go to state 33 - AND shift and go to state 145 - Equality shift and go to state 89 - EItem shift and go to state 90 + AND shift and go to state 149 + Equality shift and go to state 93 + EItem shift and go to state 94 Dimensional shift and go to state 53 -state 133 +state 137 (55) AND -> AND and action_12 . Equality action_11 (56) Equality -> . EItem EQSymbols action_13 EItem action_14 @@ -2340,17 +2421,17 @@ state 133 (61) EItem -> . rea action_2_rea (25) Dimensional -> . id DimensionsOrEmpty - openParen shift and go to state 86 - not shift and go to state 91 + openParen shift and go to state 90 + not shift and go to state 95 int shift and go to state 54 rea shift and go to state 55 id shift and go to state 33 - Equality shift and go to state 146 - EItem shift and go to state 90 + Equality shift and go to state 150 + EItem shift and go to state 94 Dimensional shift and go to state 53 -state 134 +state 138 (56) Equality -> EItem EQSymbols action_13 . EItem action_14 (59) EItem -> . Dimensional action_1 @@ -2362,10 +2443,10 @@ state 134 rea shift and go to state 55 id shift and go to state 33 - EItem shift and go to state 147 + EItem shift and go to state 151 Dimensional shift and go to state 53 -state 135 +state 139 (58) Equality -> not EL action_15 . @@ -2374,35 +2455,35 @@ state 135 or reduce using rule 58 (Equality -> not EL action_15 .) -state 136 +state 140 (20) S -> do id action_24 equals EA action_25 . coma EA action_26 IntOrEmpty then B action_29 end do - coma shift and go to state 148 + coma shift and go to state 152 -state 137 +state 141 (21) S -> do then action_21 B action_22 end . do - do shift and go to state 149 + do shift and go to state 153 -state 138 +state 142 (9) Dim -> openBra int action_30 closedBra openBra int action_31 . closedBra - closedBra shift and go to state 150 + closedBra shift and go to state 154 -state 139 +state 143 (28) ComaEAOrEmpty -> coma EA action_setDim2 . closedParen reduce using rule 28 (ComaEAOrEmpty -> coma EA action_setDim2 .) -state 140 +state 144 (43) EA -> EA SumOrSub action_3 MultDiv action_4 . @@ -2423,7 +2504,7 @@ state 140 then reduce using rule 43 (EA -> EA SumOrSub action_3 MultDiv action_4 .) -state 141 +state 145 (47) MultDiv -> MultDiv MDSymbols action_5 EAParens action_6 . @@ -2446,7 +2527,7 @@ state 141 then reduce using rule 47 (MultDiv -> MultDiv MDSymbols action_5 EAParens action_6 .) -state 142 +state 146 (19) S -> if action_16 Relif ElseOrEmpty end if action_20 . @@ -2462,16 +2543,16 @@ state 142 else reduce using rule 19 (S -> if action_16 Relif ElseOrEmpty end if action_20 .) -state 143 +state 147 (37) Relif -> Relif elif action_18 openParen EL . closedParen action_17 then B (53) EL -> EL . or action_10 AND action_9 - closedParen shift and go to state 151 - or shift and go to state 110 + closedParen shift and go to state 155 + or shift and go to state 114 -state 144 +state 148 (36) Relif -> openParen EL closedParen action_17 then . B (13) B -> . B S @@ -2488,24 +2569,24 @@ state 144 else reduce using rule 14 (B -> .) end reduce using rule 14 (B -> .) - B shift and go to state 152 + B shift and go to state 156 -state 145 +state 149 (53) EL -> EL or action_10 AND . action_9 (55) AND -> AND . and action_12 Equality action_11 (78) action_9 -> . ! shift/reduce conflict for and resolved as shift - and shift and go to state 111 + and shift and go to state 115 closedParen reduce using rule 78 (action_9 -> .) or reduce using rule 78 (action_9 -> .) ! and [ reduce using rule 78 (action_9 -> .) ] - action_9 shift and go to state 153 + action_9 shift and go to state 157 -state 146 +state 150 (55) AND -> AND and action_12 Equality . action_11 (80) action_11 -> . @@ -2514,9 +2595,9 @@ state 146 closedParen reduce using rule 80 (action_11 -> .) or reduce using rule 80 (action_11 -> .) - action_11 shift and go to state 154 + action_11 shift and go to state 158 -state 147 +state 151 (56) Equality -> EItem EQSymbols action_13 EItem . action_14 (83) action_14 -> . @@ -2525,9 +2606,9 @@ state 147 closedParen reduce using rule 83 (action_14 -> .) or reduce using rule 83 (action_14 -> .) - action_14 shift and go to state 155 + action_14 shift and go to state 159 -state 148 +state 152 (20) S -> do id action_24 equals EA action_25 coma . EA action_26 IntOrEmpty then B action_29 end do (42) EA -> . MultDiv @@ -2546,13 +2627,13 @@ state 148 rea shift and go to state 55 id shift and go to state 33 - EA shift and go to state 156 + EA shift and go to state 160 MultDiv shift and go to state 50 EAParens shift and go to state 51 EItem shift and go to state 52 Dimensional shift and go to state 53 -state 149 +state 153 (21) S -> do then action_21 B action_22 end do . @@ -2568,30 +2649,30 @@ state 149 else reduce using rule 21 (S -> do then action_21 B action_22 end do .) -state 150 +state 154 (9) Dim -> openBra int action_30 closedBra openBra int action_31 closedBra . doubleColon reduce using rule 9 (Dim -> openBra int action_30 closedBra openBra int action_31 closedBra .) -state 151 +state 155 (37) Relif -> Relif elif action_18 openParen EL closedParen . action_17 then B (86) action_17 -> . then reduce using rule 86 (action_17 -> .) - action_17 shift and go to state 157 + action_17 shift and go to state 161 -state 152 +state 156 (36) Relif -> openParen EL closedParen action_17 then B . (13) B -> B . S (15) S -> . Dimensional action_7 equals EA action_8 (16) S -> . id parens (17) S -> . read RDimensional - (18) S -> . print RDimOrString + (18) S -> . print RDimOrString action_35 (19) S -> . if action_16 Relif ElseOrEmpty end if action_20 (20) S -> . do id action_24 equals EA action_25 coma EA action_26 IntOrEmpty then B action_29 end do (21) S -> . do then action_21 B action_22 end do @@ -2614,7 +2695,7 @@ state 152 S shift and go to state 15 Dimensional shift and go to state 16 -state 153 +state 157 (53) EL -> EL or action_10 AND action_9 . @@ -2623,7 +2704,7 @@ state 153 and reduce using rule 53 (EL -> EL or action_10 AND action_9 .) -state 154 +state 158 (55) AND -> AND and action_12 Equality action_11 . @@ -2632,7 +2713,7 @@ state 154 or reduce using rule 55 (AND -> AND and action_12 Equality action_11 .) -state 155 +state 159 (56) Equality -> EItem EQSymbols action_13 EItem action_14 . @@ -2641,7 +2722,7 @@ state 155 or reduce using rule 56 (Equality -> EItem EQSymbols action_13 EItem action_14 .) -state 156 +state 160 (20) S -> do id action_24 equals EA action_25 coma EA . action_26 IntOrEmpty then B action_29 end do (43) EA -> EA . SumOrSub action_3 MultDiv action_4 @@ -2651,33 +2732,33 @@ state 156 coma reduce using rule 95 (action_26 -> .) then reduce using rule 95 (action_26 -> .) - plus shift and go to state 72 - minus shift and go to state 73 + plus shift and go to state 75 + minus shift and go to state 76 - action_26 shift and go to state 158 - SumOrSub shift and go to state 71 + action_26 shift and go to state 162 + SumOrSub shift and go to state 74 -state 157 +state 161 (37) Relif -> Relif elif action_18 openParen EL closedParen action_17 . then B - then shift and go to state 159 + then shift and go to state 163 -state 158 +state 162 (20) S -> do id action_24 equals EA action_25 coma EA action_26 . IntOrEmpty then B action_29 end do (40) IntOrEmpty -> . coma int action_28 (41) IntOrEmpty -> . action_27 (96) action_27 -> . - coma shift and go to state 160 + coma shift and go to state 164 then reduce using rule 96 (action_27 -> .) - IntOrEmpty shift and go to state 161 - action_27 shift and go to state 162 + IntOrEmpty shift and go to state 165 + action_27 shift and go to state 166 -state 159 +state 163 (37) Relif -> Relif elif action_18 openParen EL closedParen action_17 then . B (13) B -> . B S @@ -2694,37 +2775,37 @@ state 159 else reduce using rule 14 (B -> .) end reduce using rule 14 (B -> .) - B shift and go to state 163 + B shift and go to state 167 -state 160 +state 164 (40) IntOrEmpty -> coma . int action_28 - int shift and go to state 164 + int shift and go to state 168 -state 161 +state 165 (20) S -> do id action_24 equals EA action_25 coma EA action_26 IntOrEmpty . then B action_29 end do - then shift and go to state 165 + then shift and go to state 169 -state 162 +state 166 (41) IntOrEmpty -> action_27 . then reduce using rule 41 (IntOrEmpty -> action_27 .) -state 163 +state 167 (37) Relif -> Relif elif action_18 openParen EL closedParen action_17 then B . (13) B -> B . S (15) S -> . Dimensional action_7 equals EA action_8 (16) S -> . id parens (17) S -> . read RDimensional - (18) S -> . print RDimOrString + (18) S -> . print RDimOrString action_35 (19) S -> . if action_16 Relif ElseOrEmpty end if action_20 (20) S -> . do id action_24 equals EA action_25 coma EA action_26 IntOrEmpty then B action_29 end do (21) S -> . do then action_21 B action_22 end do @@ -2747,16 +2828,16 @@ state 163 S shift and go to state 15 Dimensional shift and go to state 16 -state 164 +state 168 (40) IntOrEmpty -> coma int . action_28 (97) action_28 -> . then reduce using rule 97 (action_28 -> .) - action_28 shift and go to state 166 + action_28 shift and go to state 170 -state 165 +state 169 (20) S -> do id action_24 equals EA action_25 coma EA action_26 IntOrEmpty then . B action_29 end do (13) B -> . B S @@ -2771,16 +2852,16 @@ state 165 exit reduce using rule 14 (B -> .) end reduce using rule 14 (B -> .) - B shift and go to state 167 + B shift and go to state 171 -state 166 +state 170 (40) IntOrEmpty -> coma int action_28 . then reduce using rule 40 (IntOrEmpty -> coma int action_28 .) -state 167 +state 171 (20) S -> do id action_24 equals EA action_25 coma EA action_26 IntOrEmpty then B . action_29 end do (13) B -> B . S @@ -2788,7 +2869,7 @@ state 167 (15) S -> . Dimensional action_7 equals EA action_8 (16) S -> . id parens (17) S -> . read RDimensional - (18) S -> . print RDimOrString + (18) S -> . print RDimOrString action_35 (19) S -> . if action_16 Relif ElseOrEmpty end if action_20 (20) S -> . do id action_24 equals EA action_25 coma EA action_26 IntOrEmpty then B action_29 end do (21) S -> . do then action_21 B action_22 end do @@ -2806,25 +2887,25 @@ state 167 swap shift and go to state 21 exit shift and go to state 22 - action_29 shift and go to state 168 + action_29 shift and go to state 172 S shift and go to state 15 Dimensional shift and go to state 16 -state 168 +state 172 (20) S -> do id action_24 equals EA action_25 coma EA action_26 IntOrEmpty then B action_29 . end do - end shift and go to state 169 + end shift and go to state 173 -state 169 +state 173 (20) S -> do id action_24 equals EA action_25 coma EA action_26 IntOrEmpty then B action_29 end . do - do shift and go to state 170 + do shift and go to state 174 -state 170 +state 174 (20) S -> do id action_24 equals EA action_25 coma EA action_26 IntOrEmpty then B action_29 end do . @@ -2842,6 +2923,6 @@ state 170 WARNING: WARNING: Conflicts: WARNING: -WARNING: shift/reduce conflict for and in state 88 resolved as shift -WARNING: shift/reduce conflict for or in state 119 resolved as shift -WARNING: shift/reduce conflict for and in state 145 resolved as shift +WARNING: shift/reduce conflict for and in state 92 resolved as shift +WARNING: shift/reduce conflict for or in state 123 resolved as shift +WARNING: shift/reduce conflict for and in state 149 resolved as shift diff --git a/final_lang/parsetab.py b/final_lang/parsetab.py index 3ef132b..2b2ecb3 100644 --- a/final_lang/parsetab.py +++ b/final_lang/parsetab.py @@ -6,9 +6,9 @@ _tabversion = '3.10' _lr_method = 'LALR' -_lr_signature = 'and closedBra closedParen coma div do doubleColon doubleEquals elif else end equals exit id if int integer less lessEquals minus more moreEquals mul not notEquals openBra openParen or parens plus print program rea read real string subroutine swap then\n programa : program id V F B end program\n \n V : V Tipo Dim doubleColon Rid action_addSymbols action_32\n |\n \n Rid : id\n | Rid coma id\n \n Tipo : integer\n | real\n \n Dim : openBra int action_30 closedBra\n | openBra int action_30 closedBra openBra int action_31 closedBra\n |\n \n F : F subroutine id B end subroutine\n |\n \n B : B S\n |\n \n S : Dimensional action_7 equals EA action_8\n | id parens\n | read RDimensional\n | print RDimOrString\n | if action_16 Relif ElseOrEmpty end if action_20\n | do id action_24 equals EA action_25 coma EA action_26 IntOrEmpty then B action_29 end do\n | do then action_21 B action_22 end do\n | swap Dimensional coma Dimensional\n | exit action_23 \n | id openParen closedParen\n \n Dimensional : id DimensionsOrEmpty\n \n DimensionsOrEmpty : openParen EA action_setDim1 ComaEAOrEmpty closedParen\n |\n \n ComaEAOrEmpty : coma EA action_setDim2\n |\n \n RDimensional : Dimensional\n | RDimensional coma Dimensional\n \n RDimOrString : DimOrString\n | RDimOrString coma DimOrString\n \n DimOrString : Dimensional\n | string\n \n Relif : openParen EL closedParen action_17 then B\n | Relif elif action_18 openParen EL closedParen action_17 then B\n \n ElseOrEmpty : else action_19 B\n |\n \n IntOrEmpty : coma int action_28\n | action_27\n \n EA : MultDiv\n | EA SumOrSub action_3 MultDiv action_4\n \n SumOrSub : plus\n | minus\n \n MultDiv : EAParens\n | MultDiv MDSymbols action_5 EAParens action_6\n \n MDSymbols : mul\n | div\n \n EAParens : EItem\n | openParen EA closedParen\n \n EL : AND\n | EL or action_10 AND action_9\n \n AND : Equality\n | AND and action_12 Equality action_11\n \n Equality : EItem EQSymbols action_13 EItem action_14\n | openParen EL closedParen\n | not EL action_15\n \n EItem : Dimensional action_1\n | int action_2\n | rea action_2_rea\n \n EQSymbols : less\n | more\n | doubleEquals\n | notEquals\n | lessEquals\n | moreEquals\n action_addSymbols :action_1 :action_2 :action_2_rea :action_3 :action_4 :action_5 :action_6 :action_7 :action_8 :action_9 :action_10 :action_11 :action_12 :action_13 :action_14 :action_15 :action_16 :action_17 :action_18 :action_19 :action_20 :action_21 :action_22 :action_23 :action_24 :action_25 :action_26 :action_27 :action_28 :action_29 :action_30 :action_31 :action_32 :action_setDim1 :action_setDim2 :' +_lr_signature = 'and closedBra closedParen coma div do doubleColon doubleEquals elif else end equals exit id if int integer less lessEquals minus more moreEquals mul not notEquals openBra openParen or parens plus print program rea read real string subroutine swap then\n programa : program id V F B end program\n \n V : V Tipo Dim doubleColon Rid action_addSymbols action_32\n |\n \n Rid : id\n | Rid coma id\n \n Tipo : integer\n | real\n \n Dim : openBra int action_30 closedBra\n | openBra int action_30 closedBra openBra int action_31 closedBra\n |\n \n F : F subroutine id B end subroutine\n |\n \n B : B S\n |\n \n S : Dimensional action_7 equals EA action_8\n | id parens\n | read RDimensional\n | print RDimOrString action_35\n | if action_16 Relif ElseOrEmpty end if action_20\n | do id action_24 equals EA action_25 coma EA action_26 IntOrEmpty then B action_29 end do\n | do then action_21 B action_22 end do\n | swap Dimensional coma Dimensional\n | exit action_23 \n | id openParen closedParen\n \n Dimensional : id DimensionsOrEmpty\n \n DimensionsOrEmpty : openParen EA action_setDim1 ComaEAOrEmpty closedParen\n |\n \n ComaEAOrEmpty : coma EA action_setDim2\n |\n \n RDimensional : Dimensional\n | RDimensional coma Dimensional\n \n RDimOrString : DimOrString\n | RDimOrString coma DimOrString\n \n DimOrString : Dimensional action_1 action_33\n | string action_34\n \n Relif : openParen EL closedParen action_17 then B\n | Relif elif action_18 openParen EL closedParen action_17 then B\n \n ElseOrEmpty : else action_19 B\n |\n \n IntOrEmpty : coma int action_28\n | action_27\n \n EA : MultDiv\n | EA SumOrSub action_3 MultDiv action_4\n \n SumOrSub : plus\n | minus\n \n MultDiv : EAParens\n | MultDiv MDSymbols action_5 EAParens action_6\n \n MDSymbols : mul\n | div\n \n EAParens : EItem\n | openParen EA closedParen\n \n EL : AND\n | EL or action_10 AND action_9\n \n AND : Equality\n | AND and action_12 Equality action_11\n \n Equality : EItem EQSymbols action_13 EItem action_14\n | openParen EL closedParen\n | not EL action_15\n \n EItem : Dimensional action_1\n | int action_2\n | rea action_2_rea\n \n EQSymbols : less\n | more\n | doubleEquals\n | notEquals\n | lessEquals\n | moreEquals\n action_addSymbols :action_1 :action_2 :action_2_rea :action_3 :action_4 :action_5 :action_6 :action_7 :action_8 :action_9 :action_10 :action_11 :action_12 :action_13 :action_14 :action_15 :action_16 :action_17 :action_18 :action_19 :action_20 :action_21 :action_22 :action_23 :action_24 :action_25 :action_26 :action_27 :action_28 :action_29 :action_30 :action_31 :action_32 :action_33 :action_34 :action_35 :action_setDim1 :action_setDim2 :' -_lr_action_items = {'program':([0,14,],[2,29,]),'$end':([1,29,],[0,-1,]),'id':([2,3,4,5,9,10,15,17,18,20,21,22,23,24,26,27,28,31,32,33,34,35,36,37,40,42,43,44,45,47,48,50,51,52,53,54,55,56,57,58,59,61,63,64,66,67,71,72,73,74,75,76,77,78,79,80,81,82,85,86,91,92,93,94,95,96,97,99,101,102,103,104,107,110,111,112,113,114,115,116,117,118,123,125,126,127,128,129,132,133,134,140,141,142,144,148,149,152,159,163,165,167,170,],[3,-3,-12,-14,13,23,-13,33,33,39,33,-92,-14,45,-16,33,-25,-17,-30,-27,-18,-32,-34,-35,-90,-23,13,-68,-4,33,-24,-42,-46,-50,-69,-70,-71,33,33,33,33,33,-14,33,-101,97,-72,-44,-45,-74,-48,-49,-59,-60,-61,-77,-31,-33,-88,33,33,33,13,-22,-11,-2,-5,-51,33,33,33,-15,-14,-79,-81,-82,-62,-63,-64,-65,-66,-67,-26,-73,-75,-89,33,13,33,33,33,-43,-47,-19,-14,33,-21,13,-14,13,-14,13,-20,]),'integer':([3,4,44,45,66,96,97,],[-3,7,-68,-4,-101,-2,-5,]),'real':([3,4,44,45,66,96,97,],[-3,8,-68,-4,-101,-2,-5,]),'subroutine':([3,4,5,44,45,65,66,95,96,97,],[-3,-12,10,-68,-4,95,-101,-11,-2,-5,]),'end':([3,4,5,9,15,22,23,26,28,31,32,33,34,35,36,37,40,42,43,44,45,48,50,51,52,53,54,55,60,63,66,77,78,79,80,81,82,83,85,93,94,95,96,97,99,104,107,121,123,125,126,127,129,140,141,142,144,149,152,159,163,165,167,168,170,],[-3,-12,-14,14,-13,-92,-14,-16,-25,-17,-30,-27,-18,-32,-34,-35,-90,-23,65,-68,-4,-24,-42,-46,-50,-69,-70,-71,-39,-14,-101,-59,-60,-61,-77,-31,-33,105,-88,-91,-22,-11,-2,-5,-51,-15,-14,137,-26,-73,-75,-89,-38,-43,-47,-19,-14,-21,-36,-14,-37,-14,-98,169,-20,]),'read':([3,4,5,9,15,22,23,26,28,31,32,33,34,35,36,37,40,42,43,44,45,48,50,51,52,53,54,55,63,66,77,78,79,80,81,82,85,93,94,95,96,97,99,104,107,123,125,126,127,129,140,141,142,144,149,152,159,163,165,167,170,],[-3,-12,-14,17,-13,-92,-14,-16,-25,-17,-30,-27,-18,-32,-34,-35,-90,-23,17,-68,-4,-24,-42,-46,-50,-69,-70,-71,-14,-101,-59,-60,-61,-77,-31,-33,-88,17,-22,-11,-2,-5,-51,-15,-14,-26,-73,-75,-89,17,-43,-47,-19,-14,-21,17,-14,17,-14,17,-20,]),'print':([3,4,5,9,15,22,23,26,28,31,32,33,34,35,36,37,40,42,43,44,45,48,50,51,52,53,54,55,63,66,77,78,79,80,81,82,85,93,94,95,96,97,99,104,107,123,125,126,127,129,140,141,142,144,149,152,159,163,165,167,170,],[-3,-12,-14,18,-13,-92,-14,-16,-25,-17,-30,-27,-18,-32,-34,-35,-90,-23,18,-68,-4,-24,-42,-46,-50,-69,-70,-71,-14,-101,-59,-60,-61,-77,-31,-33,-88,18,-22,-11,-2,-5,-51,-15,-14,-26,-73,-75,-89,18,-43,-47,-19,-14,-21,18,-14,18,-14,18,-20,]),'if':([3,4,5,9,15,22,23,26,28,31,32,33,34,35,36,37,40,42,43,44,45,48,50,51,52,53,54,55,63,66,77,78,79,80,81,82,85,93,94,95,96,97,99,104,105,107,123,125,126,127,129,140,141,142,144,149,152,159,163,165,167,170,],[-3,-12,-14,19,-13,-92,-14,-16,-25,-17,-30,-27,-18,-32,-34,-35,-90,-23,19,-68,-4,-24,-42,-46,-50,-69,-70,-71,-14,-101,-59,-60,-61,-77,-31,-33,-88,19,-22,-11,-2,-5,-51,-15,127,-14,-26,-73,-75,-89,19,-43,-47,-19,-14,-21,19,-14,19,-14,19,-20,]),'do':([3,4,5,9,15,22,23,26,28,31,32,33,34,35,36,37,40,42,43,44,45,48,50,51,52,53,54,55,63,66,77,78,79,80,81,82,85,93,94,95,96,97,99,104,107,123,125,126,127,129,137,140,141,142,144,149,152,159,163,165,167,169,170,],[-3,-12,-14,20,-13,-92,-14,-16,-25,-17,-30,-27,-18,-32,-34,-35,-90,-23,20,-68,-4,-24,-42,-46,-50,-69,-70,-71,-14,-101,-59,-60,-61,-77,-31,-33,-88,20,-22,-11,-2,-5,-51,-15,-14,-26,-73,-75,-89,20,149,-43,-47,-19,-14,-21,20,-14,20,-14,20,170,-20,]),'swap':([3,4,5,9,15,22,23,26,28,31,32,33,34,35,36,37,40,42,43,44,45,48,50,51,52,53,54,55,63,66,77,78,79,80,81,82,85,93,94,95,96,97,99,104,107,123,125,126,127,129,140,141,142,144,149,152,159,163,165,167,170,],[-3,-12,-14,21,-13,-92,-14,-16,-25,-17,-30,-27,-18,-32,-34,-35,-90,-23,21,-68,-4,-24,-42,-46,-50,-69,-70,-71,-14,-101,-59,-60,-61,-77,-31,-33,-88,21,-22,-11,-2,-5,-51,-15,-14,-26,-73,-75,-89,21,-43,-47,-19,-14,-21,21,-14,21,-14,21,-20,]),'exit':([3,4,5,9,15,22,23,26,28,31,32,33,34,35,36,37,40,42,43,44,45,48,50,51,52,53,54,55,63,66,77,78,79,80,81,82,85,93,94,95,96,97,99,104,107,123,125,126,127,129,140,141,142,144,149,152,159,163,165,167,170,],[-3,-12,-14,22,-13,-92,-14,-16,-25,-17,-30,-27,-18,-32,-34,-35,-90,-23,22,-68,-4,-24,-42,-46,-50,-69,-70,-71,-14,-101,-59,-60,-61,-77,-31,-33,-88,22,-22,-11,-2,-5,-51,-15,-14,-26,-73,-75,-89,22,-43,-47,-19,-14,-21,22,-14,22,-14,22,-20,]),'openBra':([6,7,8,68,],[12,-6,-7,98,]),'doubleColon':([6,7,8,11,68,150,],[-10,-6,-7,24,-8,-9,]),'int':([12,27,47,56,58,61,71,72,73,74,75,76,86,91,92,98,101,102,103,110,111,112,113,114,115,116,117,118,128,132,133,134,148,160,],[25,54,54,54,54,54,-72,-44,-45,-74,-48,-49,54,54,54,122,54,54,54,-79,-81,-82,-62,-63,-64,-65,-66,-67,54,54,54,54,54,164,]),'parens':([13,],[26,]),'openParen':([13,19,27,33,38,47,56,58,61,71,72,73,74,75,76,84,86,91,92,101,102,103,106,110,111,128,132,133,148,],[27,-85,47,58,61,47,47,47,86,-72,-44,-45,-74,-48,-49,-87,86,86,47,47,47,47,128,-79,-81,86,86,86,47,]),'equals':([13,16,28,30,39,62,123,],[-27,-76,-25,56,-93,92,-26,]),'elif':([15,22,26,28,31,32,33,34,35,36,37,42,48,50,51,52,53,54,55,60,77,78,79,80,81,82,94,99,104,123,125,126,127,140,141,142,144,149,152,159,163,170,],[-13,-92,-16,-25,-17,-30,-27,-18,-32,-34,-35,-23,-24,-42,-46,-50,-69,-70,-71,84,-59,-60,-61,-77,-31,-33,-22,-51,-15,-26,-73,-75,-89,-43,-47,-19,-14,-21,-36,-14,-37,-20,]),'else':([15,22,26,28,31,32,33,34,35,36,37,42,48,50,51,52,53,54,55,60,77,78,79,80,81,82,94,99,104,123,125,126,127,140,141,142,144,149,152,159,163,170,],[-13,-92,-16,-25,-17,-30,-27,-18,-32,-34,-35,-23,-24,-42,-46,-50,-69,-70,-71,85,-59,-60,-61,-77,-31,-33,-22,-51,-15,-26,-73,-75,-89,-43,-47,-19,-14,-21,-36,-14,-37,-20,]),'string':([18,59,],[37,37,]),'then':([20,28,33,50,51,52,53,54,55,77,78,79,99,109,123,125,126,131,140,141,151,156,157,158,161,162,164,166,],[40,-25,-27,-42,-46,-50,-69,-70,-71,-59,-60,-61,-51,-86,-26,-73,-75,144,-43,-47,-86,-95,159,-96,165,-41,-97,-40,]),'closedBra':([25,46,122,138,],[-99,68,-100,150,]),'closedParen':([27,28,33,49,50,51,52,53,54,55,69,70,77,78,79,87,88,89,99,100,108,119,123,124,125,126,130,135,139,140,141,143,145,146,147,153,154,155,],[48,-25,-27,-102,-42,-46,-50,-69,-70,-71,99,-29,-59,-60,-61,109,-52,-54,-51,123,130,-84,-26,-103,-73,-75,-57,-58,-28,-43,-47,151,-78,-80,-83,-53,-55,-56,]),'rea':([27,47,56,58,61,71,72,73,74,75,76,86,91,92,101,102,103,110,111,112,113,114,115,116,117,118,128,132,133,134,148,],[55,55,55,55,55,-72,-44,-45,-74,-48,-49,55,55,55,55,55,55,-79,-81,-82,-62,-63,-64,-65,-66,-67,55,55,55,55,55,]),'coma':([28,31,32,33,34,35,36,37,41,44,45,49,50,51,52,53,54,55,70,77,78,79,81,82,97,99,120,123,125,126,136,140,141,156,158,],[-25,57,-30,-27,59,-32,-34,-35,64,67,-4,-102,-42,-46,-50,-69,-70,-71,101,-59,-60,-61,-31,-33,-5,-51,-94,-26,-73,-75,148,-43,-47,-95,160,]),'mul':([28,33,50,51,52,53,54,55,77,78,79,99,123,125,126,141,],[-25,-27,75,-46,-50,-69,-70,-71,-59,-60,-61,-51,-26,75,-75,-47,]),'div':([28,33,50,51,52,53,54,55,77,78,79,99,123,125,126,141,],[-25,-27,76,-46,-50,-69,-70,-71,-59,-60,-61,-51,-26,76,-75,-47,]),'plus':([28,33,49,50,51,52,53,54,55,69,77,78,79,80,99,120,123,124,125,126,140,141,156,],[-25,-27,72,-42,-46,-50,-69,-70,-71,72,-59,-60,-61,72,-51,72,-26,72,-73,-75,-43,-47,72,]),'minus':([28,33,49,50,51,52,53,54,55,69,77,78,79,80,99,120,123,124,125,126,140,141,156,],[-25,-27,73,-42,-46,-50,-69,-70,-71,73,-59,-60,-61,73,-51,73,-26,73,-73,-75,-43,-47,73,]),'less':([28,33,53,54,55,77,78,79,90,123,],[-25,-27,-69,-70,-71,-59,-60,-61,113,-26,]),'more':([28,33,53,54,55,77,78,79,90,123,],[-25,-27,-69,-70,-71,-59,-60,-61,114,-26,]),'doubleEquals':([28,33,53,54,55,77,78,79,90,123,],[-25,-27,-69,-70,-71,-59,-60,-61,115,-26,]),'notEquals':([28,33,53,54,55,77,78,79,90,123,],[-25,-27,-69,-70,-71,-59,-60,-61,116,-26,]),'lessEquals':([28,33,53,54,55,77,78,79,90,123,],[-25,-27,-69,-70,-71,-59,-60,-61,117,-26,]),'moreEquals':([28,33,53,54,55,77,78,79,90,123,],[-25,-27,-69,-70,-71,-59,-60,-61,118,-26,]),'and':([28,33,53,54,55,77,78,79,88,89,119,123,130,135,145,146,147,153,154,155,],[-25,-27,-69,-70,-71,-59,-60,-61,111,-54,-84,-26,-57,-58,111,-80,-83,-53,-55,-56,]),'or':([28,33,53,54,55,77,78,79,87,88,89,108,119,123,130,135,143,145,146,147,153,154,155,],[-25,-27,-69,-70,-71,-59,-60,-61,110,-52,-54,110,110,-26,-57,-58,110,-78,-80,-83,-53,-55,-56,]),'not':([61,86,91,110,111,128,132,133,],[91,91,91,-79,-81,91,91,91,]),} +_lr_action_items = {'program':([0,14,],[2,29,]),'$end':([1,29,],[0,-1,]),'id':([2,3,4,5,9,10,15,17,18,20,21,22,23,24,26,27,28,31,32,33,34,35,36,37,40,42,43,44,45,47,48,50,51,52,53,54,55,56,57,58,59,60,61,62,64,66,67,69,70,74,75,76,77,78,79,80,81,82,83,84,85,86,89,90,95,96,97,98,99,100,101,103,105,106,107,108,111,114,115,116,117,118,119,120,121,122,127,129,130,131,132,133,136,137,138,144,145,146,148,152,153,156,163,167,169,171,174,],[3,-3,-12,-14,13,23,-13,33,33,39,33,-92,-14,45,-16,33,-25,-17,-30,-27,-104,-32,-69,-103,-90,-23,13,-68,-4,33,-24,-42,-46,-50,-69,-70,-71,33,33,33,-18,33,-102,-35,33,-14,33,-101,101,-72,-44,-45,-74,-48,-49,-59,-60,-61,-77,-31,-33,-34,-88,33,33,33,13,-22,-11,-2,-5,-51,33,33,33,-15,-14,-79,-81,-82,-62,-63,-64,-65,-66,-67,-26,-73,-75,-89,33,13,33,33,33,-43,-47,-19,-14,33,-21,13,-14,13,-14,13,-20,]),'integer':([3,4,44,45,69,100,101,],[-3,7,-68,-4,-101,-2,-5,]),'real':([3,4,44,45,69,100,101,],[-3,8,-68,-4,-101,-2,-5,]),'subroutine':([3,4,5,44,45,68,69,99,100,101,],[-3,-12,10,-68,-4,99,-101,-11,-2,-5,]),'end':([3,4,5,9,15,22,23,26,28,31,32,33,34,35,36,37,40,42,43,44,45,48,50,51,52,53,54,55,59,61,62,63,66,69,80,81,82,83,84,85,86,87,89,97,98,99,100,101,103,108,111,125,127,129,130,131,133,144,145,146,148,153,156,163,167,169,171,172,174,],[-3,-12,-14,14,-13,-92,-14,-16,-25,-17,-30,-27,-104,-32,-69,-103,-90,-23,68,-68,-4,-24,-42,-46,-50,-69,-70,-71,-18,-102,-35,-39,-14,-101,-59,-60,-61,-77,-31,-33,-34,109,-88,-91,-22,-11,-2,-5,-51,-15,-14,141,-26,-73,-75,-89,-38,-43,-47,-19,-14,-21,-36,-14,-37,-14,-98,173,-20,]),'read':([3,4,5,9,15,22,23,26,28,31,32,33,34,35,36,37,40,42,43,44,45,48,50,51,52,53,54,55,59,61,62,66,69,80,81,82,83,84,85,86,89,97,98,99,100,101,103,108,111,127,129,130,131,133,144,145,146,148,153,156,163,167,169,171,174,],[-3,-12,-14,17,-13,-92,-14,-16,-25,-17,-30,-27,-104,-32,-69,-103,-90,-23,17,-68,-4,-24,-42,-46,-50,-69,-70,-71,-18,-102,-35,-14,-101,-59,-60,-61,-77,-31,-33,-34,-88,17,-22,-11,-2,-5,-51,-15,-14,-26,-73,-75,-89,17,-43,-47,-19,-14,-21,17,-14,17,-14,17,-20,]),'print':([3,4,5,9,15,22,23,26,28,31,32,33,34,35,36,37,40,42,43,44,45,48,50,51,52,53,54,55,59,61,62,66,69,80,81,82,83,84,85,86,89,97,98,99,100,101,103,108,111,127,129,130,131,133,144,145,146,148,153,156,163,167,169,171,174,],[-3,-12,-14,18,-13,-92,-14,-16,-25,-17,-30,-27,-104,-32,-69,-103,-90,-23,18,-68,-4,-24,-42,-46,-50,-69,-70,-71,-18,-102,-35,-14,-101,-59,-60,-61,-77,-31,-33,-34,-88,18,-22,-11,-2,-5,-51,-15,-14,-26,-73,-75,-89,18,-43,-47,-19,-14,-21,18,-14,18,-14,18,-20,]),'if':([3,4,5,9,15,22,23,26,28,31,32,33,34,35,36,37,40,42,43,44,45,48,50,51,52,53,54,55,59,61,62,66,69,80,81,82,83,84,85,86,89,97,98,99,100,101,103,108,109,111,127,129,130,131,133,144,145,146,148,153,156,163,167,169,171,174,],[-3,-12,-14,19,-13,-92,-14,-16,-25,-17,-30,-27,-104,-32,-69,-103,-90,-23,19,-68,-4,-24,-42,-46,-50,-69,-70,-71,-18,-102,-35,-14,-101,-59,-60,-61,-77,-31,-33,-34,-88,19,-22,-11,-2,-5,-51,-15,131,-14,-26,-73,-75,-89,19,-43,-47,-19,-14,-21,19,-14,19,-14,19,-20,]),'do':([3,4,5,9,15,22,23,26,28,31,32,33,34,35,36,37,40,42,43,44,45,48,50,51,52,53,54,55,59,61,62,66,69,80,81,82,83,84,85,86,89,97,98,99,100,101,103,108,111,127,129,130,131,133,141,144,145,146,148,153,156,163,167,169,171,173,174,],[-3,-12,-14,20,-13,-92,-14,-16,-25,-17,-30,-27,-104,-32,-69,-103,-90,-23,20,-68,-4,-24,-42,-46,-50,-69,-70,-71,-18,-102,-35,-14,-101,-59,-60,-61,-77,-31,-33,-34,-88,20,-22,-11,-2,-5,-51,-15,-14,-26,-73,-75,-89,20,153,-43,-47,-19,-14,-21,20,-14,20,-14,20,174,-20,]),'swap':([3,4,5,9,15,22,23,26,28,31,32,33,34,35,36,37,40,42,43,44,45,48,50,51,52,53,54,55,59,61,62,66,69,80,81,82,83,84,85,86,89,97,98,99,100,101,103,108,111,127,129,130,131,133,144,145,146,148,153,156,163,167,169,171,174,],[-3,-12,-14,21,-13,-92,-14,-16,-25,-17,-30,-27,-104,-32,-69,-103,-90,-23,21,-68,-4,-24,-42,-46,-50,-69,-70,-71,-18,-102,-35,-14,-101,-59,-60,-61,-77,-31,-33,-34,-88,21,-22,-11,-2,-5,-51,-15,-14,-26,-73,-75,-89,21,-43,-47,-19,-14,-21,21,-14,21,-14,21,-20,]),'exit':([3,4,5,9,15,22,23,26,28,31,32,33,34,35,36,37,40,42,43,44,45,48,50,51,52,53,54,55,59,61,62,66,69,80,81,82,83,84,85,86,89,97,98,99,100,101,103,108,111,127,129,130,131,133,144,145,146,148,153,156,163,167,169,171,174,],[-3,-12,-14,22,-13,-92,-14,-16,-25,-17,-30,-27,-104,-32,-69,-103,-90,-23,22,-68,-4,-24,-42,-46,-50,-69,-70,-71,-18,-102,-35,-14,-101,-59,-60,-61,-77,-31,-33,-34,-88,22,-22,-11,-2,-5,-51,-15,-14,-26,-73,-75,-89,22,-43,-47,-19,-14,-21,22,-14,22,-14,22,-20,]),'openBra':([6,7,8,71,],[12,-6,-7,102,]),'doubleColon':([6,7,8,11,71,154,],[-10,-6,-7,24,-8,-9,]),'int':([12,27,47,56,58,64,74,75,76,77,78,79,90,95,96,102,105,106,107,114,115,116,117,118,119,120,121,122,132,136,137,138,152,164,],[25,54,54,54,54,54,-72,-44,-45,-74,-48,-49,54,54,54,126,54,54,54,-79,-81,-82,-62,-63,-64,-65,-66,-67,54,54,54,54,54,168,]),'parens':([13,],[26,]),'openParen':([13,19,27,33,38,47,56,58,64,74,75,76,77,78,79,88,90,95,96,105,106,107,110,114,115,132,136,137,152,],[27,-85,47,58,64,47,47,47,90,-72,-44,-45,-74,-48,-49,-87,90,90,47,47,47,47,132,-79,-81,90,90,90,47,]),'equals':([13,16,28,30,39,65,127,],[-27,-76,-25,56,-93,96,-26,]),'elif':([15,22,26,28,31,32,33,34,35,36,37,42,48,50,51,52,53,54,55,59,61,62,63,80,81,82,83,84,85,86,98,103,108,127,129,130,131,144,145,146,148,153,156,163,167,174,],[-13,-92,-16,-25,-17,-30,-27,-104,-32,-69,-103,-23,-24,-42,-46,-50,-69,-70,-71,-18,-102,-35,88,-59,-60,-61,-77,-31,-33,-34,-22,-51,-15,-26,-73,-75,-89,-43,-47,-19,-14,-21,-36,-14,-37,-20,]),'else':([15,22,26,28,31,32,33,34,35,36,37,42,48,50,51,52,53,54,55,59,61,62,63,80,81,82,83,84,85,86,98,103,108,127,129,130,131,144,145,146,148,153,156,163,167,174,],[-13,-92,-16,-25,-17,-30,-27,-104,-32,-69,-103,-23,-24,-42,-46,-50,-69,-70,-71,-18,-102,-35,89,-59,-60,-61,-77,-31,-33,-34,-22,-51,-15,-26,-73,-75,-89,-43,-47,-19,-14,-21,-36,-14,-37,-20,]),'string':([18,60,],[37,37,]),'then':([20,28,33,50,51,52,53,54,55,80,81,82,103,113,127,129,130,135,144,145,155,160,161,162,165,166,168,170,],[40,-25,-27,-42,-46,-50,-69,-70,-71,-59,-60,-61,-51,-86,-26,-73,-75,148,-43,-47,-86,-95,163,-96,169,-41,-97,-40,]),'closedBra':([25,46,126,142,],[-99,71,-100,154,]),'closedParen':([27,28,33,49,50,51,52,53,54,55,72,73,80,81,82,91,92,93,103,104,112,123,127,128,129,130,134,139,143,144,145,147,149,150,151,157,158,159,],[48,-25,-27,-105,-42,-46,-50,-69,-70,-71,103,-29,-59,-60,-61,113,-52,-54,-51,127,134,-84,-26,-106,-73,-75,-57,-58,-28,-43,-47,155,-78,-80,-83,-53,-55,-56,]),'rea':([27,47,56,58,64,74,75,76,77,78,79,90,95,96,105,106,107,114,115,116,117,118,119,120,121,122,132,136,137,138,152,],[55,55,55,55,55,-72,-44,-45,-74,-48,-49,55,55,55,55,55,55,-79,-81,-82,-62,-63,-64,-65,-66,-67,55,55,55,55,55,]),'coma':([28,31,32,33,34,35,36,37,41,44,45,49,50,51,52,53,54,55,61,62,73,80,81,82,84,85,86,101,103,124,127,129,130,140,144,145,160,162,],[-25,57,-30,-27,60,-32,-69,-103,67,70,-4,-105,-42,-46,-50,-69,-70,-71,-102,-35,105,-59,-60,-61,-31,-33,-34,-5,-51,-94,-26,-73,-75,152,-43,-47,-95,164,]),'mul':([28,33,50,51,52,53,54,55,80,81,82,103,127,129,130,145,],[-25,-27,78,-46,-50,-69,-70,-71,-59,-60,-61,-51,-26,78,-75,-47,]),'div':([28,33,50,51,52,53,54,55,80,81,82,103,127,129,130,145,],[-25,-27,79,-46,-50,-69,-70,-71,-59,-60,-61,-51,-26,79,-75,-47,]),'plus':([28,33,49,50,51,52,53,54,55,72,80,81,82,83,103,124,127,128,129,130,144,145,160,],[-25,-27,75,-42,-46,-50,-69,-70,-71,75,-59,-60,-61,75,-51,75,-26,75,-73,-75,-43,-47,75,]),'minus':([28,33,49,50,51,52,53,54,55,72,80,81,82,83,103,124,127,128,129,130,144,145,160,],[-25,-27,76,-42,-46,-50,-69,-70,-71,76,-59,-60,-61,76,-51,76,-26,76,-73,-75,-43,-47,76,]),'less':([28,33,53,54,55,80,81,82,94,127,],[-25,-27,-69,-70,-71,-59,-60,-61,117,-26,]),'more':([28,33,53,54,55,80,81,82,94,127,],[-25,-27,-69,-70,-71,-59,-60,-61,118,-26,]),'doubleEquals':([28,33,53,54,55,80,81,82,94,127,],[-25,-27,-69,-70,-71,-59,-60,-61,119,-26,]),'notEquals':([28,33,53,54,55,80,81,82,94,127,],[-25,-27,-69,-70,-71,-59,-60,-61,120,-26,]),'lessEquals':([28,33,53,54,55,80,81,82,94,127,],[-25,-27,-69,-70,-71,-59,-60,-61,121,-26,]),'moreEquals':([28,33,53,54,55,80,81,82,94,127,],[-25,-27,-69,-70,-71,-59,-60,-61,122,-26,]),'and':([28,33,53,54,55,80,81,82,92,93,123,127,134,139,149,150,151,157,158,159,],[-25,-27,-69,-70,-71,-59,-60,-61,115,-54,-84,-26,-57,-58,115,-80,-83,-53,-55,-56,]),'or':([28,33,53,54,55,80,81,82,91,92,93,112,123,127,134,139,147,149,150,151,157,158,159,],[-25,-27,-69,-70,-71,-59,-60,-61,114,-52,-54,114,114,-26,-57,-58,114,-78,-80,-83,-53,-55,-56,]),'not':([64,90,95,114,115,132,136,137,],[95,95,95,-79,-81,95,95,95,]),} _lr_action = {} for _k, _v in _lr_action_items.items(): @@ -17,7 +17,7 @@ for _k, _v in _lr_action_items.items(): _lr_action[_x][_k] = _y del _lr_action_items -_lr_goto_items = {'programa':([0,],[1,]),'V':([3,],[4,]),'F':([4,],[5,]),'Tipo':([4,],[6,]),'B':([5,23,63,107,144,159,165,],[9,43,93,129,152,163,167,]),'Dim':([6,],[11,]),'S':([9,43,93,129,152,163,167,],[15,15,15,15,15,15,15,]),'Dimensional':([9,17,18,21,27,43,47,56,57,58,59,61,64,86,91,92,93,101,102,103,128,129,132,133,134,148,152,163,167,],[16,32,36,41,53,16,53,53,81,53,36,53,94,53,53,53,16,53,53,53,53,16,53,53,53,53,16,16,16,]),'DimensionsOrEmpty':([13,33,],[28,28,]),'action_7':([16,],[30,]),'RDimensional':([17,],[31,]),'RDimOrString':([18,],[34,]),'DimOrString':([18,59,],[35,82,]),'action_16':([19,],[38,]),'action_23':([22,],[42,]),'Rid':([24,],[44,]),'action_30':([25,],[46,]),'EA':([27,47,56,58,92,101,148,],[49,69,80,49,120,124,156,]),'MultDiv':([27,47,56,58,92,101,102,148,],[50,50,50,50,50,50,125,50,]),'EAParens':([27,47,56,58,92,101,102,103,148,],[51,51,51,51,51,51,51,126,51,]),'EItem':([27,47,56,58,61,86,91,92,101,102,103,128,132,133,134,148,],[52,52,52,52,90,90,90,52,52,52,52,90,90,90,147,52,]),'Relif':([38,],[60,]),'action_24':([39,],[62,]),'action_21':([40,],[63,]),'action_addSymbols':([44,],[66,]),'action_setDim1':([49,],[70,]),'SumOrSub':([49,69,80,120,124,156,],[71,71,71,71,71,71,]),'MDSymbols':([50,125,],[74,74,]),'action_1':([53,],[77,]),'action_2':([54,],[78,]),'action_2_rea':([55,],[79,]),'ElseOrEmpty':([60,],[83,]),'EL':([61,86,91,128,],[87,108,119,143,]),'AND':([61,86,91,128,132,],[88,88,88,88,145,]),'Equality':([61,86,91,128,132,133,],[89,89,89,89,89,146,]),'action_32':([66,],[96,]),'ComaEAOrEmpty':([70,],[100,]),'action_3':([71,],[102,]),'action_5':([74,],[103,]),'action_8':([80,],[104,]),'action_18':([84,],[106,]),'action_19':([85,],[107,]),'EQSymbols':([90,],[112,]),'action_22':([93,],[121,]),'action_17':([109,151,],[131,157,]),'action_10':([110,],[132,]),'action_12':([111,],[133,]),'action_13':([112,],[134,]),'action_15':([119,],[135,]),'action_25':([120,],[136,]),'action_31':([122,],[138,]),'action_setDim2':([124,],[139,]),'action_4':([125,],[140,]),'action_6':([126,],[141,]),'action_20':([127,],[142,]),'action_9':([145,],[153,]),'action_11':([146,],[154,]),'action_14':([147,],[155,]),'action_26':([156,],[158,]),'IntOrEmpty':([158,],[161,]),'action_27':([158,],[162,]),'action_28':([164,],[166,]),'action_29':([167,],[168,]),} +_lr_goto_items = {'programa':([0,],[1,]),'V':([3,],[4,]),'F':([4,],[5,]),'Tipo':([4,],[6,]),'B':([5,23,66,111,148,163,169,],[9,43,97,133,156,167,171,]),'Dim':([6,],[11,]),'S':([9,43,97,133,156,167,171,],[15,15,15,15,15,15,15,]),'Dimensional':([9,17,18,21,27,43,47,56,57,58,60,64,67,90,95,96,97,105,106,107,132,133,136,137,138,152,156,167,171,],[16,32,36,41,53,16,53,53,84,53,36,53,98,53,53,53,16,53,53,53,53,16,53,53,53,53,16,16,16,]),'DimensionsOrEmpty':([13,33,],[28,28,]),'action_7':([16,],[30,]),'RDimensional':([17,],[31,]),'RDimOrString':([18,],[34,]),'DimOrString':([18,60,],[35,85,]),'action_16':([19,],[38,]),'action_23':([22,],[42,]),'Rid':([24,],[44,]),'action_30':([25,],[46,]),'EA':([27,47,56,58,96,105,152,],[49,72,83,49,124,128,160,]),'MultDiv':([27,47,56,58,96,105,106,152,],[50,50,50,50,50,50,129,50,]),'EAParens':([27,47,56,58,96,105,106,107,152,],[51,51,51,51,51,51,51,130,51,]),'EItem':([27,47,56,58,64,90,95,96,105,106,107,132,136,137,138,152,],[52,52,52,52,94,94,94,52,52,52,52,94,94,94,151,52,]),'action_35':([34,],[59,]),'action_1':([36,53,],[61,80,]),'action_34':([37,],[62,]),'Relif':([38,],[63,]),'action_24':([39,],[65,]),'action_21':([40,],[66,]),'action_addSymbols':([44,],[69,]),'action_setDim1':([49,],[73,]),'SumOrSub':([49,72,83,124,128,160,],[74,74,74,74,74,74,]),'MDSymbols':([50,129,],[77,77,]),'action_2':([54,],[81,]),'action_2_rea':([55,],[82,]),'action_33':([61,],[86,]),'ElseOrEmpty':([63,],[87,]),'EL':([64,90,95,132,],[91,112,123,147,]),'AND':([64,90,95,132,136,],[92,92,92,92,149,]),'Equality':([64,90,95,132,136,137,],[93,93,93,93,93,150,]),'action_32':([69,],[100,]),'ComaEAOrEmpty':([73,],[104,]),'action_3':([74,],[106,]),'action_5':([77,],[107,]),'action_8':([83,],[108,]),'action_18':([88,],[110,]),'action_19':([89,],[111,]),'EQSymbols':([94,],[116,]),'action_22':([97,],[125,]),'action_17':([113,155,],[135,161,]),'action_10':([114,],[136,]),'action_12':([115,],[137,]),'action_13':([116,],[138,]),'action_15':([123,],[139,]),'action_25':([124,],[140,]),'action_31':([126,],[142,]),'action_setDim2':([128,],[143,]),'action_4':([129,],[144,]),'action_6':([130,],[145,]),'action_20':([131,],[146,]),'action_9':([149,],[157,]),'action_11':([150,],[158,]),'action_14':([151,],[159,]),'action_26':([160,],[162,]),'IntOrEmpty':([162,],[165,]),'action_27':([162,],[166,]),'action_28':([168,],[170,]),'action_29':([171,],[172,]),} _lr_goto = {} for _k, _v in _lr_goto_items.items(): @@ -27,107 +27,110 @@ for _k, _v in _lr_goto_items.items(): del _lr_goto_items _lr_productions = [ ("S' -> programa","S'",1,None,None,None), - ('programa -> program id V F B end program','programa',7,'p_programa','fort.py',214), - ('V -> V Tipo Dim doubleColon Rid action_addSymbols action_32','V',7,'p_V','fort.py',221), - ('V -> ','V',0,'p_V','fort.py',222), - ('Rid -> id','Rid',1,'p_Rid','fort.py',228), - ('Rid -> Rid coma id','Rid',3,'p_Rid','fort.py',229), - ('Tipo -> integer','Tipo',1,'p_Tipo','fort.py',241), - ('Tipo -> real','Tipo',1,'p_Tipo','fort.py',242), - ('Dim -> openBra int action_30 closedBra','Dim',4,'p_Dim','fort.py',250), - ('Dim -> openBra int action_30 closedBra openBra int action_31 closedBra','Dim',8,'p_Dim','fort.py',251), - ('Dim -> ','Dim',0,'p_Dim','fort.py',252), - ('F -> F subroutine id B end subroutine','F',6,'p_F','fort.py',258), - ('F -> ','F',0,'p_F','fort.py',259), - ('B -> B S','B',2,'p_B','fort.py',265), - ('B -> ','B',0,'p_B','fort.py',266), - ('S -> Dimensional action_7 equals EA action_8','S',5,'p_S','fort.py',272), - ('S -> id parens','S',2,'p_S','fort.py',273), - ('S -> read RDimensional','S',2,'p_S','fort.py',274), - ('S -> print RDimOrString','S',2,'p_S','fort.py',275), - ('S -> if action_16 Relif ElseOrEmpty end if action_20','S',7,'p_S','fort.py',276), - ('S -> do id action_24 equals EA action_25 coma EA action_26 IntOrEmpty then B action_29 end do','S',15,'p_S','fort.py',277), - ('S -> do then action_21 B action_22 end do','S',7,'p_S','fort.py',278), - ('S -> swap Dimensional coma Dimensional','S',4,'p_S','fort.py',279), - ('S -> exit action_23','S',2,'p_S','fort.py',280), - ('S -> id openParen closedParen','S',3,'p_S','fort.py',281), - ('Dimensional -> id DimensionsOrEmpty','Dimensional',2,'p_Dimensional','fort.py',289), - ('DimensionsOrEmpty -> openParen EA action_setDim1 ComaEAOrEmpty closedParen','DimensionsOrEmpty',5,'p_DimensionsOrEmpty','fort.py',296), - ('DimensionsOrEmpty -> ','DimensionsOrEmpty',0,'p_DimensionsOrEmpty','fort.py',297), - ('ComaEAOrEmpty -> coma EA action_setDim2','ComaEAOrEmpty',3,'p_ComaEAOrEmpty','fort.py',303), - ('ComaEAOrEmpty -> ','ComaEAOrEmpty',0,'p_ComaEAOrEmpty','fort.py',304), - ('RDimensional -> Dimensional','RDimensional',1,'p_RDimensional','fort.py',310), - ('RDimensional -> RDimensional coma Dimensional','RDimensional',3,'p_RDimensional','fort.py',311), - ('RDimOrString -> DimOrString','RDimOrString',1,'p_RDimOrString','fort.py',317), - ('RDimOrString -> RDimOrString coma DimOrString','RDimOrString',3,'p_RDimOrString','fort.py',318), - ('DimOrString -> Dimensional','DimOrString',1,'p_DimOrString','fort.py',324), - ('DimOrString -> string','DimOrString',1,'p_DimOrString','fort.py',325), - ('Relif -> openParen EL closedParen action_17 then B','Relif',6,'p_Relif','fort.py',331), - ('Relif -> Relif elif action_18 openParen EL closedParen action_17 then B','Relif',9,'p_Relif','fort.py',332), - ('ElseOrEmpty -> else action_19 B','ElseOrEmpty',3,'p_ElseOrEmpty','fort.py',338), - ('ElseOrEmpty -> ','ElseOrEmpty',0,'p_ElseOrEmpty','fort.py',339), - ('IntOrEmpty -> coma int action_28','IntOrEmpty',3,'p_IntOrEmpty','fort.py',345), - ('IntOrEmpty -> action_27','IntOrEmpty',1,'p_IntOrEmpty','fort.py',346), - ('EA -> MultDiv','EA',1,'p_EA','fort.py',352), - ('EA -> EA SumOrSub action_3 MultDiv action_4','EA',5,'p_EA','fort.py',353), - ('SumOrSub -> plus','SumOrSub',1,'p_SumOrSub','fort.py',359), - ('SumOrSub -> minus','SumOrSub',1,'p_SumOrSub','fort.py',360), - ('MultDiv -> EAParens','MultDiv',1,'p_MultDiv','fort.py',367), - ('MultDiv -> MultDiv MDSymbols action_5 EAParens action_6','MultDiv',5,'p_MultDiv','fort.py',368), - ('MDSymbols -> mul','MDSymbols',1,'p_MDSymbols','fort.py',374), - ('MDSymbols -> div','MDSymbols',1,'p_MDSymbols','fort.py',375), - ('EAParens -> EItem','EAParens',1,'p_EAParens','fort.py',382), - ('EAParens -> openParen EA closedParen','EAParens',3,'p_EAParens','fort.py',383), - ('EL -> AND','EL',1,'p_EL','fort.py',389), - ('EL -> EL or action_10 AND action_9','EL',5,'p_EL','fort.py',390), - ('AND -> Equality','AND',1,'p_AND','fort.py',396), - ('AND -> AND and action_12 Equality action_11','AND',5,'p_AND','fort.py',397), - ('Equality -> EItem EQSymbols action_13 EItem action_14','Equality',5,'p_Equality','fort.py',403), - ('Equality -> openParen EL closedParen','Equality',3,'p_Equality','fort.py',404), - ('Equality -> not EL action_15','Equality',3,'p_Equality','fort.py',405), - ('EItem -> Dimensional action_1','EItem',2,'p_EItem','fort.py',411), - ('EItem -> int action_2','EItem',2,'p_EItem','fort.py',412), - ('EItem -> rea action_2_rea','EItem',2,'p_EItem','fort.py',413), - ('EQSymbols -> less','EQSymbols',1,'p_EQSymbols','fort.py',419), - ('EQSymbols -> more','EQSymbols',1,'p_EQSymbols','fort.py',420), - ('EQSymbols -> doubleEquals','EQSymbols',1,'p_EQSymbols','fort.py',421), - ('EQSymbols -> notEquals','EQSymbols',1,'p_EQSymbols','fort.py',422), - ('EQSymbols -> lessEquals','EQSymbols',1,'p_EQSymbols','fort.py',423), - ('EQSymbols -> moreEquals','EQSymbols',1,'p_EQSymbols','fort.py',424), - ('action_addSymbols -> ','action_addSymbols',0,'p_action_addSymbols','fort.py',433), - ('action_1 -> ','action_1',0,'p_action_1','fort.py',439), - ('action_2 -> ','action_2',0,'p_action_2','fort.py',459), - ('action_2_rea -> ','action_2_rea',0,'p_action_2_rea','fort.py',465), - ('action_3 -> ','action_3',0,'p_action_3','fort.py',471), - ('action_4 -> ','action_4',0,'p_action_4','fort.py',476), - ('action_5 -> ','action_5',0,'p_action_5','fort.py',499), - ('action_6 -> ','action_6',0,'p_action_6','fort.py',504), - ('action_7 -> ','action_7',0,'p_action_7','fort.py',527), - ('action_8 -> ','action_8',0,'p_action_8','fort.py',547), - ('action_9 -> ','action_9',0,'p_action_9','fort.py',565), - ('action_10 -> ','action_10',0,'p_action_10','fort.py',588), - ('action_11 -> ','action_11',0,'p_action_11','fort.py',593), - ('action_12 -> ','action_12',0,'p_action_12','fort.py',616), - ('action_13 -> ','action_13',0,'p_action_13','fort.py',621), - ('action_14 -> ','action_14',0,'p_action_14','fort.py',626), - ('action_15 -> ','action_15',0,'p_action_15','fort.py',649), - ('action_16 -> ','action_16',0,'p_action_16','fort.py',659), - ('action_17 -> ','action_17',0,'p_action_17','fort.py',664), - ('action_18 -> ','action_18',0,'p_action_18','fort.py',680), - ('action_19 -> ','action_19',0,'p_action_19','fort.py',690), - ('action_20 -> ','action_20',0,'p_action_20','fort.py',700), - ('action_21 -> ','action_21',0,'p_action_21','fort.py',708), - ('action_22 -> ','action_22',0,'p_action_22','fort.py',714), - ('action_23 -> ','action_23',0,'p_action_23','fort.py',727), - ('action_24 -> ','action_24',0,'p_action_24','fort.py',736), - ('action_25 -> ','action_25',0,'p_action_25','fort.py',750), - ('action_26 -> ','action_26',0,'p_action_26','fort.py',768), - ('action_27 -> ','action_27',0,'p_action_27','fort.py',794), - ('action_28 -> ','action_28',0,'p_action_28','fort.py',800), - ('action_29 -> ','action_29',0,'p_action_29','fort.py',806), - ('action_30 -> ','action_30',0,'p_action_30','fort.py',829), - ('action_31 -> ','action_31',0,'p_action_31','fort.py',837), - ('action_32 -> ','action_32',0,'p_action_32','fort.py',844), - ('action_setDim1 -> ','action_setDim1',0,'p_action_setDim1','fort.py',854), - ('action_setDim2 -> ','action_setDim2',0,'p_action_setDim2','fort.py',865), + ('programa -> program id V F B end program','programa',7,'p_programa','fort.py',224), + ('V -> V Tipo Dim doubleColon Rid action_addSymbols action_32','V',7,'p_V','fort.py',231), + ('V -> ','V',0,'p_V','fort.py',232), + ('Rid -> id','Rid',1,'p_Rid','fort.py',238), + ('Rid -> Rid coma id','Rid',3,'p_Rid','fort.py',239), + ('Tipo -> integer','Tipo',1,'p_Tipo','fort.py',251), + ('Tipo -> real','Tipo',1,'p_Tipo','fort.py',252), + ('Dim -> openBra int action_30 closedBra','Dim',4,'p_Dim','fort.py',260), + ('Dim -> openBra int action_30 closedBra openBra int action_31 closedBra','Dim',8,'p_Dim','fort.py',261), + ('Dim -> ','Dim',0,'p_Dim','fort.py',262), + ('F -> F subroutine id B end subroutine','F',6,'p_F','fort.py',268), + ('F -> ','F',0,'p_F','fort.py',269), + ('B -> B S','B',2,'p_B','fort.py',275), + ('B -> ','B',0,'p_B','fort.py',276), + ('S -> Dimensional action_7 equals EA action_8','S',5,'p_S','fort.py',281), + ('S -> id parens','S',2,'p_S','fort.py',282), + ('S -> read RDimensional','S',2,'p_S','fort.py',283), + ('S -> print RDimOrString action_35','S',3,'p_S','fort.py',284), + ('S -> if action_16 Relif ElseOrEmpty end if action_20','S',7,'p_S','fort.py',285), + ('S -> do id action_24 equals EA action_25 coma EA action_26 IntOrEmpty then B action_29 end do','S',15,'p_S','fort.py',286), + ('S -> do then action_21 B action_22 end do','S',7,'p_S','fort.py',287), + ('S -> swap Dimensional coma Dimensional','S',4,'p_S','fort.py',288), + ('S -> exit action_23','S',2,'p_S','fort.py',289), + ('S -> id openParen closedParen','S',3,'p_S','fort.py',290), + ('Dimensional -> id DimensionsOrEmpty','Dimensional',2,'p_Dimensional','fort.py',298), + ('DimensionsOrEmpty -> openParen EA action_setDim1 ComaEAOrEmpty closedParen','DimensionsOrEmpty',5,'p_DimensionsOrEmpty','fort.py',305), + ('DimensionsOrEmpty -> ','DimensionsOrEmpty',0,'p_DimensionsOrEmpty','fort.py',306), + ('ComaEAOrEmpty -> coma EA action_setDim2','ComaEAOrEmpty',3,'p_ComaEAOrEmpty','fort.py',312), + ('ComaEAOrEmpty -> ','ComaEAOrEmpty',0,'p_ComaEAOrEmpty','fort.py',313), + ('RDimensional -> Dimensional','RDimensional',1,'p_RDimensional','fort.py',319), + ('RDimensional -> RDimensional coma Dimensional','RDimensional',3,'p_RDimensional','fort.py',320), + ('RDimOrString -> DimOrString','RDimOrString',1,'p_RDimOrString','fort.py',326), + ('RDimOrString -> RDimOrString coma DimOrString','RDimOrString',3,'p_RDimOrString','fort.py',327), + ('DimOrString -> Dimensional action_1 action_33','DimOrString',3,'p_DimOrString','fort.py',333), + ('DimOrString -> string action_34','DimOrString',2,'p_DimOrString','fort.py',334), + ('Relif -> openParen EL closedParen action_17 then B','Relif',6,'p_Relif','fort.py',340), + ('Relif -> Relif elif action_18 openParen EL closedParen action_17 then B','Relif',9,'p_Relif','fort.py',341), + ('ElseOrEmpty -> else action_19 B','ElseOrEmpty',3,'p_ElseOrEmpty','fort.py',347), + ('ElseOrEmpty -> ','ElseOrEmpty',0,'p_ElseOrEmpty','fort.py',348), + ('IntOrEmpty -> coma int action_28','IntOrEmpty',3,'p_IntOrEmpty','fort.py',354), + ('IntOrEmpty -> action_27','IntOrEmpty',1,'p_IntOrEmpty','fort.py',355), + ('EA -> MultDiv','EA',1,'p_EA','fort.py',361), + ('EA -> EA SumOrSub action_3 MultDiv action_4','EA',5,'p_EA','fort.py',362), + ('SumOrSub -> plus','SumOrSub',1,'p_SumOrSub','fort.py',368), + ('SumOrSub -> minus','SumOrSub',1,'p_SumOrSub','fort.py',369), + ('MultDiv -> EAParens','MultDiv',1,'p_MultDiv','fort.py',376), + ('MultDiv -> MultDiv MDSymbols action_5 EAParens action_6','MultDiv',5,'p_MultDiv','fort.py',377), + ('MDSymbols -> mul','MDSymbols',1,'p_MDSymbols','fort.py',383), + ('MDSymbols -> div','MDSymbols',1,'p_MDSymbols','fort.py',384), + ('EAParens -> EItem','EAParens',1,'p_EAParens','fort.py',391), + ('EAParens -> openParen EA closedParen','EAParens',3,'p_EAParens','fort.py',392), + ('EL -> AND','EL',1,'p_EL','fort.py',398), + ('EL -> EL or action_10 AND action_9','EL',5,'p_EL','fort.py',399), + ('AND -> Equality','AND',1,'p_AND','fort.py',405), + ('AND -> AND and action_12 Equality action_11','AND',5,'p_AND','fort.py',406), + ('Equality -> EItem EQSymbols action_13 EItem action_14','Equality',5,'p_Equality','fort.py',412), + ('Equality -> openParen EL closedParen','Equality',3,'p_Equality','fort.py',413), + ('Equality -> not EL action_15','Equality',3,'p_Equality','fort.py',414), + ('EItem -> Dimensional action_1','EItem',2,'p_EItem','fort.py',420), + ('EItem -> int action_2','EItem',2,'p_EItem','fort.py',421), + ('EItem -> rea action_2_rea','EItem',2,'p_EItem','fort.py',422), + ('EQSymbols -> less','EQSymbols',1,'p_EQSymbols','fort.py',428), + ('EQSymbols -> more','EQSymbols',1,'p_EQSymbols','fort.py',429), + ('EQSymbols -> doubleEquals','EQSymbols',1,'p_EQSymbols','fort.py',430), + ('EQSymbols -> notEquals','EQSymbols',1,'p_EQSymbols','fort.py',431), + ('EQSymbols -> lessEquals','EQSymbols',1,'p_EQSymbols','fort.py',432), + ('EQSymbols -> moreEquals','EQSymbols',1,'p_EQSymbols','fort.py',433), + ('action_addSymbols -> ','action_addSymbols',0,'p_action_addSymbols','fort.py',442), + ('action_1 -> ','action_1',0,'p_action_1','fort.py',453), + ('action_2 -> ','action_2',0,'p_action_2','fort.py',496), + ('action_2_rea -> ','action_2_rea',0,'p_action_2_rea','fort.py',502), + ('action_3 -> ','action_3',0,'p_action_3','fort.py',508), + ('action_4 -> ','action_4',0,'p_action_4','fort.py',513), + ('action_5 -> ','action_5',0,'p_action_5','fort.py',536), + ('action_6 -> ','action_6',0,'p_action_6','fort.py',541), + ('action_7 -> ','action_7',0,'p_action_7','fort.py',564), + ('action_8 -> ','action_8',0,'p_action_8','fort.py',607), + ('action_9 -> ','action_9',0,'p_action_9','fort.py',625), + ('action_10 -> ','action_10',0,'p_action_10','fort.py',648), + ('action_11 -> ','action_11',0,'p_action_11','fort.py',653), + ('action_12 -> ','action_12',0,'p_action_12','fort.py',676), + ('action_13 -> ','action_13',0,'p_action_13','fort.py',681), + ('action_14 -> ','action_14',0,'p_action_14','fort.py',686), + ('action_15 -> ','action_15',0,'p_action_15','fort.py',709), + ('action_16 -> ','action_16',0,'p_action_16','fort.py',724), + ('action_17 -> ','action_17',0,'p_action_17','fort.py',729), + ('action_18 -> ','action_18',0,'p_action_18','fort.py',745), + ('action_19 -> ','action_19',0,'p_action_19','fort.py',755), + ('action_20 -> ','action_20',0,'p_action_20','fort.py',765), + ('action_21 -> ','action_21',0,'p_action_21','fort.py',773), + ('action_22 -> ','action_22',0,'p_action_22','fort.py',779), + ('action_23 -> ','action_23',0,'p_action_23','fort.py',792), + ('action_24 -> ','action_24',0,'p_action_24','fort.py',801), + ('action_25 -> ','action_25',0,'p_action_25','fort.py',815), + ('action_26 -> ','action_26',0,'p_action_26','fort.py',833), + ('action_27 -> ','action_27',0,'p_action_27','fort.py',859), + ('action_28 -> ','action_28',0,'p_action_28','fort.py',865), + ('action_29 -> ','action_29',0,'p_action_29','fort.py',871), + ('action_30 -> ','action_30',0,'p_action_30','fort.py',894), + ('action_31 -> ','action_31',0,'p_action_31','fort.py',902), + ('action_32 -> ','action_32',0,'p_action_32','fort.py',909), + ('action_33 -> ','action_33',0,'p_action_33','fort.py',918), + ('action_34 -> ','action_34',0,'p_action_34','fort.py',927), + ('action_35 -> ','action_35',0,'p_action_35','fort.py',935), + ('action_setDim1 -> ','action_setDim1',0,'p_action_setDim1','fort.py',942), + ('action_setDim2 -> ','action_setDim2',0,'p_action_setDim2','fort.py',954), ] diff --git a/final_lang/test3.fort b/final_lang/test3.fort index 6627aab..82692cb 100644 --- a/final_lang/test3.fort +++ b/final_lang/test3.fort @@ -1,6 +1,6 @@ program test -integer :: b -if (.not. 2 > 3 .or. 5 < 4) then - b = 2 -end if +integer [10] :: a, b +integer :: c +print a(3), ' ', b(0), ' ', c, ' hello' +c = 2 end program \ No newline at end of file diff --git a/final_lang/test3.fort.out b/final_lang/test3.fort.out index 1aa974f..67a77c6 100644 --- a/final_lang/test3.fort.out +++ b/final_lang/test3.fort.out @@ -1,6 +1,8 @@ -> 2 3 $0 -< 5 4 $1 -.or. $0 $1 $2 -.not. $2 $0 -gotoF $0 7 -= 2 $50 +print $53 +print ' ' +print $61 +print ' ' +print $72 +print ' hello' +print "\n" += 2 $72