1 0 $accept : declaration $end 2 3 1 $$1 : 4 5 2 $$2 : 6 7 3 declaration : class type $$1 $$2 namelist 8 4 | type locnamelist 9 10 5 class : GLOBAL 11 6 | LOCAL 12 13 7 type : REAL 14 8 | INTEGER 15 16 9 namelist : namelist NAME 17 10 | NAME 18 19 11 locnamelist : namelist 20 22 state 0 23 $accept : . declaration $end (0) 24 25 GLOBAL shift 1 26 LOCAL shift 2 27 REAL shift 3 28 INTEGER shift 4 29 . error 30 31 declaration goto 5 32 class goto 6 33 type goto 7 34 35 36 state 1 37 class : GLOBAL . (5) 38 39 . reduce 5 40 41 42 state 2 43 class : LOCAL . (6) 44 45 . reduce 6 46 47 48 state 3 49 type : REAL . (7) 50 51 . reduce 7 52 53 54 state 4 55 type : INTEGER . (8) 56 57 . reduce 8 58 59 60 state 5 61 $accept : declaration . $end (0) 62 63 $end accept 64 65 66 state 6 67 declaration : class . type $$1 $$2 namelist (3) 68 69 REAL shift 3 70 INTEGER shift 4 71 . error 72 73 type goto 8 74 75 76 state 7 77 declaration : type . locnamelist (4) 78 79 NAME shift 9 80 . error 81 82 namelist goto 10 83 locnamelist goto 11 84 85 86 state 8 87 declaration : class type . $$1 $$2 namelist (3) 88 $$1 : . (1) 89 90 . reduce 1 91 92 $$1 goto 12 93 94 95 state 9 96 namelist : NAME . (10) 97 98 . reduce 10 99 100 101 state 10 102 namelist : namelist . NAME (9) 103 locnamelist : namelist . (11) 104 105 NAME shift 13 106 $end reduce 11 107 108 109 state 11 110 declaration : type locnamelist . (4) 111 112 . reduce 4 113 114 115 state 12 116 declaration : class type $$1 . $$2 namelist (3) 117 $$2 : . (2) 118 119 . reduce 2 120 121 $$2 goto 14 122 123 124 state 13 125 namelist : namelist NAME . (9) 126 127 . reduce 9 128 129 130 state 14 131 declaration : class type $$1 $$2 . namelist (3) 132 133 NAME shift 9 134 . error 135 136 namelist goto 15 137 138 139 state 15 140 declaration : class type $$1 $$2 namelist . (3) 141 namelist : namelist . NAME (9) 142 143 NAME shift 13 144 $end reduce 3 145 146 147 7 terminals, 8 nonterminals 148 12 grammar rules, 16 states 149 150 grammar parser grammar 151 symbol# value# symbol 152 0 0 $end 153 1 256 error 154 2 257 GLOBAL 155 3 258 LOCAL 156 4 259 REAL 157 5 260 INTEGER 158 6 261 NAME 159 7 262 $accept 160 8 263 declaration 161 9 264 namelist 162 10 265 locnamelist 163 11 266 class 164 12 267 type 165 13 268 $$1 166 14 269 $$2 167