#if 0 "level2" 0 0 0 0undef action performed can't backup scanner in line no. 4818 can't backup scanner in line no. 4818 can't backup scanner in line no. 4818 can't backup scanner in line no. 4818 can't backup scanner in line no. 4818 can't backup scanner in line no. 4818 can't backup scanner in line no. 4818 can't backup scanner in line no. 4818 can't backup scanner in line no. 4818 can't backup scanner in line no. 4818 can't backup scanner in line no. 4818 can't backup scanner in line no. 4818 can't backup scanner in line no. 4818 can't backup scanner in line no. 4818 can't backup scanner in line no. 4818 can't backup scanner in line no. 4818 can't backup scanner in line no. 4818 can't backup scanner in line no. 4818 can't backup scanner in line no. 4818 legal at line number: 4818 string literals used: 287, total string space used: 4886 symbols used: 213, total string space used: 2322 peak parser stack depth: 159 #endif #if 0 #define deftest1 int c(){a=b;a=b+c;a=b+c+d;a=b*c+d*e;condtest=a?b+c:d*e;} int b; /*/*/*deftest1: int c(){a=b;a=b+c;a=b+c+d;a=b*c+d*e;condtest=a?b+c:d*e;}*/*/*/ deftest1 /*/*/*int c(){a=b;a=b+c;a=b+c+d;a=b*c+d*e;condtest=a?b+c:d*e;}*/*/*/ int c(){a=b;a=b+c;a=b+c+d;a=b*c+d*e;condtest=a?b+c:d*e;} #define deftest2 deftest2 int a; /*/*/* int c(){ a = function_parameter_test( 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,1,0,45,0,21,3,0,5,6,7,8,9,10,0,11, 0,0,0,0,0,0,0,0,0,0,4,12,13,14,15,2, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,16,0,17,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,18,19,20,0,0 ); } */*/*/ int c(){ a = function_parameter_test( 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,1,0,45,0,21,3,0,5,6,7,8,9,10,0,11, 0,0,0,0,0,0,0,0,0,0,4,12,13,14,15,2, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,16,0,17,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,18,19,20,0,0 ); } /*/*/* end function_parameter_test */*/*/ int testfun(){ #ifndef a40=b*0+d*4; #ifndef a41=b*1+d*4; #endif a42=b*2+d*4; #endif #ifndef a50=b*0+d*5; #ifdef a51=b*1+d*5; #endif a52=b*2+d*5; #endif #ifdef a60=b*0+d*6; #ifndef a61=b*1+d*6; #endif a62=b*2+d*6; #endif #ifdef a70=b*0+d*7; #ifdef a71=b*1+d*7; #endif a72=b*2+d*7; #endif #ifndef xxx a=b*0+d*0; #ifndef xyz a=b*1+d*0; #endif a=b*2+d*0; #endif #ifndef xxx a=b*0+d*1; #ifdef xyz a=b*1+d*1; #endif a=b*2+d*1; #endif #ifdef xxx a=b*0+d*2; #ifndef xyz a=b*1+d*2; #endif a=b*2+d*2; #endif #ifdef xxx a=b*0+d*3; #ifdef xyz a=b*1+d*3; #endif a=b*2+d*3; #endif #ifndef xxx a=b*0+d*1; #ifdef xyz /* #endif */ /*#endif*/ a=b*1+d*1; #endif a=b*2+d*1; #endif #ifndef xxx a=b*0+d*1; #ifdef xyz str = "#endif"; a=b*1+d*1; #endif a=b*2+d*1; #endif } /*/*/* start of nested define test */*/*/ #define level1 #define level2 int testx(){a=b;a=b+c;a=b+c+d;a=b*c+d*e;condtest=a?b+c:d*e;} level1 level2 /* int level2; */ #undef level2 int level2; /*/*/* end of nested define test */*/*/ /* #endif */ /* EMPTY,# -1,~ ~ EXHAUSTED,# -2,~ ~~ */ #define EMPTY (-1) #define EXHAUSTED (-2) #define NONTERMINAL (1024) /*/*/* start of nested include test */*/*/ #include "cxparsetabtest.h" int testx1(){a=CONSTANT1*CONSTANT2+CONSTANT3*CONSTANT4;} /*/*/* end of nested include test */*/*/ /* ctestcase for parser/codegenerator testing */ /* c-.c adapted to generate its parser tables*/ /* #define gcc 1 #if gcc #include #include #else #include "..\include\time.h" #include "..\include\stdio.h" #endif */ #define CONST 28 #define STRING 29 #define IDENT 30 #define LINK (sizeof(token_map)/sizeof(intx /*char**/) + 2) int testprint=3; int ch = 0; int ch_look_ahead = 0; int identifier_length_limit = 128; int scanned_identifier_length; int scanned_identifier[129]; int scanned_identifier_index; int scanned_string_limit = 1000; int scanned_string_length; int scanned_string[1001]; int scanned_string_index; int scanned_constant_value; int line_no; int testfun1(){ch = LINK;} /* 1 initial identifier A-Z a-z _ $ 2 internal indentifier A-Z a-z _ $ 0-9 4 whitespace space tab cr lf vt ff 8 operator ! " % ' ( ) * + , - / ; : < = > [ ] { | } # $ 16 number 0-9 32 hex number A-F a-f 0-9 64 escape */ int character_type_map[128] = { 0,0,0,0,0,0,0,0,0,4,4,4,4,4,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 4,8,8,8,3,8,8,8,8,8,8,8,8,8,0,8, 50,50,50,50,50,50,50,50,50,50,8,8,8,8,8,8, 0,35,35,35,35,35,35,3,3,3,3,3,3,3,3,3, 3,3,3,3,3,3,3,3,3,3,3,8,64,8,0,3, 0,35,35,35,35,35,35,3,3,3,3,3,3,3,3,3, 3,3,3,3,3,3,3,3,3,3,3,8,8,8,0,0, }; int character_operator_map[128] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,1,0,45,0,21,3,0,5,6,7,8,9,10,0,11, 0,0,0,0,0,0,0,0,0,0,4,12,13,14,15,2, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,16,0,17,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,18,19,20,0,0, }; int next_symbol_string_list = 78; int symbol_string_list_limit = 10000; int symbol_string_list[10000] = {'0', /* 1 */ 'b','r','e','a','k',0, /* 7 */ 'c','a','s','e',0, /* 12 */ 'c','o','n','t','i','n','u','e',0, /* 21 */ 'd','e','f','a','u','l','t',0, /* 29 */ 'd','o',0, /* 32 */ 'e','l','s','e',0, /* 37 */ 'f','o','r',0, /* 41 */ 'g','o','t','o',0, /* 46 */ 'i','f',0, /* 49 */ 'i','n','t',0, /* 53 */ 'r','e','t','u','r','n',0, /* 60 */ 's','w','i','t','c','h',0, /* 67 */ 'v','o','i','d',0, /* 72 */ 'w','h','i','l','e',0, /* 78 */ }; int /* char * */ token_map[] ={"null", "!", "?", "&", ":", "(", ")", "*", "+", ",", "-", "/", ";", "<", "=", ">", "[", "]", "{", "|", "}", "%", ">>", "<<", ">=", "<=", "!=", "==", "", "", "", "break", "case", "continue", "default", "do", "else", "for", "goto", "if", "int", "return", "switch", "void", "while", "#",}; int token_types = 128 /* sizeof(token_map)/intsize */ ; /* #define CONST 28 #define STRING 29 #define IDENT 30 #define LINK (sizeof(token_map)/sizeof(int /*char**/) + 2) */ int symbol_index_limit = 256; int next_symbol_index = 14; int first_identifier_index = 14; int symbol_string_list_index[256]= { 1, 7, 12, 21, 29, 32, 37, 41, 46, 49, 53, 60, 67, 72, }; int symbol_sorted_order[256] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, }; int symbol_value_1[256] = { 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, }; int symbol_value_2[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; int symbol_value_3[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; int symbol_value_4[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; /* #define EMPTY (-1) #define EXHAUSTED (-2) #define NONTERMINAL (1024) #define TRUE (1==1) #define FALSE (1==0) */ int testfun2(){ch = LINK;} /* orig hand coded tables used to bootstrap generated tables for bnf parser/table generator */ int parse_table_token[] = { }; int parse_table_action[] = { }; int parse_table_control[] = { }; int parse_table_data[] = { }; int testfun3(){ch = LINK;} /* generated tables */ /* nested comments allowed-- int parse_table_token[] = { /* 0 from production # 0 */ 0, /* 1 from production # 1 */ 3+NONTERMINAL, /* 2 from production # 1 */ EXHAUSTED, /* 3 from production # 3 */ 8+NONTERMINAL, /* 4 from production # 5 */ EMPTY, /* 5 from production # 3 */ EXHAUSTED, /* 6 from production # 3 */ 3+NONTERMINAL, /* 7 from production # 3 */ EXHAUSTED, /* 8 from production # 7 */ 12+NONTERMINAL, /* 9 from production # 7 */ EXHAUSTED, /* 10 from production # 7 */ 19+NONTERMINAL, /* 11 from production # 7 */ EXHAUSTED, /* 12 from production # 9 */ 16+NONTERMINAL, /* 13 from production # 9 */ EXHAUSTED, /* 14 from production # 9 */ 30, /* 15 from production # 9 */ EXHAUSTED, /* 16 from production # 11 */ 43, /* 17 from production # 13 */ 40, /* 18 from production # 11 */ EXHAUSTED, /* 19 from production # 15 */ 12, /* 20 from production # 17 */ 14, /* 21 from production # 19 */ 40+NONTERMINAL, /* 22 from production # 21 */ 32+NONTERMINAL, /* 23 from production # 15 */ EXHAUSTED, /* 24 from production # 17 */ 30+NONTERMINAL, /* 25 from production # 17 */ EXHAUSTED, /* 26 from production # 17 */ 12, /* 27 from production # 17 */ EXHAUSTED, /* 28 from production # 21 */ 12, /* 29 from production # 21 */ EXHAUSTED, /* 30 from production # 23 */ 48+NONTERMINAL, /* 31 from production # 23 */ EXHAUSTED, /* 32 from production # 25 */ 16, /* 33 from production # 25 */ EXHAUSTED, /* 34 from production # 25 */ 51+NONTERMINAL, /* 35 from production # 25 */ EXHAUSTED, /* 36 from production # 25 */ 17, /* 37 from production # 25 */ EXHAUSTED, /* 38 from production # 25 */ 54+NONTERMINAL, /* 39 from production # 25 */ EXHAUSTED, /* 40 from production # 27 */ 5, /* 41 from production # 27 */ EXHAUSTED, /* 42 from production # 27 */ 63+NONTERMINAL, /* 43 from production # 27 */ EXHAUSTED, /* 44 from production # 27 */ 6, /* 45 from production # 27 */ EXHAUSTED, /* 46 from production # 27 */ 84+NONTERMINAL, /* 47 from production # 27 */ EXHAUSTED, /* 48 from production # 29 */ 119+NONTERMINAL, /* 49 from production # 31 */ EMPTY, /* 50 from production # 29 */ EXHAUSTED, /* 51 from production # 33 */ 119+NONTERMINAL, /* 52 from production # 35 */ EMPTY, /* 53 from production # 33 */ EXHAUSTED, /* 54 from production # 37 */ 14, /* 55 from production # 39 */ EMPTY, /* 56 from production # 37 */ EXHAUSTED, /* 57 from production # 37 */ 18, /* 58 from production # 37 */ EXHAUSTED, /* 59 from production # 37 */ 109+NONTERMINAL, /* 60 from production # 37 */ EXHAUSTED, /* 61 from production # 37 */ 20, /* 62 from production # 37 */ EXHAUSTED, /* 63 from production # 41 */ 67+NONTERMINAL, /* 64 from production # 41 */ EXHAUSTED, /* 65 from production # 41 */ 79+NONTERMINAL, /* 66 from production # 41 */ EXHAUSTED, /* 67 from production # 43 */ 40, /* 68 from production # 45 */ EMPTY, /* 69 from production # 43 */ EXHAUSTED, /* 70 from production # 43 */ 30, /* 71 from production # 43 */ EXHAUSTED, /* 72 from production # 43 */ 74+NONTERMINAL, /* 73 from production # 43 */ EXHAUSTED, /* 74 from production # 47 */ 16, /* 75 from production # 49 */ EMPTY, /* 76 from production # 47 */ EXHAUSTED, /* 77 from production # 47 */ 17, /* 78 from production # 47 */ EXHAUSTED, /* 79 from production # 51 */ 9, /* 80 from production # 53 */ EMPTY, /* 81 from production # 51 */ EXHAUSTED, /* 82 from production # 51 */ 63+NONTERMINAL, /* 83 from production # 51 */ EXHAUSTED, /* 84 from production # 55 */ 18, /* 85 from production # 57 */ 12, /* 86 from production # 55 */ EXHAUSTED, /* 87 from production # 55 */ 93+NONTERMINAL, /* 88 from production # 55 */ EXHAUSTED, /* 89 from production # 55 */ 401+NONTERMINAL, /* 90 from production # 55 */ EXHAUSTED, /* 91 from production # 55 */ 20, /* 92 from production # 55 */ EXHAUSTED, /* 93 from production # 59 */ 98+NONTERMINAL, /* 94 from production # 61 */ EMPTY, /* 95 from production # 59 */ EXHAUSTED, /* 96 from production # 59 */ 93+NONTERMINAL, /* 97 from production # 59 */ EXHAUSTED, /* 98 from production # 63 */ 12+NONTERMINAL, /* 99 from production # 63 */ EXHAUSTED, /* 100 from production # 63 */ 102+NONTERMINAL, /* 101 from production # 63 */ EXHAUSTED, /* 102 from production # 65 */ 32+NONTERMINAL, /* 103 from production # 67 */ 48+NONTERMINAL, /* 104 from production # 65 */ EXHAUSTED, /* 105 from production # 65 */ 12, /* 106 from production # 65 */ EXHAUSTED, /* 107 from production # 67 */ 12, /* 108 from production # 67 */ EXHAUSTED, /* 109 from production # 69 */ 119+NONTERMINAL, /* 110 from production # 71 */ EMPTY, /* 111 from production # 69 */ EXHAUSTED, /* 112 from production # 69 */ 114+NONTERMINAL, /* 113 from production # 69 */ EXHAUSTED, /* 114 from production # 73 */ 9, /* 115 from production # 75 */ EMPTY, /* 116 from production # 73 */ EXHAUSTED, /* 117 from production # 73 */ 109+NONTERMINAL, /* 118 from production # 73 */ EXHAUSTED, /* 119 from production # 77 */ 121+NONTERMINAL, /* 120 from production # 77 */ EXHAUSTED, /* 121 from production # 79 */ 134+NONTERMINAL, /* 122 from production # 79 */ EXHAUSTED, /* 123 from production # 79 */ 125+NONTERMINAL, /* 124 from production # 79 */ EXHAUSTED, /* 125 from production # 81 */ 2, /* 126 from production # 83 */ EMPTY, /* 127 from production # 81 */ EXHAUSTED, /* 128 from production # 81 */ 134+NONTERMINAL, /* 129 from production # 81 */ EXHAUSTED, /* 130 from production # 81 */ 4, /* 131 from production # 81 */ EXHAUSTED, /* 132 from production # 81 */ 134+NONTERMINAL, /* 133 from production # 81 */ EXHAUSTED, /* 134 from production # 85 */ 140+NONTERMINAL, /* 135 from production # 85 */ EXHAUSTED, /* 136 from production # 85 */ 152+NONTERMINAL, /* 137 from production # 85 */ EXHAUSTED, /* 138 from production # 85 */ 144+NONTERMINAL, /* 139 from production # 85 */ EXHAUSTED, /* 140 from production # 87 */ 1, /* 141 from production # 89 */ 10, /* 142 from production # 91 */ EMPTY, /* 143 from production # 87 */ EXHAUSTED, /* 144 from production # 93 */ 19, /* 145 from production # 95 */ 3, /* 146 from production # 97 */ EMPTY, /* 147 from production # 93 */ EXHAUSTED, /* 148 from production # 93 */ 152+NONTERMINAL, /* 149 from production # 93 */ EXHAUSTED, /* 150 from production # 95 */ 152+NONTERMINAL, /* 151 from production # 95 */ EXHAUSTED, /* 152 from production # 99 */ 176+NONTERMINAL, /* 153 from production # 99 */ EXHAUSTED, /* 154 from production # 99 */ 156+NONTERMINAL, /* 155 from production # 99 */ EXHAUSTED, /* 156 from production # 101 */ 24, /* 157 from production # 103 */ 25, /* 158 from production # 105 */ 27, /* 159 from production # 107 */ 26, /* 160 from production # 109 */ 15, /* 161 from production # 111 */ 13, /* 162 from production # 113 */ EMPTY, /* 163 from production # 101 */ EXHAUSTED, /* 164 from production # 101 */ 176+NONTERMINAL, /* 165 from production # 101 */ EXHAUSTED, /* 166 from production # 103 */ 176+NONTERMINAL, /* 167 from production # 103 */ EXHAUSTED, /* 168 from production # 105 */ 176+NONTERMINAL, /* 169 from production # 105 */ EXHAUSTED, /* 170 from production # 107 */ 176+NONTERMINAL, /* 171 from production # 107 */ EXHAUSTED, /* 172 from production # 109 */ 176+NONTERMINAL, /* 173 from production # 109 */ EXHAUSTED, /* 174 from production # 111 */ 176+NONTERMINAL, /* 175 from production # 111 */ EXHAUSTED, /* 176 from production # 115 */ 188+NONTERMINAL, /* 177 from production # 115 */ EXHAUSTED, /* 178 from production # 115 */ 180+NONTERMINAL, /* 179 from production # 115 */ EXHAUSTED, /* 180 from production # 117 */ 23, /* 181 from production # 119 */ 22, /* 182 from production # 121 */ EMPTY, /* 183 from production # 117 */ EXHAUSTED, /* 184 from production # 117 */ 188+NONTERMINAL, /* 185 from production # 117 */ EXHAUSTED, /* 186 from production # 119 */ 188+NONTERMINAL, /* 187 from production # 119 */ EXHAUSTED, /* 188 from production # 123 */ 204+NONTERMINAL, /* 189 from production # 123 */ EXHAUSTED, /* 190 from production # 123 */ 192+NONTERMINAL, /* 191 from production # 123 */ EXHAUSTED, /* 192 from production # 125 */ 8, /* 193 from production # 127 */ 10, /* 194 from production # 129 */ EMPTY, /* 195 from production # 125 */ EXHAUSTED, /* 196 from production # 125 */ 208+NONTERMINAL, /* 197 from production # 125 */ EXHAUSTED, /* 198 from production # 125 */ 192+NONTERMINAL, /* 199 from production # 125 */ EXHAUSTED, /* 200 from production # 127 */ 208+NONTERMINAL, /* 201 from production # 127 */ EXHAUSTED, /* 202 from production # 127 */ 192+NONTERMINAL, /* 203 from production # 127 */ EXHAUSTED, /* 204 from production # 131 */ 220+NONTERMINAL, /* 205 from production # 131 */ EXHAUSTED, /* 206 from production # 131 */ 208+NONTERMINAL, /* 207 from production # 131 */ EXHAUSTED, /* 208 from production # 133 */ 7, /* 209 from production # 135 */ 11, /* 210 from production # 137 */ EMPTY, /* 211 from production # 133 */ EXHAUSTED, /* 212 from production # 133 */ 220+NONTERMINAL, /* 213 from production # 133 */ EXHAUSTED, /* 214 from production # 133 */ 208+NONTERMINAL, /* 215 from production # 133 */ EXHAUSTED, /* 216 from production # 135 */ 220+NONTERMINAL, /* 217 from production # 135 */ EXHAUSTED, /* 218 from production # 135 */ 208+NONTERMINAL, /* 219 from production # 135 */ EXHAUSTED, /* 220 from production # 139 */ 222+NONTERMINAL, /* 221 from production # 139 */ EXHAUSTED, /* 222 from production # 141 */ 3, /* 223 from production # 143 */ 28, /* 224 from production # 145 */ 29, /* 225 from production # 147 */ 5, /* 226 from production # 141 */ EXHAUSTED, /* 227 from production # 141 */ 30, /* 228 from production # 141 */ EXHAUSTED, /* 229 from production # 147 */ 119+NONTERMINAL, /* 230 from production # 147 */ EXHAUSTED, /* 231 from production # 147 */ 6, /* 232 from production # 147 */ EXHAUSTED, /* 233 from production # 149 */ 235+NONTERMINAL, /* 234 from production # 149 */ EXHAUSTED, /* 235 from production # 151 */ 237+NONTERMINAL, /* 236 from production # 151 */ EXHAUSTED, /* 237 from production # 153 */ 291+NONTERMINAL, /* 238 from production # 153 */ EXHAUSTED, /* 239 from production # 155 */ 235+NONTERMINAL, /* 240 from production # 157 */ EMPTY, /* 241 from production # 155 */ EXHAUSTED, /* 242 from production # 155 */ 244+NONTERMINAL, /* 243 from production # 155 */ EXHAUSTED, /* 244 from production # 159 */ 9, /* 245 from production # 161 */ EMPTY, /* 246 from production # 159 */ EXHAUSTED, /* 247 from production # 159 */ 239+NONTERMINAL, /* 248 from production # 159 */ EXHAUSTED, /* 249 from production # 163 */ 28, /* 250 from production # 165 */ 29, /* 251 from production # 167 */ 30, /* 252 from production # 169 */ 5, /* 253 from production # 163 */ EXHAUSTED, /* 254 from production # 167 */ 262+NONTERMINAL, /* 255 from production # 167 */ EXHAUSTED, /* 256 from production # 169 */ 235+NONTERMINAL, /* 257 from production # 169 */ EXHAUSTED, /* 258 from production # 169 */ 6, /* 259 from production # 169 */ EXHAUSTED, /* 260 from production # 169 */ 262+NONTERMINAL, /* 261 from production # 169 */ EXHAUSTED, /* 262 from production # 171 */ 5, /* 263 from production # 173 */ 16, /* 264 from production # 175 */ EMPTY, /* 265 from production # 171 */ EXHAUSTED, /* 266 from production # 171 */ 239+NONTERMINAL, /* 267 from production # 171 */ EXHAUSTED, /* 268 from production # 171 */ 6, /* 269 from production # 171 */ EXHAUSTED, /* 270 from production # 173 */ 235+NONTERMINAL, /* 271 from production # 173 */ EXHAUSTED, /* 272 from production # 173 */ 17, /* 273 from production # 173 */ EXHAUSTED, /* 274 from production # 177 */ 30, /* 275 from production # 179 */ 249+NONTERMINAL, /* 276 from production # 181 */ 7, /* 277 from production # 183 */ 5, /* 278 from production # 177 */ EXHAUSTED, /* 279 from production # 179 */ 16, /* 280 from production # 179 */ EXHAUSTED, /* 281 from production # 179 */ 235+NONTERMINAL, /* 282 from production # 179 */ EXHAUSTED, /* 283 from production # 179 */ 17, /* 284 from production # 179 */ EXHAUSTED, /* 285 from production # 181 */ 235+NONTERMINAL, /* 286 from production # 181 */ EXHAUSTED, /* 287 from production # 183 */ 274+NONTERMINAL, /* 288 from production # 183 */ EXHAUSTED, /* 289 from production # 183 */ 6, /* 290 from production # 183 */ EXHAUSTED, /* 291 from production # 185 */ 307+NONTERMINAL, /* 292 from production # 185 */ EXHAUSTED, /* 293 from production # 185 */ 295+NONTERMINAL, /* 294 from production # 185 */ EXHAUSTED, /* 295 from production # 187 */ 2, /* 296 from production # 189 */ 14, /* 297 from production # 191 */ EMPTY, /* 298 from production # 187 */ EXHAUSTED, /* 299 from production # 187 */ 307+NONTERMINAL, /* 300 from production # 187 */ EXHAUSTED, /* 301 from production # 187 */ 4, /* 302 from production # 187 */ EXHAUSTED, /* 303 from production # 187 */ 307+NONTERMINAL, /* 304 from production # 187 */ EXHAUSTED, /* 305 from production # 189 */ 307+NONTERMINAL, /* 306 from production # 189 */ EXHAUSTED, /* 307 from production # 193 */ 1, /* 308 from production # 195 */ 10, /* 309 from production # 197 */ 7, /* 310 from production # 199 */ 3, /* 311 from production # 201 */ 331+NONTERMINAL, /* 312 from production # 193 */ EXHAUSTED, /* 313 from production # 193 */ 331+NONTERMINAL, /* 314 from production # 193 */ EXHAUSTED, /* 315 from production # 195 */ 331+NONTERMINAL, /* 316 from production # 195 */ EXHAUSTED, /* 317 from production # 197 */ 331+NONTERMINAL, /* 318 from production # 197 */ EXHAUSTED, /* 319 from production # 199 */ 331+NONTERMINAL, /* 320 from production # 199 */ EXHAUSTED, /* 321 from production # 201 */ 323+NONTERMINAL, /* 322 from production # 201 */ EXHAUSTED, /* 323 from production # 203 */ 19, /* 324 from production # 205 */ 3, /* 325 from production # 207 */ EMPTY, /* 326 from production # 203 */ EXHAUSTED, /* 327 from production # 203 */ 331+NONTERMINAL, /* 328 from production # 203 */ EXHAUSTED, /* 329 from production # 205 */ 331+NONTERMINAL, /* 330 from production # 205 */ EXHAUSTED, /* 331 from production # 209 */ 355+NONTERMINAL, /* 332 from production # 209 */ EXHAUSTED, /* 333 from production # 209 */ 335+NONTERMINAL, /* 334 from production # 209 */ EXHAUSTED, /* 335 from production # 211 */ 24, /* 336 from production # 213 */ 25, /* 337 from production # 215 */ 26, /* 338 from production # 217 */ 27, /* 339 from production # 219 */ 15, /* 340 from production # 221 */ 13, /* 341 from production # 223 */ EMPTY, /* 342 from production # 211 */ EXHAUSTED, /* 343 from production # 211 */ 355+NONTERMINAL, /* 344 from production # 211 */ EXHAUSTED, /* 345 from production # 213 */ 355+NONTERMINAL, /* 346 from production # 213 */ EXHAUSTED, /* 347 from production # 215 */ 355+NONTERMINAL, /* 348 from production # 215 */ EXHAUSTED, /* 349 from production # 217 */ 355+NONTERMINAL, /* 350 from production # 217 */ EXHAUSTED, /* 351 from production # 219 */ 355+NONTERMINAL, /* 352 from production # 219 */ EXHAUSTED, /* 353 from production # 221 */ 355+NONTERMINAL, /* 354 from production # 221 */ EXHAUSTED, /* 355 from production # 225 */ 367+NONTERMINAL, /* 356 from production # 225 */ EXHAUSTED, /* 357 from production # 225 */ 359+NONTERMINAL, /* 358 from production # 225 */ EXHAUSTED, /* 359 from production # 227 */ 23, /* 360 from production # 229 */ 22, /* 361 from production # 231 */ EMPTY, /* 362 from production # 227 */ EXHAUSTED, /* 363 from production # 227 */ 367+NONTERMINAL, /* 364 from production # 227 */ EXHAUSTED, /* 365 from production # 229 */ 367+NONTERMINAL, /* 366 from production # 229 */ EXHAUSTED, /* 367 from production # 233 */ 383+NONTERMINAL, /* 368 from production # 233 */ EXHAUSTED, /* 369 from production # 233 */ 371+NONTERMINAL, /* 370 from production # 233 */ EXHAUSTED, /* 371 from production # 235 */ 8, /* 372 from production # 237 */ 10, /* 373 from production # 239 */ EMPTY, /* 374 from production # 235 */ EXHAUSTED, /* 375 from production # 235 */ 383+NONTERMINAL, /* 376 from production # 235 */ EXHAUSTED, /* 377 from production # 235 */ 371+NONTERMINAL, /* 378 from production # 235 */ EXHAUSTED, /* 379 from production # 237 */ 383+NONTERMINAL, /* 380 from production # 237 */ EXHAUSTED, /* 381 from production # 237 */ 371+NONTERMINAL, /* 382 from production # 237 */ EXHAUSTED, /* 383 from production # 241 */ 399+NONTERMINAL, /* 384 from production # 241 */ EXHAUSTED, /* 385 from production # 241 */ 387+NONTERMINAL, /* 386 from production # 241 */ EXHAUSTED, /* 387 from production # 243 */ 7, /* 388 from production # 245 */ 11, /* 389 from production # 247 */ EMPTY, /* 390 from production # 243 */ EXHAUSTED, /* 391 from production # 243 */ 399+NONTERMINAL, /* 392 from production # 243 */ EXHAUSTED, /* 393 from production # 243 */ 371+NONTERMINAL, /* 394 from production # 243 */ EXHAUSTED, /* 395 from production # 245 */ 399+NONTERMINAL, /* 396 from production # 245 */ EXHAUSTED, /* 397 from production # 245 */ 371+NONTERMINAL, /* 398 from production # 245 */ EXHAUSTED, /* 399 from production # 249 */ 249+NONTERMINAL, /* 400 from production # 249 */ EXHAUSTED, /* 401 from production # 251 */ 412+NONTERMINAL, /* 402 from production # 253 */ EMPTY, /* 403 from production # 251 */ EXHAUSTED, /* 404 from production # 251 */ 401+NONTERMINAL, /* 405 from production # 251 */ EXHAUSTED, /* 406 from production # 255 */ 18, /* 407 from production # 255 */ EXHAUSTED, /* 408 from production # 255 */ 401+NONTERMINAL, /* 409 from production # 255 */ EXHAUSTED, /* 410 from production # 255 */ 20, /* 411 from production # 255 */ EXHAUSTED, /* 412 from production # 257 */ 425+NONTERMINAL, /* 413 from production # 259 */ 435+NONTERMINAL, /* 414 from production # 261 */ 453+NONTERMINAL, /* 415 from production # 263 */ 466+NONTERMINAL, /* 416 from production # 265 */ 475+NONTERMINAL, /* 417 from production # 267 */ 485+NONTERMINAL, /* 418 from production # 269 */ 491+NONTERMINAL, /* 419 from production # 271 */ 406+NONTERMINAL, /* 420 from production # 273 */ 235+NONTERMINAL, /* 421 from production # 275 */ 12, /* 422 from production # 257 */ EXHAUSTED, /* 423 from production # 273 */ 12, /* 424 from production # 273 */ EXHAUSTED, /* 425 from production # 277 */ 42, /* 426 from production # 277 */ EXHAUSTED, /* 427 from production # 277 */ 235+NONTERMINAL, /* 428 from production # 277 */ EXHAUSTED, /* 429 from production # 277 */ 18, /* 430 from production # 277 */ EXHAUSTED, /* 431 from production # 277 */ 495+NONTERMINAL, /* 432 from production # 277 */ EXHAUSTED, /* 433 from production # 277 */ 20, /* 434 from production # 277 */ EXHAUSTED, /* 435 from production # 279 */ 37, /* 436 from production # 279 */ EXHAUSTED, /* 437 from production # 279 */ 5, /* 438 from production # 279 */ EXHAUSTED, /* 439 from production # 279 */ 527+NONTERMINAL, /* 440 from production # 279 */ EXHAUSTED, /* 441 from production # 279 */ 12, /* 442 from production # 279 */ EXHAUSTED, /* 443 from production # 279 */ 547+NONTERMINAL, /* 444 from production # 279 */ EXHAUSTED, /* 445 from production # 279 */ 12, /* 446 from production # 279 */ EXHAUSTED, /* 447 from production # 279 */ 537+NONTERMINAL, /* 448 from production # 279 */ EXHAUSTED, /* 449 from production # 279 */ 6, /* 450 from production # 279 */ EXHAUSTED, /* 451 from production # 279 */ 412+NONTERMINAL, /* 452 from production # 279 */ EXHAUSTED, /* 453 from production # 281 */ 39, /* 454 from production # 281 */ EXHAUSTED, /* 455 from production # 281 */ 235+NONTERMINAL, /* 456 from production # 281 */ EXHAUSTED, /* 457 from production # 281 */ 412+NONTERMINAL, /* 458 from production # 281 */ EXHAUSTED, /* 459 from production # 281 */ 461+NONTERMINAL, /* 460 from production # 281 */ EXHAUSTED, /* 461 from production # 283 */ 36, /* 462 from production # 285 */ EMPTY, /* 463 from production # 283 */ EXHAUSTED, /* 464 from production # 283 */ 412+NONTERMINAL, /* 465 from production # 283 */ EXHAUSTED, /* 466 from production # 287 */ 41, /* 467 from production # 287 */ EXHAUSTED, /* 468 from production # 287 */ 472+NONTERMINAL, /* 469 from production # 287 */ EXHAUSTED, /* 470 from production # 287 */ 12, /* 471 from production # 287 */ EXHAUSTED, /* 472 from production # 289 */ 235+NONTERMINAL, /* 473 from production # 291 */ EMPTY, /* 474 from production # 289 */ EXHAUSTED, /* 475 from production # 293 */ 35, /* 476 from production # 293 */ EXHAUSTED, /* 477 from production # 293 */ 412+NONTERMINAL, /* 478 from production # 293 */ EXHAUSTED, /* 479 from production # 293 */ 44, /* 480 from production # 293 */ EXHAUSTED, /* 481 from production # 293 */ 235+NONTERMINAL, /* 482 from production # 293 */ EXHAUSTED, /* 483 from production # 293 */ 12, /* 484 from production # 293 */ EXHAUSTED, /* 485 from production # 295 */ 44, /* 486 from production # 295 */ EXHAUSTED, /* 487 from production # 295 */ 235+NONTERMINAL, /* 488 from production # 295 */ EXHAUSTED, /* 489 from production # 295 */ 412+NONTERMINAL, /* 490 from production # 295 */ EXHAUSTED, /* 491 from production # 297 */ 31, /* 492 from production # 297 */ EXHAUSTED, /* 493 from production # 297 */ 12, /* 494 from production # 297 */ EXHAUSTED, /* 495 from production # 299 */ 505+NONTERMINAL, /* 496 from production # 301 */ EMPTY, /* 497 from production # 299 */ EXHAUSTED, /* 498 from production # 299 */ 500+NONTERMINAL, /* 499 from production # 299 */ EXHAUSTED, /* 500 from production # 303 */ 505+NONTERMINAL, /* 501 from production # 305 */ EMPTY, /* 502 from production # 303 */ EXHAUSTED, /* 503 from production # 303 */ 495+NONTERMINAL, /* 504 from production # 303 */ EXHAUSTED, /* 505 from production # 307 */ 509+NONTERMINAL, /* 506 from production # 307 */ EXHAUSTED, /* 507 from production # 307 */ 401+NONTERMINAL, /* 508 from production # 307 */ EXHAUSTED, /* 509 from production # 309 */ 518+NONTERMINAL, /* 510 from production # 309 */ EXHAUSTED, /* 511 from production # 309 */ 513+NONTERMINAL, /* 512 from production # 309 */ EXHAUSTED, /* 513 from production # 311 */ 518+NONTERMINAL, /* 514 from production # 313 */ EMPTY, /* 515 from production # 311 */ EXHAUSTED, /* 516 from production # 311 */ 509+NONTERMINAL, /* 517 from production # 311 */ EXHAUSTED, /* 518 from production # 315 */ 32, /* 519 from production # 317 */ 34, /* 520 from production # 315 */ EXHAUSTED, /* 521 from production # 315 */ 119+NONTERMINAL, /* 522 from production # 315 */ EXHAUSTED, /* 523 from production # 315 */ 4, /* 524 from production # 315 */ EXHAUSTED, /* 525 from production # 317 */ 4, /* 526 from production # 317 */ EXHAUSTED, /* 527 from production # 319 */ 235+NONTERMINAL, /* 528 from production # 321 */ EMPTY, /* 529 from production # 319 */ EXHAUSTED, /* 530 from production # 319 */ 532+NONTERMINAL, /* 531 from production # 319 */ EXHAUSTED, /* 532 from production # 323 */ 9, /* 533 from production # 325 */ EMPTY, /* 534 from production # 323 */ EXHAUSTED, /* 535 from production # 323 */ 527+NONTERMINAL, /* 536 from production # 323 */ EXHAUSTED, /* 537 from production # 327 */ 235+NONTERMINAL, /* 538 from production # 329 */ EMPTY, /* 539 from production # 327 */ EXHAUSTED, /* 540 from production # 327 */ 542+NONTERMINAL, /* 541 from production # 327 */ EXHAUSTED, /* 542 from production # 331 */ 9, /* 543 from production # 333 */ EMPTY, /* 544 from production # 331 */ EXHAUSTED, /* 545 from production # 331 */ 537+NONTERMINAL, /* 546 from production # 331 */ EXHAUSTED, /* 547 from production # 335 */ 235+NONTERMINAL, /* 548 from production # 337 */ EMPTY, /* 549 from production # 335 */ EXHAUSTED, /* 550 from production # 339 */ 237+NONTERMINAL, /* 551 from production # 339 */ EXHAUSTED, /* 552 from production # 339 */ 5, /* 553 from production # 339 */ EXHAUSTED, /* 554 from production # 339 */ 239+NONTERMINAL, /* 555 from production # 339 */ EXHAUSTED, /* 556 from production # 339 */ 6, /* 557 from production # 339 */ EXHAUSTED, }; int parse_table_action[] = { 0, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, }; int parse_table_control[] = { 0, EMPTY, EMPTY, 6, EMPTY, EMPTY, EMPTY, EMPTY, 10, EMPTY, EMPTY, EMPTY, 14, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, 24, EMPTY, 28, EMPTY, 26, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, 34, EMPTY, 36, EMPTY, 38, EMPTY, EMPTY, EMPTY, 42, EMPTY, 44, EMPTY, 46, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, 57, EMPTY, EMPTY, 59, EMPTY, 61, EMPTY, EMPTY, EMPTY, 65, EMPTY, EMPTY, EMPTY, 70, EMPTY, EMPTY, 72, EMPTY, EMPTY, EMPTY, 77, EMPTY, EMPTY, EMPTY, EMPTY, 82, EMPTY, EMPTY, EMPTY, EMPTY, 87, EMPTY, EMPTY, 89, EMPTY, 91, EMPTY, EMPTY, EMPTY, 96, EMPTY, EMPTY, EMPTY, EMPTY, 100, EMPTY, EMPTY, EMPTY, 105, 107, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, 112, EMPTY, EMPTY, EMPTY, EMPTY, 117, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, 123, EMPTY, EMPTY, EMPTY, 128, EMPTY, EMPTY, 130, EMPTY, 132, EMPTY, EMPTY, EMPTY, 136, EMPTY, 138, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, 148, 150, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, 154, EMPTY, EMPTY, EMPTY, 164, 166, 168, 170, 172, 174, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, 178, EMPTY, EMPTY, EMPTY, 184, 186, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, 190, EMPTY, EMPTY, EMPTY, 196, 200, EMPTY, EMPTY, 198, EMPTY, EMPTY, EMPTY, 202, EMPTY, EMPTY, EMPTY, 206, EMPTY, EMPTY, EMPTY, 212, 216, EMPTY, EMPTY, 214, EMPTY, EMPTY, EMPTY, 218, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, 227, EMPTY, EMPTY, 229, EMPTY, EMPTY, EMPTY, 231, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, 242, EMPTY, EMPTY, EMPTY, EMPTY, 247, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, 254, 256, EMPTY, EMPTY, EMPTY, 258, EMPTY, 260, EMPTY, EMPTY, EMPTY, 266, 270, EMPTY, EMPTY, 268, EMPTY, EMPTY, EMPTY, 272, EMPTY, EMPTY, EMPTY, EMPTY, 279, 285, 287, EMPTY, 281, EMPTY, 283, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, 289, EMPTY, EMPTY, EMPTY, 293, EMPTY, EMPTY, EMPTY, 299, 305, EMPTY, EMPTY, 301, EMPTY, 303, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, 313, 315, 317, 319, 321, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, 327, 329, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, 333, EMPTY, EMPTY, EMPTY, 343, 345, 347, 349, 351, 353, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, 357, EMPTY, EMPTY, EMPTY, 363, 365, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, 369, EMPTY, EMPTY, EMPTY, 375, 379, EMPTY, EMPTY, 377, EMPTY, EMPTY, EMPTY, 381, EMPTY, EMPTY, EMPTY, 385, EMPTY, EMPTY, EMPTY, 391, 395, EMPTY, EMPTY, 393, EMPTY, EMPTY, EMPTY, 397, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, 404, EMPTY, EMPTY, EMPTY, EMPTY, 408, EMPTY, 410, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, 423, EMPTY, EMPTY, EMPTY, EMPTY, 427, EMPTY, 429, EMPTY, 431, EMPTY, 433, EMPTY, EMPTY, EMPTY, 437, EMPTY, 439, EMPTY, 441, EMPTY, 443, EMPTY, 445, EMPTY, 447, EMPTY, 449, EMPTY, 451, EMPTY, EMPTY, EMPTY, 455, EMPTY, 457, EMPTY, 459, EMPTY, EMPTY, EMPTY, 464, EMPTY, EMPTY, EMPTY, EMPTY, 468, EMPTY, 470, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, 477, EMPTY, 479, EMPTY, 481, EMPTY, 483, EMPTY, EMPTY, EMPTY, 487, EMPTY, 489, EMPTY, EMPTY, EMPTY, 493, EMPTY, EMPTY, EMPTY, 498, EMPTY, EMPTY, EMPTY, EMPTY, 503, EMPTY, EMPTY, EMPTY, EMPTY, 507, EMPTY, EMPTY, EMPTY, 511, EMPTY, EMPTY, EMPTY, 516, EMPTY, EMPTY, EMPTY, EMPTY, 521, 525, EMPTY, 523, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, 530, EMPTY, EMPTY, EMPTY, EMPTY, 535, EMPTY, EMPTY, EMPTY, EMPTY, 540, EMPTY, EMPTY, EMPTY, EMPTY, 545, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, 552, EMPTY, 554, EMPTY, 556, EMPTY, EMPTY, EMPTY, }; #define PRODLABEL 1 int prod_label[] = { "break", "program", "program", "decl_list", "decl_list", "decl_list", "decl_list", "decl_list", "decl", "decl", "decl", "decl", "typespecifier", "typespecifier", "typespecifier", "typespecifier", "type", "type", "type", "globalobjspecifier", "globalobjspecifier", "globalobjspecifier", "globalobjspecifier", "globalobjspecifier", "globalobjspecifier", "globalobjspecifier", "globalobjspecifier", "globalobjspecifier", "globalobjspecifier", "globalobjspecifier", "initspecifier", "initspecifier", "arrayspecifier", "arrayspecifier", "arrayspecifier", "arrayspecifier", "arrayspecifier", "arrayspecifier", "arrayspecifier", "arrayspecifier", "subroutinespecifier", "subroutinespecifier", "subroutinespecifier", "subroutinespecifier", "subroutinespecifier", "subroutinespecifier", "subroutinespecifier", "subroutinespecifier", "scalarspecifier", "scalarspecifier", "scalarspecifier", "arraysize", "arraysize", "arraysize", "initlist", "initlist", "initlist", "initlist", "initlist", "initlist", "initlist", "initlist", "initlist", "formalparameterlist", "formalparameterlist", "formalparameterlist", "formalparameterlist", "formalparameter", "formalparameter", "formalparameter", "formalparameter", "formalparameter", "formalparameter", "formalparameter", "parameterarray", "parameterarray", "parameterarray", "parameterarray", "parameterarray", "formalparametertail", "formalparametertail", "formalparametertail", "formalparametertail", "formalparametertail", "subrbody", "subrbody", "subrbody", "subrbody", "subrbody", "subrbody", "subrbody", "subrbody", "subrbody", "localdecllist", "localdecllist", "localdecllist", "localdecllist", "localdecllist", "localdecl", "localdecl", "localdecl", "localdecl", "localobjspecifier", "localobjspecifier", "localobjspecifier", "localobjspecifier", "localobjspecifier", "localobjspecifier", "localobjspecifier", "constantexprlist", "constantexprlist", "constantexprlist", "constantexprlist", "constantexprlist", "constantexprlisttail", "constantexprlisttail", "constantexprlisttail", "constantexprlisttail", "constantexprlisttail", "constantexpr", "constantexpr", "constantcond", "constantcond", "constantcond", "constantcond", "constantcond1", "constantcond1", "constantcond1", "constantcond1", "constantcond1", "constantcond1", "constantcond1", "constantcond1", "constantcond1", "constantmsk", "constantmsk", "constantmsk", "constantmsk", "constantmsk", "constantmsk", "unop", "unop", "unop", "unop", "constantmsk1", "constantmsk1", "constantmsk1", "constantmsk1", "constantmsk1", "constantmsk1", "constantmsk1", "constantmsk1", "constantcmp", "constantcmp", "constantcmp", "constantcmp", "constantcmp1", "constantcmp1", "constantcmp1", "constantcmp1", "constantcmp1", "constantcmp1", "constantcmp1", "constantcmp1", "constantcmp1", "constantcmp1", "constantcmp1", "constantcmp1", "constantcmp1", "constantcmp1", "constantcmp1", "constantcmp1", "constantcmp1", "constantcmp1", "constantcmp1", "constantcmp1", "constantbp", "constantbp", "constantbp", "constantbp", "constantbp1", "constantbp1", "constantbp1", "constantbp1", "constantbp1", "constantbp1", "constantbp1", "constantbp1", "constantsum", "constantsum", "constantsum", "constantsum", "constantsum1", "constantsum1", "constantsum1", "constantsum1", "constantsum1", "constantsum1", "constantsum1", "constantsum1", "constantsum1", "constantsum1", "constantsum1", "constantsum1", "constantterm", "constantterm", "constantterm", "constantterm", "constantterm1", "constantterm1", "constantterm1", "constantterm1", "constantterm1", "constantterm1", "constantterm1", "constantterm1", "constantterm1", "constantterm1", "constantterm1", "constantterm1", "constantfact", "constantfact", "constantpri", "constantpri", "constantpri", "constantpri", "constantpri", "constantpri", "constantpri", "constantpri", "constantpri", "constantpri", "constantpri", "rhs", "rhs", "expr", "expr", "primary", "primary", "actualparamlist", "actualparamlist", "actualparamlist", "actualparamlist", "actualparamlist", "actualparamlisttail", "actualparamlisttail", "actualparamlisttail", "actualparamlisttail", "actualparamlisttail", "lprimary", "lprimary", "lprimary", "lprimary", "lprimary", "lprimary", "lprimary", "lprimary", "lprimary", "lprimary", "lprimary", "lprimary", "lprimary", "lprimarysuffix", "lprimarysuffix", "lprimarysuffix", "lprimarysuffix", "lprimarysuffix", "lprimarysuffix", "lprimarysuffix", "lprimarysuffix", "lprimarysuffix", "lprimarysuffix", "lprimarysuffix", "lprimarysuffix", "lhs", "lhs", "lhs", "lhs", "lhs", "lhs", "lhs", "lhs", "lhs", "lhs", "lhs", "lhs", "lhs", "lhs", "lhs", "lhs", "lhs", "cond", "cond", "cond", "cond", "cond1", "cond1", "cond1", "cond1", "cond1", "cond1", "cond1", "cond1", "cond1", "cond1", "cond1", "cond1", "msk", "msk", "msk", "msk", "msk", "msk", "msk", "msk", "msk", "msk", "msk", "msk", "msk", "msk", "msk", "msk", "msk1", "msk1", "msk1", "msk1", "msk1", "msk1", "msk1", "msk1", "cmp", "cmp", "cmp", "cmp", "cmp1", "cmp1", "cmp1", "cmp1", "cmp1", "cmp1", "cmp1", "cmp1", "cmp1", "cmp1", "cmp1", "cmp1", "cmp1", "cmp1", "cmp1", "cmp1", "cmp1", "cmp1", "cmp1", "cmp1", "bp", "bp", "bp", "bp", "bp1", "bp1", "bp1", "bp1", "bp1", "bp1", "bp1", "bp1", "s", "s", "s", "s", "s1", "s1", "s1", "s1", "s1", "s1", "s1", "s1", "s1", "s1", "s1", "s1", "t", "t", "t", "t", "t1", "t1", "t1", "t1", "t1", "t1", "t1", "t1", "t1", "t1", "t1", "t1", "f", "f", "stmtlist", "stmtlist", "stmtlist", "stmtlist", "stmtlist", "compoundstmt", "compoundstmt", "compoundstmt", "compoundstmt", "compoundstmt", "compoundstmt", "stmt", "stmt", "stmt", "stmt", "stmt", "stmt", "stmt", "stmt", "stmt", "stmt", "stmt", "stmt", "stmt", "switchstmt", "switchstmt", "switchstmt", "switchstmt", "switchstmt", "switchstmt", "switchstmt", "switchstmt", "switchstmt", "switchstmt", "forstmt", "forstmt", "forstmt", "forstmt", "forstmt", "forstmt", "forstmt", "forstmt", "forstmt", "forstmt", "forstmt", "forstmt", "forstmt", "forstmt", "forstmt", "forstmt", "forstmt", "forstmt", "ifstmt", "ifstmt", "ifstmt", "ifstmt", "ifstmt", "ifstmt", "ifstmt", "ifstmt", "elseclause", "elseclause", "elseclause", "elseclause", "elseclause", "returnstmt", "returnstmt", "returnstmt", "returnstmt", "returnstmt", "returnstmt", "returnvalue", "returnvalue", "returnvalue", "dostmt", "dostmt", "dostmt", "dostmt", "dostmt", "dostmt", "dostmt", "dostmt", "dostmt", "dostmt", "whilestmt", "whilestmt", "whilestmt", "whilestmt", "whilestmt", "whilestmt", "breakstmt", "breakstmt", "breakstmt", "breakstmt", "casesequence", "casesequence", "casesequence", "casesequence", "casesequence", "casesequencetail", "casesequencetail", "casesequencetail", "casesequencetail", "casesequencetail", "caseclause", "caseclause", "caseclause", "caseclause", "caseprefixseq", "caseprefixseq", "caseprefixseq", "caseprefixseq", "caseprefixseqtail", "caseprefixseqtail", "caseprefixseqtail", "caseprefixseqtail", "caseprefixseqtail", "caseprefix", "caseprefix", "caseprefix", "caseprefix", "caseprefix", "caseprefix", "caseprefix", "caseprefix", "caseprefix", "startlist", "startlist", "startlist", "startlist", "startlist", "startlisttail", "startlisttail", "startlisttail", "startlisttail", "startlisttail", "iterlist", "iterlist", "iterlist", "iterlist", "iterlist", "iterlisttail", "iterlisttail", "iterlisttail", "iterlisttail", "iterlisttail", "forexpr", "forexpr", "forexpr", "subrinvocation", "subrinvocation", "subrinvocation", "subrinvocation", "subrinvocation", "subrinvocation", "subrinvocation", "subrinvocation", }; */ /* ~~ program # decl_list # "EMPTY" # "EMPTY" decl_list # decl decl_list # "EMPTY" # "EMPTY" decl_list # "EMPTY" # "EMPTY" # "EMPTY" decl # typespecifier globalobjspecifier # "EMPTY" # "EMPTY" typespecifier # type 30 # "EMPTY" # "EMPTY" type # void # "EMPTY" # "EMPTY" type # int # "EMPTY" # "EMPTY" globalobjspecifier # ; # "EMPTY" # "EMPTY" globalobjspecifier # = initspecifier ; # "EMPTY" # "EMPTY" globalobjspecifier # subroutinespecifier # "EMPTY" # "EMPTY" globalobjspecifier # arrayspecifier ; # "EMPTY" # "EMPTY" initspecifier # scalarspecifier # "EMPTY" # "EMPTY" arrayspecifier # [ arraysize ] initlist # "EMPTY" # "EMPTY" subroutinespecifier # ( formalparameterlist ) subrbody # "EMPTY" # "EMPTY" scalarspecifier # constantexpr # "EMPTY" # "EMPTY" scalarspecifier # "EMPTY" # "EMPTY" # "EMPTY" arraysize # constantexpr # "EMPTY" # "EMPTY" arraysize # "EMPTY" # "EMPTY" # "EMPTY" initlist # = { constantexprlist } # "EMPTY" # "EMPTY" initlist # "EMPTY" # "EMPTY" # "EMPTY" formalparameterlist # formalparameter formalparametertail # "EMPTY" # "EMPTY" formalparameter # int 30 parameterarray # "EMPTY" # "EMPTY" formalparameter # "EMPTY" # "EMPTY" # "EMPTY" parameterarray # [ ] # "EMPTY" # "EMPTY" parameterarray # "EMPTY" # "EMPTY" # "EMPTY" formalparametertail # , formalparameterlist # "EMPTY" # "EMPTY" formalparametertail # "EMPTY" # "EMPTY" # "EMPTY" subrbody # { localdecllist stmtlist } # "EMPTY" # "EMPTY" subrbody # ; # "EMPTY" # "EMPTY" localdecllist # localdecl localdecllist # "EMPTY" # "EMPTY" localdecllist # "EMPTY" # "EMPTY" # "EMPTY" localdecl # typespecifier localobjspecifier # "EMPTY" # "EMPTY" localobjspecifier # arrayspecifier ; # "EMPTY" # "EMPTY" localobjspecifier # scalarspecifier ; # "EMPTY" # "EMPTY" constantexprlist # constantexpr constantexprlisttail # "EMPTY" # "EMPTY" constantexprlist # "EMPTY" # "EMPTY" # "EMPTY" constantexprlisttail # , constantexprlist # "EMPTY" # "EMPTY" constantexprlisttail # "EMPTY" # "EMPTY" # "EMPTY" constantexpr # constantcond # "EMPTY" # "EMPTY" constantcond # constantmsk constantcond1 # "EMPTY" # "EMPTY" constantcond1 # ? constantmsk : constantmsk # "EMPTY" # "EMPTY" constantcond1 # "EMPTY" # "EMPTY" # "EMPTY" constantmsk # unop constantcmp constantmsk1 # "EMPTY" # "EMPTY" unop # ! # "EMPTY" # "EMPTY" unop # - # "EMPTY" # "EMPTY" unop # "EMPTY" # "EMPTY" # "EMPTY" constantmsk1 # | constantcmp # "EMPTY" # "EMPTY" constantmsk1 # & constantcmp # "EMPTY" # "EMPTY" constantmsk1 # "EMPTY" # "EMPTY" # "EMPTY" constantcmp # constantbp constantcmp1 # "EMPTY" # "EMPTY" constantcmp1 # >= constantbp # "EMPTY" # "EMPTY" constantcmp1 # <= constantbp # "EMPTY" # "EMPTY" constantcmp1 # == constantbp # "EMPTY" # "EMPTY" constantcmp1 # != constantbp # "EMPTY" # "EMPTY" constantcmp1 # > constantbp # "EMPTY" # "EMPTY" constantcmp1 # < constantbp # "EMPTY" # "EMPTY" constantcmp1 # "EMPTY" # "EMPTY" # "EMPTY" constantbp # constantsum constantbp1 # "EMPTY" # "EMPTY" constantbp1 # << constantsum # "EMPTY" # "EMPTY" constantbp1 # >> constantsum # "EMPTY" # "EMPTY" constantbp1 # "EMPTY" # "EMPTY" # "EMPTY" constantsum # constantterm constantsum1 # "EMPTY" # "EMPTY" constantsum1 # + constantterm1 constantsum1 # "EMPTY" # "EMPTY" constantsum1 # - constantterm1 constantsum1 # "EMPTY" # "EMPTY" constantsum1 # "EMPTY" # "EMPTY" # "EMPTY" constantterm # constantfact constantterm1 # "EMPTY" # "EMPTY" constantterm1 # * constantfact constantterm1 # "EMPTY" # "EMPTY" constantterm1 # / constantfact constantterm1 # "EMPTY" # "EMPTY" constantterm1 # "EMPTY" # "EMPTY" # "EMPTY" constantfact # constantpri # "EMPTY" # "EMPTY" constantpri # & 30 # "EMPTY" # "EMPTY" constantpri # 28 # "EMPTY" # "EMPTY" constantpri # 29 # "EMPTY" # "EMPTY" constantpri # ( constantexpr ) # "EMPTY" # "EMPTY" rhs # expr # "EMPTY" # "EMPTY" expr # primary # "EMPTY" # "EMPTY" primary # cond # "EMPTY" # "EMPTY" actualparamlist # expr actualparamlisttail # "EMPTY" # "EMPTY" actualparamlist # "EMPTY" # "EMPTY" # "EMPTY" actualparamlisttail # , actualparamlist # "EMPTY" # "EMPTY" actualparamlisttail # "EMPTY" # "EMPTY" # "EMPTY" lprimary # 28 # "EMPTY" # "EMPTY" lprimary # 29 # "EMPTY" # "EMPTY" lprimary # 30 lprimarysuffix # "EMPTY" # "EMPTY" lprimary # ( expr ) lprimarysuffix # "EMPTY" # "EMPTY" lprimarysuffix # ( actualparamlist ) # "EMPTY" # "EMPTY" lprimarysuffix # [ expr ] # "EMPTY" # "EMPTY" lprimarysuffix # "EMPTY" # "EMPTY" # "EMPTY" lhs # 30 # "EMPTY" # "EMPTY" lhs # lprimary [ expr ] # "EMPTY" # "EMPTY" lhs # * expr # "EMPTY" # "EMPTY" lhs # ( lhs ) # "EMPTY" # "EMPTY" cond # msk cond1 # "EMPTY" # "EMPTY" cond1 # ? msk : msk # "EMPTY" # "EMPTY" cond1 # = msk # "EMPTY" # "EMPTY" cond1 # "EMPTY" # "EMPTY" # "EMPTY" msk # ! cmp # "EMPTY" # "EMPTY" msk # - cmp # "EMPTY" # "EMPTY" msk # * cmp # "EMPTY" # "EMPTY" msk # & cmp # "EMPTY" # "EMPTY" msk # cmp msk1 # "EMPTY" # "EMPTY" msk1 # | cmp # "EMPTY" # "EMPTY" msk1 # & cmp # "EMPTY" # "EMPTY" msk1 # "EMPTY" # "EMPTY" # "EMPTY" cmp # bp cmp1 # "EMPTY" # "EMPTY" cmp1 # >= bp # "EMPTY" # "EMPTY" cmp1 # <= bp # "EMPTY" # "EMPTY" cmp1 # != bp # "EMPTY" # "EMPTY" cmp1 # == bp # "EMPTY" # "EMPTY" cmp1 # > bp # "EMPTY" # "EMPTY" cmp1 # < bp # "EMPTY" # "EMPTY" cmp1 # "EMPTY" # "EMPTY" # "EMPTY" bp # s bp1 # "EMPTY" # "EMPTY" bp1 # << s # "EMPTY" # "EMPTY" bp1 # >> s # "EMPTY" # "EMPTY" bp1 # "EMPTY" # "EMPTY" # "EMPTY" s # t s1 # "EMPTY" # "EMPTY" s1 # + t s1 # "EMPTY" # "EMPTY" s1 # - t s1 # "EMPTY" # "EMPTY" s1 # "EMPTY" # "EMPTY" # "EMPTY" t # f t1 # "EMPTY" # "EMPTY" t1 # * f s1 # "EMPTY" # "EMPTY" t1 # / f s1 # "EMPTY" # "EMPTY" t1 # "EMPTY" # "EMPTY" # "EMPTY" f # lprimary # "EMPTY" # "EMPTY" stmtlist # stmt stmtlist # "EMPTY" # "EMPTY" stmtlist # "EMPTY" # "EMPTY" # "EMPTY" compoundstmt # { stmtlist } # "EMPTY" # "EMPTY" stmt # switchstmt # "EMPTY" # "EMPTY" stmt # forstmt # "EMPTY" # "EMPTY" stmt # ifstmt # "EMPTY" # "EMPTY" stmt # returnstmt # "EMPTY" # "EMPTY" stmt # dostmt # "EMPTY" # "EMPTY" stmt # whilestmt # "EMPTY" # "EMPTY" stmt # breakstmt # "EMPTY" # "EMPTY" stmt # compoundstmt # "EMPTY" # "EMPTY" stmt # expr ; # "EMPTY" # "EMPTY" stmt # ; # "EMPTY" # "EMPTY" switchstmt # switch expr { casesequence } # "EMPTY" # "EMPTY" forstmt # for ( startlist ; forexpr ; iterlist ) stmt # "EMPTY" # "EMPTY" ifstmt # if expr stmt elseclause # "EMPTY" # "EMPTY" elseclause # else stmt # "EMPTY" # "EMPTY" elseclause # "EMPTY" # "EMPTY" # "EMPTY" returnstmt # return returnvalue ; # "EMPTY" # "EMPTY" returnvalue # expr # "EMPTY" # "EMPTY" returnvalue # "EMPTY" # "EMPTY" # "EMPTY" dostmt # do stmt while expr ; # "EMPTY" # "EMPTY" whilestmt # while expr stmt # "EMPTY" # "EMPTY" breakstmt # break ; # "EMPTY" # "EMPTY" casesequence # caseclause casesequencetail # "EMPTY" # "EMPTY" casesequence # "EMPTY" # "EMPTY" # "EMPTY" casesequencetail # caseclause casesequence # "EMPTY" # "EMPTY" casesequencetail # "EMPTY" # "EMPTY" # "EMPTY" caseclause # caseprefixseq stmtlist # "EMPTY" # "EMPTY" caseprefixseq # caseprefix caseprefixseqtail # "EMPTY" # "EMPTY" caseprefixseqtail # caseprefix caseprefixseq # "EMPTY" # "EMPTY" caseprefixseqtail # "EMPTY" # "EMPTY" # "EMPTY" caseprefix # case constantexpr : # "EMPTY" # "EMPTY" caseprefix # default : # "EMPTY" # "EMPTY" startlist # expr startlisttail # "EMPTY" # "EMPTY" startlist # "EMPTY" # "EMPTY" # "EMPTY" startlisttail # , startlist # "EMPTY" # "EMPTY" startlisttail # "EMPTY" # "EMPTY" # "EMPTY" iterlist # expr iterlisttail # "EMPTY" # "EMPTY" iterlist # "EMPTY" # "EMPTY" # "EMPTY" iterlisttail # , iterlist # "EMPTY" # "EMPTY" iterlisttail # "EMPTY" # "EMPTY" # "EMPTY" forexpr # expr # "EMPTY" # "EMPTY" forexpr # "EMPTY" # "EMPTY" # "EMPTY" subrinvocation # primary ( actualparamlist ) # "EMPTY" # "EMPTY" # */ int parse_stack_limit = 100; int parse_stack; int parse_table; int parse_stack_state[100]; int parse_stack_value1[100];int parse_stack_value2[100]; void parse_table_check(); void symbol_table_init(); int next_literal_string_list = 3; int literal_string_list_limit = 10000; int literal_string_list[10000]; int literal_index_limit = 256; int next_literal_index = 3; int literal_string_list_index[256]; int literal_sorted_order[256]; int testfun4(){ch = LINK;} int main(){ line_no = 0; printf("#if 0\n\n"); symbol_table_init(); /* compile(); */ if(testprint != 0) parse_table_check(); for (; conway_parser() == 0;); printf("#endif\n\n"); return(0); } int testfun5(){ch = LINK;} void parse_table_check() { int i;int len; printf("token list entries: %d\n", sizeof(parse_table_token)/intsize - 1); printf("control list entries: %d\n", sizeof(parse_table_control)/intsize - 1); printf("action list entries: %d\n", sizeof(parse_table_action)/intsize - 1); printf("conditional expression tests start here\n"); /* * comment line * */ 3 ? 5 : 7; /* * */ (3)?(5):(7); /* * */ a = (3 ? 5 : 7); len = (sizeof(parse_table_token) > sizeof(parse_table_control))?sizeof(parse_table_control) : sizeof(parse_table_token); len = (len > sizeof(parse_table_action))?sizeof(parse_table_action):len; len = len/intsize; for(i=1;i < len; i=i+1) { printf("%3d | ", i); if(parse_table_token[i] == EXHAUSTED) {printf(" EXHAUSTED ");} else if(parse_table_token[i] == EMPTY) { printf(" EMPTY ");} else if(parse_table_token[i] < NONTERMINAL) {printf("%12s ",token_map[parse_table_token[i]]);} else printf("nonterm%3d ",parse_table_token[i] - NONTERMINAL); printf("|"); if(parse_table_action[i] == 0) {printf(" ");} else if(parse_table_action[i] == EMPTY) {printf(" EMPTY ");} else printf (" action %3d ",parse_table_action[i]); printf("|"); if(parse_table_control[i] == 0) { printf(" ");} else if(parse_table_control[i] == EMPTY){ printf(" EMPTY ");} else printf (" next state %3d ",parse_table_control[i]); printf("|\n"); }; } int testfun6(){ch = LINK;} int compile(){ int token; int i;int k;int m; /* if ((token = scan()) == EOF)return(0); */ for(parse_stack = 0,parse_table = 0;;){ if ((token = scan()) == EOF){symbol_table_dump(0);return(0);}; }; } int testfun7(){ch = LINK;} int token_dump(int token){ int i;int j;int k; int /*char **/ cp; j = 0; /* if (token < 43) printf(" %s ",token_map[token]); */ if ((token < 0) | (token > token_types)) {printf(": %3d ",token); return 0;}; /* if ((token != 28) & (token != 29) & (token != 30) & (token < 43)) printf(" %s ",token_map[token]); */ if (token == 28) {printf("%5d",scanned_constant_value);j = 5;}; /*if (token == 29) for(i=0; scanned_string[i] !=0;i=i+1)printf("%c",scanned_string[i]);*/ if (token == 29){ k = literal_string_list_index[scanned_string_index]; for(i=k,j=0; literal_string_list[i] !=0;i=i+1,j=j+1)printf("%c",literal_string_list[i]); }; if (token == 30) { k = symbol_string_list_index[scanned_identifier_index]; for(i=k,j=0; symbol_string_list[i] !=0;i=i+1,j=j+1)printf("%c",symbol_string_list[i]); }; /*k = printf(" %s ",token_map[token]);*/ for(k=0,cp=token_map[token];cp[k] != 0;k=k+1,j=j+1) printf("%c",cp[k]); return j; } int testfun8(){ch = LINK;} void token_print(int token){ if ((token < 0) | (token > token_types)) {printf(": %3d ",token);} else printf(" %s ",token_map[token]); } int testfun9(){ch = LINK;} int symbol_table_dump(int n){ int i;int k;int m;int p; for(m=n;m': state = 4; break; case '!': state = 5; break; case '=': state = 6; break; case '"': state = 13; break; case '\'': state = 14; break; case '-': state = 23; sign = -1; break; default: return(character_operator_map[ch]); }; break; }; if ((character_type_map[ch] & 16) == 16) {state = 7; scanned_constant_value = ch - '0'; break;}; if (character_type_map[ch] == 64) {state = 8; break;}; break; case 1: if ((character_type_map[ch] & 0x02) == 2) { if (scanned_identifier_length ') {return(22/*right shift op*/);} else { if (ch == '=') {return(24/*greater than or equal op*/);} else {ch_look_ahead = ch; return(character_operator_map['>']);}; }; break; case 5: if (ch == '=') {return(26/*inequality op*/);} else {ch_look_ahead = ch; return(character_operator_map['!']);}; break; case 6: if (ch == '=') {return(27/*equality op*/);} else {ch_look_ahead = ch; return(character_operator_map['=']);}; break; case 7: if (((ch == 'x') | (ch == 'X')) & (scanned_constant_value == 0)) {state = 11;} else { if ((character_type_map[ch] & 16) == 16) {scanned_constant_value = (scanned_constant_value * 10) + ( sign * (ch - '0') ); state = 12;} else {ch_look_ahead = ch; return(28/*constant*/);}; }; break; case 8: switch(ch){ case 'n': scanned_constant_value = '\n'; break; case 't': scanned_constant_value = '\n'; break; case 'b': scanned_constant_value = '\b'; break; case 'r': scanned_constant_value = '\r'; break; case 'f': scanned_constant_value = '\f'; break; case '\\': scanned_constant_value = '\\'; break; case '\'': scanned_constant_value = '\''; break; case '0': scanned_constant_value = 0; break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': /* should these have single quotes? */ scanned_constant_value = ch - '0'; state = 21; break; default: state = 0; break; }; if ((state != 0) & (state != 21)){ return(28/*constant*/);} break; case 9: if (ch == '*') state = 10; break; case 10: if (ch == '/') { state = 0; if (testprint != 0) printf("end comment\n"); } else state = 9; break; case 11: if ((character_type_map[ch] & 32) == 32) { scanned_constant_value = (scanned_constant_value * 16) + ch; if (ch >= 'A') { if (ch >= 'a') {scanned_constant_value = scanned_constant_value - 'a' + 10;} else scanned_constant_value = scanned_constant_value - 'A' + 10; } else scanned_constant_value = scanned_constant_value - '0'; } else {ch_look_ahead = ch; return(28/*constant*/);}; break; case 12: if ((character_type_map[ch] & 16) == 16) {scanned_constant_value = (scanned_constant_value * 10) + (sign * (ch - '0') ); } else {ch_look_ahead = ch; return(28/*constant*/);}; break; case 13: if (ch != '"') { if (scanned_string_length < scanned_string_limit) { if (ch == '\\') state = 15; else { scanned_string[scanned_string_length] = ch; scanned_string_length = scanned_string_length + 1; scanned_string[scanned_string_length] = 0; }; break;}; } else { scanned_string_index = string_table_lookup(literal_index_limit, &next_literal_index, literal_string_list_limit, literal_string_list_index, literal_sorted_order, literal_string_list, &next_literal_string_list, scanned_string, scanned_string_length); return(29/*string*/); }; break; case 14:if (character_type_map[ch] == 64) {state = 19;} else { scanned_constant_value = ch; state = 20; }; break; case 15: switch(ch){ case 'n': scanned_constant_value = '\n'; state = 16; break; case 't': scanned_constant_value = '\n'; state = 16; break; case 'b': scanned_constant_value = '\b'; state = 16; break; case 'r': scanned_constant_value = '\r'; state = 16; break; case 'f': scanned_constant_value = '\f'; state = 16; break; case '\\': scanned_constant_value = '\\'; state = 16; break; case '\'': scanned_constant_value = '\''; state = 16; break; case '0': scanned_constant_value = 0; state = 16; break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': scanned_constant_value = ch - '0'; state = 17; break; default: ch_look_ahead = ch; state = 13; break; }; break; case 16: ch_look_ahead = ch; scanned_string[scanned_string_length] = scanned_constant_value; scanned_string_length = scanned_string_length + 1; scanned_string[scanned_string_length] = 0; state = 13; break; case 17: if ( (ch >= '0') & (ch <= '7')) { scanned_constant_value = (scanned_constant_value * 8) + ch - '0'; state = 18; } else { ch_look_ahead = ch; state = 16; }; break; case 18: if ( (ch >= '0') & (ch <= '7')) {scanned_constant_value = (scanned_constant_value * 8) + ch - '0';} else ch_look_ahead = ch; state = 16; break; case 19: switch(ch){ case 'n': scanned_constant_value = '\n'; state = 20; break; case 't': scanned_constant_value = '\n'; state = 20; break; case 'b': scanned_constant_value = '\b'; state = 20; break; case 'r': scanned_constant_value = '\r'; state = 20; break; case 'f': scanned_constant_value = '\f'; state = 20; break; case '\\': scanned_constant_value = '\\'; state = 20; break; case '\'': scanned_constant_value = '\''; state = 20; break; case '0': scanned_constant_value = 0; state = 20; break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': scanned_constant_value = ch - '0'; state = 21; break; default: scanned_constant_value = ch; state = 20; break; }; break; case 20: if (ch != '\'') ch_look_ahead = ch; return(28 /*constant*/); break; case 21: if ( (ch >= '0') & (ch <= '7')) { scanned_constant_value = (scanned_constant_value * 8) + ch - '0'; state = 22; } else { ch_look_ahead = ch; state = 20; }; break; case 22: if ( (ch >= '0') & (ch <= '7')) scanned_constant_value = (scanned_constant_value * 8) + ch - '0'; else ch_look_ahead = ch; state = 20; break; case 23: if ((character_type_map[ch] == 4))break; if (((character_type_map[ch] & 0x10) == 0x10)) { scanned_constant_value = sign * (ch - '0'); state = 7; break; } else { ch_look_ahead = ch; return(character_operator_map['-']); }; break; }; } } int testfun12(){ch = LINK;} int string_table_lookup(int string_index_limit, int next_string_index[], int string_list_limit, int string_list_index[], int string_sorted_order[], int string_list[], int next_string_list[], int string[], int string_len){ int i;int j;int k;int m;int n;int u;int v; for (m = ((*next_string_index)-1)/2, u = 0, v = ((*next_string_index)-1),n = 0; (u <= v) & (n >= 0); m = (u+v)/2) { k = string_list_index[string_sorted_order[m]]; for (i = k,j = 0; (string_list[i] != 0) | (string[j] != 0); i=i+1,j=j+1) { if (string_list[i] > string[j]) { v = m-1; n = m; break; } else if (string_list[i] < string[j]) { u = m+1; n = m+1; break; } else n = -1; } ; if (n < 0) { /* printf("n<0; m= %3d\n",m); */ /* found matching string */ return(string_sorted_order[m]); } ; } /* since no existing string matches, then insert the new string in the string list. */ if ( (n >= 0) & ((*next_string_index) < string_index_limit)) { /*printf("n>=0, n= %3d\n",n);*/ if(n < (*next_string_index)) for(i=(*next_string_index); i>n; i = i - 1) string_sorted_order[i] = string_sorted_order[i-1]; string_sorted_order[n] = (*next_string_index); for (i = 0,j = (*next_string_list); (i < string_len) & (j < string_list_limit); i=i+1,j=j+1) string_list[j] = string[i]; string_list_index[(*next_string_index)] = (*next_string_list); *next_string_list = j + 1; /* symbol_value_1[next_symbol_index] = 30;*/ *next_string_index = (*next_string_index) + 1; return(string_sorted_order[n]); } else return (0); } int testfun13(){ch = LINK;} int symbol_table_lookup(){ int index; int i; index = string_table_lookup(symbol_index_limit,&next_symbol_index, symbol_string_list_limit, symbol_string_list_index, symbol_sorted_order, symbol_string_list, &next_symbol_string_list, scanned_identifier, scanned_identifier_length); printf("symbol: ");for(i=0;i= first_identifier_index) symbol_value_1[index] = 30; return (index); } int testfun14(){ch = LINK;} /**************************************************************************************/ /* code generation and parsing follows */ int j;int scan_index;int current_token;int current_token_value; int prodlist[10000];int prodtokenvalue[10000];int actionlist[2048];int sequencelist[2048];int tokenlist[2048];int tokenvaluelist[2048]; int prodlistlimit; int actionlistlimit; int sequencelistlimit ;int tokenlistlimit; int prevprodindx;int curprodindx;int curprodhead;int prevprodhead; int nextavailentry; /**************************************************************************************/ /* code generation first */ int testfun15(){ch = LINK;} void codegen_init() { int i; prodlistlimit = sizeof(prodlist)/intsize; actionlistlimit = sizeof(actionlist)/intsize; sequencelistlimit = sizeof(sequencelist)/intsize; tokenlistlimit = sizeof(tokenlist)/intsize; for(i=0;i 0) /*main loop iterates over groups of alternate productions*/ { if((testprint & 0x2) != 0) printf("mainloop\n"); if((testprint & 0x2) != 0) printf("curprodhead: %3d, prodlist[curprodhead]: %3d\n",curprodhead,prodlist[curprodhead]); for(i=0,j=curprodhead,k=curprodhead;prodlist[k]>0;) { if((testprint & 0x2) != 0) printf("j: %3d, k: %3d\n",j,k); if(prodlist[j] == prodlist[k]) { i=i+1;/* count number of alternates for this production*/ prodlist[k + 5] = k + 5; if((testprint & 0x2) != 0) printf("i: %3d, j: %3d, k: %3d\n",i, j,k); } k = prodlist[k + 1]; }; prodlist[curprodhead + 4] = nextavailentry; /* reserve space for alternates */ nextavailentry = nextavailentry + i + 1; if((testprint & 0x2) != 0) printf("space reservation for alternates: prodlist[curprodhead + 4]:prodlist[%3d]: %3d, new nextavailentry: %3d\n",curprodhead + 4, prodlist[curprodhead + 4], nextavailentry); if((testprint & 0x2) != 0) printf("alternates: %3d, for entry: %3d\n",i,curprodhead); for(i=1,l=1;i<=curprodindx;i=i+1){ if(l == i){if((testprint & 0x2) != 0) printf("\n");l = prodlist[i+1];}; if((testprint & 0x2) != 0) printf("%3d: %4d %4d ",i,prodlist[i], prodtokenvalue[i]); if (prodlist[i] == 29) { j = literal_string_list_index[prodtokenvalue[i]]; for(k=j; literal_string_list[k] !=0;k=k+1)if((testprint & 0x2) != 0) printf("%c",literal_string_list[k]); }; if((testprint & 0x2) != 0) printf("\n"); }; if((testprint & 0x2) != 0) printf("first definition here\n"); if (symbol_value_3[prodlist[curprodhead]] == 0) {/* first definition here*/ symbol_value_3[prodlist[curprodhead]] = prodlist[curprodhead + 4] /*nextavailentry*/; }; if (symbol_value_3[prodlist[curprodhead]] < 0) {if((testprint & 0x2) != 0) printf("fixup3 forward references here\n"); /*fixup forward references here*/ for(i=symbol_value_3[prodlist[curprodhead]];i<0;) { j = tokenlist[-i]; tokenlist[-i] = prodlist[curprodhead + 4] /*nextavailentry*/ + NONTERMINAL; if((testprint & 0x2) != 0) printf("tokenlist[%3d] fixup: %3d\n",-i,prodlist[curprodhead + 4]/*nextavailentry*/); i = j; }; symbol_value_3[prodlist[curprodhead]] = prodlist[curprodhead + 4] /*nextavailentry*/; }; if((testprint & 0x2) != 0) printf("finished fixup3 forward references here\n"); if (symbol_value_4[prodlist[curprodhead]] == 0) {/* first definition here*/ symbol_value_4[prodlist[curprodhead]] = prodlist[curprodhead + 4] /*nextavailentry*/; }; if (symbol_value_4[prodlist[curprodhead]] < 0) {if((testprint & 0x2) != 0) printf("fixup forward4 references here\n"); /*fixup forward references here*/ for(i=symbol_value_4[prodlist[curprodhead]];i<0;) { j = sequencelist[-i]; sequencelist[-i] = prodlist[curprodhead + 4] /*nextavailentry*/ ; if((testprint & 0x2) != 0) printf("sequencelist[%3d] fixup: %3d\n",-i,prodlist[curprodhead + 4] /*nextavailentry*/); i = j; }; symbol_value_4[prodlist[curprodhead]] = prodlist[curprodhead + 4] /*nextavailentry*/; }; if((testprint & 0x2) != 0) printf("finished fixup4 forward references here\n"); if((testprint & 0x2) != 0) printf("prodlist prior to loop1 entry\n"); for(i=1,l=1;i<=curprodindx;i=i+1){ if(l == i) { if((testprint & 0x2) != 0) printf("\n"); l = prodlist[i+1]; if(i == curprodhead)if((testprint & 0x2) != 0) printf("---------curprodhead\n"); if((testprint & 0x2) != 0) printf("prod: "); { k = symbol_string_list_index[prodlist[i]]; for(j=k; symbol_string_list[j] !=0;j=j+1)if((testprint & 0x2) != 0) printf("%c",symbol_string_list[j]); }; if((testprint & 0x2) != 0) printf("\n"); }; if((testprint & 0x2) != 0) printf("%3d: %4d %4d ",i,prodlist[i], prodtokenvalue[i]); if (prodlist[i] == 29) { j = literal_string_list_index[prodtokenvalue[i]]; for(k=j; literal_string_list[k] !=0;k=k+1)if((testprint & 0x2) != 0) printf("%c",literal_string_list[k]); }; if((testprint & 0x2) != 0) printf("\n"); }; /* for(i=0;i0;) { printf("j: %3d, k: %3d\n",j,k); if(prodlist[j] == prodlist[k]) { i=i+1;//count number of alternates for this production prodlist[k + 5] = k + 5; printf("i: %3d, j: %3d, k: %3d\n",i, j,k); } k = prodlist[k + 1]; }; */ for(j=curprodhead,k=curprodhead;prodlist[k]>0;) {if((testprint & 0x2) != 0) printf("loop1\n"); if((testprint & 0x2) != 0) printf(" j: %3d k: %3d\n",j,k); if(prodlist[j] == prodlist[k]) { {/* generate alternate entries first */ if((testprint & 0x2) != 0) printf("alternate entry at: %3d, alt production: %3d\n",prodlist[j + 4],k); altentry = prodlist[j + 4]; if((testprint & 0x2) != 0) printf("prodlist[k + 1]: %4d\n",prodlist[k + 1]); if((testprint & 0x2) != 0) printf("prodlist[k + 5]: %4d\n",prodlist[k + 5]); if (prodlist[k + 5] < (prodlist[k + 1] - 1)) { prodlist[k + 5] = prodlist[k + 5] + 1; i = prodlist[k + 5]; if (i == (prodlist[k + 1] - 1)) {/* last token in sequence*/ if((testprint & 0x2) != 0) printf("last token in sequence\n"); if((testprint & 0x2) != 0) printf("table entry A at %3d:\n",altentry); /* tokenlist*/ switch(prodlist[i]) { case 29: tokenlist[altentry] = 29; tokenvaluelist[altentry] = prodtokenvalue[i]; break; case 28: tokenlist[altentry] = 28; tokenvaluelist[altentry] = prodtokenvalue[i]; break; case 30: tokenlist[altentry] = symbol_value_3[prodlist[prodtokenvalue[i]]]; /*/*/*check 1 */*/*/ if(symbol_value_3[prodlist[prodtokenvalue[i]]] <= 0) symbol_value_3[prodlist[prodtokenvalue[i]]] = -altentry; /*continue backward fixup chain*/ break; break; case 46: tokenlist[altentry] = symbol_value_3[prodlist[prodtokenvalue[i]]]; /*/*/*check 2 */*/*/ if(symbol_value_3[prodlist[prodtokenvalue[i]]] <= 0) symbol_value_3[prodlist[prodtokenvalue[i]]] = -altentry; /*continue backward fixup chain*/ else tokenlist[altentry] = tokenlist[altentry] + NONTERMINAL; break; default: tokenlist[altentry] = prodlist[i]; break; }; if((testprint & 0x2) != 0) printf("tokenlist[altentry:%3d]: %3d\n",altentry,tokenlist[altentry]); /* actionlist */ switch(prodlist[k + 2]) { case 28: actionlist[altentry] = prodtokenvalue[k + 2]; break; case 29: actionlist[altentry] = -prodtokenvalue[k + 2]; /*-ve denotes string index at output*/ break; default: actionlist[altentry] = prodlist[k + 2]; break; }; if((testprint & 0x2) != 0) printf("actionlist[altentry:%3d]: %3d\n",altentry,actionlist[altentry]); /* sequencelist */ switch(prodlist[k + 3]) { case 28: sequencelist[altentry] = prodtokenvalue[k + 3]; break; case 29: sequencelist[altentry] = -prodtokenvalue[k + 3]; /*-ve denotes string index at output*/ break; /*#if 0*/ /* * if (0){ case 30: sequencelist[altentry] = symbol_value_4[prodlist[prodtokenvalue[k + 3]]]; if(symbol_value_4[prodlist[prodtokenvalue[k + 3]]] <= 0) symbol_value_4[prodlist[prodtokenvalue[k + 3]]] = -altentry; /*continue backward fixup chain*/ break; /*#endif*/ }; */ case 46: sequencelist[altentry] = symbol_value_4[prodlist[prodtokenvalue[k + 3]]]; if(symbol_value_4[prodlist[prodtokenvalue[k + 3]]] <= 0) symbol_value_4[prodlist[prodtokenvalue[k + 3]]] = -altentry; /*continue backward fixup chain*/ break; default: printf("suspect token type: prodlist[k + 3]: prodlist[ %3d]: %3d\n",k + 3, prodlist[k + 3]); sequencelist[altentry] = prodlist[k + 3]; break; }; if(prevseqfixup > 0) { sequencelist[prevseqfixup] = altentry ; if((testprint & 0x2) != 0) printf("table entry B at %3d:\n",prevseqfixup); if((testprint & 0x2) != 0) printf("sequencelistlink: %3d, at: %3d\n",sequencelist[prevseqfixup],prevseqfixup); if((testprint & 0x2) != 0) printf("sequencelist[prevseqfixup:%3d]: %3d\n",prevseqfixup,sequencelist[prevseqfixup]); }; prevseqfixup = 0; if((testprint & 0x2) != 0) printf("table entry C at %3d:\n",altentry); if((testprint & 0x2) != 0) printf("sequencelis[altentry:%3d]: %3d\n",altentry,sequencelist[altentry]); altentry = altentry + 1; prodlist[j + 4] = prodlist[j + 4] + 1; } else {if (i < (prodlist[k + 1] - 1)) {/* not last token in sequence */ if((testprint & 0x2) != 0) printf("not last token in sequence\n"); if((testprint & 0x2) != 0) printf("table entry D at %3d:\n",altentry); /* tokenlist*/ switch(prodlist[i]) { case 29: tokenlist[altentry] = 29; tokenvaluelist[altentry] = prodtokenvalue[i]; break; case 28: tokenlist[altentry] = 28; tokenvaluelist[altentry] = prodtokenvalue[i]; break; case 30: tokenlist[altentry] = symbol_value_3[prodlist[prodtokenvalue[i]]]; /*/*/*check 3 */*/*/ if(symbol_value_3[prodlist[prodtokenvalue[i]]] <= 0) symbol_value_3[prodlist[prodtokenvalue[i]]] = -altentry; /*continue backward fixup chain*/ break; case 46: tokenlist[altentry] = symbol_value_3[prodlist[prodtokenvalue[i]]]; /*/*/*check 4 */*/*/ if(symbol_value_3[prodlist[prodtokenvalue[i]]] <= 0) symbol_value_3[prodlist[prodtokenvalue[i]]] = -altentry; /*continue backward fixup chain*/ else tokenlist[altentry] = tokenlist[altentry] + NONTERMINAL; break; default: tokenlist[altentry] = prodlist[i]; break; }; if((testprint & 0x2) != 0) printf("tokenlist[altentry:%3d]: %3d\n",altentry,tokenlist[altentry]); /* actionlist */ actionlist[altentry] = EMPTY; if((testprint & 0x2) != 0) printf("actionlist[altentry:%3d]: %3d\n",altentry,actionlist[altentry]); /* sequencelist */ if(prevseqfixup > 0) { sequencelist[prevseqfixup] = altentry ; if((testprint & 0x2) != 0) printf("table entry E at %3d:\n",prevseqfixup); if((testprint & 0x2) != 0) printf("sequencelistlink: %3d, at: %3d\n",sequencelist[prevseqfixup],prevseqfixup); if((testprint & 0x2) != 0) printf("sequencelist[prevseqfixup:%3d]: %3d\n",prevseqfixup,sequencelist[prevseqfixup]); }; prevseqfixup = altentry; sequencelist[altentry] = EMPTY; if((testprint & 0x2) != 0) printf("table entry F at %3d:\n",altentry); if((testprint & 0x2) != 0) printf("sequencelist[altentry:%3d]: %3d\n",altentry,sequencelist[altentry]); altentry = altentry + 1; prodlist[j + 4] = prodlist[j + 4] + 1; /* tokenlist[nextavailentry] = EXHAUSTED; actionlist[nextavailentry] = EMPTY; sequencelist[prevseqfixup] = EMPTY; nextavailentry = nextavailentry + 1; */ }; }; }; };/* generate alternate entries first*/ while(prodlist[k + 5] < prodlist[k + 1]) {if((testprint & 0x2) != 0) printf("loop2\n"); prodlist[k + 5] = prodlist[k + 5] + 1; if((testprint & 0x2) != 0) printf("prodlist[k + 1]: %4d\n",prodlist[k + 1]); if((testprint & 0x2) != 0) printf("prodlist[k + 5]: %4d\n",prodlist[k + 5]); i = prodlist[k + 5]; if (i == (prodlist[k + 1] - 1)) {/* last token in sequence*/ if((testprint & 0x2) != 0) printf("last token in sequence\n"); if((testprint & 0x2) != 0) printf("table entry G at %3d:\n",nextavailentry); /* tokenlist*/ switch(prodlist[i]) { case 29: tokenlist[nextavailentry] = 29; tokenvaluelist[nextavailentry] = prodtokenvalue[i]; break; case 28: tokenlist[nextavailentry] = 28; tokenvaluelist[nextavailentry] = prodtokenvalue[i]; break; case 30: tokenlist[nextavailentry] = symbol_value_3[prodlist[prodtokenvalue[i]]]; /*/*/*check 5 */*/*/ if(symbol_value_3[prodlist[prodtokenvalue[i]]] <= 0) symbol_value_3[prodlist[prodtokenvalue[i]]] = -nextavailentry; /*continue backward fixup chain*/ break; case 46: tokenlist[nextavailentry] = symbol_value_3[prodlist[prodtokenvalue[i]]]; /*/*/*check 6 */*/*/ if(symbol_value_3[prodlist[prodtokenvalue[i]]] <= 0) symbol_value_3[prodlist[prodtokenvalue[i]]] = -nextavailentry; /*continue backward fixup chain*/ else tokenlist[nextavailentry] = tokenlist[nextavailentry] + NONTERMINAL; break; default: tokenlist[nextavailentry] = prodlist[i]; break; }; if((testprint & 0x2) != 0) printf("tokenlist[nextavailentry:%3d]: %3d\n",nextavailentry,tokenlist[nextavailentry]); /* actionlist */ switch(prodlist[k + 2]) { case 28: actionlist[nextavailentry] = prodtokenvalue[k + 2]; break; case 29: actionlist[nextavailentry] = -prodtokenvalue[k + 2]; /*-ve denotes string index at output*/ break; default: actionlist[nextavailentry] = prodlist[k + 2]; break; }; if((testprint & 0x2) != 0) printf("actionlist[nextavailentry:%3d]: %3d\n",nextavailentry,actionlist[nextavailentry]); /* sequencelist */ switch(prodlist[k + 3]) { case 28: sequencelist[nextavailentry] = prodtokenvalue[k + 3]; break; case 29: sequencelist[nextavailentry] = -prodtokenvalue[k + 3]; /*-ve denotes string index at output*/ break; /* * /*#if 0*/ if (0){ case 30: sequencelist[nextavailentry] = symbol_value_4[prodlist[prodtokenvalue[k + 3]]]; if(symbol_value_4[prodlist[prodtokenvalue[k + 3]]] <= 0) symbol_value_4[prodlist[prodtokenvalue[k + 3]]] = -nextavailentry; /*continue backward fixup chain*/ break; /*#endif*/ }; */ case 46: sequencelist[nextavailentry] = symbol_value_4[prodlist[prodtokenvalue[k + 3]]]; if(symbol_value_4[prodlist[prodtokenvalue[k + 3]]] <= 0) symbol_value_4[prodlist[prodtokenvalue[k + 3]]] = -nextavailentry; /*continue backward fixup chain*/ break; default: sequencelist[nextavailentry] = prodlist[k + 3]; break; }; if((testprint & 0x2) != 0) printf("sequencelist[nextavailentry:%3d]: %3d\n",nextavailentry,sequencelist[nextavailentry]); if(prevseqfixup > 0) { sequencelist[prevseqfixup] = nextavailentry ; if((testprint & 0x2) != 0) printf("table entry H at %3d:\n",prevseqfixup); if((testprint & 0x2) != 0) printf("sequencelistlink: %3d, at: %3d\n",sequencelist[prevseqfixup],prevseqfixup); if((testprint & 0x2) != 0) printf("sequencelist[prevseqfixup:%3d]: %3d\n",prevseqfixup,sequencelist[prevseqfixup]); }; prevseqfixup = 0; nextavailentry = nextavailentry + 1; tokenlist[nextavailentry] = EXHAUSTED; actionlist[nextavailentry] = EMPTY; sequencelist[nextavailentry] = EMPTY; if((testprint & 0x2) != 0) printf("table entry HA at %3d:\n",nextavailentry); if((testprint & 0x2) != 0) printf("tokenlist[nextavailentry:%3d]: %3d\n",nextavailentry,tokenlist[nextavailentry]); if((testprint & 0x2) != 0) printf("actionlist[nextavailentry:%3d]: %3d\n",nextavailentry,actionlist[nextavailentry]); if((testprint & 0x2) != 0) printf("sequencelist[nextavailentry:%3d]: %3d\n",nextavailentry,sequencelist[nextavailentry]); nextavailentry = nextavailentry + 1; } else {if (i < (prodlist[k + 1] - 1)) {/* not last token in sequence */ if((testprint & 0x2) != 0) printf("not last token in sequence\n"); if((testprint & 0x2) != 0) printf("table entry I at %3d:\n",nextavailentry); /* tokenlist*/ switch(prodlist[i]) { case 29: tokenlist[nextavailentry] = 29; tokenvaluelist[nextavailentry] = prodtokenvalue[i]; break; case 28: tokenlist[nextavailentry] = 28; tokenvaluelist[nextavailentry] = prodtokenvalue[i]; break; case 30: tokenlist[nextavailentry] = symbol_value_3[prodlist[prodtokenvalue[i]]]; /*/*/*check 7 */*/*/ if(symbol_value_3[prodlist[prodtokenvalue[i]]] <= 0) symbol_value_3[prodlist[prodtokenvalue[i]]] = -nextavailentry; /*continue backward fixup chain*/ break; case 46: tokenlist[nextavailentry] = symbol_value_3[prodlist[prodtokenvalue[i]]]; /*/*/*check 8 */*/*/ if(symbol_value_3[prodlist[prodtokenvalue[i]]] <= 0) symbol_value_3[prodlist[prodtokenvalue[i]]] = -nextavailentry; /*continue backward fixup chain*/ else tokenlist[nextavailentry] = tokenlist[nextavailentry] + NONTERMINAL; break; default: tokenlist[nextavailentry] = prodlist[i]; break; }; if((testprint & 0x2) != 0) printf("tokenlist[nextavailentry:%3d]: %3d\n",nextavailentry,tokenlist[nextavailentry]); /* actionlist */ actionlist[nextavailentry] = EMPTY; if((testprint & 0x2) != 0) printf("actionlist[nextavailentry:%3d]: %3d\n",nextavailentry,actionlist[nextavailentry]); /* sequencelist */ if(prevseqfixup > 0) { sequencelist[prevseqfixup] = nextavailentry ; if((testprint & 0x2) != 0) printf("table entry J at %3d:\n",prevseqfixup); if((testprint & 0x2) != 0) printf("sequencelist: %3d\n",sequencelist[prevseqfixup]); }; prevseqfixup = nextavailentry ; nextavailentry = nextavailentry + 1; tokenlist[nextavailentry] = EXHAUSTED; actionlist[nextavailentry] = EMPTY; sequencelist[nextavailentry] = EMPTY; if((testprint & 0x2) != 0) printf("table entry K at %3d:\n",nextavailentry); if((testprint & 0x2) != 0) printf("tokenlist[nextavailentry:%3d]: %3d\n",nextavailentry,tokenlist[nextavailentry]); if((testprint & 0x2) != 0) printf("actionlist[nextavailentry:%3d]: %3d\n",nextavailentry,actionlist[nextavailentry]); if((testprint & 0x2) != 0) printf("sequencelist[nextavailentry:%3d]: %3d\n",nextavailentry,sequencelist[nextavailentry]); sequencelist[prevseqfixup] = EMPTY; nextavailentry = nextavailentry + 1; }; }; /* prodlist[k + 5] = prodlist[k + 5] + 1; once is enough*/ };/* loop2 */ if((testprint & 0x2) != 0) printf("end of loop2-- j: %3d k: %3d\n",j,k); }; k = prodlist[k + 1]; }; /* loop1 */ if(tokenlist[prodlist[j + 4]] == 0) { altentry = prodlist[j + 4]; tokenlist[altentry] = EXHAUSTED; actionlist[altentry] = EMPTY; sequencelist[altentry] = EMPTY; if((testprint & 0x2) != 0) printf("table entry L at %3d:\n",altentry); if((testprint & 0x2) != 0) printf("tokenlist[altentry:%3d]: %3d\n",altentry,tokenlist[altentry]); if((testprint & 0x2) != 0) printf("actionlist[altentry:%3d]: %3d\n",altentry,actionlist[altentry]); if((testprint & 0x2) != 0) printf("sequencelist[altentry:%3d]: %3d\n",altentry,sequencelist[altentry]); }; if((testprint & 0x2) != 0) printf("end of loop1-- j: %3d k: %3d\n",j,k); k = curprodhead; while ((prodlist[k] > 0) & (prodlist[curprodhead] == prodlist[k])) k =prodlist[k + 1]; curprodhead = k; if((testprint & 0x2) != 0) printf("bottom of main loop-- curprodhead: %3d, j: %3d, k: %3d\n",curprodhead,j,k); if((testprint & 0x2) != 0) { printf("progress of output tables:\n"); for(i=0;i 0) {if (tokenlist[i] <= NONTERMINAL) printf("| %3d ",tokenlist[i] ); else printf("|%3d+NONTERMINAL",tokenlist[i] - NONTERMINAL); } else if (tokenlist[i] < 0) { printf("|"); for(j = literal_string_list_index[ -tokenlist[i] ], k=0; (literal_string_list[j] !=0) & (k < 15);k=k+1,j=j+1)printf("%c",literal_string_list[j]); for(;k < 15;k=k+1)printf(" "); } else printf("| %3d ",tokenlist[i] ); /* * * if (tokenlist[i] == EMPTY) * printf("|EMPTY "); * else * printf("|EXHAUSTED"); * */ }; {/* actionlist */ if (actionlist[i] < (-1)) { printf("|"); for(j = literal_string_list_index[ -actionlist[i]], k=0; (literal_string_list[j] !=0) & (k < 12);k=k+1,j=j+1)printf("%c",literal_string_list[j]); for(;k < 12;k=k+1)printf(" "); } else printf("| %3d ",actionlist[i] ); }; {/* sequencelist */ if (sequencelist[i] == EMPTY) printf("|EMPTY \n "); else printf("| %3d \n ",sequencelist[i] ); }; }; printf("\n\n"); } }; /*main loop*/ }; /* finished generating parse tables */ /* report any undefined symbols */ printf("\n\n\n"); for(i=first_identifier_index;i= 0) {if (tokenlist[i] <= NONTERMINAL) { /*printf("| %3d ",tokenlist[i] );*/ printf("|"); if (tokenlist[i] == 28) scanned_constant_value = tokenvaluelist[i]; else if (tokenlist[i] == 29) scanned_string_index = tokenvaluelist[i]; k = token_dump(tokenlist[i] ); for(;k < 15;k=k+1)printf(" "); } else printf("|%3d+NONTERMINAL",tokenlist[i] - NONTERMINAL); } else if (tokenlist[i] < 0) { if (tokenlist[i] == EMPTY) printf("|EMPTY "); else if (tokenlist[i] == EXHAUSTED)printf("|EXHAUSTED "); else { printf("|"); for(j = literal_string_list_index[ -tokenlist[i] ], k=0; (literal_string_list[j] !=0) & (k < 15);k=k+1,j=j+1)printf("%c",literal_string_list[j]); for(;k < 15;k=k+1)printf(" "); }; }; }; {/* actionlist */ if (actionlist[i] < EXHAUSTED) { printf("|"); for(j = literal_string_list_index[ -actionlist[i]], k=0; (literal_string_list[j] !=0) & (k < 13);k=k+1,j=j+1)printf("%c",literal_string_list[j]); for(;k < 13;k=k+1)printf(" "); } else if (actionlist[i] == EMPTY) printf("|EMPTY "); else if (actionlist[i] == EXHAUSTED)printf("|EXHAUSTED "); else printf("| %3d ",actionlist[i] ); }; {/* sequencelist */ if (sequencelist[i] == EMPTY) printf("|EMPTY \n "); else if(sequencelist[i] < 0) { for(j = literal_string_list_index[ -sequencelist[i]], k=0; (literal_string_list[j] !=0) & (k < 13);k=k+1,j=j+1)printf("%c",literal_string_list[j]); printf(",\n"); } else printf("| %3d \n ",sequencelist[i] ); }; }; symbol_table_dump(13); }; { printf("#endif\n\n"); /* formatted tables to paste into code */ /* * int parse_table_token[] = x * int parse_table_action[] = x * int parse_table_control[] = x */ printf("\n\n/* generated tables */\n"); printf("\n\nint parse_table_token[] = {\n"); for(i=0;i= 0) {if (tokenlist[i] <= NONTERMINAL) { if (tokenlist[i] == 28) printf(" %3d,\n",tokenvaluelist[i]); else { if (tokenlist[i] == 29) { printf(" "); for(j = literal_string_list_index[ tokenvaluelist[i] ], k=0; (literal_string_list[j] !=0) & (k < 15);k=k+1,j=j+1)printf("%c",literal_string_list[j]); printf(",\n"); } else printf(" %3d,\n",tokenlist[i]); }; } else printf(" %3d+NONTERMINAL,\n",tokenlist[i] - NONTERMINAL); } else { if (tokenlist[i] == EMPTY) printf(" EMPTY,\n"); else { if (tokenlist[i] == EXHAUSTED) printf(" EXHAUSTED,\n"); else printf(" %3d,\n",tokenlist[i]); }; }; }; printf(" };\n"); printf("\n\nint parse_table_action[] = {\n"); for(i=0;i= prodlistlimit){printf("production list is full at line %5d, can't proceed\n",line_no);return;}; curprodindx = curprodindx + 1; curprodhead = curprodindx; /*if (prevprodhead > 0) prodlist[prevprodhead + 1] = curprodhead;*/ if (symbol_value_2[scanned_identifier_index] == 0) {/* first definition here*/ if((testprint & 0x2) != 0) printf("first definition here\n"); symbol_value_2[scanned_identifier_index] = curprodhead ; }; if (symbol_value_2[scanned_identifier_index] < 0) {/*fixup forward references here*/ if((testprint & 0x2) != 0) printf("fixup forward references here\n"); for(i=symbol_value_2[scanned_identifier_index];i<0;) { j = prodtokenvalue[-i]; if((testprint & 0x2) != 0) printf("fixup reference prodtokenvalue[%3d] to be %3d\n",-i,curprodhead); prodtokenvalue[-i] = curprodhead ; i = j; }; symbol_value_2[scanned_identifier_index] = curprodhead ; } prodlist[curprodhead] = scanned_identifier_index; /* space for fwd link, action, and sequence */ curprodindx = curprodindx + 5; break; case 4: if((testprint & 0x2) != 0) printf("add token to data table\n"); if((testprint & 0x2) != 0) token_dump(current_token); if((testprint & 0x2) != 0) printf("\n\n"); if((curprodindx + 2) >= prodlistlimit){printf("production list is full at line %5d, can't proceed\n",line_no);return;}; curprodindx = curprodindx + 1; if (current_token == 28) /* numeric constant is used directly*/ { prodlist[curprodindx] = 28; prodtokenvalue[curprodindx] = scanned_constant_value; } else if (current_token == 29) {/* string literal */ prodlist[curprodindx] = 29; prodtokenvalue[curprodindx] = scanned_string_index; } else if (current_token == 30) {/* identifier */ prodlist[curprodindx] = 46; prodtokenvalue[curprodindx] = symbol_value_2[scanned_identifier_index]; if (symbol_value_2[scanned_identifier_index] <= 0) {/*not defined yet-- add fixup link */ symbol_value_2[scanned_identifier_index] = -curprodindx; }; } else prodlist[curprodindx] = current_token; break; case 5: if((testprint & 0x2) != 0) printf("add action identifier to data table\n"); if((testprint & 0x2) != 0) token_dump(current_token); if((testprint & 0x2) != 0) printf("\n\n"); if (current_token == 28) /* numeric constant is used directly*/ { prodlist[curprodhead + 2] = 28; prodtokenvalue[curprodhead + 2] = scanned_constant_value; } else if (current_token == 30) {/* identifier is interned in string literal list*/ prodlist[curprodhead + 2] = 29; prodtokenvalue[curprodhead + 2] = string_table_lookup(literal_index_limit, &next_literal_index, literal_string_list_limit, literal_string_list_index, literal_sorted_order, literal_string_list, &next_literal_string_list, scanned_identifier, scanned_identifier_length); } else if (current_token == 29) { prodlist[curprodhead + 2] = 29; prodtokenvalue[curprodhead + 2] = scanned_string_index; } else { printf("can\'t have this token type in action field: "); token_dump(current_token); printf("\n"); } break; case 6: if((testprint & 0x2) != 0) printf("add sequence identifier to data table\n"); if((testprint & 0x2) != 0) token_dump(current_token); if((testprint & 0x2) != 0) printf("\n\n"); if (current_token == 28) /* numeric constant is used directly*/ { prodlist[curprodhead + 3] = 28; prodtokenvalue[curprodhead + 3] = scanned_constant_value; } else if (current_token == 30) {/* identifier */ prodlist[curprodhead + 3] = 46; prodtokenvalue[curprodhead + 3] = symbol_value_2[scanned_identifier_index]; if (symbol_value_2[scanned_identifier_index] <= 0) {/*not defined yet-- add fixup link */ symbol_value_2[scanned_identifier_index] = -(curprodhead + 3); }; } else if (current_token == 29) {/* string literal */ prodlist[curprodhead + 3] = 29; prodtokenvalue[curprodhead + 3] = scanned_string_index; }; break; default: return; }; } int testfun17(){ch = LINK;} /**************************************************************************************/ /* parser */ /* Slimmick's version of Conway's parser: */ int conway_parser() { codegen_init(); j = 1; scan_index = j; current_token = scan(); if(current_token == (-1)) return 1; { if(takepath(1) == TRUE) {if(testprint != 0)printf("legal\n\n");} else {if(testprint != 0)printf("illegal at line number: %4d\n\n",line_no);}; }; return (0); } int testfun18(){ch = LINK;} void semantic_action_orig(int i) { printf("******** semantic action %3d\n",i); } int testfun19(){ch = LINK;} int sym(int i) { if(i == scan_index) { if(testprint & 0x1 != 0) printf("index:%3d, scan_index:%3d, current_token:%3d is: ",i, scan_index, current_token); if(testprint & 0x1 != 0) token_dump(current_token); if(testprint & 0x1 != 0) printf("\n"); return current_token;} else if (i > scan_index) { current_token = scan(); current_token_value = 0; if (current_token == 28) current_token_value = scanned_constant_value; if (current_token == 30) current_token_value = scanned_identifier_index; if(testprint & 0x1 != 0) printf("index:%3d, scan_index:%3d, current_token:%3d is: ",i, scan_index, current_token); if(testprint & 0x1 != 0) { token_dump(current_token); printf("\n");}; scan_index = i; return current_token;}; printf("can't backup scanner\n"); if(testprint & 0x1 != 0) printf("index:%3d, scan_index:%3d, current_token:%3d\n",i, scan_index, current_token); return current_token; } int testfun20(){ch = LINK;} int terminal(int i){return ( (i < NONTERMINAL) & (i > 0) );} int testfun21(){ch = LINK;} int nonterminal(int i){return (i >= NONTERMINAL);} int testfun22(){ch = LINK;} int takepath_orig(int k) { /*recursive original version*/ int jsave;int i; printf("parsing diagram rooted at node %3d\n",k); i = k; for(;(i != EMPTY) & (parse_table_token[i] != EXHAUSTED);) { printf("checking token %3d at node %3d\n",parse_table_token[i], i); if(terminal(parse_table_token[i])) { printf("looking for "); token_print(parse_table_token[i]); printf("\n"); if(parse_table_token[i] == sym(j)) { printf("terminal token matched at node %3d\n",i); semantic_action(parse_table_action[i]); j = j+1; i = parse_table_control[i]; } else {printf("terminal token mismatched at node %2d\n",i); i = i+1;}; } else { if(nonterminal(parse_table_token[i])) {printf("checking nonterminal token %3d (node %3d) from node %3d\n",parse_table_token[i], parse_table_token[i] - NONTERMINAL, i); jsave = j; if(takepath(parse_table_token[i] - NONTERMINAL)) {printf("accepted nonterminal token %3d (node %3d) from node %3d\n",parse_table_token[i], parse_table_token[i] - NONTERMINAL,i); semantic_action(parse_table_action[i]); i = parse_table_control[i];} else {printf("rejected nonterminal token %3d (node %3d) from node %3d\n",parse_table_token[i], parse_table_token[i] - NONTERMINAL,i); j = jsave; i = i+1; } } else { if(parse_table_token[i] == EMPTY) {printf("empty token accepted at node %3d\n",i);semantic_action(parse_table_action[i]);i = parse_table_control[i];} else {printf("error1 at node %3d\n", i); return(FALSE);}; }; } }; if(i == EMPTY) return(TRUE); else { if(parse_table_control[i] == EMPTY /*EXHAUSTED*/) {printf("error2a at node %3d\n", i); return(FALSE);} else {/* printf("error2b at node %3d\n", i); */ return (FALSE);}; } } int testfun23(){ch = LINK;} int takepath(int k) { /*version using explicit stack instead of recursion*/ /*/*/* local init test-- int parse_table_stack[100] = {0,};int token_stack[100] = {1,}; int stack_limit; int stack_index = 0; int recurse = 0; int return_value; */*/*/ int parse_table_stack[100] = {0,};int token_stack[100] = {1,}; int stack_limit; int stack_index = 0; int recurse = 0; int return_value; int i; stack_limit = sizeof(parse_table_stack)/intsize; /* stack_index = 0; recurse = 0; parse_table_stack[0] = 0; token_stack[0] = -1; */ i = k; for (;;) { if(testprint & 0x1 != 0)printf("parsing diagram rooted at node %3d\n",i); for(;(i != EMPTY) & ((parse_table_token[i] != EXHAUSTED) & (recurse == 0));) { if(testprint & 0x1 != 0)printf("checking token %3d at node %3d\n",parse_table_token[i], i); if(terminal(parse_table_token[i])) { if(testprint & 0x1 != 0) printf("looking for "); if(testprint & 0x1 != 0) token_print(parse_table_token[i]); if(testprint & 0x1 != 0) printf("\n"); if(parse_table_token[i] == sym(j)) { if(testprint & 0x1 != 0) printf("terminal token matched at node %3d\n",i); semantic_action(parse_table_action[i]); j = j+1; i = parse_table_control[i]; } else { if(testprint & 0x1 != 0) printf("terminal token mismatched at node %3d\n",i); i = i+1;}; } else { if(nonterminal(parse_table_token[i])) { recurse = 1; } else { if(parse_table_token[i] == EMPTY) { if(testprint & 0x1 != 0) printf("empty token accepted at node %3d\n",i); semantic_action(parse_table_action[i]); i = parse_table_control[i]; } else { printf("error1 at node %3d\n", i); return(FALSE); }; }; }; }; if(recurse == 0) { if(i == EMPTY) return_value = TRUE; else { if(parse_table_control[i] == EMPTY /*EXHAUSTED*/) {printf("error2 at node %3d\n", i); return(FALSE);} else { return_value = FALSE; }; }; if (stack_index > 0) { stack_index = stack_index - 1; if (return_value == TRUE) { if(testprint & 0x1 != 0) printf("accepted nonterminal token %3d (node %3d) from node %3d\n",parse_table_token[parse_table_stack[stack_index]], parse_table_token[parse_table_stack[stack_index]] - NONTERMINAL,parse_table_stack[stack_index]); semantic_action(parse_table_action[parse_table_stack[stack_index] ]); i = parse_table_control[parse_table_stack[stack_index] ]; } else { if(testprint & 0x1 != 0) printf("rejected nonterminal token %3d (node %3d) from node %3d\n",parse_table_token[parse_table_stack[stack_index]], parse_table_token[parse_table_stack[stack_index]] - NONTERMINAL,parse_table_stack[stack_index]); j = token_stack[stack_index]; i = parse_table_stack[stack_index] + 1; }; } else return(return_value); } else { if(testprint & 0x1 != 0) printf("checking nonterminal token %3d (node %3d) from node %3d\n",parse_table_token[i], parse_table_token[i] - NONTERMINAL, i); token_stack[stack_index] = j; parse_table_stack[stack_index] = i; i = parse_table_token[i] - NONTERMINAL; if (stack_index >= stack_limit){printf("parser stack is full at line %5d, can't continue\n",line_no); return FALSE;}; stack_index = stack_index + 1; recurse = 0; }; }; } int testfun24(){ch = LINK;} int testfun25(){ch = LINK;} /* last line is comment */ #include "actions.h" program ` decl_list ` "EMPTY" ` "EMPTY" decl_list ` decl ` "EMPTY" ` decl_list decl_list ` "EMPTY" ` "EMPTY" ` "EMPTY" decl ` typespecifier globalobjspecifier ` "EMPTY" ` "EMPTY" typespecifier ` type IDENT ` "EMPTY" ` "EMPTY" type ` void ` "EMPTY" ` "EMPTY" type ` int ` "EMPTY" ` "EMPTY" globalobjspecifier ` ; ` "EMPTY" ` "EMPTY" globalobjspecifier ` = initspecifier ; ` "EMPTY" ` "EMPTY" globalobjspecifier ` subroutinespecifier ` "EMPTY" ` "EMPTY" globalobjspecifier ` arrayspecifier ; ` "EMPTY" ` "EMPTY" initspecifier ` scalarspecifier ` "EMPTY" ` "EMPTY" arrayspecifier ` [ arraysize ] initlistprefix ` "EMPTY" ` "EMPTY" subroutinespecifier ` ( formalparameterlist ) subrbody ` "EMPTY" ` "EMPTY" scalarspecifier ` constantexpr ` "EMPTY" ` "EMPTY" scalarspecifier ` "EMPTY" ` "EMPTY" ` "EMPTY" arraysize ` constantexpr ` "EMPTY" ` "EMPTY" arraysize ` "EMPTY" ` "EMPTY" ` "EMPTY" initlistprefix ` = { ` "EMPTY" ` initlistsuffix initlistprefix ` "EMPTY" ` "EMPTY" ` "EMPTY" initlistsuffix ` constantexprlist } ` "EMPTY" ` "EMPTY" formalparameterlist ` formalparameter ` "EMPTY" ` formalparametertail formalparameter ` int IDENT parameterarray ` "EMPTY" ` "EMPTY" formalparameter ` "EMPTY" ` "EMPTY" ` "EMPTY" parameterarray ` [ ] ` "EMPTY" ` "EMPTY" parameterarray ` "EMPTY" ` "EMPTY" ` "EMPTY" formalparametertail ` , ` "EMPTY" ` formalparameterlist formalparametertail ` "EMPTY" ` "EMPTY" ` "EMPTY" subrbody ` { localdecllist stmtlist } ` "EMPTY" ` "EMPTY" subrbody ` ; ` "EMPTY" ` "EMPTY" localdecllist ` localdecl localdecllist ` "EMPTY" ` "EMPTY" localdecllist ` "EMPTY" ` "EMPTY" ` "EMPTY" localdecl ` typespecifier localobjspecifier ` "EMPTY" ` "EMPTY" localobjspecifier ` ; ` "EMPTY" ` "EMPTY" localobjspecifier ` arrayspecifier ; ` "EMPTY" ` "EMPTY" localobjspecifier ` = initspecifier ; ` "EMPTY" ` "EMPTY" constantexprlist ` constantexpr ` "EMPTY" ` constantexprlisttail constantexprlist ` "EMPTY" ` "EMPTY" ` "EMPTY" constantexprlisttail ` , ` "EMPTY" ` constantexprlist constantexprlisttail ` "EMPTY" ` "EMPTY" ` "EMPTY" constantexpr ` constantcond ` "EMPTY" ` "EMPTY" constantcond ` constantmsk constantcond1 ` "EMPTY" ` "EMPTY" constantcond1 ` ? constantmsk : constantmsk ` "EMPTY" ` "EMPTY" constantcond1 ` "EMPTY" ` "EMPTY" ` "EMPTY" constantmsk ` unop constantcmp constantmsk1 ` "EMPTY" ` "EMPTY" unop ` ! ` "EMPTY" ` "EMPTY" unop ` - ` "EMPTY" ` "EMPTY" unop ` "EMPTY" ` "EMPTY" ` "EMPTY" constantmsk1 ` | constantcmp ` "EMPTY" ` "EMPTY" constantmsk1 ` & constantcmp ` "EMPTY" ` "EMPTY" constantmsk1 ` "EMPTY" ` "EMPTY" ` "EMPTY" constantcmp ` constantbp constantcmp1 ` "EMPTY" ` "EMPTY" constantcmp1 ` >= constantbp ` "EMPTY" ` "EMPTY" constantcmp1 ` <= constantbp ` "EMPTY" ` "EMPTY" constantcmp1 ` == constantbp ` "EMPTY" ` "EMPTY" constantcmp1 ` != constantbp ` "EMPTY" ` "EMPTY" constantcmp1 ` > constantbp ` "EMPTY" ` "EMPTY" constantcmp1 ` < constantbp ` "EMPTY" ` "EMPTY" constantcmp1 ` "EMPTY" ` "EMPTY" ` "EMPTY" constantbp ` constantsum constantbp1 ` "EMPTY" ` "EMPTY" constantbp1 ` << constantsum ` "EMPTY" ` "EMPTY" constantbp1 ` >> constantsum ` "EMPTY" ` "EMPTY" constantbp1 ` "EMPTY" ` "EMPTY" ` "EMPTY" constantsum ` constantterm constantsum1 ` "EMPTY" ` "EMPTY" constantsum1 ` + constantterm constantsum1 ` "EMPTY" ` "EMPTY" constantsum1 ` - constantterm constantsum1 ` "EMPTY" ` "EMPTY" constantsum1 ` "EMPTY" ` "EMPTY" ` "EMPTY" constantterm ` constantfact constantterm1 ` "EMPTY" ` "EMPTY" constantterm1 ` * constantfact constantterm1 ` "EMPTY" ` "EMPTY" constantterm1 ` / constantfact constantterm1 ` "EMPTY" ` "EMPTY" constantterm1 ` "EMPTY" ` "EMPTY" ` "EMPTY" constantfact ` constantpri ` "EMPTY" ` "EMPTY" constantpri ` & IDENT ` "EMPTY" ` "EMPTY" constantpri ` CONST ` "EMPTY" ` "EMPTY" constantpri ` STRING ` "EMPTY" ` "EMPTY" constantpri ` ( constantexpr ) ` "EMPTY" ` "EMPTY" expr ` primary ` "EMPTY" ` "EMPTY" primary ` cond ` "EMPTY" ` "EMPTY" cond ` msk cond1 ` "EMPTY" ` "EMPTY" cond1 ` ? expr : expr ` 25 ` "EMPTY" cond1 ` = expr ` 26 ` "EMPTY" cond1 ` "EMPTY" ` "EMPTY" ` "EMPTY" msk ` ! cmp ` 21 ` "EMPTY" msk ` - cmp ` 22 ` "EMPTY" msk ` * cmp ` 23 ` "EMPTY" msk ` & cmp ` 24 ` "EMPTY" msk ` cmp msk1 ` "EMPTY" ` "EMPTY" msk1 ` | cmp ` 19 ` "EMPTY" msk1 ` & cmp ` 20 ` "EMPTY" msk1 ` "EMPTY" ` "EMPTY" ` "EMPTY" cmp ` bp cmp1 ` "EMPTY" ` "EMPTY" cmp1 ` >= bp ` 13 ` "EMPTY" cmp1 ` <= bp ` 14 ` "EMPTY" cmp1 ` != bp ` 15 ` "EMPTY" cmp1 ` == bp ` 16 ` "EMPTY" cmp1 ` > bp ` 17 ` "EMPTY" cmp1 ` < bp ` 18 ` "EMPTY" cmp1 ` "EMPTY" ` "EMPTY" ` "EMPTY" bp ` s bp1 ` "EMPTY" ` "EMPTY" bp1 ` << s ` 11 ` "EMPTY" bp1 ` >> s ` 12 ` "EMPTY" bp1 ` "EMPTY" ` "EMPTY" ` "EMPTY" s ` t s1 ` "EMPTY" ` "EMPTY" s1 ` + t s1 ` 9 ` "EMPTY" s1 ` - t s1 ` 10 ` "EMPTY" s1 ` "EMPTY" ` "EMPTY" ` "EMPTY" t ` f f1 ` "EMPTY" ` "EMPTY" f1 ` * f f1 ` 7 ` "EMPTY" f1 ` / f f1 ` 8 ` "EMPTY" f1 ` "EMPTY" ` "EMPTY" ` "EMPTY" f ` lprimary ` "EMPTY" ` "EMPTY" lprimary ` CONST ` 1 ` "EMPTY" lprimary ` STRING ` 2 ` "EMPTY" lprimary ` IDENT ` 3 ` lprimarysuffix lprimary ` ( expr ) lprimarysuffix ` "EMPTY" ` "EMPTY" lprimarysuffix ` ( actualparamlist ) ` 5 ` "EMPTY" lprimarysuffix ` [ expr ] ` 6 ` "EMPTY" lprimarysuffix ` "EMPTY" ` "EMPTY" ` "EMPTY" actualparamlist ` expr ` 27 `actualparamlisttail actualparamlist ` "EMPTY" ` "EMPTY" ` "EMPTY" actualparamlisttail ` , ` "EMPTY" ` actualparamlist actualparamlisttail ` "EMPTY" ` "EMPTY" ` "EMPTY" stmtlist ` stmt ` "EMPTY" ` stmtlist stmtlist ` "EMPTY" ` "EMPTY" ` "EMPTY" compoundstmt ` { stmtlist } ` "EMPTY" ` "EMPTY" stmt ` switchstmt ` "EMPTY" ` "EMPTY" stmt ` forstmt ` "EMPTY" ` "EMPTY" stmt ` ifstmt ` "EMPTY" ` "EMPTY" stmt ` returnstmt ` "EMPTY" ` "EMPTY" stmt ` dostmt ` "EMPTY" ` "EMPTY" stmt ` whilestmt ` "EMPTY" ` "EMPTY" stmt ` breakstmt ` "EMPTY" ` "EMPTY" stmt ` compoundstmt ` "EMPTY" ` "EMPTY" stmt ` expr ; ` "EMPTY" ` "EMPTY" stmt ` ; ` "EMPTY" ` "EMPTY" switchstmt ` switch expr { casesequence } ` "EMPTY" ` "EMPTY" forstmt ` for ( startlist ; forexpr ; iterlist ) stmt ` "EMPTY" ` "EMPTY" ifstmt ` if expr stmt elseclause ` "EMPTY" ` "EMPTY" elseclause ` else stmt ` "EMPTY" ` "EMPTY" elseclause ` "EMPTY" ` "EMPTY" ` "EMPTY" returnstmt ` return returnvalue ; ` "EMPTY" ` "EMPTY" returnvalue ` expr ` "EMPTY" ` "EMPTY" returnvalue ` "EMPTY" ` "EMPTY" ` "EMPTY" dostmt ` do stmt while expr ; ` "EMPTY" ` "EMPTY" whilestmt ` while expr stmt ` "EMPTY" ` "EMPTY" breakstmt ` break ; ` "EMPTY" ` "EMPTY" casesequence ` caseclause ` "EMPTY" ` casesequence casesequence ` "EMPTY" ` "EMPTY" ` "EMPTY" caseclause ` caseprefixseq stmtlist ` "EMPTY" ` "EMPTY" caseprefixseq ` caseprefix ` "EMPTY" ` caseprefixseqtail caseprefixseqtail ` caseprefix ` "EMPTY" ` caseprefixseqtail caseprefixseqtail ` "EMPTY" ` "EMPTY" ` "EMPTY" caseprefix ` case constantexpr : ` "EMPTY" ` "EMPTY" caseprefix ` default : ` "EMPTY" ` "EMPTY" startlist ` expr startlisttail ` "EMPTY" ` "EMPTY" startlist ` "EMPTY" ` "EMPTY" ` "EMPTY" startlisttail ` , startlist ` "EMPTY" ` "EMPTY" startlisttail ` "EMPTY" ` "EMPTY" ` "EMPTY" iterlist ` expr iterlisttail ` "EMPTY" ` "EMPTY" iterlist ` "EMPTY" ` "EMPTY" ` "EMPTY" iterlisttail ` , iterlist ` "EMPTY" ` "EMPTY" iterlisttail ` "EMPTY" ` "EMPTY" ` "EMPTY" forexpr ` expr ` "EMPTY" ` "EMPTY" forexpr ` "EMPTY" ` "EMPTY" ` "EMPTY" ` #endif