1 2/* A Bison parser, made from scheme.y 3 by GNU Bison version 1.28 */ 4 5#define YYBISON 1 /* Identify Bison output. */ 6 7#define LPAREN 257 8#define LVECTPAREN 258 9#define RPAREN 259 10#define DEFINE 260 11#define SET 261 12#define LAMBDA 262 13#define BEGINTOK 263 14#define AND 264 15#define OR 265 16#define CASE 266 17#define COND 267 18#define ELSE 268 19#define ARROW 269 20#define CALLCC 270 21#define APPLY 271 22#define IF 272 23#define LET 273 24#define LETSTAR 274 25#define LETREC 275 26#define DOT 276 27#define INTEGER 277 28#define CHAR 278 29#define BOOLEAN 279 30#define DOUBLE 280 31#define SYMBOL 281 32#define STRING 282 33#define QUOTECHAR 283 34#define QUOTE 284 35 36#line 1 "scheme.y" 37 38#import "SchemeTypes.h" 39 40#define YYSTYPE id 41 42YYSTYPE yyresult; 43int yyinputitem; 44id yyresultform; 45 46extern int yysofar; 47extern NSMutableArray *positionStack; 48#ifndef YYSTYPE 49#define YYSTYPE int 50#endif 51#include <stdio.h> 52 53#ifndef __cplusplus 54#ifndef __STDC__ 55#define const 56#endif 57#endif 58 59 60 61#define YYFINAL 206 62#define YYFLAG -32768 63#define YYNTBASE 31 64 65#define YYTRANSLATE(x) ((unsigned)(x) <= 284 ? yytranslate[x] : 72) 66 67static const char yytranslate[] = { 0, 68 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 69 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 70 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 71 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 72 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 73 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 74 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 75 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 76 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 77 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 78 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 79 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 80 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 81 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 82 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 83 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 84 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 85 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 86 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 87 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 88 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 89 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 90 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 91 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 92 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 93 2, 2, 2, 2, 2, 1, 3, 4, 5, 6, 94 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 95 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 96 27, 28, 29, 30 97}; 98 99#if YYDEBUG != 0 100static const short yyprhs[] = { 0, 101 0, 1, 4, 10, 16, 18, 20, 23, 25, 28, 102 30, 32, 34, 36, 38, 40, 42, 44, 47, 49, 103 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 104 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 105 91, 93, 95, 97, 99, 101, 103, 105, 107, 109, 106 111, 113, 115, 117, 119, 121, 123, 125, 130, 137, 107 141, 146, 152, 157, 159, 162, 164, 167, 173, 180, 108 185, 191, 196, 200, 205, 209, 214, 220, 226, 232, 109 239, 245, 251, 254, 259, 264, 266, 269, 277, 285, 110 293, 296, 298, 302, 305, 307, 311, 314, 316, 319, 111 321, 324, 328, 332, 334, 336, 338, 340, 344, 347, 112 351, 354, 356, 360, 363, 367, 369 113}; 114 115static const short yyrhs[] = { -1, 116 32, 31, 0, 3, 6, 27, 36, 5, 0, 3, 117 6, 70, 33, 5, 0, 36, 0, 36, 0, 36, 118 33, 0, 36, 0, 34, 36, 0, 23, 0, 24, 119 0, 25, 0, 26, 0, 27, 0, 28, 0, 66, 120 0, 68, 0, 29, 35, 0, 15, 0, 30, 0, 121 16, 0, 17, 0, 6, 0, 7, 0, 8, 0, 122 18, 0, 9, 0, 10, 0, 11, 0, 12, 0, 123 13, 0, 14, 0, 19, 0, 20, 0, 21, 0, 124 23, 0, 24, 0, 25, 0, 26, 0, 27, 0, 125 28, 0, 65, 0, 67, 0, 51, 0, 50, 0, 126 55, 0, 56, 0, 57, 0, 52, 0, 49, 0, 127 48, 0, 47, 0, 45, 0, 46, 0, 43, 0, 128 44, 0, 37, 0, 3, 16, 36, 5, 0, 3, 129 3, 33, 5, 33, 5, 0, 3, 36, 5, 0, 130 3, 36, 33, 5, 0, 3, 36, 15, 36, 5, 131 0, 3, 14, 33, 5, 0, 38, 0, 41, 38, 132 0, 39, 0, 42, 39, 0, 3, 12, 36, 41, 133 5, 0, 3, 12, 36, 41, 40, 5, 0, 3, 134 13, 42, 5, 0, 3, 13, 42, 40, 5, 0, 135 3, 10, 34, 5, 0, 3, 10, 5, 0, 3, 136 11, 34, 5, 0, 3, 11, 5, 0, 3, 9, 137 33, 5, 0, 3, 7, 27, 36, 5, 0, 3, 138 17, 36, 36, 5, 0, 3, 18, 36, 36, 5, 139 0, 3, 18, 36, 36, 36, 5, 0, 3, 8, 140 27, 33, 5, 0, 3, 8, 71, 33, 5, 0, 141 29, 35, 0, 3, 30, 35, 5, 0, 3, 27, 142 36, 5, 0, 53, 0, 53, 54, 0, 3, 19, 143 3, 54, 5, 33, 5, 0, 3, 20, 3, 54, 144 5, 33, 5, 0, 3, 21, 3, 54, 5, 33, 145 5, 0, 3, 5, 0, 36, 0, 36, 22, 36, 146 0, 36, 59, 0, 35, 0, 35, 22, 35, 0, 147 35, 60, 0, 36, 0, 36, 61, 0, 35, 0, 148 35, 62, 0, 3, 59, 5, 0, 3, 60, 5, 149 0, 63, 0, 58, 0, 64, 0, 58, 0, 4, 150 61, 5, 0, 4, 5, 0, 4, 62, 5, 0, 151 4, 5, 0, 27, 0, 27, 22, 27, 0, 27, 152 69, 0, 3, 69, 5, 0, 70, 0, 58, 0 153}; 154 155#endif 156 157#if YYDEBUG != 0 158static const short yyrline[] = { 0, 159 56, 60, 68, 76, 84, 94, 97, 102, 105, 110, 160 113, 116, 119, 122, 125, 128, 131, 134, 138, 141, 161 144, 147, 150, 153, 156, 159, 162, 165, 168, 171, 162 174, 177, 180, 183, 186, 191, 194, 197, 200, 203, 163 206, 209, 212, 215, 218, 221, 224, 227, 230, 233, 164 236, 239, 242, 245, 248, 251, 254, 259, 264, 269, 165 272, 275, 280, 285, 288, 293, 296, 301, 304, 310, 166 313, 318, 321, 326, 329, 334, 339, 344, 349, 352, 167 357, 360, 365, 368, 373, 378, 381, 386, 391, 396, 168 401, 406, 409, 412, 417, 420, 423, 428, 431, 436, 169 439, 444, 449, 454, 457, 462, 465, 470, 473, 478, 170 481, 486, 489, 492, 497, 502, 505 171}; 172#endif 173 174 175#if YYDEBUG != 0 || defined (YYERROR_VERBOSE) 176 177static const char * const yytname[] = { "$","error","$undefined.","LPAREN", 178"LVECTPAREN","RPAREN","DEFINE","SET","LAMBDA","BEGINTOK","AND","OR","CASE","COND", 179"ELSE","ARROW","CALLCC","APPLY","IF","LET","LETSTAR","LETREC","DOT","INTEGER", 180"CHAR","BOOLEAN","DOUBLE","SYMBOL","STRING","QUOTECHAR","QUOTE","top","topitem", 181"sequence","revsequence","qform","form","callcc","singlecase","singlecond","elsecasecond", 182"cases","conditions","case","cond","and","or","begin","set","apply","if","lambda", 183"quote","singlebinding","listofbindings","let","letstar","letrec","emptylist", 184"nonemptylistdata","qnonemptylistdata","nonemptyvectdata","qnonemptyvectdata", 185"nonemptylist","qnonemptylist","list","qlist","vector","qvector","nonemptysymlistdata", 186"nonemptysymlist","symlist", NULL 187}; 188#endif 189 190static const short yyr1[] = { 0, 191 31, 31, 32, 32, 32, 33, 33, 34, 34, 35, 192 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 193 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 194 35, 35, 35, 35, 35, 36, 36, 36, 36, 36, 195 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 196 36, 36, 36, 36, 36, 36, 36, 37, 38, 39, 197 39, 39, 40, 41, 41, 42, 42, 43, 43, 44, 198 44, 45, 45, 46, 46, 47, 48, 49, 50, 50, 199 51, 51, 52, 52, 53, 54, 54, 55, 56, 57, 200 58, 59, 59, 59, 60, 60, 60, 61, 61, 62, 201 62, 63, 64, 65, 65, 66, 66, 67, 67, 68, 202 68, 69, 69, 69, 70, 71, 71 203}; 204 205static const short yyr2[] = { 0, 206 0, 2, 5, 5, 1, 1, 2, 1, 2, 1, 207 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 208 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 209 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 210 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 211 1, 1, 1, 1, 1, 1, 1, 4, 6, 3, 212 4, 5, 4, 1, 2, 1, 2, 5, 6, 4, 213 5, 4, 3, 4, 3, 4, 5, 5, 5, 6, 214 5, 5, 2, 4, 4, 1, 2, 7, 7, 7, 215 2, 1, 3, 2, 1, 3, 2, 1, 2, 1, 216 2, 3, 3, 1, 1, 1, 1, 3, 2, 3, 217 2, 1, 3, 2, 3, 1, 1 218}; 219 220static const short yydefact[] = { 1, 221 0, 0, 36, 37, 38, 39, 40, 41, 0, 1, 222 5, 57, 55, 56, 53, 54, 52, 51, 50, 45, 223 44, 49, 46, 47, 48, 105, 104, 42, 43, 0, 224 91, 0, 0, 0, 0, 0, 0, 0, 0, 0, 225 0, 0, 0, 0, 0, 0, 92, 0, 109, 98, 226 0, 0, 0, 23, 24, 25, 27, 28, 29, 30, 227 31, 32, 19, 21, 22, 26, 33, 34, 35, 10, 228 11, 12, 13, 14, 15, 0, 20, 83, 107, 106, 229 16, 17, 2, 0, 0, 0, 0, 0, 0, 117, 230 116, 0, 0, 6, 73, 0, 8, 75, 0, 0, 231 0, 66, 0, 0, 0, 0, 0, 0, 0, 0, 232 0, 94, 102, 99, 108, 95, 0, 111, 100, 0, 233 18, 112, 0, 0, 0, 0, 0, 0, 76, 7, 234 72, 9, 74, 0, 64, 0, 0, 0, 70, 67, 235 0, 58, 0, 0, 0, 86, 0, 0, 0, 84, 236 93, 0, 97, 103, 101, 110, 0, 114, 115, 3, 237 4, 77, 81, 82, 0, 0, 68, 65, 0, 60, 238 0, 0, 0, 71, 78, 79, 0, 0, 87, 0, 239 0, 0, 96, 113, 0, 69, 0, 61, 0, 80, 240 0, 0, 0, 0, 0, 62, 63, 85, 88, 89, 241 90, 0, 59, 0, 0, 0 242}; 243 244static const short yydefgoto[] = { 83, 245 10, 93, 96, 116, 94, 12, 135, 102, 141, 136, 246 103, 13, 14, 15, 16, 17, 18, 19, 20, 21, 247 22, 146, 147, 23, 24, 25, 26, 48, 117, 51, 248 120, 27, 80, 28, 81, 29, 82, 123, 86, 92 249}; 250 251static const short yypact[] = { 139, 252 288, 344,-32768,-32768,-32768,-32768,-32768,-32768, 260, 139, 253-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 254-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 316, 255-32768, 1, -13, 4, 433, 351, 358, 433, 12, 433, 256 433, 433, 15, 20, 23, 260, 385, 27,-32768, 433, 257 29, 176, 204,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 258-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 259-32768,-32768,-32768,-32768,-32768, 260,-32768,-32768,-32768,-32768, 260-32768,-32768,-32768, 8, 433, 433, 433, -2, 433,-32768, 261-32768, 433, 34, 433,-32768, 392,-32768,-32768, 399, 41, 262 433,-32768, 19, 44, 433, 433, 43, 43, 43, 48, 263 433,-32768,-32768,-32768,-32768, 232, 49,-32768, 260, 51, 264-32768, -10, 52, 53, 54, 55, 56, 57,-32768,-32768, 265-32768,-32768,-32768, 60,-32768, 24, 132, 100,-32768,-32768, 266 61,-32768, 62, 426, 38, 43, 63, 64, 65,-32768, 267-32768, 260,-32768,-32768,-32768,-32768, 45,-32768,-32768,-32768, 268-32768,-32768,-32768,-32768, 433, 6,-32768,-32768, 66,-32768, 269 433, 68, 433,-32768,-32768,-32768, 69, 433,-32768, 433, 270 433, 433,-32768,-32768, 71,-32768, 72,-32768, 74,-32768, 271 75, 76, 77, 78, 433,-32768,-32768,-32768,-32768,-32768, 272-32768, 79,-32768, 86, 88,-32768 273}; 274 275static const short yypgoto[] = { 89, 276-32768, -73, 58, 2, 0,-32768, -46, -12, -43,-32768, 277-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 278-32768,-32768, -103,-32768,-32768,-32768, -1, 47, -19, 67, 279 -21,-32768,-32768,-32768,-32768,-32768,-32768, -20, 82,-32768 280}; 281 282 283#define YYLAST 462 284 285 286static const short yytable[] = { 11, 287 47, 50, 31, 84, 148, 149, 88, 79, 165, 11, 288 78, 157, 125, 87, 101, 127, 122, 107, 128, 173, 289 130, 138, 108, 139, 122, 109, 166, 85, 167, 47, 290 89, 113, 90, 115, 122, 97, 97, 100, 129, 104, 291 105, 106, 179, 134, 79, 145, 47, 110, 142, 50, 292 79, 79, 150, 154, 119, 156, 159, 160, 161, 162, 293 163, 164, 165, 172, 178, 174, 175, 180, 181, 182, 294 186, 184, 188, 190, 79, 195, 196, 121, 197, 198, 295 199, 200, 201, 203, 124, 205, 126, 206, 204, 168, 296 140, 185, 169, 112, 99, 132, 153, 155, 132, 189, 297 137, 158, 30, 2, 143, 144, 192, 193, 194, 0, 298 151, 0, 0, 173, 79, 91, 114, 79, 0, 0, 299 119, 202, 3, 4, 5, 6, 7, 8, 9, 0, 300 0, 0, 0, 0, 30, 2, 170, 137, 0, 0, 301 0, 1, 2, 177, 0, 0, 171, 0, 0, 0, 302 79, 0, 0, 183, 3, 4, 5, 6, 7, 8, 303 9, 3, 4, 5, 6, 7, 8, 9, 0, 0, 304 187, 0, 0, 0, 0, 0, 0, 191, 52, 53, 305 31, 54, 55, 56, 57, 58, 59, 60, 61, 62, 306 63, 64, 65, 66, 67, 68, 69, 0, 70, 71, 307 72, 73, 74, 75, 76, 77, 52, 53, 118, 54, 308 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 309 65, 66, 67, 68, 69, 0, 70, 71, 72, 73, 310 74, 75, 76, 77, 52, 53, 0, 54, 55, 56, 311 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 312 67, 68, 69, 152, 70, 71, 72, 73, 74, 75, 313 76, 77, 52, 53, 0, 54, 55, 56, 57, 58, 314 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 315 69, 0, 70, 71, 72, 73, 74, 75, 76, 77, 316 30, 2, 31, 32, 33, 34, 35, 36, 37, 38, 317 39, 0, 0, 40, 41, 42, 43, 44, 45, 0, 318 3, 4, 5, 6, 7, 8, 9, 46, 30, 2, 319 31, 0, 33, 34, 35, 36, 37, 38, 39, 0, 320 0, 40, 41, 42, 43, 44, 45, 0, 3, 4, 321 5, 6, 7, 8, 9, 46, 30, 2, 49, 0, 322 0, 0, 0, 30, 2, 95, 0, 0, 0, 0, 323 30, 2, 98, 0, 0, 0, 3, 4, 5, 6, 324 7, 8, 9, 3, 4, 5, 6, 7, 8, 9, 325 3, 4, 5, 6, 7, 8, 9, 30, 2, 0, 326 0, 0, 0, 0, 30, 2, 131, 0, 0, 0, 327 0, 30, 2, 133, 0, 0, 111, 3, 4, 5, 328 6, 7, 8, 9, 3, 4, 5, 6, 7, 8, 329 9, 3, 4, 5, 6, 7, 8, 9, 30, 2, 330 176, 0, 0, 0, 0, 30, 2, 0, 0, 0, 331 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 332 5, 6, 7, 8, 9, 3, 4, 5, 6, 7, 333 8, 9 334}; 335 336static const short yycheck[] = { 0, 337 1, 2, 5, 3, 108, 109, 3, 9, 3, 10, 338 9, 22, 86, 27, 3, 89, 27, 3, 92, 14, 339 94, 3, 3, 5, 27, 3, 3, 27, 5, 30, 340 27, 5, 34, 5, 27, 36, 37, 38, 5, 40, 341 41, 42, 146, 3, 46, 3, 47, 46, 5, 50, 342 52, 53, 5, 5, 53, 5, 5, 5, 5, 5, 343 5, 5, 3, 137, 27, 5, 5, 5, 5, 5, 344 5, 27, 5, 5, 76, 5, 5, 76, 5, 5, 345 5, 5, 5, 5, 85, 0, 87, 0, 0, 136, 346 103, 165, 136, 47, 37, 96, 116, 119, 99, 173, 347 101, 122, 3, 4, 105, 106, 180, 181, 182, -1, 348 111, -1, -1, 14, 116, 34, 50, 119, -1, -1, 349 119, 195, 23, 24, 25, 26, 27, 28, 29, -1, 350 -1, -1, -1, -1, 3, 4, 5, 138, -1, -1, 351 -1, 3, 4, 144, -1, -1, 15, -1, -1, -1, 352 152, -1, -1, 152, 23, 24, 25, 26, 27, 28, 353 29, 23, 24, 25, 26, 27, 28, 29, -1, -1, 354 171, -1, -1, -1, -1, -1, -1, 178, 3, 4, 355 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 356 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 357 25, 26, 27, 28, 29, 30, 3, 4, 5, 6, 358 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 359 17, 18, 19, 20, 21, -1, 23, 24, 25, 26, 360 27, 28, 29, 30, 3, 4, -1, 6, 7, 8, 361 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 362 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 363 29, 30, 3, 4, -1, 6, 7, 8, 9, 10, 364 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 365 21, -1, 23, 24, 25, 26, 27, 28, 29, 30, 366 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 367 13, -1, -1, 16, 17, 18, 19, 20, 21, -1, 368 23, 24, 25, 26, 27, 28, 29, 30, 3, 4, 369 5, -1, 7, 8, 9, 10, 11, 12, 13, -1, 370 -1, 16, 17, 18, 19, 20, 21, -1, 23, 24, 371 25, 26, 27, 28, 29, 30, 3, 4, 5, -1, 372 -1, -1, -1, 3, 4, 5, -1, -1, -1, -1, 373 3, 4, 5, -1, -1, -1, 23, 24, 25, 26, 374 27, 28, 29, 23, 24, 25, 26, 27, 28, 29, 375 23, 24, 25, 26, 27, 28, 29, 3, 4, -1, 376 -1, -1, -1, -1, 3, 4, 5, -1, -1, -1, 377 -1, 3, 4, 5, -1, -1, 22, 23, 24, 25, 378 26, 27, 28, 29, 23, 24, 25, 26, 27, 28, 379 29, 23, 24, 25, 26, 27, 28, 29, 3, 4, 380 5, -1, -1, -1, -1, 3, 4, -1, -1, -1, 381 -1, -1, -1, -1, -1, -1, -1, -1, 23, 24, 382 25, 26, 27, 28, 29, 23, 24, 25, 26, 27, 383 28, 29 384}; 385/* -*-C-*- Note some compilers choke on comments on `#line' lines. */ 386#line 3 "/usr/share/bison.simple" 387/* This file comes from bison-1.28. */ 388 389/* Skeleton output parser for bison, 390 Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. 391 392 This program is free software; you can redistribute it and/or modify 393 it under the terms of the GNU General Public License as published by 394 the Free Software Foundation; either version 2, or (at your option) 395 any later version. 396 397 This program is distributed in the hope that it will be useful, 398 but WITHOUT ANY WARRANTY; without even the implied warranty of 399 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 400 GNU General Public License for more details. 401 402 You should have received a copy of the GNU General Public License 403 along with this program; if not, write to the Free Software 404 Foundation, Inc., 59 Temple Place - Suite 330, 405 Boston, MA 02111-1307, USA. */ 406 407/* As a special exception, when this file is copied by Bison into a 408 Bison output file, you may use that output file without restriction. 409 This special exception was added by the Free Software Foundation 410 in version 1.24 of Bison. */ 411 412/* This is the parser code that is written into each bison parser 413 when the %semantic_parser declaration is not specified in the grammar. 414 It was written by Richard Stallman by simplifying the hairy parser 415 used when %semantic_parser is specified. */ 416 417#ifndef YYPARSE_RETURN_TYPE 418#define YYPARSE_RETURN_TYPE int 419#endif 420 421 422#ifndef YYSTACK_USE_ALLOCA 423#ifdef alloca 424#define YYSTACK_USE_ALLOCA 425#else /* alloca not defined */ 426#ifdef __GNUC__ 427#define YYSTACK_USE_ALLOCA 428#define alloca __builtin_alloca 429#else /* not GNU C. */ 430#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386)) 431#define YYSTACK_USE_ALLOCA 432#include <alloca.h> 433#else /* not sparc */ 434/* We think this test detects Watcom and Microsoft C. */ 435/* This used to test MSDOS, but that is a bad idea 436 since that symbol is in the user namespace. */ 437#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__) 438#if 0 /* No need for malloc.h, which pollutes the namespace; 439 instead, just don't use alloca. */ 440#include <malloc.h> 441#endif 442#else /* not MSDOS, or __TURBOC__ */ 443#if defined(_AIX) 444/* I don't know what this was needed for, but it pollutes the namespace. 445 So I turned it off. rms, 2 May 1997. */ 446/* #include <malloc.h> */ 447 #pragma alloca 448#define YYSTACK_USE_ALLOCA 449#else /* not MSDOS, or __TURBOC__, or _AIX */ 450#if 0 451#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up, 452 and on HPUX 10. Eventually we can turn this on. */ 453#define YYSTACK_USE_ALLOCA 454#define alloca __builtin_alloca 455#endif /* __hpux */ 456#endif 457#endif /* not _AIX */ 458#endif /* not MSDOS, or __TURBOC__ */ 459#endif /* not sparc */ 460#endif /* not GNU C */ 461#endif /* alloca not defined */ 462#endif /* YYSTACK_USE_ALLOCA not defined */ 463 464#ifdef YYSTACK_USE_ALLOCA 465#define YYSTACK_ALLOC alloca 466#else 467#define YYSTACK_ALLOC malloc 468#endif 469 470/* Note: there must be only one dollar sign in this file. 471 It is replaced by the list of actions, each action 472 as one case of the switch. */ 473 474#define yyerrok (yyerrstatus = 0) 475#define yyclearin (yychar = YYEMPTY) 476#define YYEMPTY -2 477#define YYEOF 0 478#define YYACCEPT goto yyacceptlab 479#define YYABORT goto yyabortlab 480#define YYERROR goto yyerrlab1 481/* Like YYERROR except do call yyerror. 482 This remains here temporarily to ease the 483 transition to the new meaning of YYERROR, for GCC. 484 Once GCC version 2 has supplanted version 1, this can go. */ 485#define YYFAIL goto yyerrlab 486#define YYRECOVERING() (!!yyerrstatus) 487#define YYBACKUP(token, value) \ 488do \ 489 if (yychar == YYEMPTY && yylen == 1) \ 490 { yychar = (token), yylval = (value); \ 491 yychar1 = YYTRANSLATE (yychar); \ 492 YYPOPSTACK; \ 493 goto yybackup; \ 494 } \ 495 else \ 496 { yyerror ("syntax error: cannot back up"); YYERROR; } \ 497while (0) 498 499#define YYTERROR 1 500#define YYERRCODE 256 501 502#ifndef YYPURE 503#define YYLEX yylex() 504#endif 505 506#ifdef YYPURE 507#ifdef YYLSP_NEEDED 508#ifdef YYLEX_PARAM 509#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM) 510#else 511#define YYLEX yylex(&yylval, &yylloc) 512#endif 513#else /* not YYLSP_NEEDED */ 514#ifdef YYLEX_PARAM 515#define YYLEX yylex(&yylval, YYLEX_PARAM) 516#else 517#define YYLEX yylex(&yylval) 518#endif 519#endif /* not YYLSP_NEEDED */ 520#endif 521 522/* If nonreentrant, generate the variables here */ 523 524#ifndef YYPURE 525 526int yychar; /* the lookahead symbol */ 527YYSTYPE yylval; /* the semantic value of the */ 528 /* lookahead symbol */ 529 530#ifdef YYLSP_NEEDED 531YYLTYPE yylloc; /* location data for the lookahead */ 532 /* symbol */ 533#endif 534 535int yynerrs; /* number of parse errors so far */ 536#endif /* not YYPURE */ 537 538#if YYDEBUG != 0 539int yydebug; /* nonzero means print parse trace */ 540/* Since this is uninitialized, it does not stop multiple parsers 541 from coexisting. */ 542#endif 543 544/* YYINITDEPTH indicates the initial size of the parser's stacks */ 545 546#ifndef YYINITDEPTH 547#define YYINITDEPTH 200 548#endif 549 550/* YYMAXDEPTH is the maximum size the stacks can grow to 551 (effective only if the built-in stack extension method is used). */ 552 553#if YYMAXDEPTH == 0 554#undef YYMAXDEPTH 555#endif 556 557#ifndef YYMAXDEPTH 558#define YYMAXDEPTH 10000 559#endif 560 561/* Define __yy_memcpy. Note that the size argument 562 should be passed with type unsigned int, because that is what the non-GCC 563 definitions require. With GCC, __builtin_memcpy takes an arg 564 of type size_t, but it can handle unsigned int. */ 565 566#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ 567#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) 568#else /* not GNU C or C++ */ 569#ifndef __cplusplus 570 571/* This is the most reliable way to avoid incompatibilities 572 in available built-in functions on various systems. */ 573static void 574__yy_memcpy (to, from, count) 575 char *to; 576 char *from; 577 unsigned int count; 578{ 579 register char *f = from; 580 register char *t = to; 581 register int i = count; 582 583 while (i-- > 0) 584 *t++ = *f++; 585} 586 587#else /* __cplusplus */ 588 589/* This is the most reliable way to avoid incompatibilities 590 in available built-in functions on various systems. */ 591static void 592__yy_memcpy (char *to, char *from, unsigned int count) 593{ 594 register char *t = to; 595 register char *f = from; 596 register int i = count; 597 598 while (i-- > 0) 599 *t++ = *f++; 600} 601 602#endif 603#endif 604 605#line 222 "/usr/share/bison.simple" 606 607/* The user can define YYPARSE_PARAM as the name of an argument to be passed 608 into yyparse. The argument should have type void *. 609 It should actually point to an object. 610 Grammar actions can access the variable by casting it 611 to the proper pointer type. */ 612 613#ifdef YYPARSE_PARAM 614#ifdef __cplusplus 615#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM 616#define YYPARSE_PARAM_DECL 617#else /* not __cplusplus */ 618#define YYPARSE_PARAM_ARG YYPARSE_PARAM 619#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; 620#endif /* not __cplusplus */ 621#else /* not YYPARSE_PARAM */ 622#define YYPARSE_PARAM_ARG 623#define YYPARSE_PARAM_DECL 624#endif /* not YYPARSE_PARAM */ 625 626/* Prevent warning if -Wstrict-prototypes. */ 627#ifdef __GNUC__ 628#ifdef YYPARSE_PARAM 629YYPARSE_RETURN_TYPE 630yyparse (void *); 631#else 632YYPARSE_RETURN_TYPE 633yyparse (void); 634#endif 635#endif 636 637YYPARSE_RETURN_TYPE 638yyparse(YYPARSE_PARAM_ARG) 639 YYPARSE_PARAM_DECL 640{ 641 register int yystate; 642 register int yyn; 643 register short *yyssp; 644 register YYSTYPE *yyvsp; 645 int yyerrstatus; /* number of tokens to shift before error messages enabled */ 646 int yychar1 = 0; /* lookahead token as an internal (translated) token number */ 647 648 short yyssa[YYINITDEPTH]; /* the state stack */ 649 YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ 650 651 short *yyss = yyssa; /* refer to the stacks thru separate pointers */ 652 YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ 653 654#ifdef YYLSP_NEEDED 655 YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ 656 YYLTYPE *yyls = yylsa; 657 YYLTYPE *yylsp; 658 659#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) 660#else 661#define YYPOPSTACK (yyvsp--, yyssp--) 662#endif 663 664 int yystacksize = YYINITDEPTH; 665#ifndef YYSTACK_USE_ALLOCA 666 int yyfree_stacks = 0; 667#endif 668 669#ifdef YYPURE 670 int yychar; 671 YYSTYPE yylval; 672 int yynerrs; 673#ifdef YYLSP_NEEDED 674 YYLTYPE yylloc; 675#endif 676#endif 677 678 YYSTYPE yyval; /* the variable used to return */ 679 /* semantic values from the action */ 680 /* routines */ 681 682 int yylen; 683 684#if YYDEBUG != 0 685 if (yydebug) 686 fprintf(stderr, "Starting parse\n"); 687#endif 688 689 yystate = 0; 690 yyerrstatus = 0; 691 yynerrs = 0; 692 yychar = YYEMPTY; /* Cause a token to be read. */ 693 694 /* Initialize stack pointers. 695 Waste one element of value and location stack 696 so that they stay on the same level as the state stack. 697 The wasted elements are never initialized. */ 698 699 yyssp = yyss - 1; 700 yyvsp = yyvs; 701#ifdef YYLSP_NEEDED 702 yylsp = yyls; 703#endif 704 705/* Push a new state, which is found in yystate . */ 706/* In all cases, when you get here, the value and location stacks 707 have just been pushed. so pushing a state here evens the stacks. */ 708yynewstate: 709 710 *++yyssp = yystate; 711 712 if (yyssp >= yyss + yystacksize - 1) 713 { 714 /* Give user a chance to reallocate the stack */ 715 /* Use copies of these so that the &'s don't force the real ones into memory. */ 716 YYSTYPE *yyvs1 = yyvs; 717 short *yyss1 = yyss; 718#ifdef YYLSP_NEEDED 719 YYLTYPE *yyls1 = yyls; 720#endif 721 722 /* Get the current used size of the three stacks, in elements. */ 723 int size = yyssp - yyss + 1; 724 725#ifdef yyoverflow 726 /* Each stack pointer address is followed by the size of 727 the data in use in that stack, in bytes. */ 728#ifdef YYLSP_NEEDED 729 /* This used to be a conditional around just the two extra args, 730 but that might be undefined if yyoverflow is a macro. */ 731 yyoverflow("parser stack overflow", 732 &yyss1, size * sizeof (*yyssp), 733 &yyvs1, size * sizeof (*yyvsp), 734 &yyls1, size * sizeof (*yylsp), 735 &yystacksize); 736#else 737 yyoverflow("parser stack overflow", 738 &yyss1, size * sizeof (*yyssp), 739 &yyvs1, size * sizeof (*yyvsp), 740 &yystacksize); 741#endif 742 743 yyss = yyss1; yyvs = yyvs1; 744#ifdef YYLSP_NEEDED 745 yyls = yyls1; 746#endif 747#else /* no yyoverflow */ 748 /* Extend the stack our own way. */ 749 if (yystacksize >= YYMAXDEPTH) 750 { 751 yyerror("parser stack overflow"); 752#ifndef YYSTACK_USE_ALLOCA 753 if (yyfree_stacks) 754 { 755 free (yyss); 756 free (yyvs); 757#ifdef YYLSP_NEEDED 758 free (yyls); 759#endif 760 } 761#endif 762 return 2; 763 } 764 yystacksize *= 2; 765 if (yystacksize > YYMAXDEPTH) 766 yystacksize = YYMAXDEPTH; 767#ifndef YYSTACK_USE_ALLOCA 768 yyfree_stacks = 1; 769#endif 770 yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp)); 771 __yy_memcpy ((char *)yyss, (char *)yyss1, 772 size * (unsigned int) sizeof (*yyssp)); 773 yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp)); 774 __yy_memcpy ((char *)yyvs, (char *)yyvs1, 775 size * (unsigned int) sizeof (*yyvsp)); 776#ifdef YYLSP_NEEDED 777 yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp)); 778 __yy_memcpy ((char *)yyls, (char *)yyls1, 779 size * (unsigned int) sizeof (*yylsp)); 780#endif 781#endif /* no yyoverflow */ 782 783 yyssp = yyss + size - 1; 784 yyvsp = yyvs + size - 1; 785#ifdef YYLSP_NEEDED 786 yylsp = yyls + size - 1; 787#endif 788 789#if YYDEBUG != 0 790 if (yydebug) 791 fprintf(stderr, "Stack size increased to %d\n", yystacksize); 792#endif 793 794 if (yyssp >= yyss + yystacksize - 1) 795 YYABORT; 796 } 797 798#if YYDEBUG != 0 799 if (yydebug) 800 fprintf(stderr, "Entering state %d\n", yystate); 801#endif 802 803 goto yybackup; 804 yybackup: 805 806/* Do appropriate processing given the current state. */ 807/* Read a lookahead token if we need one and don't already have one. */ 808/* yyresume: */ 809 810 /* First try to decide what to do without reference to lookahead token. */ 811 812 yyn = yypact[yystate]; 813 if (yyn == YYFLAG) 814 goto yydefault; 815 816 /* Not known => get a lookahead token if don't already have one. */ 817 818 /* yychar is either YYEMPTY or YYEOF 819 or a valid token in external form. */ 820 821 if (yychar == YYEMPTY) 822 { 823#if YYDEBUG != 0 824 if (yydebug) 825 fprintf(stderr, "Reading a token: "); 826#endif 827 yychar = YYLEX; 828 } 829 830 /* Convert token to internal form (in yychar1) for indexing tables with */ 831 832 if (yychar <= 0) /* This means end of input. */ 833 { 834 yychar1 = 0; 835 yychar = YYEOF; /* Don't call YYLEX any more */ 836 837#if YYDEBUG != 0 838 if (yydebug) 839 fprintf(stderr, "Now at end of input.\n"); 840#endif 841 } 842 else 843 { 844 yychar1 = YYTRANSLATE(yychar); 845 846#if YYDEBUG != 0 847 if (yydebug) 848 { 849 fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]); 850 /* Give the individual parser a way to print the precise meaning 851 of a token, for further debugging info. */ 852#ifdef YYPRINT 853 YYPRINT (stderr, yychar, yylval); 854#endif 855 fprintf (stderr, ")\n"); 856 } 857#endif 858 } 859 860 yyn += yychar1; 861 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) 862 goto yydefault; 863 864 yyn = yytable[yyn]; 865 866 /* yyn is what to do for this token type in this state. 867 Negative => reduce, -yyn is rule number. 868 Positive => shift, yyn is new state. 869 New state is final state => don't bother to shift, 870 just return success. 871 0, or most negative number => error. */ 872 873 if (yyn < 0) 874 { 875 if (yyn == YYFLAG) 876 goto yyerrlab; 877 yyn = -yyn; 878 goto yyreduce; 879 } 880 else if (yyn == 0) 881 goto yyerrlab; 882 883 if (yyn == YYFINAL) 884 YYACCEPT; 885 886 /* Shift the lookahead token. */ 887 888#if YYDEBUG != 0 889 if (yydebug) 890 fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]); 891#endif 892 893 /* Discard the token being shifted unless it is eof. */ 894 if (yychar != YYEOF) 895 yychar = YYEMPTY; 896 897 *++yyvsp = yylval; 898#ifdef YYLSP_NEEDED 899 *++yylsp = yylloc; 900#endif 901 902 /* count tokens shifted since error; after three, turn off error status. */ 903 if (yyerrstatus) yyerrstatus--; 904 905 yystate = yyn; 906 goto yynewstate; 907 908/* Do the default action for the current state. */ 909yydefault: 910 911 yyn = yydefact[yystate]; 912 if (yyn == 0) 913 goto yyerrlab; 914 915/* Do a reduction. yyn is the number of a rule to reduce with. */ 916yyreduce: 917 yylen = yyr2[yyn]; 918 if (yylen > 0) 919 yyval = yyvsp[1-yylen]; /* implement default value of the action */ 920 921#if YYDEBUG != 0 922 if (yydebug) 923 { 924 int i; 925 926 fprintf (stderr, "Reducing via rule %d (line %d), ", 927 yyn, yyrline[yyn]); 928 929 /* Print the symbols being reduced, and their result. */ 930 for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) 931 fprintf (stderr, "%s ", yytname[yyrhs[i]]); 932 fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]); 933 } 934#endif 935 936 937 switch (yyn) { 938 939case 1: 940#line 56 "scheme.y" 941{ 942 yyval = [NSNull null]; 943 yyresultform = yyval; 944; 945 break;} 946case 2: 947#line 60 "scheme.y" 948{ 949 yyval = [Triple newTag:FORM_TOP Arg1:yyvsp[-1] Arg2:yyvsp[0]]; 950 yyresultform = yyval; 951 952 yyinputitem++; 953; 954 break;} 955case 3: 956#line 68 "scheme.y" 957{ 958 NSValue *entry = 959 [NSValue valueWithRange:NSMakeRange(yysofar, 0)]; 960 961 yyval = [Triple newTag:FORM_DEFINE1 Arg1:yyvsp[-2] Arg2:yyvsp[-1]]; 962 963 [[positionStack lastObject] addObject:entry]; 964; 965 break;} 966case 4: 967#line 76 "scheme.y" 968{ 969 NSValue *entry = 970 [NSValue valueWithRange:NSMakeRange(yysofar, 0)]; 971 972 yyval = [Triple newTag:FORM_DEFINE2 Arg1:yyvsp[-2] Arg2:yyvsp[-1]]; 973 974 [[positionStack lastObject] addObject:entry]; 975; 976 break;} 977case 5: 978#line 84 "scheme.y" 979{ 980 NSValue *entry = 981 [NSValue valueWithRange:NSMakeRange(yysofar, 0)]; 982 983 yyval = yyvsp[0]; 984 985 [[positionStack lastObject] addObject:entry]; 986; 987 break;} 988case 6: 989#line 94 "scheme.y" 990{ 991 yyval = [Pair newCar:yyvsp[0] Cdr:[NSNull null]]; 992; 993 break;} 994case 7: 995#line 97 "scheme.y" 996{ 997 yyval = [Pair newCar:yyvsp[-1] Cdr:yyvsp[0]]; 998; 999 break;} 1000case 8: 1001#line 102 "scheme.y" 1002{ 1003 yyval = [Pair newCar:yyvsp[0] Cdr:[NSNull null]]; 1004; 1005 break;} 1006case 9: 1007#line 105 "scheme.y" 1008{ 1009 yyval = [Pair newCar:yyvsp[0] Cdr:yyvsp[-1]]; 1010; 1011 break;} 1012case 10: 1013#line 110 "scheme.y" 1014{ 1015 yyval = yyvsp[0]; 1016; 1017 break;} 1018case 11: 1019#line 113 "scheme.y" 1020{ 1021 yyval = yyvsp[0]; 1022; 1023 break;} 1024case 12: 1025#line 116 "scheme.y" 1026{ 1027 yyval = yyvsp[0]; 1028; 1029 break;} 1030case 13: 1031#line 119 "scheme.y" 1032{ 1033 yyval = yyvsp[0]; 1034; 1035 break;} 1036case 14: 1037#line 122 "scheme.y" 1038{ 1039 yyval = yyvsp[0]; 1040; 1041 break;} 1042case 15: 1043#line 125 "scheme.y" 1044{ 1045 yyval = yyvsp[0]; 1046; 1047 break;} 1048case 16: 1049#line 128 "scheme.y" 1050{ 1051 yyval = yyvsp[0]; 1052; 1053 break;} 1054case 17: 1055#line 131 "scheme.y" 1056{ 1057 yyval = yyvsp[0]; 1058; 1059 break;} 1060case 18: 1061#line 134 "scheme.y" 1062{ 1063 yyval = [Pair newCar:[[Symbol alloc] initSCMSymbol:"quote"] 1064 Cdr:[Pair newCar:yyvsp[0] Cdr:[NSNull null]]]; 1065; 1066 break;} 1067case 19: 1068#line 138 "scheme.y" 1069{ 1070 yyval = [[Symbol alloc] initSCMSymbol:"=>"]; 1071; 1072 break;} 1073case 20: 1074#line 141 "scheme.y" 1075{ 1076 yyval = [[Symbol alloc] initSCMSymbol:"quote"]; 1077; 1078 break;} 1079case 21: 1080#line 144 "scheme.y" 1081{ 1082 yyval = [[Symbol alloc] initSCMSymbol:"call-with-current-continuation"]; 1083; 1084 break;} 1085case 22: 1086#line 147 "scheme.y" 1087{ 1088 yyval = [[Symbol alloc] initSCMSymbol:"apply"]; 1089; 1090 break;} 1091case 23: 1092#line 150 "scheme.y" 1093{ 1094 yyval = [[Symbol alloc] initSCMSymbol:"define"]; 1095; 1096 break;} 1097case 24: 1098#line 153 "scheme.y" 1099{ 1100 yyval = [[Symbol alloc] initSCMSymbol:"set!"]; 1101; 1102 break;} 1103case 25: 1104#line 156 "scheme.y" 1105{ 1106 yyval = [[Symbol alloc] initSCMSymbol:"lambda"]; 1107; 1108 break;} 1109case 26: 1110#line 159 "scheme.y" 1111{ 1112 yyval = [[Symbol alloc] initSCMSymbol:"if"]; 1113; 1114 break;} 1115case 27: 1116#line 162 "scheme.y" 1117{ 1118 yyval = [[Symbol alloc] initSCMSymbol:"begin"]; 1119; 1120 break;} 1121case 28: 1122#line 165 "scheme.y" 1123{ 1124 yyval = [[Symbol alloc] initSCMSymbol:"and"]; 1125; 1126 break;} 1127case 29: 1128#line 168 "scheme.y" 1129{ 1130 yyval = [[Symbol alloc] initSCMSymbol:"or"]; 1131; 1132 break;} 1133case 30: 1134#line 171 "scheme.y" 1135{ 1136 yyval = [[Symbol alloc] initSCMSymbol:"case"]; 1137; 1138 break;} 1139case 31: 1140#line 174 "scheme.y" 1141{ 1142 yyval = [[Symbol alloc] initSCMSymbol:"cond"]; 1143; 1144 break;} 1145case 32: 1146#line 177 "scheme.y" 1147{ 1148 yyval = [[Symbol alloc] initSCMSymbol:"else"]; 1149; 1150 break;} 1151case 33: 1152#line 180 "scheme.y" 1153{ 1154 yyval = [[Symbol alloc] initSCMSymbol:"let"]; 1155; 1156 break;} 1157case 34: 1158#line 183 "scheme.y" 1159{ 1160 yyval = [[Symbol alloc] initSCMSymbol:"let*"]; 1161; 1162 break;} 1163case 35: 1164#line 186 "scheme.y" 1165{ 1166 yyval = [[Symbol alloc] initSCMSymbol:"letrec"]; 1167; 1168 break;} 1169case 36: 1170#line 191 "scheme.y" 1171{ 1172 yyval = yyvsp[0]; 1173; 1174 break;} 1175case 37: 1176#line 194 "scheme.y" 1177{ 1178 yyval = yyvsp[0]; 1179; 1180 break;} 1181case 38: 1182#line 197 "scheme.y" 1183{ 1184 yyval = yyvsp[0]; 1185; 1186 break;} 1187case 39: 1188#line 200 "scheme.y" 1189{ 1190 yyval = yyvsp[0]; 1191; 1192 break;} 1193case 40: 1194#line 203 "scheme.y" 1195{ 1196 yyval = yyvsp[0]; 1197; 1198 break;} 1199case 41: 1200#line 206 "scheme.y" 1201{ 1202 yyval = yyvsp[0]; 1203; 1204 break;} 1205case 42: 1206#line 209 "scheme.y" 1207{ 1208 yyval = yyvsp[0]; 1209; 1210 break;} 1211case 43: 1212#line 212 "scheme.y" 1213{ 1214 yyval = yyvsp[0]; 1215; 1216 break;} 1217case 44: 1218#line 215 "scheme.y" 1219{ 1220 yyval = yyvsp[0]; 1221; 1222 break;} 1223case 45: 1224#line 218 "scheme.y" 1225{ 1226 yyval = yyvsp[0]; 1227; 1228 break;} 1229case 46: 1230#line 221 "scheme.y" 1231{ 1232 yyval = yyvsp[0]; 1233; 1234 break;} 1235case 47: 1236#line 224 "scheme.y" 1237{ 1238 yyval = yyvsp[0]; 1239; 1240 break;} 1241case 48: 1242#line 227 "scheme.y" 1243{ 1244 yyval = yyvsp[0]; 1245; 1246 break;} 1247case 49: 1248#line 230 "scheme.y" 1249{ 1250 yyval = yyvsp[0]; 1251; 1252 break;} 1253case 50: 1254#line 233 "scheme.y" 1255{ 1256 yyval = yyvsp[0]; 1257; 1258 break;} 1259case 51: 1260#line 236 "scheme.y" 1261{ 1262 yyval = yyvsp[0]; 1263; 1264 break;} 1265case 52: 1266#line 239 "scheme.y" 1267{ 1268 yyval = yyvsp[0]; 1269; 1270 break;} 1271case 53: 1272#line 242 "scheme.y" 1273{ 1274 yyval = yyvsp[0]; 1275; 1276 break;} 1277case 54: 1278#line 245 "scheme.y" 1279{ 1280 yyval = yyvsp[0]; 1281; 1282 break;} 1283case 55: 1284#line 248 "scheme.y" 1285{ 1286 yyval = yyvsp[0]; 1287; 1288 break;} 1289case 56: 1290#line 251 "scheme.y" 1291{ 1292 yyval = yyvsp[0]; 1293; 1294 break;} 1295case 57: 1296#line 254 "scheme.y" 1297{ 1298 yyval = yyvsp[0]; 1299; 1300 break;} 1301case 58: 1302#line 259 "scheme.y" 1303{ 1304 yyval = [Triple newTag:FORM_CALLCC Arg1:yyvsp[-1]]; 1305; 1306 break;} 1307case 59: 1308#line 264 "scheme.y" 1309{ 1310 yyval = [Pair newCar:yyvsp[-3] Cdr:yyvsp[-1]]; 1311; 1312 break;} 1313case 60: 1314#line 269 "scheme.y" 1315{ 1316 yyval = [Triple newTag:FORM_SCOND1 Arg1:yyvsp[-1]]; 1317; 1318 break;} 1319case 61: 1320#line 272 "scheme.y" 1321{ 1322 yyval = [Triple newTag:FORM_SCOND2 Arg1:yyvsp[-2] Arg2:yyvsp[-1]]; 1323; 1324 break;} 1325case 62: 1326#line 275 "scheme.y" 1327{ 1328 yyval = [Triple newTag:FORM_SCOND3 Arg1:yyvsp[-3] Arg2:yyvsp[-1]]; 1329; 1330 break;} 1331case 63: 1332#line 280 "scheme.y" 1333{ 1334 yyval = [Pair newCar:[NSNull null] Cdr:yyvsp[-1]]; 1335; 1336 break;} 1337case 64: 1338#line 285 "scheme.y" 1339{ 1340 yyval = [Pair newCar:yyvsp[0] Cdr:[NSNull null]]; 1341; 1342 break;} 1343case 65: 1344#line 288 "scheme.y" 1345{ 1346 yyval = [Pair newCar:yyvsp[0] Cdr:yyvsp[-1]]; 1347; 1348 break;} 1349case 66: 1350#line 293 "scheme.y" 1351{ 1352 yyval = [Pair newCar:yyvsp[0] Cdr:[NSNull null]]; 1353; 1354 break;} 1355case 67: 1356#line 296 "scheme.y" 1357{ 1358 yyval = [Pair newCar:yyvsp[0] Cdr:yyvsp[-1]]; 1359; 1360 break;} 1361case 68: 1362#line 301 "scheme.y" 1363{ 1364 yyval = [Triple newTag:FORM_CASE Arg1:yyvsp[-2] Arg2:yyvsp[-1]]; 1365; 1366 break;} 1367case 69: 1368#line 304 "scheme.y" 1369{ 1370 yyval = [Triple newTag:FORM_CASE Arg1:yyvsp[-3] 1371 Arg2:[Pair newCar:yyvsp[-1] Cdr:yyvsp[-2]]]; 1372; 1373 break;} 1374case 70: 1375#line 310 "scheme.y" 1376{ 1377 yyval = [Triple newTag:FORM_COND Arg1:yyvsp[-1]]; 1378; 1379 break;} 1380case 71: 1381#line 313 "scheme.y" 1382{ 1383 yyval = [Triple newTag:FORM_COND Arg1:[Pair newCar:yyvsp[-1] Cdr:yyvsp[-2]]]; 1384; 1385 break;} 1386case 72: 1387#line 318 "scheme.y" 1388{ 1389 yyval = [Triple newTag:FORM_AND Arg1:yyvsp[-1]]; 1390; 1391 break;} 1392case 73: 1393#line 321 "scheme.y" 1394{ 1395 yyval = [Triple newTag:FORM_AND Arg1:[NSNull null]]; 1396; 1397 break;} 1398case 74: 1399#line 326 "scheme.y" 1400{ 1401 yyval = [Triple newTag:FORM_OR Arg1:yyvsp[-1]]; 1402; 1403 break;} 1404case 75: 1405#line 329 "scheme.y" 1406{ 1407 yyval = [Triple newTag:FORM_OR Arg1:[NSNull null]]; 1408; 1409 break;} 1410case 76: 1411#line 334 "scheme.y" 1412{ 1413 yyval = [Triple newTag:FORM_BEGIN Arg1:yyvsp[-1]]; 1414; 1415 break;} 1416case 77: 1417#line 339 "scheme.y" 1418{ 1419 yyval = [Triple newTag:FORM_SET Arg1:yyvsp[-2] Arg2:yyvsp[-1]]; 1420; 1421 break;} 1422case 78: 1423#line 344 "scheme.y" 1424{ 1425 yyval = [Triple newTag:FORM_APPLY Arg1:yyvsp[-2] Arg2:yyvsp[-1]]; 1426; 1427 break;} 1428case 79: 1429#line 349 "scheme.y" 1430{ 1431 yyval = [Triple newTag:FORM_IF1 Arg1:yyvsp[-2] Arg2:yyvsp[-1]]; 1432; 1433 break;} 1434case 80: 1435#line 352 "scheme.y" 1436{ 1437 yyval = [Triple newTag:FORM_IF2 Arg1:yyvsp[-3] Arg2:yyvsp[-2] Arg3:yyvsp[-1]]; 1438; 1439 break;} 1440case 81: 1441#line 357 "scheme.y" 1442{ 1443 yyval = [Triple newTag:FORM_LAMBDA1 Arg1:yyvsp[-2] Arg2:yyvsp[-1]]; 1444; 1445 break;} 1446case 82: 1447#line 360 "scheme.y" 1448{ 1449 yyval = [Triple newTag:FORM_LAMBDA2 Arg1:yyvsp[-2] Arg2:yyvsp[-1]]; 1450; 1451 break;} 1452case 83: 1453#line 365 "scheme.y" 1454{ 1455 yyval = [Triple newTag:FORM_QUOTE Arg1:yyvsp[0]]; 1456; 1457 break;} 1458case 84: 1459#line 368 "scheme.y" 1460{ 1461 yyval = [Triple newTag:FORM_QUOTE Arg1:yyvsp[-1]]; 1462; 1463 break;} 1464case 85: 1465#line 373 "scheme.y" 1466{ 1467 yyval = [Triple newTag:FORM_BINDING Arg1:yyvsp[-2] Arg2:yyvsp[-1]]; 1468; 1469 break;} 1470case 86: 1471#line 378 "scheme.y" 1472{ 1473 yyval = [Pair newCar:yyvsp[0] Cdr:[NSNull null]]; 1474; 1475 break;} 1476case 87: 1477#line 381 "scheme.y" 1478{ 1479 yyval = [Pair newCar:yyvsp[-1] Cdr:yyvsp[0]]; 1480; 1481 break;} 1482case 88: 1483#line 386 "scheme.y" 1484{ 1485 yyval = [Triple newTag:FORM_LET Arg1:yyvsp[-3] Arg2:yyvsp[-1]]; 1486; 1487 break;} 1488case 89: 1489#line 391 "scheme.y" 1490{ 1491 yyval = [Triple newTag:FORM_LETSTAR Arg1:yyvsp[-3] Arg2:yyvsp[-1]]; 1492; 1493 break;} 1494case 90: 1495#line 396 "scheme.y" 1496{ 1497 yyval = [Triple newTag:FORM_LETREC Arg1:yyvsp[-3] Arg2:yyvsp[-1]]; 1498; 1499 break;} 1500case 91: 1501#line 401 "scheme.y" 1502{ 1503 yyval = [NSNull null]; 1504; 1505 break;} 1506case 92: 1507#line 406 "scheme.y" 1508{ 1509 yyval = [Pair newCar:yyvsp[0] Cdr:[NSNull null]]; 1510; 1511 break;} 1512case 93: 1513#line 409 "scheme.y" 1514{ 1515 yyval = [Pair newCar:yyvsp[-2] Cdr:yyvsp[0]]; 1516; 1517 break;} 1518case 94: 1519#line 412 "scheme.y" 1520{ 1521 yyval = [Pair newCar:yyvsp[-1] Cdr:yyvsp[0]]; 1522; 1523 break;} 1524case 95: 1525#line 417 "scheme.y" 1526{ 1527 yyval = [Pair newCar:yyvsp[0] Cdr:[NSNull null]]; 1528; 1529 break;} 1530case 96: 1531#line 420 "scheme.y" 1532{ 1533 yyval = [Pair newCar:yyvsp[-2] Cdr:yyvsp[0]]; 1534; 1535 break;} 1536case 97: 1537#line 423 "scheme.y" 1538{ 1539 yyval = [Pair newCar:yyvsp[-1] Cdr:yyvsp[0]]; 1540; 1541 break;} 1542case 98: 1543#line 428 "scheme.y" 1544{ 1545 yyval = [Pair newCar:yyvsp[0] Cdr:[NSNull null]]; 1546; 1547 break;} 1548case 99: 1549#line 431 "scheme.y" 1550{ 1551 yyval = [Pair newCar:yyvsp[-1] Cdr:yyvsp[0]]; 1552; 1553 break;} 1554case 100: 1555#line 436 "scheme.y" 1556{ 1557 yyval = [Pair newCar:yyvsp[0] Cdr:[NSNull null]]; 1558; 1559 break;} 1560case 101: 1561#line 439 "scheme.y" 1562{ 1563 yyval = [Pair newCar:yyvsp[-1] Cdr:yyvsp[0]]; 1564; 1565 break;} 1566case 102: 1567#line 444 "scheme.y" 1568{ 1569 yyval = yyvsp[-1]; 1570; 1571 break;} 1572case 103: 1573#line 449 "scheme.y" 1574{ 1575 yyval = yyvsp[-1]; 1576; 1577 break;} 1578case 104: 1579#line 454 "scheme.y" 1580{ 1581 yyval = yyvsp[0]; 1582; 1583 break;} 1584case 105: 1585#line 457 "scheme.y" 1586{ 1587 yyval = yyvsp[0]; 1588; 1589 break;} 1590case 106: 1591#line 462 "scheme.y" 1592{ 1593 yyval = yyvsp[0]; 1594; 1595 break;} 1596case 107: 1597#line 465 "scheme.y" 1598{ 1599 yyval = yyvsp[0]; 1600; 1601 break;} 1602case 108: 1603#line 470 "scheme.y" 1604{ 1605 yyval = [Vector newFromList:yyvsp[-1]]; 1606; 1607 break;} 1608case 109: 1609#line 473 "scheme.y" 1610{ 1611 yyval = [Vector newFromList:(Pair *)[NSNull null]]; 1612; 1613 break;} 1614case 110: 1615#line 478 "scheme.y" 1616{ 1617 yyval = [Vector newFromList:yyvsp[-1]]; 1618; 1619 break;} 1620case 111: 1621#line 481 "scheme.y" 1622{ 1623 yyval = [Vector newFromList:(Pair *)[NSNull null]]; 1624; 1625 break;} 1626case 112: 1627#line 486 "scheme.y" 1628{ 1629 yyval = [Pair newCar:yyvsp[0] Cdr:[NSNull null]]; 1630; 1631 break;} 1632case 113: 1633#line 489 "scheme.y" 1634{ 1635 yyval = [Pair newCar:yyvsp[-2] Cdr:yyvsp[0]]; 1636; 1637 break;} 1638case 114: 1639#line 492 "scheme.y" 1640{ 1641 yyval = [Pair newCar:yyvsp[-1] Cdr:yyvsp[0]]; 1642; 1643 break;} 1644case 115: 1645#line 497 "scheme.y" 1646{ 1647 yyval = yyvsp[-1]; 1648; 1649 break;} 1650case 116: 1651#line 502 "scheme.y" 1652{ 1653 yyval = yyvsp[0]; 1654; 1655 break;} 1656case 117: 1657#line 505 "scheme.y" 1658{ 1659 yyval = yyvsp[0]; 1660; 1661 break;} 1662} 1663 /* the action file gets copied in in place of this dollarsign */ 1664#line 554 "/usr/share/bison.simple" 1665 1666 yyvsp -= yylen; 1667 yyssp -= yylen; 1668#ifdef YYLSP_NEEDED 1669 yylsp -= yylen; 1670#endif 1671 1672#if YYDEBUG != 0 1673 if (yydebug) 1674 { 1675 short *ssp1 = yyss - 1; 1676 fprintf (stderr, "state stack now"); 1677 while (ssp1 != yyssp) 1678 fprintf (stderr, " %d", *++ssp1); 1679 fprintf (stderr, "\n"); 1680 } 1681#endif 1682 1683 *++yyvsp = yyval; 1684 1685#ifdef YYLSP_NEEDED 1686 yylsp++; 1687 if (yylen == 0) 1688 { 1689 yylsp->first_line = yylloc.first_line; 1690 yylsp->first_column = yylloc.first_column; 1691 yylsp->last_line = (yylsp-1)->last_line; 1692 yylsp->last_column = (yylsp-1)->last_column; 1693 yylsp->text = 0; 1694 } 1695 else 1696 { 1697 yylsp->last_line = (yylsp+yylen-1)->last_line; 1698 yylsp->last_column = (yylsp+yylen-1)->last_column; 1699 } 1700#endif 1701 1702 /* Now "shift" the result of the reduction. 1703 Determine what state that goes to, 1704 based on the state we popped back to 1705 and the rule number reduced by. */ 1706 1707 yyn = yyr1[yyn]; 1708 1709 yystate = yypgoto[yyn - YYNTBASE] + *yyssp; 1710 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) 1711 yystate = yytable[yystate]; 1712 else 1713 yystate = yydefgoto[yyn - YYNTBASE]; 1714 1715 goto yynewstate; 1716 1717yyerrlab: /* here on detecting error */ 1718 1719 if (! yyerrstatus) 1720 /* If not already recovering from an error, report this error. */ 1721 { 1722 ++yynerrs; 1723 1724#ifdef YYERROR_VERBOSE 1725 yyn = yypact[yystate]; 1726 1727 if (yyn > YYFLAG && yyn < YYLAST) 1728 { 1729 int size = 0; 1730 char *msg; 1731 int x, count; 1732 1733 count = 0; 1734 /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ 1735 for (x = (yyn < 0 ? -yyn : 0); 1736 x < (sizeof(yytname) / sizeof(char *)); x++) 1737 if (yycheck[x + yyn] == x) 1738 size += strlen(yytname[x]) + 15, count++; 1739 msg = (char *) malloc(size + 15); 1740 if (msg != 0) 1741 { 1742 strcpy(msg, "parse error"); 1743 1744 if (count < 5) 1745 { 1746 count = 0; 1747 for (x = (yyn < 0 ? -yyn : 0); 1748 x < (sizeof(yytname) / sizeof(char *)); x++) 1749 if (yycheck[x + yyn] == x) 1750 { 1751 strcat(msg, count == 0 ? ", expecting `" : " or `"); 1752 strcat(msg, yytname[x]); 1753 strcat(msg, "'"); 1754 count++; 1755 } 1756 } 1757 yyerror(msg); 1758 free(msg); 1759 } 1760 else 1761 yyerror ("parse error; also virtual memory exceeded"); 1762 } 1763 else 1764#endif /* YYERROR_VERBOSE */ 1765 yyerror("parse error"); 1766 } 1767 1768 goto yyerrlab1; 1769yyerrlab1: /* here on error raised explicitly by an action */ 1770 1771 if (yyerrstatus == 3) 1772 { 1773 /* if just tried and failed to reuse lookahead token after an error, discard it. */ 1774 1775 /* return failure if at end of input */ 1776 if (yychar == YYEOF) 1777 YYABORT; 1778 1779#if YYDEBUG != 0 1780 if (yydebug) 1781 fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]); 1782#endif 1783 1784 yychar = YYEMPTY; 1785 } 1786 1787 /* Else will try to reuse lookahead token 1788 after shifting the error token. */ 1789 1790 yyerrstatus = 3; /* Each real token shifted decrements this */ 1791 1792 goto yyerrhandle; 1793 1794yyerrdefault: /* current state does not do anything special for the error token. */ 1795 1796#if 0 1797 /* This is wrong; only states that explicitly want error tokens 1798 should shift them. */ 1799 yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/ 1800 if (yyn) goto yydefault; 1801#endif 1802 1803yyerrpop: /* pop the current state because it cannot handle the error token */ 1804 1805 if (yyssp == yyss) YYABORT; 1806 yyvsp--; 1807 yystate = *--yyssp; 1808#ifdef YYLSP_NEEDED 1809 yylsp--; 1810#endif 1811 1812#if YYDEBUG != 0 1813 if (yydebug) 1814 { 1815 short *ssp1 = yyss - 1; 1816 fprintf (stderr, "Error: state stack now"); 1817 while (ssp1 != yyssp) 1818 fprintf (stderr, " %d", *++ssp1); 1819 fprintf (stderr, "\n"); 1820 } 1821#endif 1822 1823yyerrhandle: 1824 1825 yyn = yypact[yystate]; 1826 if (yyn == YYFLAG) 1827 goto yyerrdefault; 1828 1829 yyn += YYTERROR; 1830 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) 1831 goto yyerrdefault; 1832 1833 yyn = yytable[yyn]; 1834 if (yyn < 0) 1835 { 1836 if (yyn == YYFLAG) 1837 goto yyerrpop; 1838 yyn = -yyn; 1839 goto yyreduce; 1840 } 1841 else if (yyn == 0) 1842 goto yyerrpop; 1843 1844 if (yyn == YYFINAL) 1845 YYACCEPT; 1846 1847#if YYDEBUG != 0 1848 if (yydebug) 1849 fprintf(stderr, "Shifting error token, "); 1850#endif 1851 1852 *++yyvsp = yylval; 1853#ifdef YYLSP_NEEDED 1854 *++yylsp = yylloc; 1855#endif 1856 1857 yystate = yyn; 1858 goto yynewstate; 1859 1860 yyacceptlab: 1861 /* YYACCEPT comes here. */ 1862#ifndef YYSTACK_USE_ALLOCA 1863 if (yyfree_stacks) 1864 { 1865 free (yyss); 1866 free (yyvs); 1867#ifdef YYLSP_NEEDED 1868 free (yyls); 1869#endif 1870 } 1871#endif 1872 return 0; 1873 1874 yyabortlab: 1875 /* YYABORT comes here. */ 1876#ifndef YYSTACK_USE_ALLOCA 1877 if (yyfree_stacks) 1878 { 1879 free (yyss); 1880 free (yyvs); 1881#ifdef YYLSP_NEEDED 1882 free (yyls); 1883#endif 1884 } 1885#endif 1886 return 1; 1887} 1888#line 510 "scheme.y" 1889 1890 1891