|
|
1.1.1.3 ! root 1: #ifndef lint 1.1 root 2: 1.1.1.3 ! root 3: char yysccsid[] = "@(#)yaccpar 1.3 (Berkeley) 01/21/90"; 1.1 root 4: 1.1.1.3 ! root 5: #endif 1.1 root 6: 1.1.1.3 ! root 7: #define WORD 257 1.1 root 8: 1.1.1.3 ! root 9: #define WHITESP 258 1.1 root 10: 1.1.1.3 ! root 11: #define EOLN 259 1.1 root 12: 1.1.1.3 ! root 13: #define STRING 260 1.1 root 14: 1.1.1.3 ! root 15: #define DEFINECMD 261 1.1 root 16: 1.1.1.3 ! root 17: #define INCLUDECMD 262 1.1 root 18: 1.1.1.3 ! root 19: #define IFDEFCMD 263 1.1 root 20: 1.1.1.3 ! root 21: #define IFNDEFCMD 264 1.1 root 22: 1.1.1.3 ! root 23: #define ELSECMD 265 1.1 root 24: 1.1.1.3 ! root 25: #define ENDIFCMD 266 1.1 root 26: 1.1.1.3 ! root 27: #define YYERRCODE 256 1.1 root 28: 29: #line 3 "asm.y" 30: 31: #define YYSTYPE char * 32: 33: 34: 35: #include "asmtrans.h" 36: 1.1.1.3 ! root 37: #line 19 "y_tab.c" 1.1 root 38: 1.1.1.3 ! root 39: short yylhs[] = { -1, 1.1 root 40: 1.1.1.3 ! root 41: 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1.1 root 42: 1.1.1.3 ! root 43: 1, 1, 1, 1, 3, 3, 3, 3, 6, 6, 1.1 root 44: 1.1.1.3 ! root 45: 5, 2, 4, 4, 4, 4, 4, 4, 4, 4, 1.1 root 46: 1.1.1.3 ! root 47: 4, 4, 4, 4, 4, 7, 7, 7, 8, 8, 1.1 root 48: 1.1.1.3 ! root 49: 9, 9, 9, 9, 1.1 root 50: 1.1.1.3 ! root 51: }; 1.1 root 52: 1.1.1.3 ! root 53: short yylen[] = { 2, 1.1 root 54: 1.1.1.3 ! root 55: 0, 2, 1, 2, 2, 3, 4, 4, 6, 6, 1.1 root 56: 1.1.1.3 ! root 57: 4, 4, 2, 2, 2, 4, 3, 5, 1, 3, 1.1 root 58: 1.1.1.3 ! root 59: 1, 2, 1, 2, 3, 4, 4, 4, 4, 6, 1.1 root 60: 1.1.1.3 ! root 61: 6, 11, 11, 5, 7, 1, 3, 2, 1, 2, 1.1 root 62: 1.1.1.3 ! root 63: 1, 1, 1, 1, 1.1 root 64: 1.1.1.3 ! root 65: }; 1.1 root 66: 1.1.1.3 ! root 67: short yydefred[] = { 1, 1.1 root 68: 1.1.1.3 ! root 69: 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 1.1 root 70: 1.1.1.3 ! root 71: 2, 0, 0, 0, 22, 21, 0, 0, 0, 0, 1.1 root 72: 1.1.1.3 ! root 73: 0, 13, 14, 0, 4, 0, 5, 0, 0, 0, 1.1 root 74: 1.1.1.3 ! root 75: 0, 0, 0, 0, 6, 0, 39, 0, 0, 0, 1.1 root 76: 1.1.1.3 ! root 77: 0, 0, 16, 0, 0, 0, 8, 7, 11, 12, 1.1 root 78: 1.1.1.3 ! root 79: 18, 0, 24, 0, 0, 0, 38, 40, 0, 0, 1.1 root 80: 1.1.1.3 ! root 81: 0, 41, 42, 43, 44, 0, 0, 0, 0, 0, 1.1 root 82: 1.1.1.3 ! root 83: 0, 20, 0, 0, 37, 9, 10, 0, 0, 29, 1.1 root 84: 1.1.1.3 ! root 85: 26, 27, 0, 28, 0, 0, 0, 34, 0, 0, 1.1 root 86: 1.1.1.3 ! root 87: 0, 0, 0, 30, 31, 0, 0, 35, 0, 0, 1.1 root 88: 1.1.1.3 ! root 89: 0, 0, 0, 0, 33, 32, 1.1 root 90: 1.1.1.3 ! root 91: }; 1.1 root 92: 1.1.1.3 ! root 93: short yydgoto[] = { 1, 1.1 root 94: 1.1.1.3 ! root 95: 11, 12, 13, 42, 17, 43, 44, 45, 66, 1.1 root 96: 1.1.1.3 ! root 97: }; 1.1 root 98: 1.1.1.3 ! root 99: short yysindex[] = { 0, 1.1 root 100: 1.1.1.3 ! root 101: -168, -47, -235, 0, -226, -224, -217, -215, -210, -202, 1.1 root 102: 1.1.1.3 ! root 103: 0, -203, -201, -235, 0, 0, -214, -198, -221, -197, 1.1 root 104: 1.1.1.3 ! root 105: -195, 0, 0, -193, 0, -196, 0, -192, -33, -191, 1.1 root 106: 1.1.1.3 ! root 107: -189, -185, -184, -180, 0, -33, 0, -28, -30, -27, 1.1 root 108: 1.1.1.3 ! root 109: -177, 24, 0, -24, -12, -35, 0, 0, 0, 0, 1.1 root 110: 1.1.1.3 ! root 111: 0, -28, 0, -28, 40, -28, 0, 0, -33, -28, 1.1 root 112: 1.1.1.3 ! root 113: -28, 0, 0, 0, 0, -28, -175, -174, -17, -29, 1.1 root 114: 1.1.1.3 ! root 115: 41, 0, 4, 28, 0, 0, 0, -28, 9, 0, 1.1 root 116: 1.1.1.3 ! root 117: 0, 0, -28, 0, -28, -15, -28, 0, 51, -25, 1.1 root 118: 1.1.1.3 ! root 119: -28, 57, 62, 0, 0, 12, -28, 0, 63, 64, 1.1 root 120: 1.1.1.3 ! root 121: -28, -28, 65, 68, 0, 0, 1.1 root 122: 1.1.1.3 ! root 123: }; 1.1 root 124: 1.1.1.3 ! root 125: short yyrindex[] = { 0, 1.1 root 126: 1.1.1.3 ! root 127: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.1 root 128: 1.1.1.3 ! root 129: 0, 0, 0, 0, 0, 0, -149, 0, 0, 0, 1.1 root 130: 1.1.1.3 ! root 131: 0, 0, 0, 0, 0, 0, 0, -148, 0, 0, 1.1 root 132: 1.1.1.3 ! root 133: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.1 root 134: 1.1.1.3 ! root 135: 0, -147, 0, -40, -21, 0, 0, 0, 0, 0, 1.1 root 136: 1.1.1.3 ! root 137: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.1 root 138: 1.1.1.3 ! root 139: 0, 0, 0, 0, 0, 0, 0, 0, 0, -23, 1.1 root 140: 1.1.1.3 ! root 141: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.1 root 142: 1.1.1.3 ! root 143: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.1 root 144: 1.1.1.3 ! root 145: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.1 root 146: 1.1.1.3 ! root 147: 0, 0, 0, 0, 0, 0, 1.1 root 148: 1.1.1.3 ! root 149: }; 1.1 root 150: 1.1.1.3 ! root 151: short yygindex[] = { 0, 1.1 root 152: 1.1.1.3 ! root 153: 0, 0, 101, 69, 100, -8, -14, 0, 0, 1.1 root 154: 1.1.1.3 ! root 155: }; 1.1 root 156: 1.1.1.3 ! root 157: #define YYTABLESIZE 238 1.1 root 158: 1.1.1.3 ! root 159: short yytable[] = { 38, 1.1 root 160: 1.1.1.3 ! root 161: 41, 38, 41, 23, 39, 41, 39, 41, 41, 40, 1.1 root 162: 1.1.1.3 ! root 163: 15, 40, 56, 81, 52, 60, 52, 52, 36, 36, 1.1 root 164: 1.1.1.3 ! root 165: 25, 16, 36, 53, 55, 57, 78, 51, 91, 64, 1.1 root 166: 1.1.1.3 ! root 167: 62, 18, 63, 19, 65, 31, 36, 57, 32, 69, 1.1 root 168: 1.1.1.3 ! root 169: 20, 71, 21, 29, 84, 73, 74, 83, 22, 88, 1.1 root 170: 1.1.1.3 ! root 171: 72, 75, 87, 24, 3, 25, 23, 27, 30, 33, 1.1 root 172: 1.1.1.3 ! root 173: 54, 34, 35, 86, 14, 36, 46, 59, 89, 47, 1.1 root 174: 1.1.1.3 ! root 175: 90, 36, 93, 48, 49, 79, 96, 92, 50, 58, 1.1 root 176: 1.1.1.3 ! root 177: 70, 82, 100, 76, 77, 85, 103, 104, 2, 3, 1.1 root 178: 1.1.1.3 ! root 179: 4, 94, 5, 6, 7, 8, 9, 10, 61, 95, 1.1 root 180: 1.1.1.3 ! root 181: 97, 36, 98, 36, 99, 105, 101, 102, 106, 15, 1.1 root 182: 1.1.1.3 ! root 183: 17, 19, 26, 28, 68, 0, 0, 0, 0, 0, 1.1 root 184: 1.1.1.3 ! root 185: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.1 root 186: 1.1.1.3 ! root 187: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.1 root 188: 1.1.1.3 ! root 189: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.1 root 190: 1.1.1.3 ! root 191: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.1 root 192: 1.1.1.3 ! root 193: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.1 root 194: 1.1.1.3 ! root 195: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.1 root 196: 1.1.1.3 ! root 197: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.1 root 198: 1.1.1.3 ! root 199: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.1 root 200: 1.1.1.3 ! root 201: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.1 root 202: 1.1.1.3 ! root 203: 14, 0, 0, 0, 0, 0, 0, 0, 23, 0, 1.1 root 204: 1.1.1.3 ! root 205: 0, 37, 0, 37, 67, 0, 37, 80, 37, 37, 1.1 root 206: 1.1.1.3 ! root 207: 0, 0, 0, 0, 0, 25, 0, 36, 1.1 root 208: 1.1.1.3 ! root 209: }; 1.1 root 210: 1.1.1.3 ! root 211: short yycheck[] = { 35, 1.1 root 212: 1.1.1.3 ! root 213: 36, 35, 36, 44, 40, 36, 40, 36, 36, 45, 1.1 root 214: 1.1.1.3 ! root 215: 58, 45, 40, 43, 45, 40, 45, 45, 40, 41, 1.1 root 216: 1.1.1.3 ! root 217: 44, 257, 44, 38, 39, 40, 44, 36, 44, 42, 1.1 root 218: 1.1.1.3 ! root 219: 43, 258, 45, 258, 47, 257, 58, 52, 260, 54, 1.1 root 220: 1.1.1.3 ! root 221: 258, 56, 258, 258, 41, 60, 61, 44, 259, 41, 1.1 root 222: 1.1.1.3 ! root 223: 59, 66, 44, 257, 258, 259, 259, 259, 257, 257, 1.1 root 224: 1.1.1.3 ! root 225: 91, 257, 259, 78, 258, 258, 258, 44, 83, 259, 1.1 root 226: 1.1.1.3 ! root 227: 85, 93, 87, 259, 259, 93, 91, 93, 259, 257, 1.1 root 228: 1.1.1.3 ! root 229: 41, 41, 97, 259, 259, 58, 101, 102, 257, 258, 1.1 root 230: 1.1.1.3 ! root 231: 259, 41, 261, 262, 263, 264, 265, 266, 123, 125, 1.1 root 232: 1.1.1.3 ! root 233: 44, 123, 41, 125, 93, 41, 44, 44, 41, 259, 1.1 root 234: 1.1.1.3 ! root 235: 259, 259, 12, 14, 46, -1, -1, -1, -1, -1, 1.1 root 236: 1.1.1.3 ! root 237: -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1.1 root 238: 1.1.1.3 ! root 239: -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1.1 root 240: 1.1.1.3 ! root 241: -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1.1 root 242: 1.1.1.3 ! root 243: -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1.1 root 244: 1.1.1.3 ! root 245: -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1.1 root 246: 1.1.1.3 ! root 247: -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1.1 root 248: 1.1.1.3 ! root 249: -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1.1 root 250: 1.1.1.3 ! root 251: -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1.1 root 252: 1.1.1.3 ! root 253: -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1.1 root 254: 1.1.1.3 ! root 255: 258, -1, -1, -1, -1, -1, -1, -1, 259, -1, 1.1 root 256: 1.1.1.3 ! root 257: -1, 257, -1, 257, 260, -1, 257, 257, 257, 257, 1.1 root 258: 1.1.1.3 ! root 259: -1, -1, -1, -1, -1, 259, -1, 259, 1.1 root 260: 261: }; 262: 1.1.1.3 ! root 263: #define YYFINAL 1 1.1 root 264: 1.1.1.3 ! root 265: #ifndef YYDEBUG 1.1 root 266: 1.1.1.3 ! root 267: #define YYDEBUG 0 1.1 root 268: 1.1.1.3 ! root 269: #endif 1.1 root 270: 1.1.1.3 ! root 271: #define YYMAXTOKEN 266 1.1 root 272: 1.1.1.3 ! root 273: #if YYDEBUG 1.1 root 274: 1.1.1.3 ! root 275: char *yyname[] = { 1.1 root 276: 1.1.1.3 ! root 277: "end-of-file",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.1 root 278: 1.1.1.3 ! root 279: 0,"'#'","'$'",0,0,0,"'('","')'","'*'","'+'","','","'-'",0,"'/'",0,0,0,0,0,0,0,0, 1.1 root 280: 1.1.1.3 ! root 281: 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,0,"'['", 1.1 root 282: 1.1.1.3 ! root 283: 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.1 root 284: 1.1.1.3 ! root 285: 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,0,0,0,0,0,0,0, 1.1 root 286: 1.1.1.3 ! root 287: 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,0,0,0,0,0,0,0, 1.1 root 288: 1.1.1.3 ! root 289: 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,0,0,0,0,0,0,0, 1.1 root 290: 1.1.1.3 ! root 291: 0,0,0,0,0,0,0,0,0,0,0,"WORD","WHITESP","EOLN","STRING","DEFINECMD","INCLUDECMD", 1.1 root 292: 1.1.1.3 ! root 293: "IFDEFCMD","IFNDEFCMD","ELSECMD","ENDIFCMD", 1.1 root 294: 295: }; 296: 1.1.1.3 ! root 297: char *yyrule[] = { 1.1 root 298: 1.1.1.3 ! root 299: "$accept : input", 1.1 root 300: 1.1.1.3 ! root 301: "input :", 1.1 root 302: 1.1.1.3 ! root 303: "input : input line", 1.1 root 304: 1.1.1.3 ! root 305: "line : EOLN", 1.1 root 306: 1.1.1.3 ! root 307: "line : label EOLN", 1.1 root 308: 1.1.1.3 ! root 309: "line : opline EOLN", 1.1 root 310: 1.1.1.3 ! root 311: "line : label opline EOLN", 1.1 root 312: 1.1.1.3 ! root 313: "line : INCLUDECMD WHITESP STRING EOLN", 1.1 root 314: 1.1.1.3 ! root 315: "line : INCLUDECMD WHITESP WORD EOLN", 1.1 root 316: 1.1.1.3 ! root 317: "line : DEFINECMD WHITESP WORD WHITESP STRING EOLN", 1.1 root 318: 1.1.1.3 ! root 319: "line : DEFINECMD WHITESP WORD WHITESP operand EOLN", 1.1 root 320: 1.1.1.3 ! root 321: "line : IFDEFCMD WHITESP WORD EOLN", 1.1 root 322: 1.1.1.3 ! root 323: "line : IFNDEFCMD WHITESP WORD EOLN", 1.1 root 324: 1.1.1.3 ! root 325: "line : ELSECMD EOLN", 1.1 root 326: 1.1.1.3 ! root 327: "line : ENDIFCMD EOLN", 1.1 root 328: 1.1.1.3 ! root 329: "opline : WHITESP opcode", 1.1 root 330: 1.1.1.3 ! root 331: "opline : WHITESP opcode WHITESP ops", 1.1 root 332: 1.1.1.3 ! root 333: "opline : WORD WHITESP opcode", 1.1 root 334: 1.1.1.3 ! root 335: "opline : WORD WHITESP opcode WHITESP ops", 1.1 root 336: 1.1.1.3 ! root 337: "ops : operand", 1.1 root 338: 1.1.1.3 ! root 339: "ops : operand ',' ops", 1.1 root 340: 1.1.1.3 ! root 341: "opcode : WORD", 1.1 root 342: 1.1.1.3 ! root 343: "label : WORD ':'", 1.1 root 344: 1.1.1.3 ! root 345: "operand : basic", 1.1 root 346: 1.1.1.3 ! root 347: "operand : '#' basic", 1.1 root 348: 1.1.1.3 ! root 349: "operand : '(' basic ')'", 1.1 root 350: 1.1.1.3 ! root 351: "operand : '(' basic ')' '+'", 1.1 root 352: 1.1.1.3 ! root 353: "operand : '-' '(' basic ')'", 1.1 root 354: 1.1.1.3 ! root 355: "operand : basic '(' basic ')'", 1.1 root 356: 1.1.1.3 ! root 357: "operand : '(' basic ')' WORD", 1.1 root 358: 1.1.1.3 ! root 359: "operand : basic '(' basic ',' basic ')'", 1.1 root 360: 1.1.1.3 ! root 361: "operand : basic '{' basic ':' basic '}'", 1.1 root 362: 1.1.1.3 ! root 363: "operand : '(' '[' basic ',' basic ']' ',' basic ',' basic ')'", 1.1 root 364: 1.1.1.3 ! root 365: "operand : '(' '[' basic ',' basic ',' basic ']' ',' basic ')'", 1.1 root 366: 1.1.1.3 ! root 367: "operand : '(' '[' basic ']' ')'", 1.1 root 368: 1.1.1.3 ! root 369: "operand : '(' '[' basic ']' ',' basic ')'", 1.1 root 370: 1.1.1.3 ! root 371: "basic : basexpr", 1.1 root 372: 1.1.1.3 ! root 373: "basic : basexpr op basic", 1.1 root 374: 1.1.1.3 ! root 375: "basic : '-' basic", 1.1 root 376: 1.1.1.3 ! root 377: "basexpr : WORD", 1.1 root 378: 1.1.1.3 ! root 379: "basexpr : '$' WORD", 1.1 root 380: 1.1.1.3 ! root 381: "op : '+'", 1.1 root 382: 1.1.1.3 ! root 383: "op : '-'", 1.1 root 384: 1.1.1.3 ! root 385: "op : '*'", 1.1 root 386: 1.1.1.3 ! root 387: "op : '/'", 1.1 root 388: 1.1.1.3 ! root 389: }; 1.1 root 390: 1.1.1.3 ! root 391: #endif 1.1 root 392: 1.1.1.3 ! root 393: #ifndef YYSTYPE 1.1 root 394: 1.1.1.3 ! root 395: typedef int YYSTYPE; 1.1 root 396: 1.1.1.3 ! root 397: #endif 1.1 root 398: 1.1.1.3 ! root 399: #define yyclearin (yychar=(-1)) 1.1 root 400: 1.1.1.3 ! root 401: #define yyerrok (yyerrflag=0) 1.1 root 402: 1.1.1.3 ! root 403: #ifndef YYSTACKSIZE 1.1 root 404: 1.1.1.3 ! root 405: #ifdef YYMAXDEPTH 1.1 root 406: 1.1.1.3 ! root 407: #define YYSTACKSIZE YYMAXDEPTH 1.1 root 408: 1.1.1.3 ! root 409: #else 1.1 root 410: 1.1.1.3 ! root 411: #define YYSTACKSIZE 300 1.1 root 412: 1.1.1.3 ! root 413: #endif 1.1 root 414: 1.1.1.3 ! root 415: #endif 1.1 root 416: 1.1.1.3 ! root 417: int yydebug; 1.1 root 418: 1.1.1.3 ! root 419: int yynerrs; 1.1 root 420: 1.1.1.3 ! root 421: int yyerrflag; 1.1 root 422: 1.1.1.3 ! root 423: int yychar; 1.1 root 424: 1.1.1.3 ! root 425: short *yyssp; 1.1 root 426: 1.1.1.3 ! root 427: YYSTYPE *yyvsp; 1.1 root 428: 1.1.1.3 ! root 429: YYSTYPE yyval; 1.1 root 430: 1.1.1.3 ! root 431: YYSTYPE yylval; 1.1 root 432: 1.1.1.3 ! root 433: #define yystacksize YYSTACKSIZE 1.1 root 434: 1.1.1.3 ! root 435: short yyss[YYSTACKSIZE]; 1.1 root 436: 1.1.1.3 ! root 437: YYSTYPE yyvs[YYSTACKSIZE]; 1.1 root 438: 1.1.1.3 ! root 439: #line 103 "asm.y" 1.1 root 440: 1.1.1.3 ! root 441: #include <setjmp.h> 1.1 root 442: 443: 444: 1.1.1.3 ! root 445: jmp_buf start; 1.1 root 446: 447: 448: 1.1.1.3 ! root 449: #ifdef NATIVEATARI 1.1 root 450: 1.1.1.3 ! root 451: #define STACK 32*1024L 1.1 root 452: 1.1.1.3 ! root 453: #ifdef LATTICE 1.1 root 454: 1.1.1.3 ! root 455: long _STACK = STACK; 1.1 root 456: 1.1.1.3 ! root 457: #endif 1.1 root 458: 1.1.1.3 ! root 459: #ifdef __GNUC__ 1.1 root 460: 1.1.1.3 ! root 461: long _stksize = STACK; 1.1 root 462: 1.1.1.3 ! root 463: #endif 1.1 root 464: 465: 466: 1.1.1.3 ! root 467: static void 1.1 root 468: 1.1.1.3 ! root 469: hit_return() 1.1 root 470: 1.1.1.3 ! root 471: { 1.1 root 472: 1.1.1.3 ! root 473: printf("Hit return to continue\n"); 1.1 root 474: 1.1.1.3 ! root 475: fflush(stdout); 1.1 root 476: 1.1.1.3 ! root 477: getchar(); 1.1 root 478: 1.1.1.3 ! root 479: } 1.1 root 480: 1.1.1.3 ! root 481: #endif 1.1 root 482: 483: 484: 1.1.1.3 ! root 485: void usage() 1.1 root 486: 1.1.1.3 ! root 487: { 1.1 root 488: 1.1.1.3 ! root 489: fprintf(stderr, "Usage: asmtrans [-gas][-asm][-o outfile] infile\n"); 1.1 root 490: 1.1.1.3 ! root 491: exit(2); 1.1 root 492: 1.1.1.3 ! root 493: } 1.1 root 494: 495: 496: 1.1.1.3 ! root 497: int errors = 0; 1.1 root 498: 499: 500: 1.1.1.3 ! root 501: void 1.1 root 502: 1.1.1.3 ! root 503: do_include(file) 1.1 root 504: 1.1.1.3 ! root 505: char *file; 1.1 root 506: 1.1.1.3 ! root 507: { 1.1 root 508: 1.1.1.3 ! root 509: jmp_buf save; 1.1 root 510: 1.1.1.3 ! root 511: FILE *oldin, *f; 1.1 root 512: 513: 514: 1.1.1.3 ! root 515: f = fopen(file, "rt"); 1.1 root 516: 1.1.1.3 ! root 517: if (!f) { 1.1 root 518: 1.1.1.3 ! root 519: perror(file); 1.1 root 520: 1.1.1.3 ! root 521: return; 1.1 root 522: 1.1.1.3 ! root 523: } 1.1 root 524: 1.1.1.3 ! root 525: bcopy(start, save, sizeof(jmp_buf)); 1.1 root 526: 1.1.1.3 ! root 527: oldin = infile; 1.1 root 528: 1.1.1.3 ! root 529: infile = f; 1.1 root 530: 1.1.1.3 ! root 531: setjmp(start); 1.1 root 532: 1.1.1.3 ! root 533: yyparse(); 1.1 root 534: 1.1.1.3 ! root 535: fclose(f); 1.1 root 536: 1.1.1.3 ! root 537: infile = oldin; 1.1 root 538: 1.1.1.3 ! root 539: bcopy(save, start, sizeof(jmp_buf)); 1.1 root 540: 1.1.1.3 ! root 541: longjmp(start,1); 1.1 root 542: 1.1.1.3 ! root 543: } 1.1 root 544: 545: 546: 1.1.1.3 ! root 547: /* set up initial definitions based on syntax type */ 1.1 root 548: 549: 550: 1.1.1.3 ! root 551: void 1.1 root 552: 1.1.1.3 ! root 553: do_initial_defs() 1.1 root 554: 1.1.1.3 ! root 555: { 1.1 root 556: 1.1.1.3 ! root 557: if (syntax == GAS) { 1.1 root 558: 1.1.1.3 ! root 559: do_define("mmusr", "psr"); 1.1 root 560: 1.1.1.3 ! root 561: do_define("fpiar", "fpi"); 1.1 root 562: 1.1.1.3 ! root 563: do_define("XREF", ".globl"); 1.1 root 564: 1.1.1.3 ! root 565: do_define("XDEF", ".globl"); 1.1 root 566: 1.1.1.3 ! root 567: do_define("TEXT", ".text"); 1.1 root 568: 1.1.1.3 ! root 569: do_define("DATA", ".data"); 1.1 root 570: 1.1.1.3 ! root 571: /* gas doesn't have a .bss directive */ 1.1 root 572: 1.1.1.3 ! root 573: do_define("BSS", ".data"); 1.1 root 574: 1.1.1.3 ! root 575: do_define("END", "| END"); 1.1 root 576: 1.1.1.3 ! root 577: do_define("dc.l", ".long"); 1.1 root 578: 1.1.1.3 ! root 579: do_define("dc.w", ".word"); 1.1 root 580: 1.1.1.3 ! root 581: do_define("dc.b", ".byte"); 1.1 root 582: 1.1.1.3 ! root 583: } else if (syntax == ASM) { 1.1 root 584: 1.1.1.3 ! root 585: do_define("TEXT", "SECTION TEXT,CODE"); 1.1 root 586: 1.1.1.3 ! root 587: do_define("DATA", "SECTION DATA,DATA"); 1.1 root 588: 1.1.1.3 ! root 589: do_define("BSS", "SECTION BSS,BSS"); 1.1 root 590: 1.1.1.3 ! root 591: } 1.1 root 592: 1.1.1.3 ! root 593: } 1.1 root 594: 595: 596: 1.1.1.3 ! root 597: int 1.1 root 598: 1.1.1.3 ! root 599: main (argc, argv) 1.1 root 600: 1.1.1.3 ! root 601: int argc; char **argv; 1.1 root 602: 1.1.1.3 ! root 603: { 1.1 root 604: 1.1.1.3 ! root 605: FILE *f; 1.1 root 606: 1.1.1.3 ! root 607: #ifdef NATIVEATARI 1.1 root 608: 1.1.1.3 ! root 609: if (!argv[0] || !argv[0][0]) /* run from desktop? */ 1.1 root 610: 1.1.1.3 ! root 611: atexit(hit_return); 1.1 root 612: 613: #endif 614: 1.1.1.3 ! root 615: argv++; 1.1 root 616: 1.1.1.3 ! root 617: outfile = stdout; 1.1 root 618: 619: 620: 1.1.1.3 ! root 621: while (*argv) { 1.1 root 622: 1.1.1.3 ! root 623: if (!strcmp(*argv, "-o")) { 1.1 root 624: 1.1.1.3 ! root 625: argv++; 1.1 root 626: 1.1.1.3 ! root 627: if (*argv == 0) { 1.1 root 628: 1.1.1.3 ! root 629: fprintf(stderr, "missing argument to -o\n"); 1.1 root 630: 1.1.1.3 ! root 631: usage(); 1.1 root 632: 1.1.1.3 ! root 633: } 1.1 root 634: 1.1.1.3 ! root 635: f = fopen(*argv, "wt"); 1.1 root 636: 1.1.1.3 ! root 637: if (!f) 1.1 root 638: 1.1.1.3 ! root 639: perror(*argv); 1.1 root 640: 1.1.1.3 ! root 641: else 1.1 root 642: 1.1.1.3 ! root 643: outfile = f; 1.1 root 644: 1.1.1.3 ! root 645: argv++; 1.1 root 646: 1.1.1.3 ! root 647: } else if (!strcmp(*argv, "-gas")) { 1.1 root 648: 1.1.1.3 ! root 649: argv++; 1.1 root 650: 1.1.1.3 ! root 651: syntax = GAS; 1.1 root 652: 1.1.1.3 ! root 653: } else if (!strcmp(*argv, "-asm")) { 1.1 root 654: 1.1.1.3 ! root 655: argv++; 1.1 root 656: 1.1.1.3 ! root 657: syntax = ASM; 1.1 root 658: 1.1.1.3 ! root 659: } else if (!strcmp(*argv, "-purec")) { 1.1 root 660: 1.1.1.3 ! root 661: argv++; 1.1 root 662: 1.1.1.3 ! root 663: syntax = PUREC; 1.1 root 664: 1.1.1.3 ! root 665: } else if (!strncmp(*argv, "-D", 2)) { 1.1 root 666: 1.1.1.3 ! root 667: char *word, *defn; 1.1 root 668: 1.1.1.3 ! root 669: word = *argv+2; 1.1 root 670: 1.1.1.3 ! root 671: defn = index(word,'='); 1.1 root 672: 1.1.1.3 ! root 673: if (defn) 1.1 root 674: 1.1.1.3 ! root 675: *defn++ = '\0'; 1.1 root 676: 1.1.1.3 ! root 677: else 1.1 root 678: 1.1.1.3 ! root 679: defn = "1"; 1.1 root 680: 1.1.1.3 ! root 681: if (*word) do_define(word,defn); 1.1 root 682: 1.1.1.3 ! root 683: argv++; 1.1 root 684: 1.1.1.3 ! root 685: } else if (!strcmp(*argv, "--")) { 1.1 root 686: 1.1.1.3 ! root 687: argv++; 1.1 root 688: 1.1.1.3 ! root 689: break; 1.1 root 690: 1.1.1.3 ! root 691: } else { 1.1 root 692: 1.1.1.3 ! root 693: if (**argv == '-') { 1.1 root 694: 1.1.1.3 ! root 695: fprintf(stderr, "unknown option: %s\n", 1.1 root 696: 1.1.1.3 ! root 697: *argv); 1.1 root 698: 1.1.1.3 ! root 699: usage(); 1.1 root 700: 1.1.1.3 ! root 701: } 1.1 root 702: 1.1.1.3 ! root 703: break; 1.1 root 704: 1.1.1.3 ! root 705: } 1.1 root 706: 1.1.1.3 ! root 707: } 1.1 root 708: 709: 710: 1.1.1.3 ! root 711: do_initial_defs(); 1.1 root 712: 713: 714: 1.1.1.3 ! root 715: if (*argv == 0) { 1.1 root 716: 1.1.1.3 ! root 717: setjmp(start); 1.1 root 718: 1.1.1.3 ! root 719: infile = stdin; 1.1 root 720: 1.1.1.3 ! root 721: yyparse(); 1.1 root 722: 1.1.1.3 ! root 723: } else { 1.1 root 724: 1.1.1.3 ! root 725: while(*argv) { 1.1 root 726: 1.1.1.3 ! root 727: if (!(f = fopen(*argv, "rt"))) 1.1 root 728: 1.1.1.3 ! root 729: perror(*argv); 1.1 root 730: 1.1.1.3 ! root 731: else { 1.1 root 732: 1.1.1.3 ! root 733: infile = f; 1.1 root 734: 1.1.1.3 ! root 735: setjmp(start); 1.1 root 736: 1.1.1.3 ! root 737: yyparse(); 1.1 root 738: 1.1.1.3 ! root 739: fclose(f); 1.1 root 740: 1.1.1.3 ! root 741: } 1.1 root 742: 1.1.1.3 ! root 743: argv++; 1.1 root 744: 1.1.1.3 ! root 745: } 1.1 root 746: 1.1.1.3 ! root 747: } 1.1 root 748: 749: 750: 1.1.1.3 ! root 751: if (ifstkptr != 0) { 1.1 root 752: 1.1.1.3 ! root 753: fputs("%ifdef without matching %endif\n", stderr); 1.1 root 754: 1.1.1.3 ! root 755: errors++; 1.1 root 756: 1.1.1.3 ! root 757: } 1.1 root 758: 1.1.1.3 ! root 759: return errors; 1.1 root 760: 1.1.1.3 ! root 761: } 1.1 root 762: 763: 764: 1.1.1.3 ! root 765: void 1.1 root 766: 1.1.1.3 ! root 767: yyerror (s) /* Called by yyparse on error */ 1.1 root 768: 1.1.1.3 ! root 769: char *s; 1.1 root 770: 771: { 772: 1.1.1.3 ! root 773: errors++; 1.1 root 774: 1.1.1.3 ! root 775: printf("%s\n", s); 1.1 root 776: 1.1.1.3 ! root 777: longjmp(start, 1); 1.1 root 778: 1.1.1.3 ! root 779: } 1.1 root 780: 781: 782: 1.1.1.3 ! root 783: void dbgmsg(s) char *s; 1.1 root 784: 1.1.1.3 ! root 785: { 1.1 root 786: 1.1.1.3 ! root 787: fprintf(stderr, "%s\n", s); 1.1 root 788: 1.1.1.3 ! root 789: } 1.1 root 790: 1.1.1.3 ! root 791: #line 396 "y_tab.c" 1.1 root 792: 1.1.1.3 ! root 793: #define YYABORT goto yyabort 1.1 root 794: 1.1.1.3 ! root 795: #define YYACCEPT goto yyaccept 1.1 root 796: 1.1.1.3 ! root 797: #define YYERROR goto yyerrlab 1.1 root 798: 799: int 800: 801: yyparse() 802: 803: { 804: 1.1.1.3 ! root 805: register int yym, yyn, yystate; 1.1 root 806: 1.1.1.3 ! root 807: #if YYDEBUG 1.1 root 808: 1.1.1.3 ! root 809: register char *yys; 1.1 root 810: 1.1.1.3 ! root 811: extern char *getenv(); 1.1 root 812: 813: 814: 1.1.1.3 ! root 815: if (yys = getenv("YYDEBUG")) 1.1 root 816: 1.1.1.3 ! root 817: { 1.1 root 818: 1.1.1.3 ! root 819: yyn = *yys; 1.1 root 820: 1.1.1.3 ! root 821: if (yyn == '0') 1.1 root 822: 1.1.1.3 ! root 823: yydebug = 0; 1.1 root 824: 1.1.1.3 ! root 825: else if (yyn >= '1' && yyn <= '9') 1.1 root 826: 1.1.1.3 ! root 827: yydebug = yyn - '0'; 1.1 root 828: 1.1.1.3 ! root 829: } 1.1 root 830: 1.1.1.3 ! root 831: #endif 1.1 root 832: 833: 834: 1.1.1.3 ! root 835: yynerrs = 0; 1.1 root 836: 1.1.1.3 ! root 837: yyerrflag = 0; 1.1 root 838: 1.1.1.3 ! root 839: yychar = (-1); 1.1 root 840: 841: 842: 1.1.1.3 ! root 843: yyssp = yyss; 1.1 root 844: 1.1.1.3 ! root 845: yyvsp = yyvs; 1.1 root 846: 1.1.1.3 ! root 847: *yyssp = yystate = 0; 1.1 root 848: 849: 850: 1.1.1.3 ! root 851: yyloop: 1.1 root 852: 1.1.1.3 ! root 853: if (yyn = yydefred[yystate]) goto yyreduce; 1.1 root 854: 1.1.1.3 ! root 855: if (yychar < 0) 1.1 root 856: 1.1.1.3 ! root 857: { 1.1 root 858: 1.1.1.3 ! root 859: if ((yychar = yylex()) < 0) yychar = 0; 1.1 root 860: 1.1.1.3 ! root 861: #if YYDEBUG 1.1 root 862: 1.1.1.3 ! root 863: if (yydebug) 1.1 root 864: 1.1.1.3 ! root 865: { 1.1 root 866: 1.1.1.3 ! root 867: yys = 0; 1.1 root 868: 1.1.1.3 ! root 869: if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; 1.1 root 870: 1.1.1.3 ! root 871: if (!yys) yys = "illegal-symbol"; 1.1 root 872: 1.1.1.3 ! root 873: printf("yydebug: state %d, reading %d (%s)\n", yystate, 1.1 root 874: 1.1.1.3 ! root 875: yychar, yys); 1.1 root 876: 1.1.1.3 ! root 877: } 1.1 root 878: 1.1.1.3 ! root 879: #endif 1.1 root 880: 1.1.1.3 ! root 881: } 1.1 root 882: 1.1.1.3 ! root 883: if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 && 1.1 root 884: 1.1.1.3 ! root 885: yyn <= YYTABLESIZE && yycheck[yyn] == yychar) 1.1 root 886: 1.1.1.3 ! root 887: { 1.1 root 888: 1.1.1.3 ! root 889: #if YYDEBUG 1.1 root 890: 1.1.1.3 ! root 891: if (yydebug) 1.1 root 892: 1.1.1.3 ! root 893: printf("yydebug: state %d, shifting to state %d\n", 1.1 root 894: 1.1.1.3 ! root 895: yystate, yytable[yyn]); 1.1 root 896: 897: #endif 898: 1.1.1.3 ! root 899: if (yyssp >= yyss + yystacksize - 1) 1.1 root 900: 1.1.1.3 ! root 901: { 1.1 root 902: 1.1.1.3 ! root 903: goto yyoverflow; 1.1 root 904: 1.1.1.3 ! root 905: } 1.1 root 906: 1.1.1.3 ! root 907: *++yyssp = yystate = yytable[yyn]; 1.1 root 908: 1.1.1.3 ! root 909: *++yyvsp = yylval; 1.1 root 910: 1.1.1.3 ! root 911: yychar = (-1); 1.1 root 912: 1.1.1.3 ! root 913: if (yyerrflag > 0) --yyerrflag; 1.1 root 914: 1.1.1.3 ! root 915: goto yyloop; 1.1 root 916: 1.1.1.3 ! root 917: } ! 918: ! 919: if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 && 1.1 root 920: 1.1.1.3 ! root 921: yyn <= YYTABLESIZE && yycheck[yyn] == yychar) 1.1 root 922: 1.1.1.3 ! root 923: { 1.1 root 924: 1.1.1.3 ! root 925: yyn = yytable[yyn]; 1.1 root 926: 1.1.1.3 ! root 927: goto yyreduce; 1.1 root 928: 1.1.1.3 ! root 929: } 1.1 root 930: 1.1.1.3 ! root 931: if (yyerrflag) goto yyinrecovery; 1.1 root 932: 1.1.1.3 ! root 933: #ifdef lint 1.1 root 934: 1.1.1.3 ! root 935: goto yynewerror; 1.1 root 936: 937: #endif 938: 1.1.1.3 ! root 939: yynewerror: 1.1 root 940: 1.1.1.3 ! root 941: yyerror("syntax error"); 1.1 root 942: 1.1.1.3 ! root 943: #ifdef lint 1.1 root 944: 1.1.1.3 ! root 945: goto yyerrlab; 1.1 root 946: 1.1.1.3 ! root 947: #endif 1.1 root 948: 1.1.1.3 ! root 949: yyerrlab: 1.1 root 950: 1.1.1.3 ! root 951: ++yynerrs; 1.1 root 952: 1.1.1.3 ! root 953: yyinrecovery: 1.1 root 954: 1.1.1.3 ! root 955: if (yyerrflag < 3) 1.1 root 956: 1.1.1.3 ! root 957: { 1.1 root 958: 1.1.1.3 ! root 959: yyerrflag = 3; 1.1 root 960: 1.1.1.3 ! root 961: for (;;) 1.1 root 962: 1.1.1.3 ! root 963: { 1.1 root 964: 1.1.1.3 ! root 965: if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 && 1.1 root 966: 1.1.1.3 ! root 967: yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) 1.1 root 968: 1.1.1.3 ! root 969: { 1.1 root 970: 1.1.1.3 ! root 971: #if YYDEBUG 1.1 root 972: 1.1.1.3 ! root 973: if (yydebug) 1.1 root 974: 1.1.1.3 ! root 975: printf("yydebug: state %d, error recovery shifting\ ! 976: ! 977: to state %d\n", *yyssp, yytable[yyn]); 1.1 root 978: 979: #endif 980: 1.1.1.3 ! root 981: if (yyssp >= yyss + yystacksize - 1) 1.1 root 982: 1.1.1.3 ! root 983: { 1.1 root 984: 1.1.1.3 ! root 985: goto yyoverflow; 1.1 root 986: 1.1.1.3 ! root 987: } 1.1 root 988: 1.1.1.3 ! root 989: *++yyssp = yystate = yytable[yyn]; 1.1 root 990: 1.1.1.3 ! root 991: *++yyvsp = yylval; 1.1 root 992: 1.1.1.3 ! root 993: goto yyloop; 1.1 root 994: 1.1.1.3 ! root 995: } 1.1 root 996: 1.1.1.3 ! root 997: else 1.1 root 998: 1.1.1.3 ! root 999: { 1.1 root 1000: 1.1.1.3 ! root 1001: #if YYDEBUG 1.1 root 1002: 1.1.1.3 ! root 1003: if (yydebug) 1.1 root 1004: 1.1.1.3 ! root 1005: printf("yydebug: error recovery discarding state %d\n", 1.1 root 1006: 1.1.1.3 ! root 1007: *yyssp); 1.1 root 1008: 1009: #endif 1010: 1.1.1.3 ! root 1011: if (yyssp <= yyss) goto yyabort; 1.1 root 1012: 1.1.1.3 ! root 1013: --yyssp; 1.1 root 1014: 1.1.1.3 ! root 1015: --yyvsp; 1.1 root 1016: 1.1.1.3 ! root 1017: } 1.1 root 1018: 1.1.1.3 ! root 1019: } 1.1 root 1020: 1.1.1.3 ! root 1021: } 1.1 root 1022: 1.1.1.3 ! root 1023: else 1.1 root 1024: 1.1.1.3 ! root 1025: { 1.1 root 1026: 1.1.1.3 ! root 1027: if (yychar == 0) goto yyabort; 1.1 root 1028: 1.1.1.3 ! root 1029: #if YYDEBUG 1.1 root 1030: 1.1.1.3 ! root 1031: if (yydebug) 1.1 root 1032: 1.1.1.3 ! root 1033: { 1.1 root 1034: 1.1.1.3 ! root 1035: yys = 0; 1.1 root 1036: 1.1.1.3 ! root 1037: if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; 1.1 root 1038: 1.1.1.3 ! root 1039: if (!yys) yys = "illegal-symbol"; 1.1 root 1040: 1.1.1.3 ! root 1041: printf("yydebug: state %d, error recovery discards token %d (%s)\n", 1.1 root 1042: 1.1.1.3 ! root 1043: yystate, yychar, yys); 1.1 root 1044: 1.1.1.3 ! root 1045: } 1.1 root 1046: 1.1.1.3 ! root 1047: #endif 1.1 root 1048: 1.1.1.3 ! root 1049: yychar = (-1); 1.1 root 1050: 1.1.1.3 ! root 1051: goto yyloop; 1.1 root 1052: 1.1.1.3 ! root 1053: } 1.1 root 1054: 1.1.1.3 ! root 1055: yyreduce: 1.1 root 1056: 1.1.1.3 ! root 1057: #if YYDEBUG 1.1 root 1058: 1.1.1.3 ! root 1059: if (yydebug) 1.1 root 1060: 1.1.1.3 ! root 1061: printf("yydebug: state %d, reducing by rule %d (%s)\n", 1.1 root 1062: 1.1.1.3 ! root 1063: yystate, yyn, yyrule[yyn]); 1.1 root 1064: 1.1.1.3 ! root 1065: #endif 1.1 root 1066: 1.1.1.3 ! root 1067: yym = yylen[yyn]; 1.1 root 1068: 1.1.1.3 ! root 1069: yyval = yyvsp[1-yym]; 1.1 root 1070: 1.1.1.3 ! root 1071: switch (yyn) 1.1 root 1072: 1.1.1.3 ! root 1073: { 1.1 root 1074: 1.1.1.3 ! root 1075: case 3: 1.1 root 1076: 1.1.1.3 ! root 1077: #line 25 "asm.y" 1.1 root 1078: 1.1.1.3 ! root 1079: { emit(yyvsp[0]); } 1.1 root 1080: 1.1.1.3 ! root 1081: break; 1.1 root 1082: 1.1.1.3 ! root 1083: case 4: 1.1 root 1084: 1.1.1.3 ! root 1085: #line 28 "asm.y" 1.1 root 1086: 1.1.1.3 ! root 1087: { emit(yyvsp[-1]); emit(yyvsp[0]); } 1.1 root 1088: 1.1.1.3 ! root 1089: break; 1.1 root 1090: 1.1.1.3 ! root 1091: case 5: 1.1 root 1092: 1.1.1.3 ! root 1093: #line 29 "asm.y" 1.1 root 1094: 1.1.1.3 ! root 1095: { emit(yyvsp[-1]); emit(yyvsp[0]); } 1.1 root 1096: 1.1.1.3 ! root 1097: break; 1.1 root 1098: 1.1.1.3 ! root 1099: case 6: 1.1 root 1100: 1.1.1.3 ! root 1101: #line 30 "asm.y" 1.1 root 1102: 1.1.1.3 ! root 1103: { emit(yyvsp[-2]); emit(yyvsp[-1]); 1.1 root 1104: 1.1.1.3 ! root 1105: emit(yyvsp[0]); } 1.1 root 1106: 1.1.1.3 ! root 1107: break; 1.1 root 1108: 1.1.1.3 ! root 1109: case 7: 1.1 root 1110: 1.1.1.3 ! root 1111: #line 32 "asm.y" 1.1 root 1112: 1.1.1.3 ! root 1113: { if (!hidecnt) do_include(yyvsp[-1]); free(yyvsp[-1]); } 1.1 root 1114: 1.1.1.3 ! root 1115: break; 1.1 root 1116: 1.1.1.3 ! root 1117: case 8: 1.1 root 1118: 1.1.1.3 ! root 1119: #line 33 "asm.y" 1.1 root 1120: 1.1.1.3 ! root 1121: { if (!hidecnt) do_include(yyvsp[-1]); free(yyvsp[-1]); } 1.1 root 1122: 1.1.1.3 ! root 1123: break; 1.1 root 1124: 1.1.1.3 ! root 1125: case 9: 1.1 root 1126: 1.1.1.3 ! root 1127: #line 34 "asm.y" 1.1 root 1128: 1.1.1.3 ! root 1129: { 1.1 root 1130: 1.1.1.3 ! root 1131: if (!hidecnt) do_define(yyvsp[-3], yyvsp[-1]); free(yyvsp[-3]); free(yyvsp[-1]); } 1.1 root 1132: 1.1.1.3 ! root 1133: break; 1.1 root 1134: 1.1.1.3 ! root 1135: case 10: 1.1 root 1136: 1.1.1.3 ! root 1137: #line 36 "asm.y" 1.1 root 1138: 1.1.1.3 ! root 1139: { 1.1 root 1140: 1.1.1.3 ! root 1141: if (!hidecnt) do_define(yyvsp[-3], yyvsp[-1]); free(yyvsp[-3]); free(yyvsp[-1]); } 1.1 root 1142: 1.1.1.3 ! root 1143: break; 1.1 root 1144: 1.1.1.3 ! root 1145: case 11: 1.1 root 1146: 1.1.1.3 ! root 1147: #line 38 "asm.y" 1.1 root 1148: 1.1.1.3 ! root 1149: { do_ifdef(yyvsp[-1]); free(yyvsp[-1]); } 1.1 root 1150: 1.1.1.3 ! root 1151: break; 1.1 root 1152: 1.1.1.3 ! root 1153: case 12: 1.1 root 1154: 1.1.1.3 ! root 1155: #line 39 "asm.y" 1.1 root 1156: 1.1.1.3 ! root 1157: { do_ifndef(yyvsp[-1]); free(yyvsp[-1]); } 1.1 root 1158: 1.1.1.3 ! root 1159: break; 1.1 root 1160: 1.1.1.3 ! root 1161: case 13: 1.1 root 1162: 1.1.1.3 ! root 1163: #line 40 "asm.y" 1.1 root 1164: 1.1.1.3 ! root 1165: { do_else(); } 1.1 root 1166: 1.1.1.3 ! root 1167: break; 1.1 root 1168: 1.1.1.3 ! root 1169: case 14: 1.1 root 1170: 1.1.1.3 ! root 1171: #line 41 "asm.y" 1.1 root 1172: 1.1.1.3 ! root 1173: { do_endif(); } 1.1 root 1174: 1.1.1.3 ! root 1175: break; 1.1 root 1176: 1.1.1.3 ! root 1177: case 15: 1.1 root 1178: 1.1.1.3 ! root 1179: #line 44 "asm.y" 1.1 root 1180: 1.1.1.3 ! root 1181: { yyval = do_ops("", yyvsp[0], "", ""); free(yyvsp[0]); } 1.1 root 1182: 1.1.1.3 ! root 1183: break; 1.1 root 1184: 1.1.1.3 ! root 1185: case 16: 1.1 root 1186: 1.1.1.3 ! root 1187: #line 46 "asm.y" 1.1 root 1188: 1.1.1.3 ! root 1189: { yyval = do_ops("", yyvsp[-2], yyvsp[-1], yyvsp[0]); 1.1 root 1190: 1.1.1.3 ! root 1191: free(yyvsp[-2]); free(yyvsp[-1]); free(yyvsp[0]); } 1.1 root 1192: 1.1.1.3 ! root 1193: break; 1.1 root 1194: 1.1.1.3 ! root 1195: case 17: 1.1 root 1196: 1.1.1.3 ! root 1197: #line 48 "asm.y" 1.1 root 1198: 1.1.1.3 ! root 1199: { yyval = do_ops(yyvsp[-2], yyvsp[0], "", ""); free(yyvsp[-2]); free(yyvsp[0]); } 1.1 root 1200: 1.1.1.3 ! root 1201: break; 1.1 root 1202: 1.1.1.3 ! root 1203: case 18: 1.1 root 1204: 1.1.1.3 ! root 1205: #line 50 "asm.y" 1.1 root 1206: 1.1.1.3 ! root 1207: { yyval = do_ops(yyvsp[-4], yyvsp[-2], yyvsp[-1], yyvsp[0]); 1.1 root 1208: 1.1.1.3 ! root 1209: free(yyvsp[-4]); free(yyvsp[-2]); free(yyvsp[-1]); free(yyvsp[0]);} 1.1 root 1210: 1.1.1.3 ! root 1211: break; 1.1 root 1212: 1.1.1.3 ! root 1213: case 19: 1.1 root 1214: 1.1.1.3 ! root 1215: #line 54 "asm.y" 1.1 root 1216: 1.1.1.3 ! root 1217: { yyval = yyvsp[0]; } 1.1 root 1218: 1.1.1.3 ! root 1219: break; 1.1 root 1220: 1.1.1.3 ! root 1221: case 20: 1.1 root 1222: 1.1.1.3 ! root 1223: #line 55 "asm.y" 1.1 root 1224: 1.1.1.3 ! root 1225: { yyval = concat3(yyvsp[-2], ",", yyvsp[0]); 1.1 root 1226: 1.1.1.3 ! root 1227: free(yyvsp[-2]); free(yyvsp[0]); } 1.1 root 1228: 1.1.1.3 ! root 1229: break; 1.1 root 1230: 1.1.1.3 ! root 1231: case 21: 1.1 root 1232: 1.1.1.3 ! root 1233: #line 59 "asm.y" 1.1 root 1234: 1.1.1.3 ! root 1235: { yyval = wordlookup(yyvsp[0]); free(yyvsp[0]); } 1.1 root 1236: 1.1.1.3 ! root 1237: break; 1.1 root 1238: 1.1.1.3 ! root 1239: case 22: 1.1 root 1240: 1.1.1.3 ! root 1241: #line 62 "asm.y" 1.1 root 1242: 1.1.1.3 ! root 1243: { yyval = concat(yyvsp[-1], ":"); free(yyvsp[-1]); } 1.1 root 1244: 1.1.1.3 ! root 1245: break; 1.1 root 1246: 1.1.1.3 ! root 1247: case 23: 1.1 root 1248: 1.1.1.3 ! root 1249: #line 64 "asm.y" 1.1 root 1250: 1.1.1.3 ! root 1251: {yyval = yyvsp[0]; } 1.1 root 1252: 1.1.1.3 ! root 1253: break; 1.1 root 1254: 1.1.1.3 ! root 1255: case 24: 1.1 root 1256: 1.1.1.3 ! root 1257: #line 65 "asm.y" 1.1 root 1258: 1.1.1.3 ! root 1259: {yyval = immediate(yyvsp[0]); free(yyvsp[0]); } 1.1 root 1260: 1.1.1.3 ! root 1261: break; 1.1 root 1262: 1.1.1.3 ! root 1263: case 25: 1.1 root 1264: 1.1.1.3 ! root 1265: #line 66 "asm.y" 1.1 root 1266: 1.1.1.3 ! root 1267: {yyval = indirect(yyvsp[-1]); free(yyvsp[-1]); } 1.1 root 1268: 1.1.1.3 ! root 1269: break; 1.1 root 1270: 1.1.1.3 ! root 1271: case 26: 1.1 root 1272: 1.1.1.3 ! root 1273: #line 67 "asm.y" 1.1 root 1274: 1.1.1.3 ! root 1275: {yyval = postinc(yyvsp[-2]); free(yyvsp[-2]); } 1.1 root 1276: 1.1.1.3 ! root 1277: break; 1.1 root 1278: 1.1.1.3 ! root 1279: case 27: 1.1 root 1280: 1.1.1.3 ! root 1281: #line 68 "asm.y" 1.1 root 1282: 1.1.1.3 ! root 1283: {yyval = predec(yyvsp[-1]); free(yyvsp[-1]); } 1.1 root 1284: 1.1.1.3 ! root 1285: break; 1.1 root 1286: 1.1.1.3 ! root 1287: case 28: 1.1 root 1288: 1.1.1.3 ! root 1289: #line 69 "asm.y" 1.1 root 1290: 1.1.1.3 ! root 1291: {yyval = indexed(yyvsp[-3], yyvsp[-1]); free(yyvsp[-3]); free(yyvsp[-1]); } 1.1 root 1292: 1.1.1.3 ! root 1293: break; 1.1 root 1294: 1.1.1.3 ! root 1295: case 29: 1.1 root 1296: 1.1.1.3 ! root 1297: #line 70 "asm.y" 1.1 root 1298: 1.1.1.3 ! root 1299: {yyval = sizedop(yyvsp[-2], yyvsp[0]); free(yyvsp[-2]); free(yyvsp[0]); } 1.1 root 1300: 1.1.1.3 ! root 1301: break; 1.1 root 1302: 1.1.1.3 ! root 1303: case 30: 1.1.1.2 root 1304: 1.1.1.3 ! root 1305: #line 71 "asm.y" 1.1 root 1306: 1.1.1.3 ! root 1307: {yyval = twoindex(yyvsp[-5], yyvsp[-3], yyvsp[-1]); 1.1 root 1308: 1.1.1.3 ! root 1309: free(yyvsp[-5]); free(yyvsp[-3]); free(yyvsp[-1]); } 1.1 root 1310: 1.1.1.3 ! root 1311: break; 1.1 root 1312: 1.1.1.3 ! root 1313: case 31: 1.1 root 1314: 1.1.1.3 ! root 1315: #line 73 "asm.y" 1.1 root 1316: 1.1.1.3 ! root 1317: {yyval = bitfield(yyvsp[-5], yyvsp[-3], yyvsp[-1]); 1.1 root 1318: 1.1.1.3 ! root 1319: free(yyvsp[-5]); free(yyvsp[-3]); free(yyvsp[-1]); } 1.1 root 1320: 1.1.1.3 ! root 1321: break; 1.1 root 1322: 1.1.1.3 ! root 1323: case 32: 1.1 root 1324: 1.1.1.3 ! root 1325: #line 76 "asm.y" 1.1 root 1326: 1.1.1.3 ! root 1327: { yyval =postindex(yyvsp[-8],yyvsp[-6],yyvsp[-3],yyvsp[-1]); 1.1 root 1328: 1.1.1.3 ! root 1329: free(yyvsp[-8]); free(yyvsp[-6]); free(yyvsp[-3]); free(yyvsp[-1]); } 1.1 root 1330: 1.1.1.3 ! root 1331: break; 1.1 root 1332: 1.1.1.3 ! root 1333: case 33: 1.1 root 1334: 1.1.1.3 ! root 1335: #line 79 "asm.y" 1.1 root 1336: 1.1.1.3 ! root 1337: { yyval =preindex(yyvsp[-8],yyvsp[-6],yyvsp[-4],yyvsp[-1]); 1.1 root 1338: 1.1.1.3 ! root 1339: free(yyvsp[-8]); free(yyvsp[-6]); free(yyvsp[-4]); free(yyvsp[-1]); } 1.1 root 1340: 1.1.1.3 ! root 1341: break; 1.1 root 1342: 1.1.1.3 ! root 1343: case 34: 1.1 root 1344: 1.1.1.3 ! root 1345: #line 82 "asm.y" 1.1 root 1346: 1.1.1.3 ! root 1347: { yyval =postindex0(yyvsp[-2]); 1.1 root 1348: 1.1.1.3 ! root 1349: free(yyvsp[-2]); } 1.1 root 1350: 1.1.1.3 ! root 1351: break; 1.1 root 1352: 1.1.1.3 ! root 1353: case 35: 1.1 root 1354: 1.1.1.3 ! root 1355: #line 85 "asm.y" 1.1 root 1356: 1.1.1.3 ! root 1357: { yyval =postindex1(yyvsp[-4],yyvsp[-1]); 1.1 root 1358: 1.1.1.3 ! root 1359: free(yyvsp[-4]); free(yyvsp[-1]); } 1.1 root 1360: 1.1.1.3 ! root 1361: break; 1.1 root 1362: 1.1.1.3 ! root 1363: case 36: 1.1 root 1364: 1.1.1.3 ! root 1365: #line 89 "asm.y" 1.1 root 1366: 1.1.1.3 ! root 1367: { yyval = yyvsp[0]; } 1.1 root 1368: 1.1.1.3 ! root 1369: break; 1.1 root 1370: 1.1.1.3 ! root 1371: case 37: 1.1 root 1372: 1.1.1.3 ! root 1373: #line 90 "asm.y" 1.1 root 1374: 1.1.1.3 ! root 1375: { yyval = concat3(yyvsp[-2], yyvsp[-1], yyvsp[0]); free(yyvsp[-2]); free(yyvsp[-1]); free(yyvsp[0]); } 1.1 root 1376: 1.1.1.3 ! root 1377: break; 1.1 root 1378: 1.1.1.3 ! root 1379: case 38: 1.1 root 1380: 1.1.1.3 ! root 1381: #line 91 "asm.y" 1.1 root 1382: 1.1.1.3 ! root 1383: { yyval = concat("-", yyvsp[0]); free(yyvsp[0]); } 1.1 root 1384: 1.1.1.3 ! root 1385: break; 1.1 root 1386: 1.1.1.3 ! root 1387: case 39: 1.1 root 1388: 1.1.1.3 ! root 1389: #line 93 "asm.y" 1.1 root 1390: 1.1.1.3 ! root 1391: {yyval = wordlookup(yyvsp[0]); free(yyvsp[0]); } 1.1 root 1392: 1.1.1.3 ! root 1393: break; 1.1 root 1394: 1.1.1.3 ! root 1395: case 40: 1.1 root 1396: 1.1.1.3 ! root 1397: #line 94 "asm.y" 1.1 root 1398: 1.1.1.3 ! root 1399: {yyval = hexop(yyvsp[0]); free(yyvsp[0]);} 1.1 root 1400: 1.1.1.3 ! root 1401: break; 1.1 root 1402: 1.1.1.3 ! root 1403: case 41: 1.1 root 1404: 1.1.1.3 ! root 1405: #line 97 "asm.y" 1.1 root 1406: 1.1.1.3 ! root 1407: { yyval = strdup("+"); } 1.1 root 1408: 1.1.1.3 ! root 1409: break; 1.1 root 1410: 1.1.1.3 ! root 1411: case 42: 1.1 root 1412: 1.1.1.3 ! root 1413: #line 98 "asm.y" 1.1 root 1414: 1.1.1.3 ! root 1415: { yyval = strdup("-"); } 1.1 root 1416: 1.1.1.3 ! root 1417: break; 1.1 root 1418: 1.1.1.3 ! root 1419: case 43: 1.1 root 1420: 1.1.1.3 ! root 1421: #line 99 "asm.y" 1.1 root 1422: 1.1.1.3 ! root 1423: { yyval = strdup("*"); } 1.1 root 1424: 1.1.1.3 ! root 1425: break; 1.1 root 1426: 1.1.1.3 ! root 1427: case 44: 1.1 root 1428: 1.1.1.3 ! root 1429: #line 100 "asm.y" 1.1 root 1430: 1.1.1.3 ! root 1431: { yyval = strdup("/"); } 1.1 root 1432: 1.1.1.3 ! root 1433: break; 1.1 root 1434: 1.1.1.3 ! root 1435: #line 718 "y_tab.c" 1.1 root 1436: 1.1.1.3 ! root 1437: } 1.1 root 1438: 1.1.1.3 ! root 1439: yyssp -= yym; 1.1 root 1440: 1.1.1.3 ! root 1441: yystate = *yyssp; 1.1 root 1442: 1.1.1.3 ! root 1443: yyvsp -= yym; 1.1 root 1444: 1.1.1.3 ! root 1445: yym = yylhs[yyn]; 1.1 root 1446: 1.1.1.3 ! root 1447: if (yystate == 0 && yym == 0) 1.1 root 1448: 1.1.1.3 ! root 1449: { 1.1 root 1450: 1.1.1.3 ! root 1451: #ifdef YYDEBUG 1.1 root 1452: 1.1.1.3 ! root 1453: if (yydebug) 1.1 root 1454: 1.1.1.3 ! root 1455: printf("yydebug: after reduction, shifting from state 0 to\ 1.1 root 1456: 1.1.1.3 ! root 1457: state %d\n", YYFINAL); 1.1 root 1458: 1.1.1.3 ! root 1459: #endif 1.1 root 1460: 1.1.1.3 ! root 1461: yystate = YYFINAL; 1.1 root 1462: 1.1.1.3 ! root 1463: *++yyssp = YYFINAL; 1.1 root 1464: 1.1.1.3 ! root 1465: *++yyvsp = yyval; 1.1 root 1466: 1.1.1.3 ! root 1467: if (yychar < 0) 1.1 root 1468: 1.1.1.3 ! root 1469: { 1.1 root 1470: 1.1.1.3 ! root 1471: if ((yychar = yylex()) < 0) yychar = 0; 1.1 root 1472: 1.1.1.3 ! root 1473: #if YYDEBUG 1.1 root 1474: 1.1.1.3 ! root 1475: if (yydebug) 1.1 root 1476: 1.1.1.3 ! root 1477: { 1.1 root 1478: 1.1.1.3 ! root 1479: yys = 0; 1.1 root 1480: 1.1.1.3 ! root 1481: if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; 1.1 root 1482: 1.1.1.3 ! root 1483: if (!yys) yys = "illegal-symbol"; 1.1 root 1484: 1.1.1.3 ! root 1485: printf("yydebug: state %d, reading %d (%s)\n", 1.1 root 1486: 1.1.1.3 ! root 1487: YYFINAL, yychar, yys); 1.1 root 1488: 1.1.1.3 ! root 1489: } 1.1 root 1490: 1.1.1.3 ! root 1491: #endif 1.1 root 1492: 1.1.1.3 ! root 1493: } 1.1 root 1494: 1.1.1.3 ! root 1495: if (yychar == 0) goto yyaccept; 1.1 root 1496: 1.1.1.3 ! root 1497: goto yyloop; 1.1 root 1498: 1.1.1.3 ! root 1499: } 1.1 root 1500: 1.1.1.3 ! root 1501: if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 && 1.1 root 1502: 1.1.1.3 ! root 1503: yyn <= YYTABLESIZE && yycheck[yyn] == yystate) 1.1 root 1504: 1.1.1.3 ! root 1505: yystate = yytable[yyn]; 1.1 root 1506: 1.1.1.3 ! root 1507: else 1.1 root 1508: 1.1.1.3 ! root 1509: yystate = yydgoto[yym]; 1.1 root 1510: 1.1.1.3 ! root 1511: #ifdef YYDEBUG 1.1 root 1512: 1.1.1.3 ! root 1513: if (yydebug) 1.1 root 1514: 1.1.1.3 ! root 1515: printf("yydebug: after reduction, shifting from state %d \ 1.1 root 1516: 1.1.1.3 ! root 1517: to state %d\n", *yyssp, yystate); 1.1 root 1518: 1.1.1.3 ! root 1519: #endif 1.1 root 1520: 1.1.1.3 ! root 1521: if (yyssp >= yyss + yystacksize - 1) 1.1 root 1522: 1.1.1.3 ! root 1523: { 1.1 root 1524: 1.1.1.3 ! root 1525: goto yyoverflow; 1.1 root 1526: 1.1.1.3 ! root 1527: } 1.1 root 1528: 1.1.1.3 ! root 1529: *++yyssp = yystate; 1.1 root 1530: 1.1.1.3 ! root 1531: *++yyvsp = yyval; 1.1 root 1532: 1.1.1.3 ! root 1533: goto yyloop; 1.1 root 1534: 1.1.1.3 ! root 1535: yyoverflow: 1.1 root 1536: 1.1.1.3 ! root 1537: yyerror("yacc stack overflow"); 1.1 root 1538: 1.1.1.3 ! root 1539: yyabort: 1.1 root 1540: 1.1.1.3 ! root 1541: return (1); 1.1 root 1542: 1.1.1.3 ! root 1543: yyaccept: 1.1 root 1544: 1.1.1.3 ! root 1545: return (0); 1.1 root 1546: 1547: } 1548:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.