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