r2l.c 103 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200
  1. #if defined(__STDC__) || defined(__cplusplus)
  2. #define YYCONST const
  3. #define YYPARAMS(x) x
  4. #define YYDEFUN(name, arglist, args) name(args)
  5. #define YYAND ,
  6. #define YYPTR void *
  7. #else
  8. #define YYCONST
  9. #define YYPARAMS(x) ()
  10. #define YYDEFUN(name, arglist, args) name arglist args;
  11. #define YYAND ;
  12. #define YYPTR char *
  13. #endif
  14. #ifndef lint
  15. YYCONST static char yysccsid[] = "@(#)yaccpar 1.8 (Berkeley +Cygnus.28) 01/20/91";
  16. #endif
  17. #define YYBYACC 1
  18. #ifndef YYDONT_INCLUDE_STDIO
  19. #include <stdio.h>
  20. #endif
  21. #ifdef __cplusplus
  22. #include <stdlib.h> /* for malloc/realloc/free */
  23. #endif
  24. #line 36 "r2l.y"
  25. /*
  26. * This is a "yacc" specification of the syntax of RLISP. It is used
  27. * to provide a (symbolic-mode) RLISP to Lisp translator that can be
  28. * made freely available without reference to anybody apart from
  29. * myself! The Lisp dialect generated is Standard Lisp and in all reality
  30. * I intend it to be for use with CSL (my own Lisp). I am putting in
  31. * a switch that causes generation of something a bit more like Common
  32. * Lisp but please do not expect this to be fully sorted out and
  33. * suitable for use with full Common Lisp: again it is tuned to my own
  34. * private purposes...
  35. *
  36. * I will think about making this work with Bison as wall as Yacc but
  37. * maybe I prefer the licence terms associated with Yacc. But it is quite
  38. * certain that if you receive this code and can make it work with Bison
  39. * you can use it internally: the only issues are to do with distribution,
  40. * and if you are careful to use a sufficiently modern release of Bison
  41. * its skeleton code may be distributed without bad license consequences.
  42. *
  43. * Usage:
  44. * r2l -common -rights -Dname=val source1.red ... sourcen.red dest.lsp
  45. */
  46. /*
  47. * This code may be used and modified, and redistributed in binary
  48. * or source form, subject to the "CCL Public License", which should
  49. * accompany it. This license is a variant on the BSD license, and thus
  50. * permits use of code derived from this in either open and commercial
  51. * projects: but it does require that updates to this code be made
  52. * available back to the originators of the package.
  53. * Before merging other code in with this or linking this code
  54. * with other packages or libraries please check that the license terms
  55. * of the other material are compatible with those of this.
  56. */
  57. /* Signature: 7db71bcc 21-Apr-2002 */
  58. #include <stdio.h>
  59. #include <string.h>
  60. #include <ctype.h>
  61. #include <stdlib.h>
  62. int *heap;
  63. int heapfringe = 0;
  64. int yyparse();
  65. FILE *inputfile, *outputfile;
  66. FILE *filestack[30];
  67. int filestackp = 0;
  68. char *defined_names[20];
  69. int n_defined_names;
  70. int common;
  71. static char *rights_message[] =
  72. {
  73. "",
  74. " This code may be used and modified, and redistributed in binary",
  75. " or source form, subject to the \"CCL Public License\", which should",
  76. " accompany it. This license is a variant on the BSD license, and thus",
  77. " permits use of code derived from this in either open and commercial",
  78. " projects: but it does require that updates to this code be made",
  79. " available back to the originators of the package.",
  80. " Before merging other code in with this or linking this code",
  81. " with other packages or libraries please check that the license terms",
  82. " of the other material are compatible with those of this.",
  83. "",
  84. NULL
  85. };
  86. int main(int argc, char *argv[])
  87. {
  88. int rights = 0;
  89. inputfile = NULL;
  90. outputfile = NULL;
  91. common = 0;
  92. /*
  93. * If the very first arg is "-common" pick that off.
  94. */
  95. if (argc > 1 &&
  96. strcmp(argv[1], "-common") == 0)
  97. { common = 1;
  98. printf("Common Lisp mode activated\n");
  99. argv++;
  100. argc--;
  101. }
  102. /*
  103. * If the next arg is "-rights" then pick that off.
  104. */
  105. if (argc > 1 &&
  106. strcmp(argv[1], "-rights") == 0)
  107. { rights = 1;
  108. printf("Will insert re-distribution rights notice\n");
  109. argv++;
  110. argc--;
  111. }
  112. /*
  113. * Pick off initial command-line things of the form "-D..." and store the
  114. * "..." bit.
  115. */
  116. n_defined_names = 0;
  117. while (argc > 1 &&
  118. argv[1][0] == '-' &&
  119. argv[1][1] == 'D')
  120. { if (n_defined_names < 20)
  121. defined_names[n_defined_names++] = &argv[1][2];
  122. argv++;
  123. argc--;
  124. }
  125. /*
  126. * If > 1 arg then final arg is destination. If only one arg then arg is
  127. * a source!
  128. */
  129. if (argc > 2)
  130. { if (strcmp(argv[--argc], "-") == 0) outputfile = stdout;
  131. else outputfile = fopen(argv[argc], "w");
  132. }
  133. if (outputfile == NULL) outputfile = stdout;
  134. if (common)
  135. fprintf(outputfile, "\n;; RLISP to LISP converter. A C Norman 2002\n");
  136. else fprintf(outputfile, "\n%% RLISP to LISP converter. A C Norman 2002\n");
  137. fprintf(outputfile, "\n\n");
  138. if (rights)
  139. { char **p = rights_message;
  140. char *m;
  141. while ((m = *p++) != NULL)
  142. { fprintf(outputfile, "%s%s\n", (common ? ";;" : "%"), m);
  143. }
  144. fprintf(outputfile, "\n\n");
  145. }
  146. heap = (int *)malloc(2000000); /* Rather arbitrary size! */
  147. if (argc == 1) filestack[filestackp++] = stdin;
  148. else while (--argc != 0)
  149. { if ((inputfile = fopen(argv[argc], "r")) == NULL)
  150. printf("File %s not readable\n", argv[argc]);
  151. else filestack[filestackp++] = inputfile;
  152. }
  153. inputfile = filestack[--filestackp];
  154. yyparse();
  155. fclose(outputfile);
  156. printf("Finished...\n");
  157. return 0;
  158. }
  159. char *lookup_name(char *s)
  160. {
  161. int i, n = strlen(s);
  162. for (i=0; i<n_defined_names; i++)
  163. { char *w = defined_names[i]; /* name or name=value */
  164. if (strncmp(s, w, n) == 0 &&
  165. w[n] == 0 ||
  166. w[n] == '=') return (w[n]==0 ? "" : &w[n+1]);
  167. }
  168. return NULL;
  169. }
  170. char linebuffer[128];
  171. int linep = 0;
  172. int ch = '\n';
  173. int linecount = 1;
  174. int nextch()
  175. {
  176. if (ch == -1) return ch; /* end of file sticks */
  177. for (;;)
  178. { ch = getc(inputfile);
  179. if (ch == -1 && filestackp != 0)
  180. { inputfile = filestack[--filestackp];
  181. continue;
  182. }
  183. else break;
  184. }
  185. if (ch == '\n') linecount++;
  186. linebuffer[127 & linep++] = ch;
  187. return ch;
  188. }
  189. void yyerror(char *m)
  190. {
  191. int q = 0;
  192. fprintf(stderr, "\nSyntax error (%s) around line %d\n", m, linecount);
  193. if (linep >= 128) q = linep-128;
  194. while (q != linep) fprintf(stderr, "%c", linebuffer[127 & q++]);
  195. fprintf(stderr, "$$$");
  196. while ((q = nextch()) != -1 && q != '\n') fprintf(stderr, "%c", q);
  197. fprintf(stderr, "\n");
  198. fflush(stderr);
  199. exit(0);
  200. }
  201. typedef struct keyword_code
  202. {
  203. char *name;
  204. int code;
  205. } keyword_code;
  206. static keyword_code operators[];
  207. int find_symbol(char *s)
  208. {
  209. char *r = (char *)&heap[heapfringe];
  210. int len = strlen(s);
  211. strcpy(r, s);
  212. heapfringe += (len+4)/4;
  213. return (int)(r+1);
  214. }
  215. static int gennum = 1000;
  216. int genlabel()
  217. {
  218. char name[32];
  219. sprintf(name, "lab%d", gennum++);
  220. return find_symbol(name);
  221. }
  222. int genvar()
  223. {
  224. char name[32];
  225. sprintf(name, "var%d", gennum++);
  226. return find_symbol(name);
  227. }
  228. static int yylex();
  229. #define C_nil ((int)0)
  230. #define qcar(x) (((int *)(x))[0])
  231. #define qcdr(x) (((int *)(x))[1])
  232. int cons(int a, int b)
  233. {
  234. int *r = &heap[heapfringe];
  235. heapfringe += 2;
  236. qcar(r) = a;
  237. qcdr(r) = b;
  238. return (int)r;
  239. }
  240. int ncons(int a)
  241. {
  242. int *r = &heap[heapfringe];
  243. heapfringe += 2;
  244. qcar(r) = a;
  245. qcdr(r) = C_nil;
  246. return (int)r;
  247. }
  248. int list1(int a)
  249. {
  250. return cons(a, C_nil);
  251. }
  252. int list2(int a, int b)
  253. {
  254. return cons(a, cons(b, C_nil));
  255. }
  256. int list3(int a, int b, int c)
  257. {
  258. return cons(a, cons(b, cons(c, C_nil)));
  259. }
  260. int list4(int a, int b, int c, int d)
  261. {
  262. return cons(a, cons(b, cons(c, cons(d, C_nil))));
  263. }
  264. int list5(int a, int b, int c, int d, int e)
  265. {
  266. return cons(a, cons(b, cons(c, cons(d, cons(e, C_nil)))));
  267. }
  268. int list6(int a, int b, int c, int d, int e, int f)
  269. {
  270. return cons(a, cons(b, cons(c, cons(d, cons(e, cons(f, C_nil))))));
  271. }
  272. int list7(int a, int b, int c, int d, int e, int f, int g)
  273. {
  274. return cons(a, cons(b, cons(c, cons(d,
  275. cons(e, cons(f, cons(g, C_nil)))))));
  276. }
  277. int list8(int a, int b, int c, int d, int e, int f, int g, int h)
  278. {
  279. return cons(a, cons(b, cons(c, cons(d,
  280. cons(e, cons(f, cons(g, cons(h, C_nil))))))));
  281. }
  282. int list9(int a, int b, int c, int d, int e, int f, int g, int h, int i)
  283. {
  284. return cons(a, cons(b, cons(c, cons(d,
  285. cons(e, cons(f, cons(g, cons(h, cons(i, C_nil)))))))));
  286. }
  287. int append(int a, int b)
  288. {
  289. if (a == C_nil || ((a & 1) != 0)) return b;
  290. else return cons(qcar(a), append(qcdr(a), b));
  291. }
  292. #define atom(x) ((int)(x)==0 || (((int)(x)) & 1) != 0)
  293. int otlpos = 0;
  294. int checkspace(int n)
  295. {
  296. if (otlpos + n < 78)
  297. { otlpos += n;
  298. return 1;
  299. }
  300. fprintf(outputfile, "\n");
  301. otlpos = n;
  302. return 0;
  303. }
  304. static char common_name[256];
  305. char *tocommon(char *s)
  306. {
  307. int easy = 1, c;
  308. int p = 0, q = 0;
  309. if (s[0] == '"') return s; /* a string */
  310. if (isdigit(s[0])) return s; /* a number */
  311. while ((c = s[p++]) != 0)
  312. { if (c == '!') c = s[p++];
  313. common_name[q++] = c;
  314. if (c == ':') common_name[q++] = c; /* double up ':' */
  315. else if (!isalpha(c) && !isdigit(c) && c != '-' &&
  316. c != '_' && c != '*' && c != '&' && c != '$') easy = 0;
  317. }
  318. common_name[q] = 0;
  319. if (!easy)
  320. { common_name[q+1] = '|';
  321. common_name[q+2] = 0;
  322. while (q != 0)
  323. { common_name[q] = common_name[q-1];
  324. q--;
  325. }
  326. common_name[0] = '|';
  327. }
  328. return common_name;
  329. }
  330. void print(int a)
  331. {
  332. if (a == C_nil)
  333. { checkspace(3);
  334. fprintf(outputfile, "nil");
  335. return;
  336. }
  337. else if (atom(a))
  338. { char *s = ((char *)a) - 1;
  339. if (common) s = tocommon(s);
  340. checkspace(strlen(s));
  341. fprintf(outputfile, "%s", s);
  342. return;
  343. }
  344. checkspace(1);
  345. fprintf(outputfile, "(");
  346. print(qcar(a));
  347. a = qcdr(a);
  348. while (!atom(a))
  349. { if (checkspace(1)) fprintf(outputfile, " ");
  350. print(qcar(a));
  351. a = qcdr(a);
  352. }
  353. if ((int)a != 0)
  354. { checkspace(2);
  355. fprintf(outputfile, " .");
  356. if (checkspace(1)) fprintf(outputfile, " ");
  357. print(a);
  358. }
  359. checkspace(1);
  360. fprintf(outputfile, ")");
  361. }
  362. static void evalorprint(int a)
  363. {
  364. if (a != C_nil && !atom(a))
  365. { int fn = qcar(a);
  366. if (fn != C_nil && atom(fn) && strcmp((char *)fn-1, "in")==0)
  367. { a = qcar(qcdr(a));
  368. if (a != C_nil && !atom(a))
  369. { fn = qcar(a);
  370. if (fn != C_nil && atom(fn) &&
  371. strcmp((char *)fn-1, "list")==0)
  372. { a = qcar(qcdr(a));
  373. if (a != C_nil && atom(a))
  374. { FILE *f;
  375. char filename[200];
  376. char *s = (char *)a-1;
  377. if (*s == '"')
  378. { s++;
  379. s[strlen(s)-1] = 0;
  380. }
  381. if (*s != '$') strcpy(filename, s);
  382. else
  383. { char parmname[200];
  384. int k=0;
  385. char *val;
  386. s++;
  387. parmname[k++] = '@';
  388. while (*s != '/') parmname[k++] = *s++;
  389. parmname[k] = 0;
  390. val = lookup_name(parmname);
  391. if (val == NULL) val = ".";
  392. strcpy(filename, val);
  393. strcat(filename, s);
  394. }
  395. f = fopen(filename, "r");
  396. if (f == NULL)
  397. { printf("File \"%s\" not found\n", filename);
  398. exit(1);
  399. }
  400. filestack[filestackp++] = inputfile;
  401. inputfile = f;
  402. printf("READING FILE <%s>\n", filename);
  403. return;
  404. }
  405. }
  406. }
  407. }
  408. }
  409. print(a);
  410. }
  411. #define sym_0 find_symbol("0")
  412. #define sym_car find_symbol("car")
  413. #define sym_cdr find_symbol("cdr")
  414. /* I have reversip available even in Common Lisp mode for nreverse */
  415. #define sym_reversip find_symbol("reversip")
  416. #define sym_plus find_symbol("plus")
  417. #define sym_minus find_symbol("minus")
  418. #define sym_minusp find_symbol("minusp")
  419. #define sym_getv find_symbol("getv")
  420. #define sym_difference find_symbol("difference")
  421. #define sym_times find_symbol("times")
  422. #define sym_quotient find_symbol("quotient")
  423. #define sym_expt find_symbol("expt")
  424. #define sym_cons find_symbol("cons")
  425. #define sym_list find_symbol("list")
  426. #define sym_progn find_symbol("progn")
  427. #define sym_prog find_symbol("prog")
  428. #define sym_de find_symbol("de")
  429. #define sym_dm find_symbol("dm")
  430. #define sym_ds find_symbol("ds")
  431. #define sym_greaterp find_symbol("greaterp")
  432. #define sym_lessp find_symbol("lessp")
  433. #define sym_equal find_symbol("equal")
  434. #define sym_setq find_symbol("setq")
  435. #define sym_and find_symbol("and")
  436. #define sym_or find_symbol("or")
  437. #define sym_not find_symbol("not")
  438. #define sym_member find_symbol("member")
  439. #define sym_memq find_symbol("memq")
  440. #define sym_neq find_symbol("neq")
  441. #define sym_eq find_symbol("eq")
  442. #define sym_geq find_symbol("geq")
  443. #define sym_leq find_symbol("leq")
  444. #define sym_freeof find_symbol("freeof")
  445. #define sym_symbolic find_symbol("symbolic")
  446. #define sym_algebraic find_symbol("algebraic")
  447. #define sym_expr find_symbol("expr")
  448. #define sym_macro find_symbol("macro")
  449. #define sym_smacro find_symbol("smacro")
  450. #define sym_procedure find_symbol("procedure")
  451. #define sym_for find_symbol("for")
  452. #define sym_step find_symbol("step")
  453. #define sym_until find_symbol("until")
  454. #define sym_each find_symbol("each")
  455. #define sym_foreach find_symbol("foreach")
  456. #define sym_in find_symbol("in")
  457. #define sym_on find_symbol("on")
  458. #define sym_do find_symbol("do")
  459. #define sym_collect find_symbol("collect")
  460. #define sym_sum find_symbol("sum")
  461. #define sym_if find_symbol("if")
  462. #define sym_then find_symbol("then")
  463. #define sym_else find_symbol("else")
  464. #define sym_repeat find_symbol("repeat")
  465. #define sym_while find_symbol("while")
  466. #define sym_begin find_symbol("begin")
  467. #define sym_end find_symbol("end")
  468. #define sym_lsect find_symbol("<<")
  469. #define sym_rsect find_symbol(">>")
  470. #define sym_go find_symbol("go")
  471. #define sym_to find_symbol("to")
  472. #define sym_goto find_symbol("goto")
  473. #define sym_scalar find_symbol("scalar")
  474. #define sym_integer find_symbol("integer")
  475. #define sym_lambda find_symbol("lambda")
  476. #define sym_symbol find_symbol("symbol")
  477. #define sym_number find_symbol("number")
  478. #define sym_string find_symbol("string")
  479. #define sym_quoted find_symbol("quoted")
  480. #define sym_return find_symbol("return")
  481. #define sym_where find_symbol("where")
  482. #define sym_rlistat find_symbol("rlistat")
  483. #define sym_endstat find_symbol("endstat")
  484. #define sym_null find_symbol("null")
  485. int make_where(int body, int var, int val)
  486. {
  487. return list2(
  488. list3(sym_lambda, list1(var), body),
  489. val);
  490. }
  491. int make_in_do(int var, int input, int body)
  492. {
  493. int lab1 = genlabel();
  494. int var1 = genvar();
  495. return list8(sym_prog, list1(var1),
  496. list3(sym_setq, var1, input),
  497. lab1,
  498. list3(sym_if, list2(sym_null, var1), list2(sym_return, C_nil)),
  499. list4(sym_prog, list1(var), list3(sym_setq, var, list2(sym_car, var1)), body),
  500. list3(sym_setq, var1, list2(sym_cdr, var1)),
  501. list2(sym_go, lab1));
  502. }
  503. int make_on_do(int var, int input, int body)
  504. {
  505. int lab1 = genlabel();
  506. return list8(sym_prog, list1(var),
  507. list3(sym_setq, var, input),
  508. lab1,
  509. list3(sym_if, list2(sym_null, var), list2(sym_return, C_nil)),
  510. body,
  511. list3(sym_setq, var, list2(sym_cdr, var)),
  512. list2(sym_go, lab1));
  513. }
  514. int make_in_collect(int var, int input, int body)
  515. {
  516. int lab1 = genlabel();
  517. int var1 = genvar();
  518. int var2 = genvar();
  519. return list8(sym_prog, list2(var1, var2),
  520. list3(sym_setq, var1, input),
  521. lab1,
  522. list3(sym_if,
  523. list2(sym_null, var1),
  524. list2(sym_return, list2(sym_reversip, var2))),
  525. list4(sym_prog, list1(var),
  526. list3(sym_setq, var, list2(sym_car, var1)),
  527. list3(sym_setq, var2, list3(sym_cons, body, var2))),
  528. list3(sym_setq, var1, list2(sym_cdr, var1)),
  529. list2(sym_go, lab1));
  530. }
  531. int make_on_collect(int var, int input, int body)
  532. {
  533. int lab1 = genlabel();
  534. int var2 = genvar();
  535. return list8(sym_prog, list1(var),
  536. list3(sym_setq, var, input),
  537. lab1,
  538. list3(sym_if,
  539. list2(sym_null, var),
  540. list2(sym_return, list2(sym_reversip, var2))),
  541. list3(sym_setq, var2, list3(sym_cons, body, var2)),
  542. list3(sym_setq, var, list2(sym_cdr, var)),
  543. list2(sym_go, lab1));
  544. }
  545. int make_in_sum(int var, int input, int body)
  546. {
  547. int lab1 = genlabel();
  548. int var1 = genvar();
  549. int var2 = genvar();
  550. return list9(sym_prog, list2(var1, var2),
  551. list3(sym_setq, var1, input),
  552. list3(sym_setq, var2, sym_0),
  553. lab1,
  554. list3(sym_if,
  555. list2(sym_null, var1),
  556. list2(sym_return, var2)),
  557. list4(sym_prog, list1(var),
  558. list3(sym_setq, var, list2(sym_car, var1)),
  559. list3(sym_setq, var2, list3(sym_plus, body, var2))),
  560. list3(sym_setq, var1, list2(sym_cdr, var1)),
  561. list2(sym_go, lab1));
  562. }
  563. int make_foreach(int var, int type, int input, int action, int body)
  564. {
  565. int inon = 0, docollect = 0;
  566. if (strcmp((char *)type-1, "on") == 0) inon = 1;
  567. if (strcmp((char *)action-1, "collect") == 0) docollect = 1;
  568. else if (strcmp((char *)action-1, "sum") == 0) docollect = 2;
  569. switch (inon+2*docollect)
  570. {
  571. case 0: /* in/do */
  572. return make_in_do(var, input, body);
  573. case 1: /* on/do */
  574. return make_on_do(var, input, body);
  575. case 2: /* in/collect */
  576. return make_in_collect(var, input, body);
  577. case 3: /* on/collect */
  578. return make_on_collect(var, input, body);
  579. case 4: /* in/sum */
  580. return make_in_sum(var, input, body);
  581. case 5: /* on/sum WHICH CAN NOT MAKE SENSE */
  582. default:
  583. return C_nil;
  584. }
  585. }
  586. int for_do(int var, int init, int step, int end, int body)
  587. {
  588. int lab1 = genlabel();
  589. return list8(sym_prog, list1(var),
  590. list3(sym_setq, var, init),
  591. lab1,
  592. list3(sym_if,
  593. list2(sym_minusp,
  594. list3(sym_times, step,
  595. list3(sym_difference, end, var))),
  596. list2(sym_return, C_nil)),
  597. body,
  598. list3(sym_setq, var, list3(sym_plus, var, step)),
  599. list2(sym_go, lab1));
  600. }
  601. int for_collect(int var, int init, int step, int end, int body)
  602. {
  603. int lab1 = genlabel();
  604. int var1 = genvar();
  605. return list8(sym_prog, list2(var, var1),
  606. list3(sym_setq, var, init),
  607. lab1,
  608. list3(sym_if,
  609. list2(sym_minusp,
  610. list3(sym_times, step,
  611. list3(sym_difference, end, var))),
  612. list2(sym_return, list2(sym_reversip, var1))),
  613. list3(sym_setq, var1, list3(sym_cons, body, var1)),
  614. list3(sym_setq, var, list3(sym_plus, var, step)),
  615. list2(sym_go, lab1));
  616. }
  617. int for_sum(int var, int init, int step, int end, int body)
  618. {
  619. int lab1 = genlabel();
  620. int var1 = genvar();
  621. return list9(sym_prog, list2(var, var1),
  622. list3(sym_setq, var, init),
  623. list3(sym_setq, var1, sym_0),
  624. lab1,
  625. list3(sym_if,
  626. list2(sym_minusp,
  627. list3(sym_times, step,
  628. list3(sym_difference, end, var))),
  629. list2(sym_return, var1)),
  630. list3(sym_setq, var1, list3(sym_plus, body, var1)),
  631. list3(sym_setq, var, list3(sym_plus, var, step)),
  632. list2(sym_go, lab1));
  633. }
  634. int make_for(int var, int init, int step, int end, int action, int body)
  635. {
  636. int docollect = 0;
  637. if (strcmp((char *)action-1, "collect") == 0) docollect = 1;
  638. else if (strcmp((char *)action-1, "sum") == 0) docollect = 2;
  639. switch (docollect)
  640. {
  641. case 0: /* do */
  642. return for_do(var, init, step, end, body);
  643. case 1: /* collect */
  644. return for_collect(var, init, step, end, body);
  645. case 2: /* sum */
  646. return for_sum(var, init, step, end, body);
  647. default:
  648. return C_nil;
  649. }
  650. }
  651. int lex_eof = 0;
  652. #line 716 "r2l.c"
  653. #define SETQ 257
  654. #define AND 258
  655. #define OR 259
  656. #define NOT 260
  657. #define MEMBER 261
  658. #define MEMQ 262
  659. #define NEQ 263
  660. #define EQ 264
  661. #define GEQ 265
  662. #define LEQ 266
  663. #define FREEOF 267
  664. #define SYMBOLIC 268
  665. #define ALGEBRAIC 269
  666. #define EXPR 270
  667. #define MACRO 271
  668. #define SMACRO 272
  669. #define PROCEDURE 273
  670. #define FOR 274
  671. #define STEP 275
  672. #define UNTIL 276
  673. #define EACH 277
  674. #define FOREACH 278
  675. #define IN 279
  676. #define ON 280
  677. #define DO 281
  678. #define COLLECT 282
  679. #define SUM 283
  680. #define IF 284
  681. #define THEN 285
  682. #define ELSE 286
  683. #define REPEAT 287
  684. #define WHILE 288
  685. #define BEGIN 289
  686. #define END 290
  687. #define ENDFILE 291
  688. #define LSECT 292
  689. #define RSECT 293
  690. #define GO 294
  691. #define TO 295
  692. #define GOTO 296
  693. #define SCALAR 297
  694. #define INTEGER 298
  695. #define LAMBDA 299
  696. #define SYMBOL 300
  697. #define NUMBER 301
  698. #define STRING 302
  699. #define LIST 303
  700. #define RETURN 304
  701. #define WHERE 305
  702. #define RLISTAT 306
  703. #define ENDSTAT 307
  704. #define HASHIF 308
  705. #define HASHELSE 309
  706. #define HASHELIF 310
  707. #define HASHENDIF 311
  708. #define YYERRCODE 256
  709. static YYCONST short yylhs[] = { -1,
  710. 0, 0, 1, 1, 1, 1, 3, 3, 4, 4,
  711. 5, 5, 5, 6, 6, 7, 7, 7, 7, 7,
  712. 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
  713. 7, 7, 7, 7, 8, 8, 8, 9, 9, 9,
  714. 9, 9, 9, 10, 10, 10, 10, 11, 11, 11,
  715. 12, 12, 2, 2, 14, 14, 15, 15, 16, 16,
  716. 16, 17, 17, 18, 18, 18, 19, 20, 21, 21,
  717. 22, 22, 22, 23, 23, 23, 24, 25, 25, 25,
  718. 26, 26, 27, 27, 28, 28, 28, 28, 28, 29,
  719. 29, 30, 30, 31, 31, 31, 13, 13, 32, 32,
  720. 33, 33, 34, 34, 35, 35, 38, 38, 37, 37,
  721. 41, 41, 36, 36, 42, 42, 39, 39, 45, 45,
  722. 40, 40, 43, 43, 44, 44, 46, 46, 46, 46,
  723. 46, 46, 46, 46, 46, 46, 46, 47, 47, 47,
  724. 47, 47, 47, 47, 47, 47, 47, 47, 49, 49,
  725. 51, 51, 52, 52, 50, 50, 57, 57, 48, 48,
  726. 53, 53, 56, 56, 54, 54, 55, 55, 58, 58,
  727. 59, 59, 59, 60, 60, 61, 61, 61, 64, 64,
  728. 62, 62, 69, 69, 63, 63, 65, 65, 65, 65,
  729. 68, 68, 66, 66, 66, 66, 67, 67, 72, 72,
  730. 72, 72, 73, 73, 70, 70, 70, 70, 71, 71,
  731. 76, 76, 76, 76, 75, 75, 75, 75, 75, 75,
  732. 75, 75, 75, 75, 78, 78, 78, 78, 74, 74,
  733. 79, 79, 80, 81, 82, 82, 82, 82, 82, 82,
  734. 77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
  735. 77, 77, 83, 83, 83, 83, 83, 83,
  736. };
  737. static YYCONST short yylen[] = { 2,
  738. 1, 2, 2, 2, 1, 2, 1, 1, 1, 1,
  739. 1, 1, 1, 1, 3, 1, 1, 1, 1, 1,
  740. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  741. 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
  742. 4, 2, 3, 4, 5, 5, 6, 1, 1, 1,
  743. 1, 3, 1, 2, 6, 4, 2, 4, 1, 1,
  744. 1, 1, 1, 7, 7, 6, 4, 4, 1, 2,
  745. 2, 2, 3, 1, 2, 3, 3, 1, 3, 3,
  746. 3, 3, 1, 2, 1, 2, 3, 3, 2, 3,
  747. 2, 1, 3, 4, 5, 6, 1, 1, 5, 1,
  748. 5, 1, 3, 1, 3, 1, 1, 3, 3, 1,
  749. 1, 3, 3, 1, 1, 3, 3, 1, 1, 3,
  750. 3, 1, 2, 1, 2, 1, 3, 3, 3, 3,
  751. 3, 3, 3, 3, 3, 3, 1, 3, 3, 3,
  752. 3, 3, 3, 3, 3, 3, 3, 1, 2, 1,
  753. 2, 1, 1, 3, 3, 1, 1, 3, 3, 1,
  754. 2, 1, 3, 1, 2, 1, 3, 1, 2, 1,
  755. 2, 2, 1, 2, 1, 2, 2, 1, 1, 3,
  756. 3, 1, 1, 3, 3, 1, 2, 2, 2, 1,
  757. 3, 1, 2, 2, 2, 1, 3, 1, 2, 2,
  758. 2, 1, 3, 1, 2, 2, 2, 1, 3, 1,
  759. 2, 2, 2, 1, 3, 1, 1, 1, 1, 1,
  760. 1, 1, 1, 1, 2, 2, 2, 1, 3, 1,
  761. 1, 3, 3, 5, 4, 3, 2, 2, 2, 1,
  762. 1, 1, 2, 2, 2, 2, 2, 2, 2, 2,
  763. 2, 2, 1, 1, 1, 1, 1, 1,
  764. };
  765. static YYCONST short yydefred[] = { 0,
  766. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  767. 0, 9, 10, 11, 12, 13, 0, 0, 0, 49,
  768. 50, 0, 0, 0, 0, 0, 1, 0, 0, 0,
  769. 0, 253, 254, 255, 256, 0, 48, 224, 0, 0,
  770. 0, 0, 0, 0, 0, 0, 223, 0, 53, 216,
  771. 217, 218, 219, 220, 221, 257, 258, 222, 97, 0,
  772. 100, 102, 0, 104, 110, 0, 118, 0, 124, 126,
  773. 0, 137, 0, 156, 164, 168, 173, 178, 0, 182,
  774. 192, 198, 0, 210, 0, 242, 241, 0, 0, 243,
  775. 245, 244, 0, 123, 125, 246, 247, 248, 249, 250,
  776. 251, 252, 35, 0, 36, 37, 0, 0, 0, 0,
  777. 0, 0, 0, 0, 85, 0, 0, 0, 7, 8,
  778. 0, 0, 83, 0, 91, 6, 0, 0, 72, 71,
  779. 0, 0, 70, 0, 171, 170, 176, 175, 172, 177,
  780. 0, 2, 3, 0, 4, 0, 0, 54, 0, 0,
  781. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  782. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  783. 0, 237, 238, 239, 0, 16, 18, 17, 19, 20,
  784. 22, 23, 24, 26, 28, 39, 21, 25, 27, 29,
  785. 30, 31, 32, 33, 34, 0, 0, 42, 0, 0,
  786. 0, 62, 63, 0, 0, 0, 0, 0, 0, 0,
  787. 86, 0, 89, 84, 90, 74, 0, 77, 73, 0,
  788. 92, 0, 0, 0, 169, 174, 233, 0, 0, 0,
  789. 0, 0, 103, 105, 109, 107, 0, 113, 117, 115,
  790. 0, 121, 0, 152, 127, 150, 138, 128, 139, 130,
  791. 141, 131, 142, 132, 143, 134, 145, 136, 147, 129,
  792. 140, 133, 144, 135, 146, 0, 155, 153, 0, 0,
  793. 162, 159, 163, 167, 0, 0, 0, 181, 179, 0,
  794. 0, 190, 185, 0, 0, 0, 191, 208, 197, 202,
  795. 209, 203, 0, 0, 0, 228, 214, 215, 229, 236,
  796. 0, 0, 0, 0, 40, 43, 44, 0, 0, 0,
  797. 0, 68, 67, 0, 78, 81, 82, 87, 88, 75,
  798. 0, 0, 94, 14, 0, 0, 0, 0, 0, 0,
  799. 52, 0, 0, 0, 149, 151, 161, 165, 0, 187,
  800. 193, 188, 194, 189, 195, 0, 205, 199, 206, 200,
  801. 207, 201, 211, 225, 212, 226, 213, 227, 235, 0,
  802. 41, 0, 0, 0, 0, 59, 61, 60, 0, 0,
  803. 0, 0, 76, 93, 0, 0, 95, 45, 0, 46,
  804. 99, 101, 108, 112, 116, 120, 154, 158, 180, 184,
  805. 231, 0, 234, 0, 0, 57, 0, 66, 55, 80,
  806. 79, 15, 96, 47, 0, 65, 0, 64, 232, 58,
  807. };
  808. static YYCONST short yydgoto[] = { 42,
  809. 43, 121, 122, 93, 46, 326, 197, 107, 108, 47,
  810. 48, 148, 49, 50, 365, 369, 204, 51, 52, 53,
  811. 54, 55, 218, 56, 316, 123, 124, 125, 57, 222,
  812. 58, 59, 60, 61, 62, 63, 64, 235, 65, 66,
  813. 238, 239, 67, 68, 242, 69, 70, 71, 245, 72,
  814. 247, 267, 268, 269, 73, 74, 272, 135, 75, 137,
  815. 76, 77, 78, 278, 279, 280, 79, 80, 283, 287,
  816. 81, 289, 82, 83, 84, 298, 85, 299, 393, 86,
  817. 90, 87, 88,
  818. };
  819. static YYCONST short yysindex[] = { 1038,
  820. 14, 14, 14, 1303, 14, 14, 14, 14, 14, 14,
  821. 14, 0, 0, 0, 0, 0, -13, -235, -227, 0,
  822. 0, 1303, 1199, 1303, -28, 12, 0, 1199, -234, -219,
  823. -35, 0, 0, 0, 0, 1303, 0, 0, 1358, 1358,
  824. 1303, 0, 1038, 12, 20, -174, 0, 1303, 0, 0,
  825. 0, 0, 0, 0, 0, 0, 0, 0, 0, -191,
  826. 0, 0, -124, 0, 0, -131, 0, -120, 0, 0,
  827. 50, 0, 111, 0, 0, 0, 0, 0, 28, 0,
  828. 0, 0, 48, 0, 107, 0, 0, 38, 1303, 0,
  829. 0, 0, -149, 0, 0, 0, 0, 0, 0, 0,
  830. 0, 0, 0, 1925, 0, 0, -133, 12, -115, -99,
  831. -173, -126, -101, -88, 0, -103, -91, 141, 0, 0,
  832. -23, 151, 0, -28, 0, 0, -16, -87, 0, 0,
  833. 3, -19, 0, 1358, 0, 0, 0, 0, 0, 0,
  834. 175, 0, 0, -13, 0, -56, -13, 0, 205, -81,
  835. 1303, 1303, 1303, 1500, 1500, 1500, 1500, 1500, 1500, 1500,
  836. 1500, 1500, 1500, 1553, 1358, 1608, 1659, 1659, 1736, 1449,
  837. 1303, 0, 0, 0, 219, 0, 0, 0, 0, 0,
  838. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  839. 0, 0, 0, 0, 0, -18, -72, 0, 1199, -173,
  840. 1303, 0, 0, 1303, 1199, 1303, 1199, 13, 13, 151,
  841. 0, 151, 0, 0, 0, 0, 1148, 0, 0, -15,
  842. 0, 1199, 33, 12, 0, 0, 0, 12, -13, 12,
  843. 1303, 223, 0, 0, 0, 0, 21, 0, 0, 0,
  844. 31, 0, 1500, 0, 0, 0, 0, 0, 0, 0,
  845. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  846. 0, 0, 0, 0, 0, 1553, 0, 0, 243, 249,
  847. 0, 0, 0, 0, 1608, 1608, 1608, 0, 0, 255,
  848. 251, 0, 0, 1659, 1659, 1659, 0, 0, 0, 0,
  849. 0, 0, 1736, 1736, 1736, 0, 0, 0, 0, 0,
  850. 39, 208, 1303, 33, 0, 0, 0, 1303, -51, -179,
  851. 16, 0, 0, -240, 0, 0, 0, 0, 0, 0,
  852. -16, 3, 0, 0, 18, 12, 1199, 1199, 12, 1199,
  853. 0, 1303, 1303, 1303, 0, 0, 0, 0, 1553, 0,
  854. 0, 0, 0, 0, 0, 1608, 0, 0, 0, 0,
  855. 0, 0, 0, 0, 0, 0, 0, 0, 0, 56,
  856. 0, -179, 1303, 1303, -179, 0, 0, 0, 1199, 1199,
  857. 13, 13, 0, 0, 33, 1199, 0, 0, 1199, 0,
  858. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  859. 0, 1303, 0, 1199, 43, 0, 1199, 0, 0, 0,
  860. 0, 0, 0, 0, 56, 0, 1303, 0, 0, 0,
  861. };
  862. static YYCONST short yyrindex[] = { 0,
  863. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  864. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  865. 0, 0, 0, 0, 0, 1093, 0, 0, 0, 0,
  866. 0, 0, 0, 0, 0, 1792, 0, 0, 0, 0,
  867. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  868. 0, 0, 0, 0, 0, 0, 0, 0, 0, 1847,
  869. 0, 0, 930, 0, 0, 970, 0, 904, 0, 0,
  870. 710, 0, 789, 0, 0, 0, 0, 0, 553, 0,
  871. 0, 0, 457, 0, 420, 0, 0, 263, 0, 0,
  872. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  873. 0, 0, 0, 17, 0, 0, 0, 0, 0, 0,
  874. 0, 0, 0, 0, 0, 0, 0, 101, 0, 0,
  875. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  876. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  877. 0, 0, 0, 0, 0, 0, 0, 0, 1933, 0,
  878. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  879. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  880. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  881. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  882. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  883. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  884. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  885. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  886. 0, 0, 0, 0, 0, 0, 983, 0, 0, 0,
  887. 943, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  888. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  889. 0, 0, 0, 0, 0, 0, 0, 0, 849, 668,
  890. 0, 0, 0, 0, 0, 0, 0, 0, 0, 598,
  891. 516, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  892. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  893. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  894. 2005, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  895. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  896. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  897. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  898. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  899. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  900. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  901. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  902. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  903. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  904. };
  905. static YYCONST short yygindex[] = { 277,
  906. 0, 1, -26, 41, -34, -277, 0, 0, -109, 0,
  907. 0, 95, -20, 0, 0, -298, 132, 0, 0, 0,
  908. 0, 0, 26, 0, -199, 210, 0, -9, 0, 27,
  909. 0, 0, 0, -142, -125, 0, 0, 4, -119, -118,
  910. 9, 19, -1, 2, 35, 0, 0, -69, 424, 329,
  911. 445, -4, 82, 84, -150, -127, 22, 15, 6, 23,
  912. 11, 0, 0, 5, -158, -145, -141, -98, 8, -116,
  913. -59, 184, 90, -129, -73, -168, 0, -40, -50, 285,
  914. 619, 290, 0,
  915. };
  916. #define YYTABLESIZE 2298
  917. static YYCONST short yytable[] = { 126,
  918. 44, 112, 94, 114, 132, 95, 364, 120, 233, 317,
  919. 146, 41, 120, 270, 39, 133, 40, 143, 145, 120,
  920. 141, 224, 305, 113, 281, 234, 361, 149, 127, 105,
  921. 119, 106, 236, 237, 228, 119, 271, 230, 120, 296,
  922. 45, 109, 119, 44, 136, 136, 220, 120, 120, 138,
  923. 138, 291, 38, 89, 139, 120, 314, 371, 146, 372,
  924. 128, 119, 140, 394, 110, 129, 397, 282, 175, 166,
  925. 119, 119, 111, 324, 167, 38, 325, 170, 119, 227,
  926. 130, 199, 303, 45, 244, 244, 244, 244, 244, 244,
  927. 244, 244, 244, 244, 212, 297, 391, 402, 147, 392,
  928. 217, 366, 367, 368, 221, 202, 203, 288, 288, 163,
  929. 161, 162, 213, 150, 215, 270, 340, 342, 344, 329,
  930. 14, 15, 16, 144, 353, 355, 357, 152, 171, 341,
  931. 343, 345, 151, 281, 281, 281, 253, 153, 271, 136,
  932. 253, 168, 253, 253, 138, 253, 253, 253, 225, 301,
  933. 302, 240, 169, 164, 241, 165, 226, 201, 205, 253,
  934. 253, 253, 253, 296, 296, 296, 198, 347, 349, 351,
  935. 136, 400, 401, 244, 206, 138, 282, 282, 282, 273,
  936. 309, 315, 315, 310, 200, 312, 120, 274, 270, 381,
  937. 41, 253, 207, 39, 253, 40, 208, 327, 210, 307,
  938. 318, 328, 319, 330, 281, 311, 382, 313, 209, 119,
  939. 149, 271, 219, 236, 237, 227, 229, 321, 232, 297,
  940. 297, 297, 323, 363, 288, 288, 288, 306, 1, 2,
  941. 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
  942. 13, 14, 15, 16, 17, 18, 103, 282, 231, 19,
  943. 20, 21, 354, 356, 358, 22, 290, 290, 23, 24,
  944. 25, 115, 303, 28, 131, 29, 211, 30, 116, 117,
  945. 31, 118, 33, 34, 35, 36, 216, 37, 38, 333,
  946. 223, 304, 360, 332, 322, 339, 104, 362, 334, 14,
  947. 15, 16, 144, 165, 217, 221, 346, 167, 240, 376,
  948. 359, 370, 379, 240, 240, 240, 240, 240, 240, 240,
  949. 154, 155, 156, 157, 158, 159, 160, 375, 407, 142,
  950. 240, 240, 240, 240, 240, 331, 25, 377, 378, 28,
  951. 380, 308, 240, 214, 387, 241, 383, 32, 33, 34,
  952. 35, 384, 395, 396, 315, 315, 373, 337, 374, 338,
  953. 389, 292, 385, 390, 409, 240, 240, 253, 253, 253,
  954. 388, 253, 253, 253, 253, 253, 253, 253, 386, 398,
  955. 399, 405, 172, 290, 290, 290, 403, 174, 0, 404,
  956. 0, 0, 0, 0, 0, 0, 410, 0, 0, 253,
  957. 253, 0, 253, 0, 406, 0, 0, 408, 0, 0,
  958. 253, 253, 253, 253, 0, 253, 0, 1, 2, 3,
  959. 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
  960. 14, 15, 16, 17, 18, 0, 0, 0, 19, 20,
  961. 21, 0, 0, 0, 22, 0, 0, 23, 24, 25,
  962. 115, 0, 28, 0, 29, 0, 30, 0, 0, 31,
  963. 118, 33, 34, 35, 36, 230, 37, 38, 0, 0,
  964. 230, 230, 230, 230, 230, 0, 230, 348, 350, 352,
  965. 0, 0, 0, 0, 0, 0, 0, 230, 230, 230,
  966. 230, 230, 246, 246, 246, 246, 246, 246, 246, 246,
  967. 246, 246, 204, 0, 0, 0, 0, 204, 204, 204,
  968. 204, 204, 0, 204, 0, 0, 0, 0, 0, 0,
  969. 0, 0, 230, 230, 204, 204, 204, 204, 204, 240,
  970. 240, 240, 0, 240, 240, 240, 240, 240, 240, 240,
  971. 0, 0, 0, 0, 0, 0, 0, 240, 240, 0,
  972. 0, 0, 0, 240, 240, 240, 0, 240, 240, 204,
  973. 0, 196, 240, 0, 0, 240, 196, 196, 196, 196,
  974. 196, 0, 0, 0, 0, 0, 0, 240, 0, 0,
  975. 0, 246, 0, 196, 196, 196, 196, 196, 248, 250,
  976. 252, 254, 256, 258, 260, 262, 264, 0, 186, 0,
  977. 0, 0, 0, 186, 0, 186, 186, 186, 0, 249,
  978. 251, 253, 255, 257, 259, 261, 263, 265, 196, 0,
  979. 186, 186, 186, 186, 186, 0, 0, 0, 0, 0,
  980. 91, 92, 0, 96, 97, 98, 99, 100, 101, 102,
  981. 0, 0, 0, 183, 0, 0, 0, 0, 183, 0,
  982. 183, 183, 183, 0, 0, 186, 0, 0, 0, 0,
  983. 0, 0, 0, 0, 0, 183, 183, 183, 183, 183,
  984. 0, 0, 0, 0, 0, 0, 335, 0, 0, 0,
  985. 0, 0, 0, 0, 0, 0, 230, 230, 230, 0,
  986. 230, 230, 230, 230, 230, 230, 230, 336, 0, 0,
  987. 183, 0, 0, 0, 230, 230, 0, 0, 0, 0,
  988. 230, 230, 230, 166, 230, 230, 173, 0, 166, 230,
  989. 166, 166, 230, 204, 204, 204, 0, 204, 204, 204,
  990. 204, 204, 204, 204, 230, 166, 166, 166, 166, 166,
  991. 0, 204, 204, 0, 0, 0, 0, 204, 204, 204,
  992. 0, 204, 204, 0, 0, 148, 204, 0, 0, 204,
  993. 148, 0, 0, 148, 0, 0, 0, 0, 0, 0,
  994. 166, 204, 0, 0, 0, 0, 0, 148, 148, 0,
  995. 0, 0, 196, 196, 196, 0, 196, 196, 196, 196,
  996. 196, 196, 196, 0, 0, 0, 0, 0, 0, 0,
  997. 196, 196, 0, 0, 0, 0, 196, 196, 196, 0,
  998. 196, 196, 148, 0, 0, 196, 0, 0, 196, 186,
  999. 186, 186, 0, 186, 186, 186, 186, 186, 186, 186,
  1000. 196, 0, 0, 0, 160, 0, 0, 186, 186, 160,
  1001. 0, 0, 160, 186, 186, 186, 0, 186, 186, 0,
  1002. 0, 0, 186, 0, 0, 186, 160, 160, 160, 160,
  1003. 160, 0, 0, 0, 183, 183, 183, 186, 183, 183,
  1004. 183, 183, 183, 183, 183, 0, 0, 0, 0, 0,
  1005. 0, 0, 183, 183, 0, 0, 0, 0, 183, 183,
  1006. 183, 160, 183, 183, 157, 0, 0, 183, 0, 157,
  1007. 183, 0, 157, 0, 0, 0, 0, 0, 0, 0,
  1008. 0, 0, 183, 0, 0, 0, 157, 157, 157, 157,
  1009. 157, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  1010. 0, 0, 0, 0, 166, 166, 166, 0, 166, 166,
  1011. 166, 166, 166, 166, 166, 0, 0, 0, 0, 122,
  1012. 0, 157, 166, 166, 122, 0, 0, 122, 166, 166,
  1013. 166, 0, 166, 166, 0, 0, 0, 166, 0, 0,
  1014. 166, 122, 122, 0, 0, 106, 148, 148, 148, 0,
  1015. 106, 0, 166, 106, 0, 0, 0, 0, 119, 0,
  1016. 0, 0, 0, 119, 148, 148, 119, 106, 106, 0,
  1017. 148, 148, 148, 0, 148, 148, 122, 0, 0, 148,
  1018. 119, 119, 148, 0, 0, 114, 0, 0, 0, 0,
  1019. 114, 0, 0, 114, 148, 0, 0, 0, 111, 0,
  1020. 0, 0, 106, 111, 0, 0, 111, 114, 114, 0,
  1021. 0, 0, 0, 0, 0, 119, 0, 0, 0, 0,
  1022. 111, 111, 0, 0, 0, 160, 160, 160, 0, 160,
  1023. 160, 160, 160, 160, 160, 160, 0, 0, 0, 0,
  1024. 0, 0, 114, 160, 160, 0, 0, 0, 0, 160,
  1025. 160, 160, 0, 160, 160, 111, 0, 41, 160, 0,
  1026. 39, 160, 40, 0, 0, 0, 0, 0, 0, 0,
  1027. 0, 0, 0, 160, 0, 0, 0, 0, 0, 0,
  1028. 0, 0, 0, 0, 0, 157, 157, 157, 0, 157,
  1029. 157, 157, 157, 157, 157, 157, 0, 0, 0, 0,
  1030. 0, 0, 0, 157, 157, 0, 0, 0, 0, 157,
  1031. 157, 157, 5, 157, 157, 5, 0, 5, 157, 0,
  1032. 0, 157, 0, 0, 0, 0, 0, 0, 0, 0,
  1033. 0, 0, 0, 157, 0, 0, 0, 0, 0, 0,
  1034. 122, 0, 122, 0, 0, 0, 0, 0, 0, 0,
  1035. 0, 0, 0, 0, 0, 0, 0, 0, 122, 122,
  1036. 0, 0, 0, 0, 122, 122, 122, 41, 122, 122,
  1037. 39, 0, 40, 122, 0, 0, 122, 0, 0, 119,
  1038. 0, 119, 0, 0, 106, 106, 0, 0, 122, 0,
  1039. 106, 106, 106, 0, 106, 106, 0, 119, 119, 106,
  1040. 0, 0, 106, 119, 119, 119, 114, 119, 119, 0,
  1041. 0, 0, 119, 0, 106, 119, 0, 0, 41, 111,
  1042. 0, 39, 0, 40, 114, 114, 0, 119, 0, 0,
  1043. 114, 114, 114, 0, 114, 114, 0, 111, 111, 114,
  1044. 0, 0, 114, 111, 111, 111, 0, 111, 111, 0,
  1045. 0, 0, 111, 0, 114, 111, 0, 0, 0, 0,
  1046. 0, 0, 0, 0, 0, 0, 0, 111, 0, 0,
  1047. 0, 0, 0, 0, 1, 2, 3, 4, 5, 6,
  1048. 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
  1049. 17, 18, 0, 0, 0, 19, 20, 21, 0, 0,
  1050. 0, 22, 0, 0, 23, 24, 25, 26, 27, 28,
  1051. 0, 29, 0, 30, 0, 0, 31, 32, 33, 34,
  1052. 35, 36, 41, 37, 38, 39, 0, 40, 0, 5,
  1053. 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
  1054. 5, 5, 5, 5, 5, 5, 5, 0, 0, 0,
  1055. 5, 5, 5, 0, 0, 0, 5, 0, 0, 5,
  1056. 5, 5, 5, 5, 5, 0, 5, 0, 5, 0,
  1057. 0, 5, 5, 5, 5, 5, 5, 41, 5, 5,
  1058. 39, 0, 40, 0, 1, 2, 3, 4, 5, 6,
  1059. 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
  1060. 17, 18, 0, 0, 0, 19, 20, 21, 0, 0,
  1061. 0, 22, 0, 0, 23, 24, 25, 0, 0, 28,
  1062. 320, 29, 0, 30, 0, 0, 31, 32, 33, 34,
  1063. 35, 36, 0, 37, 38, 1, 2, 3, 4, 5,
  1064. 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1065. 16, 17, 18, 0, 0, 0, 19, 20, 21, 0,
  1066. 0, 0, 22, 0, 0, 23, 24, 25, 41, 300,
  1067. 28, 39, 29, 40, 30, 0, 0, 31, 32, 33,
  1068. 34, 35, 36, 0, 37, 38, 0, 0, 0, 0,
  1069. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  1070. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  1071. 0, 0, 0, 0, 0, 0, 0, 0, 0, 41,
  1072. 0, 0, 39, 0, 40, 0, 0, 0, 0, 0,
  1073. 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
  1074. 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
  1075. 12, 13, 14, 15, 16, 17, 18, 0, 0, 0,
  1076. 19, 0, 0, 0, 0, 0, 22, 0, 0, 23,
  1077. 24, 25, 41, 0, 28, 39, 29, 40, 30, 0,
  1078. 0, 31, 32, 33, 34, 35, 36, 0, 0, 38,
  1079. 0, 0, 0, 0, 1, 2, 3, 134, 5, 6,
  1080. 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
  1081. 17, 18, 0, 0, 0, 19, 0, 0, 0, 0,
  1082. 0, 22, 0, 0, 23, 24, 25, 41, 0, 28,
  1083. 276, 29, 277, 30, 0, 0, 31, 32, 33, 34,
  1084. 35, 36, 0, 0, 38, 0, 0, 0, 0, 0,
  1085. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  1086. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  1087. 0, 0, 0, 0, 0, 0, 0, 0, 41, 0,
  1088. 0, 285, 0, 286, 0, 1, 2, 3, 4, 5,
  1089. 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1090. 16, 17, 18, 0, 0, 0, 19, 0, 0, 0,
  1091. 0, 0, 22, 0, 0, 23, 24, 25, 0, 0,
  1092. 28, 0, 29, 0, 30, 0, 0, 31, 32, 33,
  1093. 34, 35, 36, 0, 0, 38, 1, 2, 3, 243,
  1094. 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
  1095. 15, 16, 17, 18, 0, 41, 0, 19, 294, 0,
  1096. 295, 0, 0, 22, 0, 0, 23, 24, 25, 0,
  1097. 0, 28, 0, 29, 0, 30, 0, 0, 31, 32,
  1098. 33, 34, 35, 36, 0, 0, 38, 0, 0, 1,
  1099. 2, 3, 266, 5, 6, 7, 8, 9, 10, 11,
  1100. 12, 13, 14, 15, 16, 17, 18, 69, 0, 0,
  1101. 19, 0, 69, 0, 0, 69, 22, 0, 0, 23,
  1102. 24, 25, 0, 0, 28, 0, 29, 0, 30, 69,
  1103. 69, 31, 32, 33, 34, 35, 36, 0, 0, 38,
  1104. 0, 0, 0, 0, 1, 2, 3, 275, 5, 6,
  1105. 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
  1106. 17, 18, 98, 0, 69, 19, 0, 98, 0, 0,
  1107. 98, 22, 0, 0, 23, 24, 25, 0, 0, 28,
  1108. 0, 29, 0, 30, 98, 98, 31, 32, 33, 34,
  1109. 35, 36, 0, 0, 38, 1, 2, 3, 284, 5,
  1110. 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1111. 16, 17, 18, 0, 0, 0, 19, 0, 0, 98,
  1112. 0, 0, 22, 0, 0, 23, 24, 25, 0, 0,
  1113. 28, 0, 29, 0, 30, 0, 0, 31, 32, 33,
  1114. 34, 35, 36, 0, 196, 38, 192, 190, 51, 191,
  1115. 195, 193, 0, 51, 0, 0, 0, 0, 0, 0,
  1116. 0, 0, 0, 0, 189, 187, 188, 0, 0, 0,
  1117. 51, 51, 1, 2, 3, 293, 5, 6, 7, 8,
  1118. 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
  1119. 0, 0, 0, 19, 0, 0, 0, 0, 194, 22,
  1120. 0, 0, 23, 24, 25, 51, 0, 28, 0, 29,
  1121. 0, 30, 0, 0, 31, 32, 33, 34, 35, 36,
  1122. 56, 0, 38, 0, 0, 56, 0, 0, 56, 0,
  1123. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  1124. 0, 0, 56, 56, 0, 0, 69, 69, 0, 0,
  1125. 0, 0, 69, 69, 69, 0, 69, 69, 0, 0,
  1126. 0, 69, 0, 0, 69, 0, 0, 0, 0, 0,
  1127. 0, 0, 0, 0, 0, 0, 0, 56, 0, 0,
  1128. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  1129. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  1130. 0, 98, 98, 0, 0, 0, 0, 98, 98, 98,
  1131. 0, 98, 98, 0, 0, 0, 98, 0, 0, 98,
  1132. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  1133. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  1134. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  1135. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  1136. 0, 176, 177, 178, 0, 179, 180, 181, 182, 183,
  1137. 184, 185, 0, 0, 0, 0, 0, 0, 0, 0,
  1138. 0, 0, 0, 0, 0, 0, 0, 51, 51, 0,
  1139. 0, 0, 0, 51, 51, 51, 0, 51, 51, 0,
  1140. 0, 0, 51, 0, 186, 51, 0, 0, 0, 0,
  1141. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  1142. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  1143. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  1144. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  1145. 0, 0, 0, 0, 0, 0, 0, 0, 0, 56,
  1146. 56, 0, 0, 0, 0, 56, 56, 56, 0, 56,
  1147. 0, 0, 0, 0, 56, 0, 0, 56,
  1148. };
  1149. static YYCONST short yycheck[] = { 26,
  1150. 0, 22, 4, 24, 40, 4, 58, 36, 151, 209,
  1151. 45, 40, 36, 164, 43, 36, 45, 44, 45, 36,
  1152. 41, 41, 41, 23, 166, 151, 304, 48, 28, 43,
  1153. 59, 45, 152, 152, 144, 59, 164, 147, 36, 169,
  1154. 0, 277, 59, 43, 39, 40, 44, 36, 36, 39,
  1155. 40, 168, 36, 40, 40, 36, 44, 298, 93, 300,
  1156. 295, 59, 40, 362, 300, 300, 365, 166, 89, 42,
  1157. 59, 59, 300, 41, 47, 59, 44, 40, 59, 41,
  1158. 300, 108, 44, 43, 154, 155, 156, 157, 158, 159,
  1159. 160, 161, 162, 163, 121, 169, 41, 375, 273, 44,
  1160. 127, 281, 282, 283, 131, 279, 280, 167, 168, 60,
  1161. 61, 62, 122, 305, 124, 266, 275, 276, 277, 229,
  1162. 270, 271, 272, 273, 293, 294, 295, 259, 91, 275,
  1163. 276, 277, 257, 275, 276, 277, 36, 258, 266, 134,
  1164. 40, 94, 42, 43, 134, 45, 46, 47, 134, 170,
  1165. 171, 153, 46, 43, 153, 45, 134, 257, 285, 59,
  1166. 60, 61, 62, 293, 294, 295, 300, 284, 285, 286,
  1167. 165, 371, 372, 243, 276, 165, 275, 276, 277, 165,
  1168. 201, 208, 209, 204, 300, 206, 36, 165, 339, 332,
  1169. 40, 91, 281, 43, 94, 45, 300, 224, 58, 199,
  1170. 210, 228, 212, 230, 346, 205, 332, 207, 300, 59,
  1171. 231, 339, 300, 333, 333, 41, 273, 217, 300, 293,
  1172. 294, 295, 222, 275, 284, 285, 286, 300, 257, 258,
  1173. 259, 260, 261, 262, 263, 264, 265, 266, 267, 268,
  1174. 269, 270, 271, 272, 273, 274, 260, 346, 44, 278,
  1175. 279, 280, 293, 294, 295, 284, 167, 168, 287, 288,
  1176. 289, 290, 44, 292, 300, 294, 290, 296, 297, 298,
  1177. 299, 300, 301, 302, 303, 304, 293, 306, 307, 259,
  1178. 300, 300, 303, 61, 300, 43, 300, 308, 258, 270,
  1179. 271, 272, 273, 45, 321, 322, 42, 47, 36, 326,
  1180. 93, 286, 329, 41, 42, 43, 44, 45, 46, 47,
  1181. 261, 262, 263, 264, 265, 266, 267, 300, 276, 43,
  1182. 58, 59, 60, 61, 62, 231, 289, 327, 328, 292,
  1183. 330, 200, 334, 124, 339, 334, 333, 300, 301, 302,
  1184. 303, 333, 363, 364, 371, 372, 321, 266, 322, 266,
  1185. 346, 168, 334, 346, 405, 93, 94, 257, 258, 259,
  1186. 339, 261, 262, 263, 264, 265, 266, 267, 334, 369,
  1187. 370, 392, 88, 284, 285, 286, 376, 88, -1, 379,
  1188. -1, -1, -1, -1, -1, -1, 407, -1, -1, 289,
  1189. 290, -1, 292, -1, 394, -1, -1, 397, -1, -1,
  1190. 300, 301, 302, 303, -1, 305, -1, 257, 258, 259,
  1191. 260, 261, 262, 263, 264, 265, 266, 267, 268, 269,
  1192. 270, 271, 272, 273, 274, -1, -1, -1, 278, 279,
  1193. 280, -1, -1, -1, 284, -1, -1, 287, 288, 289,
  1194. 290, -1, 292, -1, 294, -1, 296, -1, -1, 299,
  1195. 300, 301, 302, 303, 304, 36, 306, 307, -1, -1,
  1196. 41, 42, 43, 44, 45, -1, 47, 284, 285, 286,
  1197. -1, -1, -1, -1, -1, -1, -1, 58, 59, 60,
  1198. 61, 62, 154, 155, 156, 157, 158, 159, 160, 161,
  1199. 162, 163, 36, -1, -1, -1, -1, 41, 42, 43,
  1200. 44, 45, -1, 47, -1, -1, -1, -1, -1, -1,
  1201. -1, -1, 93, 94, 58, 59, 60, 61, 62, 257,
  1202. 258, 259, -1, 261, 262, 263, 264, 265, 266, 267,
  1203. -1, -1, -1, -1, -1, -1, -1, 275, 276, -1,
  1204. -1, -1, -1, 281, 282, 283, -1, 285, 286, 93,
  1205. -1, 36, 290, -1, -1, 293, 41, 42, 43, 44,
  1206. 45, -1, -1, -1, -1, -1, -1, 305, -1, -1,
  1207. -1, 243, -1, 58, 59, 60, 61, 62, 155, 156,
  1208. 157, 158, 159, 160, 161, 162, 163, -1, 36, -1,
  1209. -1, -1, -1, 41, -1, 43, 44, 45, -1, 155,
  1210. 156, 157, 158, 159, 160, 161, 162, 163, 93, -1,
  1211. 58, 59, 60, 61, 62, -1, -1, -1, -1, -1,
  1212. 2, 3, -1, 5, 6, 7, 8, 9, 10, 11,
  1213. -1, -1, -1, 36, -1, -1, -1, -1, 41, -1,
  1214. 43, 44, 45, -1, -1, 93, -1, -1, -1, -1,
  1215. -1, -1, -1, -1, -1, 58, 59, 60, 61, 62,
  1216. -1, -1, -1, -1, -1, -1, 243, -1, -1, -1,
  1217. -1, -1, -1, -1, -1, -1, 257, 258, 259, -1,
  1218. 261, 262, 263, 264, 265, 266, 267, 243, -1, -1,
  1219. 93, -1, -1, -1, 275, 276, -1, -1, -1, -1,
  1220. 281, 282, 283, 36, 285, 286, 88, -1, 41, 290,
  1221. 43, 44, 293, 257, 258, 259, -1, 261, 262, 263,
  1222. 264, 265, 266, 267, 305, 58, 59, 60, 61, 62,
  1223. -1, 275, 276, -1, -1, -1, -1, 281, 282, 283,
  1224. -1, 285, 286, -1, -1, 36, 290, -1, -1, 293,
  1225. 41, -1, -1, 44, -1, -1, -1, -1, -1, -1,
  1226. 93, 305, -1, -1, -1, -1, -1, 58, 59, -1,
  1227. -1, -1, 257, 258, 259, -1, 261, 262, 263, 264,
  1228. 265, 266, 267, -1, -1, -1, -1, -1, -1, -1,
  1229. 275, 276, -1, -1, -1, -1, 281, 282, 283, -1,
  1230. 285, 286, 93, -1, -1, 290, -1, -1, 293, 257,
  1231. 258, 259, -1, 261, 262, 263, 264, 265, 266, 267,
  1232. 305, -1, -1, -1, 36, -1, -1, 275, 276, 41,
  1233. -1, -1, 44, 281, 282, 283, -1, 285, 286, -1,
  1234. -1, -1, 290, -1, -1, 293, 58, 59, 60, 61,
  1235. 62, -1, -1, -1, 257, 258, 259, 305, 261, 262,
  1236. 263, 264, 265, 266, 267, -1, -1, -1, -1, -1,
  1237. -1, -1, 275, 276, -1, -1, -1, -1, 281, 282,
  1238. 283, 93, 285, 286, 36, -1, -1, 290, -1, 41,
  1239. 293, -1, 44, -1, -1, -1, -1, -1, -1, -1,
  1240. -1, -1, 305, -1, -1, -1, 58, 59, 60, 61,
  1241. 62, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  1242. -1, -1, -1, -1, 257, 258, 259, -1, 261, 262,
  1243. 263, 264, 265, 266, 267, -1, -1, -1, -1, 36,
  1244. -1, 93, 275, 276, 41, -1, -1, 44, 281, 282,
  1245. 283, -1, 285, 286, -1, -1, -1, 290, -1, -1,
  1246. 293, 58, 59, -1, -1, 36, 257, 258, 259, -1,
  1247. 41, -1, 305, 44, -1, -1, -1, -1, 36, -1,
  1248. -1, -1, -1, 41, 275, 276, 44, 58, 59, -1,
  1249. 281, 282, 283, -1, 285, 286, 93, -1, -1, 290,
  1250. 58, 59, 293, -1, -1, 36, -1, -1, -1, -1,
  1251. 41, -1, -1, 44, 305, -1, -1, -1, 36, -1,
  1252. -1, -1, 93, 41, -1, -1, 44, 58, 59, -1,
  1253. -1, -1, -1, -1, -1, 93, -1, -1, -1, -1,
  1254. 58, 59, -1, -1, -1, 257, 258, 259, -1, 261,
  1255. 262, 263, 264, 265, 266, 267, -1, -1, -1, -1,
  1256. -1, -1, 93, 275, 276, -1, -1, -1, -1, 281,
  1257. 282, 283, -1, 285, 286, 93, -1, 40, 290, -1,
  1258. 43, 293, 45, -1, -1, -1, -1, -1, -1, -1,
  1259. -1, -1, -1, 305, -1, -1, -1, -1, -1, -1,
  1260. -1, -1, -1, -1, -1, 257, 258, 259, -1, 261,
  1261. 262, 263, 264, 265, 266, 267, -1, -1, -1, -1,
  1262. -1, -1, -1, 275, 276, -1, -1, -1, -1, 281,
  1263. 282, 283, 40, 285, 286, 43, -1, 45, 290, -1,
  1264. -1, 293, -1, -1, -1, -1, -1, -1, -1, -1,
  1265. -1, -1, -1, 305, -1, -1, -1, -1, -1, -1,
  1266. 257, -1, 259, -1, -1, -1, -1, -1, -1, -1,
  1267. -1, -1, -1, -1, -1, -1, -1, -1, 275, 276,
  1268. -1, -1, -1, -1, 281, 282, 283, 40, 285, 286,
  1269. 43, -1, 45, 290, -1, -1, 293, -1, -1, 257,
  1270. -1, 259, -1, -1, 275, 276, -1, -1, 305, -1,
  1271. 281, 282, 283, -1, 285, 286, -1, 275, 276, 290,
  1272. -1, -1, 293, 281, 282, 283, 257, 285, 286, -1,
  1273. -1, -1, 290, -1, 305, 293, -1, -1, 40, 257,
  1274. -1, 43, -1, 45, 275, 276, -1, 305, -1, -1,
  1275. 281, 282, 283, -1, 285, 286, -1, 275, 276, 290,
  1276. -1, -1, 293, 281, 282, 283, -1, 285, 286, -1,
  1277. -1, -1, 290, -1, 305, 293, -1, -1, -1, -1,
  1278. -1, -1, -1, -1, -1, -1, -1, 305, -1, -1,
  1279. -1, -1, -1, -1, 257, 258, 259, 260, 261, 262,
  1280. 263, 264, 265, 266, 267, 268, 269, 270, 271, 272,
  1281. 273, 274, -1, -1, -1, 278, 279, 280, -1, -1,
  1282. -1, 284, -1, -1, 287, 288, 289, 290, 291, 292,
  1283. -1, 294, -1, 296, -1, -1, 299, 300, 301, 302,
  1284. 303, 304, 40, 306, 307, 43, -1, 45, -1, 257,
  1285. 258, 259, 260, 261, 262, 263, 264, 265, 266, 267,
  1286. 268, 269, 270, 271, 272, 273, 274, -1, -1, -1,
  1287. 278, 279, 280, -1, -1, -1, 284, -1, -1, 287,
  1288. 288, 289, 290, 291, 292, -1, 294, -1, 296, -1,
  1289. -1, 299, 300, 301, 302, 303, 304, 40, 306, 307,
  1290. 43, -1, 45, -1, 257, 258, 259, 260, 261, 262,
  1291. 263, 264, 265, 266, 267, 268, 269, 270, 271, 272,
  1292. 273, 274, -1, -1, -1, 278, 279, 280, -1, -1,
  1293. -1, 284, -1, -1, 287, 288, 289, -1, -1, 292,
  1294. 293, 294, -1, 296, -1, -1, 299, 300, 301, 302,
  1295. 303, 304, -1, 306, 307, 257, 258, 259, 260, 261,
  1296. 262, 263, 264, 265, 266, 267, 268, 269, 270, 271,
  1297. 272, 273, 274, -1, -1, -1, 278, 279, 280, -1,
  1298. -1, -1, 284, -1, -1, 287, 288, 289, 40, 41,
  1299. 292, 43, 294, 45, 296, -1, -1, 299, 300, 301,
  1300. 302, 303, 304, -1, 306, 307, -1, -1, -1, -1,
  1301. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  1302. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  1303. -1, -1, -1, -1, -1, -1, -1, -1, -1, 40,
  1304. -1, -1, 43, -1, 45, -1, -1, -1, -1, -1,
  1305. -1, -1, -1, -1, -1, -1, -1, -1, -1, 257,
  1306. 258, 259, 260, 261, 262, 263, 264, 265, 266, 267,
  1307. 268, 269, 270, 271, 272, 273, 274, -1, -1, -1,
  1308. 278, -1, -1, -1, -1, -1, 284, -1, -1, 287,
  1309. 288, 289, 40, -1, 292, 43, 294, 45, 296, -1,
  1310. -1, 299, 300, 301, 302, 303, 304, -1, -1, 307,
  1311. -1, -1, -1, -1, 257, 258, 259, 260, 261, 262,
  1312. 263, 264, 265, 266, 267, 268, 269, 270, 271, 272,
  1313. 273, 274, -1, -1, -1, 278, -1, -1, -1, -1,
  1314. -1, 284, -1, -1, 287, 288, 289, 40, -1, 292,
  1315. 43, 294, 45, 296, -1, -1, 299, 300, 301, 302,
  1316. 303, 304, -1, -1, 307, -1, -1, -1, -1, -1,
  1317. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  1318. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  1319. -1, -1, -1, -1, -1, -1, -1, -1, 40, -1,
  1320. -1, 43, -1, 45, -1, 257, 258, 259, 260, 261,
  1321. 262, 263, 264, 265, 266, 267, 268, 269, 270, 271,
  1322. 272, 273, 274, -1, -1, -1, 278, -1, -1, -1,
  1323. -1, -1, 284, -1, -1, 287, 288, 289, -1, -1,
  1324. 292, -1, 294, -1, 296, -1, -1, 299, 300, 301,
  1325. 302, 303, 304, -1, -1, 307, 257, 258, 259, 260,
  1326. 261, 262, 263, 264, 265, 266, 267, 268, 269, 270,
  1327. 271, 272, 273, 274, -1, 40, -1, 278, 43, -1,
  1328. 45, -1, -1, 284, -1, -1, 287, 288, 289, -1,
  1329. -1, 292, -1, 294, -1, 296, -1, -1, 299, 300,
  1330. 301, 302, 303, 304, -1, -1, 307, -1, -1, 257,
  1331. 258, 259, 260, 261, 262, 263, 264, 265, 266, 267,
  1332. 268, 269, 270, 271, 272, 273, 274, 36, -1, -1,
  1333. 278, -1, 41, -1, -1, 44, 284, -1, -1, 287,
  1334. 288, 289, -1, -1, 292, -1, 294, -1, 296, 58,
  1335. 59, 299, 300, 301, 302, 303, 304, -1, -1, 307,
  1336. -1, -1, -1, -1, 257, 258, 259, 260, 261, 262,
  1337. 263, 264, 265, 266, 267, 268, 269, 270, 271, 272,
  1338. 273, 274, 36, -1, 93, 278, -1, 41, -1, -1,
  1339. 44, 284, -1, -1, 287, 288, 289, -1, -1, 292,
  1340. -1, 294, -1, 296, 58, 59, 299, 300, 301, 302,
  1341. 303, 304, -1, -1, 307, 257, 258, 259, 260, 261,
  1342. 262, 263, 264, 265, 266, 267, 268, 269, 270, 271,
  1343. 272, 273, 274, -1, -1, -1, 278, -1, -1, 93,
  1344. -1, -1, 284, -1, -1, 287, 288, 289, -1, -1,
  1345. 292, -1, 294, -1, 296, -1, -1, 299, 300, 301,
  1346. 302, 303, 304, -1, 40, 307, 42, 43, 36, 45,
  1347. 46, 47, -1, 41, -1, -1, -1, -1, -1, -1,
  1348. -1, -1, -1, -1, 60, 61, 62, -1, -1, -1,
  1349. 58, 59, 257, 258, 259, 260, 261, 262, 263, 264,
  1350. 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
  1351. -1, -1, -1, 278, -1, -1, -1, -1, 94, 284,
  1352. -1, -1, 287, 288, 289, 93, -1, 292, -1, 294,
  1353. -1, 296, -1, -1, 299, 300, 301, 302, 303, 304,
  1354. 36, -1, 307, -1, -1, 41, -1, -1, 44, -1,
  1355. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  1356. -1, -1, 58, 59, -1, -1, 275, 276, -1, -1,
  1357. -1, -1, 281, 282, 283, -1, 285, 286, -1, -1,
  1358. -1, 290, -1, -1, 293, -1, -1, -1, -1, -1,
  1359. -1, -1, -1, -1, -1, -1, -1, 93, -1, -1,
  1360. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  1361. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  1362. -1, 275, 276, -1, -1, -1, -1, 281, 282, 283,
  1363. -1, 285, 286, -1, -1, -1, 290, -1, -1, 293,
  1364. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  1365. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  1366. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  1367. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  1368. -1, 257, 258, 259, -1, 261, 262, 263, 264, 265,
  1369. 266, 267, -1, -1, -1, -1, -1, -1, -1, -1,
  1370. -1, -1, -1, -1, -1, -1, -1, 275, 276, -1,
  1371. -1, -1, -1, 281, 282, 283, -1, 285, 286, -1,
  1372. -1, -1, 290, -1, 300, 293, -1, -1, -1, -1,
  1373. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  1374. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  1375. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  1376. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  1377. -1, -1, -1, -1, -1, -1, -1, -1, -1, 275,
  1378. 276, -1, -1, -1, -1, 281, 282, 283, -1, 285,
  1379. -1, -1, -1, -1, 290, -1, -1, 293,
  1380. };
  1381. #define YYFINAL 42
  1382. #ifndef YYDEBUG
  1383. #define YYDEBUG 0
  1384. #endif
  1385. #define YYMAXTOKEN 311
  1386. #if YYDEBUG
  1387. static YYCONST char *YYCONST yyname[] = {
  1388. "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,
  1389. 0,0,"'$'",0,0,0,"'('","')'","'*'","'+'","','","'-'","'.'","'/'",0,0,0,0,0,0,0,0,
  1390. 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,
  1391. 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,
  1392. 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,
  1393. 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,
  1394. 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,
  1395. 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"SETQ","AND","OR","NOT","MEMBER","MEMQ","NEQ",
  1396. "EQ","GEQ","LEQ","FREEOF","SYMBOLIC","ALGEBRAIC","EXPR","MACRO","SMACRO",
  1397. "PROCEDURE","FOR","STEP","UNTIL","EACH","FOREACH","IN","ON","DO","COLLECT",
  1398. "SUM","IF","THEN","ELSE","REPEAT","WHILE","BEGIN","END","ENDFILE","LSECT",
  1399. "RSECT","GO","TO","GOTO","SCALAR","INTEGER","LAMBDA","SYMBOL","NUMBER","STRING",
  1400. "LIST","RETURN","WHERE","RLISTAT","ENDSTAT","HASHIF","HASHELSE","HASHELIF",
  1401. "HASHENDIF",
  1402. };
  1403. static YYCONST char *YYCONST yyrule[] = {
  1404. "$accept : wholefile",
  1405. "wholefile : ENDFILE",
  1406. "wholefile : command wholefile",
  1407. "command : cmnd sep",
  1408. "command : proc_type sep",
  1409. "command : END",
  1410. "command : END sep",
  1411. "sep : ';'",
  1412. "sep : '$'",
  1413. "proc_type : SYMBOLIC",
  1414. "proc_type : ALGEBRAIC",
  1415. "proc_qual : EXPR",
  1416. "proc_qual : MACRO",
  1417. "proc_qual : SMACRO",
  1418. "sym_list : ')'",
  1419. "sym_list : ',' SYMBOL sym_list",
  1420. "infix : SETQ",
  1421. "infix : OR",
  1422. "infix : AND",
  1423. "infix : MEMBER",
  1424. "infix : MEMQ",
  1425. "infix : '='",
  1426. "infix : NEQ",
  1427. "infix : EQ",
  1428. "infix : GEQ",
  1429. "infix : '>'",
  1430. "infix : LEQ",
  1431. "infix : '<'",
  1432. "infix : FREEOF",
  1433. "infix : '+'",
  1434. "infix : '-'",
  1435. "infix : '*'",
  1436. "infix : '/'",
  1437. "infix : '^'",
  1438. "infix : '.'",
  1439. "prefix : NOT",
  1440. "prefix : '+'",
  1441. "prefix : '-'",
  1442. "proc_head : SYMBOL",
  1443. "proc_head : SYMBOL SYMBOL",
  1444. "proc_head : SYMBOL '(' ')'",
  1445. "proc_head : SYMBOL '(' SYMBOL sym_list",
  1446. "proc_head : prefix SYMBOL",
  1447. "proc_head : SYMBOL infix SYMBOL",
  1448. "proc_def : PROCEDURE proc_head sep cmnd",
  1449. "proc_def : proc_type PROCEDURE proc_head sep cmnd",
  1450. "proc_def : proc_qual PROCEDURE proc_head sep cmnd",
  1451. "proc_def : proc_type proc_qual PROCEDURE proc_head sep cmnd",
  1452. "rlistat : RLISTAT",
  1453. "rlistat : IN",
  1454. "rlistat : ON",
  1455. "rltail : expr",
  1456. "rltail : expr ',' rltail",
  1457. "cmnd : expr",
  1458. "cmnd : rlistat rltail",
  1459. "if_stmt : IF expr THEN cmnd ELSE cmnd",
  1460. "if_stmt : IF expr THEN cmnd",
  1461. "for_update : ':' expr",
  1462. "for_update : STEP expr UNTIL expr",
  1463. "for_action : DO",
  1464. "for_action : SUM",
  1465. "for_action : COLLECT",
  1466. "for_inon : IN",
  1467. "for_inon : ON",
  1468. "for_stmt : FOR SYMBOL SETQ expr for_update for_action cmnd",
  1469. "for_stmt : FOR EACH SYMBOL for_inon expr for_action cmnd",
  1470. "for_stmt : FOREACH SYMBOL for_inon expr for_action cmnd",
  1471. "while_stmt : WHILE expr DO cmnd",
  1472. "repeat_stmt : REPEAT cmnd UNTIL expr",
  1473. "return_stmt : RETURN",
  1474. "return_stmt : RETURN expr",
  1475. "goto_stmt : GOTO SYMBOL",
  1476. "goto_stmt : GO SYMBOL",
  1477. "goto_stmt : GO TO SYMBOL",
  1478. "group_tail : RSECT",
  1479. "group_tail : sep RSECT",
  1480. "group_tail : sep cmnd group_tail",
  1481. "group_expr : LSECT cmnd group_tail",
  1482. "scalar_tail : sep",
  1483. "scalar_tail : ',' SYMBOL scalar_tail",
  1484. "scalar_tail : ',' INTEGER scalar_tail",
  1485. "scalar_def : SCALAR SYMBOL scalar_tail",
  1486. "scalar_def : INTEGER SYMBOL scalar_tail",
  1487. "scalar_defs : scalar_def",
  1488. "scalar_defs : scalar_defs scalar_def",
  1489. "block_tail : END",
  1490. "block_tail : cmnd END",
  1491. "block_tail : SYMBOL ':' block_tail",
  1492. "block_tail : cmnd sep block_tail",
  1493. "block_tail : sep block_tail",
  1494. "block_expr : BEGIN scalar_defs block_tail",
  1495. "block_expr : BEGIN block_tail",
  1496. "lambda_vars : sep",
  1497. "lambda_vars : ',' SYMBOL lambda_vars",
  1498. "lambda_expr : LAMBDA SYMBOL lambda_vars cmnd",
  1499. "lambda_expr : LAMBDA '(' ')' sep cmnd",
  1500. "lambda_expr : LAMBDA '(' SYMBOL sym_list sep cmnd",
  1501. "expr : rx0",
  1502. "expr : lx0",
  1503. "rx0 : lx0 WHERE SYMBOL '=' rx1",
  1504. "rx0 : rx1",
  1505. "lx0 : lx0 WHERE SYMBOL '=' lx1",
  1506. "lx0 : lx1",
  1507. "rx1 : lx2 SETQ rx1",
  1508. "rx1 : rx2",
  1509. "lx1 : lx2 SETQ lx1",
  1510. "lx1 : lx2",
  1511. "rx2tail : rx3",
  1512. "rx2tail : lx3 OR rx2tail",
  1513. "rx2 : lx3 OR rx2tail",
  1514. "rx2 : rx3",
  1515. "lx2tail : lx3",
  1516. "lx2tail : lx3 OR lx2tail",
  1517. "lx2 : lx3 OR lx2tail",
  1518. "lx2 : lx3",
  1519. "rx3tail : rx4",
  1520. "rx3tail : lx4 AND rx3tail",
  1521. "rx3 : lx4 AND rx3tail",
  1522. "rx3 : rx4",
  1523. "lx3tail : lx4",
  1524. "lx3tail : lx4 AND lx3tail",
  1525. "lx3 : lx4 AND lx3tail",
  1526. "lx3 : lx4",
  1527. "rx4 : NOT rx4",
  1528. "rx4 : rx5",
  1529. "lx4 : NOT lx4",
  1530. "lx4 : lx5",
  1531. "rx5 : lx6 MEMBER ry6",
  1532. "rx5 : lx6 MEMQ ry6",
  1533. "rx5 : lx6 '=' ry6",
  1534. "rx5 : lx6 NEQ ry6",
  1535. "rx5 : lx6 EQ ry6",
  1536. "rx5 : lx6 GEQ ry6",
  1537. "rx5 : lx6 '>' ry6",
  1538. "rx5 : lx6 LEQ ry6",
  1539. "rx5 : lx6 '<' ry6",
  1540. "rx5 : lx6 FREEOF ry6",
  1541. "rx5 : rx6",
  1542. "lx5 : lx6 MEMBER ly6",
  1543. "lx5 : lx6 MEMQ ly6",
  1544. "lx5 : lx6 '=' ly6",
  1545. "lx5 : lx6 NEQ ly6",
  1546. "lx5 : lx6 EQ ly6",
  1547. "lx5 : lx6 GEQ ly6",
  1548. "lx5 : lx6 '>' ly6",
  1549. "lx5 : lx6 LEQ ly6",
  1550. "lx5 : lx6 '<' ly6",
  1551. "lx5 : lx6 FREEOF ly6",
  1552. "lx5 : lx6",
  1553. "ry6 : NOT ry6",
  1554. "ry6 : rx6",
  1555. "ly6 : NOT ly6",
  1556. "ly6 : lx6",
  1557. "rx6tail : ry6a",
  1558. "rx6tail : ly6a '+' rx6tail",
  1559. "rx6 : lx6a '+' rx6tail",
  1560. "rx6 : rx6a",
  1561. "lx6tail : ly6a",
  1562. "lx6tail : ly6a '+' lx6tail",
  1563. "lx6 : lx6a '+' lx6tail",
  1564. "lx6 : lx6a",
  1565. "ry6a : NOT ry6a",
  1566. "ry6a : rx6a",
  1567. "rx6a : lx6a '-' ry7",
  1568. "rx6a : rx7",
  1569. "ly6a : NOT ly6a",
  1570. "ly6a : lx6a",
  1571. "lx6a : lx6a '-' ly7",
  1572. "lx6a : lx7",
  1573. "ry7 : NOT ry7",
  1574. "ry7 : rx7",
  1575. "rx7 : '+' ry7",
  1576. "rx7 : '-' ry7",
  1577. "rx7 : rx8",
  1578. "ly7 : NOT ly7",
  1579. "ly7 : lx7",
  1580. "lx7 : '+' ly7",
  1581. "lx7 : '-' ly7",
  1582. "lx7 : lx8",
  1583. "rx8tail : ry9",
  1584. "rx8tail : ly9 '*' rx8tail",
  1585. "rx8 : lx9 '*' rx8tail",
  1586. "rx8 : rx9",
  1587. "lx8tail : ly9",
  1588. "lx8tail : ly9 '*' lx8tail",
  1589. "lx8 : lx9 '*' lx8tail",
  1590. "lx8 : lx9",
  1591. "ry9 : NOT ry9",
  1592. "ry9 : '+' ry9",
  1593. "ry9 : '-' ry9",
  1594. "ry9 : rx9",
  1595. "rx9 : lx9 '/' ry10",
  1596. "rx9 : rx10",
  1597. "ly9 : NOT ly9",
  1598. "ly9 : '+' ly9",
  1599. "ly9 : '-' ly9",
  1600. "ly9 : lx9",
  1601. "lx9 : lx9 '/' ly10",
  1602. "lx9 : lx10",
  1603. "ly10 : NOT ly10",
  1604. "ly10 : '+' ly10",
  1605. "ly10 : '-' ly10",
  1606. "ly10 : lx10",
  1607. "lx10 : lx11 '^' ly10",
  1608. "lx10 : lx11",
  1609. "ry10 : NOT ry10",
  1610. "ry10 : '+' ry10",
  1611. "ry10 : '-' ry10",
  1612. "ry10 : rx10",
  1613. "rx10 : lx11 '^' ry10",
  1614. "rx10 : rx11",
  1615. "ry11 : NOT ry11",
  1616. "ry11 : '+' ry11",
  1617. "ry11 : '-' ry11",
  1618. "ry11 : rx11",
  1619. "rx11 : x12 '.' ry11",
  1620. "rx11 : if_stmt",
  1621. "rx11 : for_stmt",
  1622. "rx11 : while_stmt",
  1623. "rx11 : repeat_stmt",
  1624. "rx11 : return_stmt",
  1625. "rx11 : goto_stmt",
  1626. "rx11 : lambda_expr",
  1627. "rx11 : proc_def",
  1628. "rx11 : ENDSTAT",
  1629. "ly11 : NOT ly11",
  1630. "ly11 : '+' ly11",
  1631. "ly11 : '-' ly11",
  1632. "ly11 : lx11",
  1633. "lx11 : x12 '.' ly11",
  1634. "lx11 : x12",
  1635. "arg_list : ')'",
  1636. "arg_list : ',' expr arg_list",
  1637. "parened : '(' expr ')'",
  1638. "commaparened : '(' expr ',' expr arg_list",
  1639. "x12notparened : x13b '[' expr ']'",
  1640. "x12notparened : x13b '(' ')'",
  1641. "x12notparened : x13b parened",
  1642. "x12notparened : x13b commaparened",
  1643. "x12notparened : x13b x12notparened",
  1644. "x12notparened : x13b",
  1645. "x12 : x12notparened",
  1646. "x12 : parened",
  1647. "x12 : SETQ commaparened",
  1648. "x12 : OR commaparened",
  1649. "x12 : AND commaparened",
  1650. "x12 : MEMBER commaparened",
  1651. "x12 : MEMQ commaparened",
  1652. "x12 : NEQ commaparened",
  1653. "x12 : EQ commaparened",
  1654. "x12 : GEQ commaparened",
  1655. "x12 : LEQ commaparened",
  1656. "x12 : FREEOF commaparened",
  1657. "x13b : SYMBOL",
  1658. "x13b : NUMBER",
  1659. "x13b : STRING",
  1660. "x13b : LIST",
  1661. "x13b : group_expr",
  1662. "x13b : block_expr",
  1663. };
  1664. #endif
  1665. #ifndef YYSTYPE
  1666. typedef int YYSTYPE;
  1667. #endif
  1668. #define YYLEX yylex()
  1669. #define YYEMPTY -1
  1670. #define yyclearin (yychar=(YYEMPTY))
  1671. #define yyerrok (yyerrflag=0)
  1672. #ifndef YYINITDEPTH
  1673. #define YYINITDEPTH 200
  1674. #endif
  1675. #ifdef YYSTACKSIZE
  1676. #ifndef YYMAXDEPTH
  1677. #define YYMAXDEPTH YYSTACKSIZE
  1678. #endif
  1679. #else
  1680. #ifdef YYMAXDEPTH
  1681. #define YYSTACKSIZE YYMAXDEPTH
  1682. #else
  1683. #define YYSTACKSIZE 500
  1684. #define YYMAXDEPTH 500
  1685. #endif
  1686. #endif
  1687. #ifndef YYMAXSTACKSIZE
  1688. #define YYMAXSTACKSIZE 10000
  1689. #endif
  1690. int yydebug;
  1691. int yynerrs;
  1692. int yyerrflag;
  1693. int yychar;
  1694. YYSTYPE yyval;
  1695. YYSTYPE yylval;
  1696. static short *yyss;
  1697. static YYSTYPE *yyvs;
  1698. static int yystacksize;
  1699. #define yyfree(x) free(x)
  1700. extern int yylex();
  1701. static YYPTR
  1702. YYDEFUN (yymalloc, (bytes), unsigned bytes)
  1703. {
  1704. YYPTR ptr = (YYPTR) malloc (bytes);
  1705. if (ptr != 0) return (ptr);
  1706. yyerror ("yyparse: memory exhausted");
  1707. return (0);
  1708. }
  1709. static YYPTR
  1710. YYDEFUN (yyrealloc, (old, bytes), YYPTR old YYAND unsigned bytes)
  1711. {
  1712. YYPTR ptr = (YYPTR) realloc (old, bytes);
  1713. if (ptr != 0) return (ptr);
  1714. yyerror ("yyparse: memory exhausted");
  1715. return (0);
  1716. }
  1717. static int
  1718. #ifdef __GNUC__
  1719. __inline__
  1720. #endif
  1721. yygrow ()
  1722. {
  1723. int old_stacksize = yystacksize;
  1724. short *new_yyss;
  1725. YYSTYPE *new_yyvs;
  1726. if (yystacksize == YYMAXSTACKSIZE)
  1727. return (1);
  1728. yystacksize += (yystacksize + 1 ) / 2;
  1729. if (yystacksize > YYMAXSTACKSIZE)
  1730. yystacksize = YYMAXSTACKSIZE;
  1731. #if YYDEBUG
  1732. if (yydebug)
  1733. printf("yydebug: growing stack size from %d to %d\n",
  1734. old_stacksize, yystacksize);
  1735. #endif
  1736. new_yyss = (short *) yyrealloc ((char *)yyss, yystacksize * sizeof (short));
  1737. if (new_yyss == 0)
  1738. return (1);
  1739. new_yyvs = (YYSTYPE *) yyrealloc ((char *)yyvs, yystacksize * sizeof (YYSTYPE));
  1740. if (new_yyvs == 0)
  1741. {
  1742. yyfree (new_yyss);
  1743. return (1);
  1744. }
  1745. yyss = new_yyss;
  1746. yyvs = new_yyvs;
  1747. return (0);
  1748. }
  1749. #line 1287 "r2l.y"
  1750. static keyword_code operators[] =
  1751. {
  1752. {"plus", -1},
  1753. {"minus", -1},
  1754. {"getv", -1},
  1755. {"difference", -1},
  1756. {"times", -1},
  1757. {"quotient", -1},
  1758. {"expt", -1},
  1759. {"cons", -1},
  1760. {"list", -1},
  1761. {"progn", -1},
  1762. {"prog", -1},
  1763. {"de", -1},
  1764. {"dm", -1},
  1765. {"ds", -1},
  1766. {"greaterp", -1},
  1767. {"lessp", -1},
  1768. {"equal", -1},
  1769. {"setq", SETQ},
  1770. {"and", AND},
  1771. {"or", OR},
  1772. {"not", NOT},
  1773. {"member", MEMBER},
  1774. {"memq", MEMQ},
  1775. {"neq", NEQ},
  1776. {"eq", EQ},
  1777. {"geq", GEQ},
  1778. {"leq", LEQ},
  1779. {"freeof", FREEOF},
  1780. {"symbolic", SYMBOLIC},
  1781. {"algebraic", ALGEBRAIC},
  1782. {"expr", EXPR},
  1783. {"macro", MACRO},
  1784. {"smacro", SMACRO},
  1785. {"procedure", PROCEDURE},
  1786. {"for", FOR},
  1787. {"step", STEP},
  1788. {"until", UNTIL},
  1789. {"each", EACH},
  1790. {"foreach", FOREACH},
  1791. {"in", IN},
  1792. {"on", ON},
  1793. {"do", DO},
  1794. {"collect", COLLECT},
  1795. {"sum", SUM},
  1796. {"if", IF},
  1797. {"then", THEN},
  1798. {"else", ELSE},
  1799. {"repeat", REPEAT},
  1800. {"while", WHILE},
  1801. {"begin", BEGIN},
  1802. {"end", END},
  1803. {":lsect", LSECT},
  1804. {":rsect", RSECT},
  1805. {"go", GO},
  1806. {"to", TO},
  1807. {"goto", GOTO},
  1808. {"scalar", SCALAR},
  1809. {"integer", INTEGER},
  1810. {"lambda", LAMBDA},
  1811. {":symbol", SYMBOL},
  1812. {":number", NUMBER},
  1813. {":string", STRING},
  1814. {":list", LIST},
  1815. {"return", RETURN},
  1816. {"where", WHERE},
  1817. {"rlistat", RLISTAT},
  1818. {"endstat", ENDSTAT},
  1819. {"!#if", HASHIF},
  1820. {"!#else", HASHELSE},
  1821. {"!#elif", HASHELIF},
  1822. {"!#endif", HASHENDIF},
  1823. {NULL, 0}
  1824. };
  1825. int skipcomment()
  1826. {
  1827. if (ch == '%')
  1828. { while (ch != '\n' && ch != -1) nextch();
  1829. return 1;
  1830. }
  1831. else return 0;
  1832. }
  1833. static int onechar(int c)
  1834. {
  1835. char b[4];
  1836. b[0] = c;
  1837. b[1] = 0;
  1838. return find_symbol(b);
  1839. }
  1840. int lisp_token()
  1841. {
  1842. char buffer[1000];
  1843. int bp = 0, num = 0, r;
  1844. while (isspace(ch) || skipcomment()) nextch();
  1845. num = isdigit(ch);
  1846. while (isalpha(ch) || isdigit(ch) || ch=='_' || ch == '!' ||
  1847. (num && ch == '.'))
  1848. { buffer[bp++] = ch;
  1849. if (ch == '!')
  1850. { buffer[bp++] = nextch();
  1851. }
  1852. nextch();
  1853. }
  1854. buffer[bp] = 0;
  1855. if (bp != 0)
  1856. { yylval = find_symbol((char *)buffer);
  1857. return num ? '0': 'a';
  1858. }
  1859. if (ch == '"')
  1860. { for (;;)
  1861. { buffer[bp++] = ch;
  1862. while (nextch() != '"' && ch != '\n' && ch != EOF)
  1863. buffer[bp++] = ch;
  1864. buffer[bp++] = ch;
  1865. if (nextch() != '"') break;
  1866. }
  1867. buffer[bp] = 0;
  1868. yylval = find_symbol((char *)buffer);
  1869. return '"';
  1870. }
  1871. if (ch == '\'' || ch == '(' || ch == ')' || ch == '.')
  1872. { r = ch;
  1873. nextch();
  1874. return r;
  1875. }
  1876. r = ch;
  1877. nextch();
  1878. return onechar(r);
  1879. }
  1880. static int read_tail();
  1881. /*
  1882. * L -> atom
  1883. * L -> ' L
  1884. * L -> ( T
  1885. * L -> . error
  1886. * L -> ) error
  1887. *
  1888. * T -> )
  1889. * T -> . L )
  1890. * T -> L T
  1891. *
  1892. */
  1893. static int read_list(int r)
  1894. {
  1895. switch (r)
  1896. {
  1897. case '(': return read_tail();
  1898. case '.':
  1899. case ')': return C_nil; /* errors! */
  1900. case '\'':
  1901. return list2(find_symbol("quote"), read_list(lisp_token()));
  1902. default:
  1903. return yylval;
  1904. }
  1905. }
  1906. int read_tail()
  1907. {
  1908. int r;
  1909. switch (r = lisp_token())
  1910. {
  1911. case ')': return C_nil;
  1912. case '.': r = read_list(lisp_token());
  1913. if (lisp_token() != ')') fprintf(stderr, "\nBad syntax after '.'\n");
  1914. return r;
  1915. case '\'':
  1916. r = list2(find_symbol("quote"), read_list(lisp_token()));
  1917. return cons(r, read_tail());
  1918. case '(': r = read_list(r);
  1919. return cons(r, read_tail());
  1920. default: r = yylval;
  1921. return cons(r, read_tail());
  1922. }
  1923. }
  1924. static int skipping = 0;
  1925. static int genuine_yylex();
  1926. static int evaluates_to_true(int r)
  1927. {
  1928. int fn, arg;
  1929. char *s, *v;
  1930. if (r == C_nil) return 0;
  1931. else if (atom(r))
  1932. { s = (char *)r;
  1933. v = lookup_name(s-1);
  1934. if (v == NULL) return 0;
  1935. else return 1;
  1936. }
  1937. fn = qcar(r);
  1938. r = qcdr(r);
  1939. if (fn == C_nil || !atom(fn)) return 0;
  1940. s = (char *)fn;
  1941. if (strcmp(s-1, "and") == 0)
  1942. { while (r != C_nil && !atom(r))
  1943. { arg = qcar(r);
  1944. r = qcdr(r);
  1945. if (!evaluates_to_true(arg)) return 0;
  1946. }
  1947. return 1;
  1948. }
  1949. else if (strcmp(s-1, "or") == 0)
  1950. { while (r != C_nil && !atom(r))
  1951. { arg = qcar(r);
  1952. r = qcdr(r);
  1953. if (evaluates_to_true(arg)) return 1;
  1954. }
  1955. return 0;
  1956. }
  1957. else if (strcmp(s-1, "not") == 0)
  1958. return !evaluates_to_true(qcar(r));
  1959. else return 0; /* junk treated as false! */
  1960. }
  1961. static void skip_tokens()
  1962. {
  1963. int r;
  1964. skipping = 1;
  1965. for (;;)
  1966. { r = genuine_yylex();
  1967. switch (r)
  1968. {
  1969. case HASHIF:
  1970. skipping++;
  1971. continue;
  1972. case HASHELSE:
  1973. if (skipping == 1)
  1974. { skipping = 0;
  1975. return;
  1976. }
  1977. else continue;
  1978. case HASHELIF:
  1979. if (skipping == 1)
  1980. { skipping = 0;
  1981. r = read_list(lisp_token());
  1982. if (evaluates_to_true(r)) return;
  1983. skipping = 1;
  1984. continue;
  1985. }
  1986. else continue;
  1987. case HASHENDIF:
  1988. skipping--;
  1989. if (skipping == 0) return;
  1990. else continue;
  1991. default:continue;
  1992. }
  1993. }
  1994. }
  1995. static int genuine_yylex()
  1996. {
  1997. char buffer[1000];
  1998. int bp, num, r;
  1999. restart_lex:
  2000. bp = 0;
  2001. num = 0;
  2002. while (isspace(ch) || skipcomment()) nextch();
  2003. if (ch == -1)
  2004. { if (skipping)
  2005. { printf("\n+++ EOF while within !#if\n");
  2006. exit(1);
  2007. }
  2008. return ENDFILE;
  2009. }
  2010. num = isdigit(ch);
  2011. while (isalpha(ch) || isdigit(ch) || ch=='_' || ch == '!' ||
  2012. (num && ch == '.'))
  2013. { buffer[bp++] = ch;
  2014. if (ch == '!')
  2015. { buffer[bp++] = nextch();
  2016. }
  2017. nextch();
  2018. }
  2019. buffer[bp] = 0;
  2020. if (bp != 0)
  2021. { int k;
  2022. for (k=0;;k++)
  2023. { char *n = operators[k].name;
  2024. int v = operators[k].code;
  2025. if (n == NULL) break;
  2026. if (v < 0) continue;
  2027. if (strcmp(n, buffer) == 0)
  2028. {
  2029. switch (v)
  2030. {
  2031. case HASHIF:
  2032. if (skipping != 0) return v;
  2033. r = read_list(lisp_token());
  2034. if (!evaluates_to_true(r)) skip_tokens();
  2035. goto restart_lex;
  2036. case HASHELSE:
  2037. case HASHELIF:
  2038. if (skipping != 0) return v;
  2039. skip_tokens();
  2040. goto restart_lex;
  2041. case HASHENDIF:
  2042. if (skipping != 0) return v;
  2043. else goto restart_lex; /* Ignore it! */
  2044. default:break;
  2045. }
  2046. return v;
  2047. }
  2048. }
  2049. yylval = find_symbol((char *)buffer);
  2050. return num ? NUMBER : SYMBOL;
  2051. }
  2052. if (ch == '"')
  2053. { for (;;)
  2054. { buffer[bp++] = ch;
  2055. while (nextch() != '"' && ch != EOF && ch != '\n')
  2056. buffer[bp++] = ch;
  2057. buffer[bp++] = ch;
  2058. if (nextch() != '"') break;
  2059. }
  2060. buffer[bp] = 0;
  2061. yylval = find_symbol((char *)buffer);
  2062. return STRING;
  2063. }
  2064. if (ch == '\'')
  2065. { nextch();
  2066. r = read_list(lisp_token());
  2067. yylval = list2(find_symbol("quote"), r);
  2068. return LIST;
  2069. }
  2070. r = ch;
  2071. nextch();
  2072. if (r == ':' && ch == '=') { nextch(); r = SETQ; }
  2073. else if (r == '<' && ch == '=') { nextch(); r = LEQ; }
  2074. else if (r == '>' && ch == '=') { nextch(); r = GEQ; }
  2075. else if (r == '<' && ch == '<') { nextch(); r = LSECT; }
  2076. else if (r == '>' && ch == '>') { nextch(); r = RSECT; }
  2077. return r;
  2078. }
  2079. static int yylex()
  2080. {
  2081. return genuine_yylex();
  2082. }
  2083. /* end of file */
  2084. #line 2175 "r2l.c"
  2085. #define YYABORT goto yyabort
  2086. #define YYACCEPT goto yyaccept
  2087. #define YYERROR goto yyerrlab
  2088. #if YYDEBUG
  2089. #ifdef __cplusplus
  2090. extern "C" char *getenv();
  2091. #else
  2092. extern char *getenv();
  2093. #endif
  2094. #endif
  2095. int
  2096. yyparse()
  2097. {
  2098. register int yym, yyn, yystate;
  2099. register YYSTYPE *yyvsp;
  2100. register short *yyssp;
  2101. short *yysse;
  2102. #if YYDEBUG
  2103. register YYCONST char *yys;
  2104. if (yys = getenv("YYDEBUG"))
  2105. {
  2106. yyn = *yys;
  2107. if (yyn >= '0' && yyn <= '9')
  2108. yydebug = yyn - '0';
  2109. }
  2110. #endif
  2111. yynerrs = 0;
  2112. yyerrflag = 0;
  2113. yychar = (-1);
  2114. if (yyss == 0)
  2115. {
  2116. yyss = (short *) yymalloc (YYSTACKSIZE * sizeof (short));
  2117. if (yyss == 0)
  2118. goto yyabort;
  2119. yyvs = (YYSTYPE *) yymalloc (YYSTACKSIZE * sizeof (YYSTYPE));
  2120. if (yyvs == 0)
  2121. {
  2122. yyfree (yyss);
  2123. goto yyabort;
  2124. }
  2125. yystacksize = YYSTACKSIZE;
  2126. }
  2127. yysse = yyss + yystacksize - 1;
  2128. yyssp = yyss;
  2129. yyvsp = yyvs;
  2130. *yyssp = yystate = 0;
  2131. goto yyloop;
  2132. yypush_lex:
  2133. yyval = yylval;
  2134. yystate = yytable[yyn];
  2135. yypush:
  2136. if (yyssp >= yysse)
  2137. {
  2138. int depth = yyssp - yyss;
  2139. if (yygrow() != 0)
  2140. goto yyoverflow;
  2141. yysse = yyss + yystacksize -1;
  2142. yyssp = depth + yyss;
  2143. yyvsp = depth + yyvs;
  2144. }
  2145. *++yyssp = yystate;
  2146. *++yyvsp = yyval;
  2147. yyloop:
  2148. if (yyn = yydefred[yystate]) goto yyreduce;
  2149. yyn = yysindex[yystate];
  2150. if (yychar < 0)
  2151. {
  2152. if ((yychar = yylex()) < 0) yychar = 0;
  2153. #if YYDEBUG
  2154. if (yydebug)
  2155. {
  2156. yys = 0;
  2157. if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
  2158. if (!yys) yys = "illegal-symbol";
  2159. printf("yydebug: state %d, reading %d (%s)\n", yystate,
  2160. yychar, yys);
  2161. }
  2162. #endif
  2163. }
  2164. if (yyn != 0
  2165. && ((yyn += yychar), ((unsigned)yyn <= (unsigned)YYTABLESIZE))
  2166. && yycheck[yyn] == yychar)
  2167. {
  2168. #if YYDEBUG
  2169. if (yydebug)
  2170. printf("yydebug: state %d, shifting to state %d\n",
  2171. yystate, yytable[yyn]);
  2172. #endif
  2173. if (yyerrflag > 0) --yyerrflag;
  2174. yychar = (-1);
  2175. goto yypush_lex;
  2176. }
  2177. yyn = yyrindex[yystate];
  2178. if (yyn != 0
  2179. && ((yyn += yychar), ((unsigned)yyn <= (unsigned)YYTABLESIZE))
  2180. && yycheck[yyn] == yychar)
  2181. {
  2182. yyn = yytable[yyn];
  2183. goto yyreduce;
  2184. }
  2185. if (yyerrflag) goto yyinrecovery;
  2186. #ifdef lint
  2187. goto yynewerror;
  2188. #endif
  2189. yynewerror:
  2190. yyerror("syntax error");
  2191. #ifdef lint
  2192. goto yyerrlab;
  2193. #endif
  2194. yyerrlab:
  2195. ++yynerrs;
  2196. yyinrecovery:
  2197. if (yyerrflag < 3)
  2198. {
  2199. yyerrflag = 3;
  2200. for (;;)
  2201. {
  2202. yyn = yysindex[*yyssp];
  2203. if (yyn != 0
  2204. && ((yyn += YYERRCODE), ((unsigned)yyn <= (unsigned)YYTABLESIZE))
  2205. && yycheck[yyn] == YYERRCODE)
  2206. {
  2207. #if YYDEBUG
  2208. if (yydebug)
  2209. printf("yydebug: state %d, error recovery shifting\
  2210. to state %d\n", *yyssp, yytable[yyn]);
  2211. #endif
  2212. goto yypush_lex;
  2213. }
  2214. else
  2215. {
  2216. #if YYDEBUG
  2217. if (yydebug)
  2218. printf("yydebug: error recovery discarding state %d\n",
  2219. *yyssp);
  2220. #endif
  2221. if (yyssp <= yyss) goto yyabort;
  2222. --yyssp;
  2223. --yyvsp;
  2224. }
  2225. }
  2226. }
  2227. else
  2228. {
  2229. if (yychar == 0) goto yyabort;
  2230. #if YYDEBUG
  2231. if (yydebug)
  2232. {
  2233. yys = 0;
  2234. if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
  2235. if (!yys) yys = "illegal-symbol";
  2236. printf("yydebug: state %d, error recovery discards token %d (%s)\n",
  2237. yystate, yychar, yys);
  2238. }
  2239. #endif
  2240. yychar = (-1);
  2241. goto yyloop;
  2242. }
  2243. yyreduce:
  2244. #if YYDEBUG
  2245. if (yydebug)
  2246. printf("yydebug: state %d, reducing by rule %d (%s)\n",
  2247. yystate, yyn, yyrule[yyn]);
  2248. #endif
  2249. yym = yylen[yyn];
  2250. yyval = yyvsp[1-yym];
  2251. switch (yyn)
  2252. {
  2253. case 1:
  2254. #line 809 "r2l.y"
  2255. {
  2256. if (common) fprintf(outputfile, "\n;; end of file\n");
  2257. else fprintf(outputfile, "\n%% end of file\n");
  2258. exit(0);
  2259. }
  2260. break;
  2261. case 3:
  2262. #line 816 "r2l.y"
  2263. { evalorprint(yyvsp[-1]);
  2264. fprintf(outputfile, "\n\n");
  2265. otlpos = 0;
  2266. heapfringe = 0;
  2267. }
  2268. break;
  2269. case 9:
  2270. #line 830 "r2l.y"
  2271. { yyval = sym_symbolic; }
  2272. break;
  2273. case 10:
  2274. #line 831 "r2l.y"
  2275. { yyval = sym_algebraic; }
  2276. break;
  2277. case 11:
  2278. #line 834 "r2l.y"
  2279. { yyval = sym_de; }
  2280. break;
  2281. case 12:
  2282. #line 835 "r2l.y"
  2283. { yyval = sym_dm; }
  2284. break;
  2285. case 13:
  2286. #line 836 "r2l.y"
  2287. { yyval = sym_ds; }
  2288. break;
  2289. case 14:
  2290. #line 839 "r2l.y"
  2291. { yyval = C_nil; }
  2292. break;
  2293. case 15:
  2294. #line 840 "r2l.y"
  2295. { yyval = cons(yyvsp[-1], yyvsp[0]); }
  2296. break;
  2297. case 16:
  2298. #line 848 "r2l.y"
  2299. { yyval = sym_setq; }
  2300. break;
  2301. case 17:
  2302. #line 849 "r2l.y"
  2303. { yyval = sym_or; }
  2304. break;
  2305. case 18:
  2306. #line 850 "r2l.y"
  2307. { yyval = sym_and; }
  2308. break;
  2309. case 19:
  2310. #line 851 "r2l.y"
  2311. { yyval = sym_member; }
  2312. break;
  2313. case 20:
  2314. #line 852 "r2l.y"
  2315. { yyval = sym_memq; }
  2316. break;
  2317. case 21:
  2318. #line 853 "r2l.y"
  2319. { yyval = sym_equal; }
  2320. break;
  2321. case 22:
  2322. #line 854 "r2l.y"
  2323. { yyval = sym_neq; }
  2324. break;
  2325. case 23:
  2326. #line 855 "r2l.y"
  2327. { yyval = sym_eq; }
  2328. break;
  2329. case 24:
  2330. #line 856 "r2l.y"
  2331. { yyval = sym_geq; }
  2332. break;
  2333. case 25:
  2334. #line 857 "r2l.y"
  2335. { yyval = sym_greaterp; }
  2336. break;
  2337. case 26:
  2338. #line 858 "r2l.y"
  2339. { yyval = sym_leq; }
  2340. break;
  2341. case 27:
  2342. #line 859 "r2l.y"
  2343. { yyval = sym_lessp; }
  2344. break;
  2345. case 28:
  2346. #line 860 "r2l.y"
  2347. { yyval = sym_freeof; }
  2348. break;
  2349. case 29:
  2350. #line 861 "r2l.y"
  2351. { yyval = sym_plus; }
  2352. break;
  2353. case 30:
  2354. #line 862 "r2l.y"
  2355. { yyval = sym_difference; }
  2356. break;
  2357. case 31:
  2358. #line 863 "r2l.y"
  2359. { yyval = sym_times; }
  2360. break;
  2361. case 32:
  2362. #line 864 "r2l.y"
  2363. { yyval = sym_quotient; }
  2364. break;
  2365. case 33:
  2366. #line 865 "r2l.y"
  2367. { yyval = sym_expt; }
  2368. break;
  2369. case 34:
  2370. #line 866 "r2l.y"
  2371. { yyval = sym_cons; }
  2372. break;
  2373. case 35:
  2374. #line 869 "r2l.y"
  2375. { yyval = sym_not; }
  2376. break;
  2377. case 36:
  2378. #line 870 "r2l.y"
  2379. { yyval = sym_plus; }
  2380. break;
  2381. case 37:
  2382. #line 871 "r2l.y"
  2383. { yyval = sym_minus; }
  2384. break;
  2385. case 38:
  2386. #line 874 "r2l.y"
  2387. { yyval = cons(yyvsp[0], C_nil); }
  2388. break;
  2389. case 39:
  2390. #line 875 "r2l.y"
  2391. { yyval = list2(yyvsp[-1], yyvsp[0]); }
  2392. break;
  2393. case 40:
  2394. #line 876 "r2l.y"
  2395. { yyval = cons(yyvsp[-2], C_nil); }
  2396. break;
  2397. case 41:
  2398. #line 878 "r2l.y"
  2399. { yyval = cons(yyvsp[-3], cons(yyvsp[-1], yyvsp[0])); }
  2400. break;
  2401. case 42:
  2402. #line 879 "r2l.y"
  2403. { yyval = list2(yyvsp[-1], yyvsp[0]); }
  2404. break;
  2405. case 43:
  2406. #line 880 "r2l.y"
  2407. { yyval = list3(yyvsp[-1], yyvsp[-2], yyvsp[0]); }
  2408. break;
  2409. case 44:
  2410. #line 884 "r2l.y"
  2411. { yyval = list4(sym_de, qcar(yyvsp[-2]), qcdr(yyvsp[-2]), yyvsp[0]); }
  2412. break;
  2413. case 45:
  2414. #line 886 "r2l.y"
  2415. { yyval = list4(sym_de, qcar(yyvsp[-2]), qcdr(yyvsp[-2]), yyvsp[0]); }
  2416. break;
  2417. case 46:
  2418. #line 888 "r2l.y"
  2419. { yyval = list4(yyvsp[-4], qcar(yyvsp[-2]), qcdr(yyvsp[-2]), yyvsp[0]); }
  2420. break;
  2421. case 47:
  2422. #line 890 "r2l.y"
  2423. { yyval = list4(yyvsp[-4], qcar(yyvsp[-2]), qcdr(yyvsp[-2]), yyvsp[0]); }
  2424. break;
  2425. case 49:
  2426. #line 894 "r2l.y"
  2427. { yyval = sym_in; }
  2428. break;
  2429. case 50:
  2430. #line 895 "r2l.y"
  2431. { yyval = sym_on; }
  2432. break;
  2433. case 51:
  2434. #line 898 "r2l.y"
  2435. { yyval = cons(yyvsp[0], C_nil); }
  2436. break;
  2437. case 52:
  2438. #line 899 "r2l.y"
  2439. { yyval = cons(yyvsp[-2], yyvsp[0]); }
  2440. break;
  2441. case 54:
  2442. #line 908 "r2l.y"
  2443. { yyval = list2(yyvsp[-1], cons(sym_list, yyvsp[0])); }
  2444. break;
  2445. case 55:
  2446. #line 918 "r2l.y"
  2447. { yyval = list4(sym_if, yyvsp[-4], yyvsp[-2], yyvsp[0]); }
  2448. break;
  2449. case 56:
  2450. #line 919 "r2l.y"
  2451. { yyval = list3(sym_if, yyvsp[-2], yyvsp[0]); }
  2452. break;
  2453. case 57:
  2454. #line 922 "r2l.y"
  2455. { yyval = cons(find_symbol("1"), yyvsp[0]); }
  2456. break;
  2457. case 58:
  2458. #line 923 "r2l.y"
  2459. { yyval = cons(yyvsp[-2], yyvsp[0]); }
  2460. break;
  2461. case 59:
  2462. #line 926 "r2l.y"
  2463. { yyval = sym_do; }
  2464. break;
  2465. case 60:
  2466. #line 927 "r2l.y"
  2467. { yyval = sym_sum; }
  2468. break;
  2469. case 61:
  2470. #line 928 "r2l.y"
  2471. { yyval = sym_collect; }
  2472. break;
  2473. case 62:
  2474. #line 931 "r2l.y"
  2475. { yyval = sym_in; }
  2476. break;
  2477. case 63:
  2478. #line 932 "r2l.y"
  2479. { yyval = sym_on; }
  2480. break;
  2481. case 64:
  2482. #line 936 "r2l.y"
  2483. { yyval = make_for(yyvsp[-5], yyvsp[-3], qcar(yyvsp[-2]), qcdr(yyvsp[-2]), yyvsp[-1], yyvsp[0]); }
  2484. break;
  2485. case 65:
  2486. #line 938 "r2l.y"
  2487. { yyval = make_foreach(yyvsp[-4], yyvsp[-3], yyvsp[-2], yyvsp[-1], yyvsp[0]); }
  2488. break;
  2489. case 66:
  2490. #line 940 "r2l.y"
  2491. { yyval = make_foreach(yyvsp[-4], yyvsp[-3], yyvsp[-2], yyvsp[-1], yyvsp[0]); }
  2492. break;
  2493. case 67:
  2494. #line 943 "r2l.y"
  2495. {
  2496. int lab1 = genlabel();
  2497. yyval = list6(sym_prog, C_nil, lab1,
  2498. list3(sym_if, list2(sym_null, yyvsp[-2]), list2(sym_return, C_nil)),
  2499. yyvsp[0],
  2500. list2(sym_go, lab1)); }
  2501. break;
  2502. case 68:
  2503. #line 951 "r2l.y"
  2504. {
  2505. int lab1 = genlabel();
  2506. yyval = list5(sym_prog, C_nil, lab1,
  2507. yyvsp[-2],
  2508. list3(sym_if, list2(sym_null, yyvsp[0]), list2(sym_go, lab1))); }
  2509. break;
  2510. case 69:
  2511. #line 958 "r2l.y"
  2512. { yyval = list2(sym_return, C_nil); }
  2513. break;
  2514. case 70:
  2515. #line 959 "r2l.y"
  2516. { yyval = list2(sym_return, yyvsp[0]); }
  2517. break;
  2518. case 71:
  2519. #line 962 "r2l.y"
  2520. { yyval = list2(sym_go, yyvsp[0]); }
  2521. break;
  2522. case 72:
  2523. #line 963 "r2l.y"
  2524. { yyval = list2(sym_go, yyvsp[0]); }
  2525. break;
  2526. case 73:
  2527. #line 964 "r2l.y"
  2528. { yyval = list2(sym_go, yyvsp[0]); }
  2529. break;
  2530. case 74:
  2531. #line 967 "r2l.y"
  2532. { yyval = C_nil; }
  2533. break;
  2534. case 75:
  2535. #line 968 "r2l.y"
  2536. { yyval = C_nil; }
  2537. break;
  2538. case 76:
  2539. #line 969 "r2l.y"
  2540. { yyval = cons(yyvsp[-1], yyvsp[0]); }
  2541. break;
  2542. case 77:
  2543. #line 972 "r2l.y"
  2544. { yyval = cons(sym_progn, cons(yyvsp[-1], yyvsp[0])); }
  2545. break;
  2546. case 78:
  2547. #line 975 "r2l.y"
  2548. { yyval = C_nil; }
  2549. break;
  2550. case 79:
  2551. #line 977 "r2l.y"
  2552. { yyval = cons(yyvsp[-1], yyvsp[0]); }
  2553. break;
  2554. case 80:
  2555. #line 979 "r2l.y"
  2556. { yyval = cons(yyvsp[-1], yyvsp[0]); }
  2557. break;
  2558. case 81:
  2559. #line 983 "r2l.y"
  2560. { yyval = cons(yyvsp[-1], yyvsp[0]); }
  2561. break;
  2562. case 82:
  2563. #line 985 "r2l.y"
  2564. { yyval = cons(yyvsp[-1], yyvsp[0]); }
  2565. break;
  2566. case 84:
  2567. #line 990 "r2l.y"
  2568. { yyval = append(yyvsp[-1], yyvsp[0]); }
  2569. break;
  2570. case 85:
  2571. #line 993 "r2l.y"
  2572. { yyval = C_nil; }
  2573. break;
  2574. case 86:
  2575. #line 994 "r2l.y"
  2576. { yyval = cons(yyvsp[-1], C_nil); }
  2577. break;
  2578. case 87:
  2579. #line 995 "r2l.y"
  2580. { yyval = cons(yyvsp[-2], yyvsp[0]); }
  2581. break;
  2582. case 88:
  2583. #line 996 "r2l.y"
  2584. { yyval = cons(yyvsp[-2], yyvsp[0]); }
  2585. break;
  2586. case 89:
  2587. #line 997 "r2l.y"
  2588. { yyval = yyvsp[0]; }
  2589. break;
  2590. case 90:
  2591. #line 1001 "r2l.y"
  2592. { yyval = cons(sym_prog, cons(yyvsp[-1], yyvsp[0])); }
  2593. break;
  2594. case 91:
  2595. #line 1002 "r2l.y"
  2596. { yyval = cons(sym_prog, cons(C_nil, yyvsp[0])); }
  2597. break;
  2598. case 92:
  2599. #line 1005 "r2l.y"
  2600. { yyval = C_nil; }
  2601. break;
  2602. case 93:
  2603. #line 1007 "r2l.y"
  2604. { yyval = cons(yyvsp[-1], yyvsp[0]); }
  2605. break;
  2606. case 94:
  2607. #line 1011 "r2l.y"
  2608. { yyval = list3(sym_lambda, ncons(yyvsp[-2]), yyvsp[-1]); }
  2609. break;
  2610. case 95:
  2611. #line 1013 "r2l.y"
  2612. { yyval = list3(sym_lambda, C_nil, yyvsp[0]); }
  2613. break;
  2614. case 96:
  2615. #line 1015 "r2l.y"
  2616. { yyval = list3(sym_lambda, cons(yyvsp[-3], yyvsp[-2]), yyvsp[0]); }
  2617. break;
  2618. case 99:
  2619. #line 1028 "r2l.y"
  2620. { yyval = make_where(yyvsp[-4], yyvsp[-2], yyvsp[0]); }
  2621. break;
  2622. case 101:
  2623. #line 1033 "r2l.y"
  2624. { yyval = make_where(yyvsp[-4], yyvsp[-2], yyvsp[0]); }
  2625. break;
  2626. case 103:
  2627. #line 1037 "r2l.y"
  2628. { yyval = list3(sym_setq, yyvsp[-2], yyvsp[0]); }
  2629. break;
  2630. case 105:
  2631. #line 1041 "r2l.y"
  2632. { yyval = list3(sym_setq, yyvsp[-2], yyvsp[0]); }
  2633. break;
  2634. case 107:
  2635. #line 1045 "r2l.y"
  2636. { yyval = ncons(yyvsp[0]); }
  2637. break;
  2638. case 108:
  2639. #line 1046 "r2l.y"
  2640. { yyval = cons(yyvsp[-2], yyvsp[0]); }
  2641. break;
  2642. case 109:
  2643. #line 1048 "r2l.y"
  2644. { yyval = cons(sym_or, cons(yyvsp[-2], yyvsp[0])); }
  2645. break;
  2646. case 111:
  2647. #line 1052 "r2l.y"
  2648. { yyval = ncons(yyvsp[0]); }
  2649. break;
  2650. case 112:
  2651. #line 1053 "r2l.y"
  2652. { yyval = cons(yyvsp[-2], yyvsp[0]); }
  2653. break;
  2654. case 113:
  2655. #line 1055 "r2l.y"
  2656. { yyval = cons(sym_or, cons(yyvsp[-2], yyvsp[0])); }
  2657. break;
  2658. case 115:
  2659. #line 1059 "r2l.y"
  2660. { yyval = ncons(yyvsp[0]); }
  2661. break;
  2662. case 116:
  2663. #line 1060 "r2l.y"
  2664. { yyval = cons(yyvsp[-2], yyvsp[0]); }
  2665. break;
  2666. case 117:
  2667. #line 1062 "r2l.y"
  2668. { yyval = cons(sym_and, cons(yyvsp[-2], yyvsp[0])); }
  2669. break;
  2670. case 119:
  2671. #line 1066 "r2l.y"
  2672. { yyval = ncons(yyvsp[0]); }
  2673. break;
  2674. case 120:
  2675. #line 1067 "r2l.y"
  2676. { yyval = cons(yyvsp[-2], yyvsp[0]); }
  2677. break;
  2678. case 121:
  2679. #line 1069 "r2l.y"
  2680. { yyval = cons(sym_and, cons(yyvsp[-2], yyvsp[0])); }
  2681. break;
  2682. case 123:
  2683. #line 1073 "r2l.y"
  2684. { yyval = list2(sym_not, yyvsp[0]); }
  2685. break;
  2686. case 125:
  2687. #line 1077 "r2l.y"
  2688. { yyval = list2(sym_not, yyvsp[0]); }
  2689. break;
  2690. case 127:
  2691. #line 1081 "r2l.y"
  2692. { yyval = list3(sym_member, yyvsp[-2], yyvsp[0]); }
  2693. break;
  2694. case 128:
  2695. #line 1082 "r2l.y"
  2696. { yyval = list3(sym_memq, yyvsp[-2], yyvsp[0]); }
  2697. break;
  2698. case 129:
  2699. #line 1083 "r2l.y"
  2700. { yyval = list3(sym_equal, yyvsp[-2], yyvsp[0]); }
  2701. break;
  2702. case 130:
  2703. #line 1084 "r2l.y"
  2704. { yyval = list3(sym_neq, yyvsp[-2], yyvsp[0]); }
  2705. break;
  2706. case 131:
  2707. #line 1085 "r2l.y"
  2708. { yyval = list3(sym_eq, yyvsp[-2], yyvsp[0]); }
  2709. break;
  2710. case 132:
  2711. #line 1086 "r2l.y"
  2712. { yyval = list3(sym_geq, yyvsp[-2], yyvsp[0]); }
  2713. break;
  2714. case 133:
  2715. #line 1087 "r2l.y"
  2716. { yyval = list3(sym_greaterp, yyvsp[-2], yyvsp[0]); }
  2717. break;
  2718. case 134:
  2719. #line 1088 "r2l.y"
  2720. { yyval = list3(sym_leq, yyvsp[-2], yyvsp[0]); }
  2721. break;
  2722. case 135:
  2723. #line 1089 "r2l.y"
  2724. { yyval = list3(sym_lessp, yyvsp[-2], yyvsp[0]); }
  2725. break;
  2726. case 136:
  2727. #line 1090 "r2l.y"
  2728. { yyval = list3(sym_freeof, yyvsp[-2], yyvsp[0]); }
  2729. break;
  2730. case 138:
  2731. #line 1094 "r2l.y"
  2732. { yyval = list3(sym_member, yyvsp[-2], yyvsp[0]); }
  2733. break;
  2734. case 139:
  2735. #line 1095 "r2l.y"
  2736. { yyval = list3(sym_memq, yyvsp[-2], yyvsp[0]); }
  2737. break;
  2738. case 140:
  2739. #line 1096 "r2l.y"
  2740. { yyval = list3(sym_equal, yyvsp[-2], yyvsp[0]); }
  2741. break;
  2742. case 141:
  2743. #line 1097 "r2l.y"
  2744. { yyval = list3(sym_neq, yyvsp[-2], yyvsp[0]); }
  2745. break;
  2746. case 142:
  2747. #line 1098 "r2l.y"
  2748. { yyval = list3(sym_eq, yyvsp[-2], yyvsp[0]); }
  2749. break;
  2750. case 143:
  2751. #line 1099 "r2l.y"
  2752. { yyval = list3(sym_geq, yyvsp[-2], yyvsp[0]); }
  2753. break;
  2754. case 144:
  2755. #line 1100 "r2l.y"
  2756. { yyval = list3(sym_greaterp, yyvsp[-2], yyvsp[0]); }
  2757. break;
  2758. case 145:
  2759. #line 1101 "r2l.y"
  2760. { yyval = list3(sym_leq, yyvsp[-2], yyvsp[0]); }
  2761. break;
  2762. case 146:
  2763. #line 1102 "r2l.y"
  2764. { yyval = list3(sym_lessp, yyvsp[-2], yyvsp[0]); }
  2765. break;
  2766. case 147:
  2767. #line 1103 "r2l.y"
  2768. { yyval = list3(sym_freeof, yyvsp[-2], yyvsp[0]); }
  2769. break;
  2770. case 149:
  2771. #line 1107 "r2l.y"
  2772. { yyval = list2(sym_not, yyvsp[0]); }
  2773. break;
  2774. case 151:
  2775. #line 1111 "r2l.y"
  2776. { yyval = list2(sym_not, yyvsp[0]); }
  2777. break;
  2778. case 153:
  2779. #line 1115 "r2l.y"
  2780. { yyval = ncons(yyvsp[0]); }
  2781. break;
  2782. case 154:
  2783. #line 1116 "r2l.y"
  2784. { yyval = cons(yyvsp[-2], yyvsp[0]); }
  2785. break;
  2786. case 155:
  2787. #line 1118 "r2l.y"
  2788. { yyval = cons(sym_plus, cons(yyvsp[-2], yyvsp[0])); }
  2789. break;
  2790. case 157:
  2791. #line 1122 "r2l.y"
  2792. { yyval = ncons(yyvsp[0]); }
  2793. break;
  2794. case 158:
  2795. #line 1123 "r2l.y"
  2796. { yyval = cons(yyvsp[-2], yyvsp[0]); }
  2797. break;
  2798. case 159:
  2799. #line 1125 "r2l.y"
  2800. { yyval = cons(sym_plus, cons(yyvsp[-2], yyvsp[0])); }
  2801. break;
  2802. case 161:
  2803. #line 1129 "r2l.y"
  2804. { yyval = list2(sym_not, yyvsp[0]); }
  2805. break;
  2806. case 163:
  2807. #line 1133 "r2l.y"
  2808. { yyval = list3(sym_difference, yyvsp[-2], yyvsp[0]); }
  2809. break;
  2810. case 165:
  2811. #line 1137 "r2l.y"
  2812. { yyval = list2(sym_not, yyvsp[0]); }
  2813. break;
  2814. case 167:
  2815. #line 1141 "r2l.y"
  2816. { yyval = list3(sym_difference, yyvsp[-2], yyvsp[0]); }
  2817. break;
  2818. case 169:
  2819. #line 1145 "r2l.y"
  2820. { yyval = list2(sym_not, yyvsp[0]); }
  2821. break;
  2822. case 171:
  2823. #line 1149 "r2l.y"
  2824. { yyval = yyvsp[0]; }
  2825. break;
  2826. case 172:
  2827. #line 1150 "r2l.y"
  2828. { yyval = list2(sym_minus, yyvsp[0]); }
  2829. break;
  2830. case 174:
  2831. #line 1154 "r2l.y"
  2832. { yyval = list2(sym_not, yyvsp[0]); }
  2833. break;
  2834. case 176:
  2835. #line 1158 "r2l.y"
  2836. { yyval = yyvsp[0]; }
  2837. break;
  2838. case 177:
  2839. #line 1159 "r2l.y"
  2840. { yyval = list2(sym_minus, yyvsp[0]); }
  2841. break;
  2842. case 179:
  2843. #line 1163 "r2l.y"
  2844. { yyval = ncons(yyvsp[0]); }
  2845. break;
  2846. case 180:
  2847. #line 1164 "r2l.y"
  2848. { yyval = cons(yyvsp[-2], yyvsp[0]); }
  2849. break;
  2850. case 181:
  2851. #line 1166 "r2l.y"
  2852. { yyval = cons(sym_times, cons(yyvsp[-2], yyvsp[0])); }
  2853. break;
  2854. case 183:
  2855. #line 1170 "r2l.y"
  2856. { yyval = ncons(yyvsp[0]); }
  2857. break;
  2858. case 184:
  2859. #line 1171 "r2l.y"
  2860. { yyval = cons(yyvsp[-2], yyvsp[0]); }
  2861. break;
  2862. case 185:
  2863. #line 1173 "r2l.y"
  2864. { yyval = cons(sym_times, cons(yyvsp[-2], yyvsp[0])); }
  2865. break;
  2866. case 187:
  2867. #line 1177 "r2l.y"
  2868. { yyval = list2(sym_not, yyvsp[0]); }
  2869. break;
  2870. case 188:
  2871. #line 1178 "r2l.y"
  2872. { yyval = yyvsp[0]; }
  2873. break;
  2874. case 189:
  2875. #line 1179 "r2l.y"
  2876. { yyval = list2(sym_minus, yyvsp[0]); }
  2877. break;
  2878. case 191:
  2879. #line 1183 "r2l.y"
  2880. { yyval = list3(sym_quotient, yyvsp[-2], yyvsp[0]); }
  2881. break;
  2882. case 193:
  2883. #line 1187 "r2l.y"
  2884. { yyval = list2(sym_not, yyvsp[0]); }
  2885. break;
  2886. case 194:
  2887. #line 1188 "r2l.y"
  2888. { yyval = yyvsp[0]; }
  2889. break;
  2890. case 195:
  2891. #line 1189 "r2l.y"
  2892. { yyval = list2(sym_minus, yyvsp[0]); }
  2893. break;
  2894. case 197:
  2895. #line 1193 "r2l.y"
  2896. { yyval = list3(sym_quotient, yyvsp[-2], yyvsp[0]); }
  2897. break;
  2898. case 199:
  2899. #line 1197 "r2l.y"
  2900. { yyval = list2(sym_not, yyvsp[0]); }
  2901. break;
  2902. case 200:
  2903. #line 1198 "r2l.y"
  2904. { yyval = yyvsp[0]; }
  2905. break;
  2906. case 201:
  2907. #line 1199 "r2l.y"
  2908. { yyval = list2(sym_minus, yyvsp[0]); }
  2909. break;
  2910. case 203:
  2911. #line 1203 "r2l.y"
  2912. { yyval = list3(sym_expt, yyvsp[-2], yyvsp[0]); }
  2913. break;
  2914. case 205:
  2915. #line 1207 "r2l.y"
  2916. { yyval = list2(sym_not, yyvsp[0]); }
  2917. break;
  2918. case 206:
  2919. #line 1208 "r2l.y"
  2920. { yyval = yyvsp[0]; }
  2921. break;
  2922. case 207:
  2923. #line 1209 "r2l.y"
  2924. { yyval = list2(sym_minus, yyvsp[0]); }
  2925. break;
  2926. case 209:
  2927. #line 1213 "r2l.y"
  2928. { yyval = list3(sym_expt, yyvsp[-2], yyvsp[0]); }
  2929. break;
  2930. case 211:
  2931. #line 1217 "r2l.y"
  2932. { yyval = list2(sym_not, yyvsp[0]); }
  2933. break;
  2934. case 212:
  2935. #line 1218 "r2l.y"
  2936. { yyval = yyvsp[0]; }
  2937. break;
  2938. case 213:
  2939. #line 1219 "r2l.y"
  2940. { yyval = list2(sym_minus, yyvsp[0]); }
  2941. break;
  2942. case 215:
  2943. #line 1223 "r2l.y"
  2944. { yyval = list3(sym_cons, yyvsp[-2], yyvsp[0]); }
  2945. break;
  2946. case 224:
  2947. #line 1232 "r2l.y"
  2948. { yyval = ncons(yyvsp[0]); }
  2949. break;
  2950. case 225:
  2951. #line 1235 "r2l.y"
  2952. { yyval = list2(sym_not, yyvsp[0]); }
  2953. break;
  2954. case 226:
  2955. #line 1236 "r2l.y"
  2956. { yyval = yyvsp[0]; }
  2957. break;
  2958. case 227:
  2959. #line 1237 "r2l.y"
  2960. { yyval = list2(sym_minus, yyvsp[0]); }
  2961. break;
  2962. case 229:
  2963. #line 1241 "r2l.y"
  2964. { yyval = list3(sym_cons, yyvsp[-2], yyvsp[0]); }
  2965. break;
  2966. case 231:
  2967. #line 1245 "r2l.y"
  2968. { yyval = C_nil; }
  2969. break;
  2970. case 232:
  2971. #line 1246 "r2l.y"
  2972. { yyval = cons(yyvsp[-1], yyvsp[0]); }
  2973. break;
  2974. case 233:
  2975. #line 1249 "r2l.y"
  2976. { yyval = yyvsp[-1]; }
  2977. break;
  2978. case 234:
  2979. #line 1252 "r2l.y"
  2980. { yyval = cons(yyvsp[-3], cons(yyvsp[-1],yyvsp[0])); }
  2981. break;
  2982. case 235:
  2983. #line 1255 "r2l.y"
  2984. { yyval = list3(sym_getv, yyvsp[-3], yyvsp[-1]); }
  2985. break;
  2986. case 236:
  2987. #line 1256 "r2l.y"
  2988. { yyval = cons(yyvsp[-2], C_nil); }
  2989. break;
  2990. case 237:
  2991. #line 1257 "r2l.y"
  2992. { yyval = cons(yyvsp[-1], cons(yyvsp[0], C_nil)); }
  2993. break;
  2994. case 238:
  2995. #line 1258 "r2l.y"
  2996. { yyval = cons(yyvsp[-1], yyvsp[0]); }
  2997. break;
  2998. case 239:
  2999. #line 1259 "r2l.y"
  3000. { yyval = list2(yyvsp[-1], yyvsp[0]); }
  3001. break;
  3002. case 241:
  3003. #line 1263 "r2l.y"
  3004. { yyval = yyvsp[0]; }
  3005. break;
  3006. case 242:
  3007. #line 1264 "r2l.y"
  3008. { yyval = yyvsp[0]; }
  3009. break;
  3010. case 243:
  3011. #line 1265 "r2l.y"
  3012. { yyval = cons(sym_setq, yyvsp[0]); }
  3013. break;
  3014. case 244:
  3015. #line 1266 "r2l.y"
  3016. { yyval = cons(sym_or, yyvsp[0]); }
  3017. break;
  3018. case 245:
  3019. #line 1267 "r2l.y"
  3020. { yyval = cons(sym_and, yyvsp[0]); }
  3021. break;
  3022. case 246:
  3023. #line 1268 "r2l.y"
  3024. { yyval = cons(sym_member, yyvsp[0]); }
  3025. break;
  3026. case 247:
  3027. #line 1269 "r2l.y"
  3028. { yyval = cons(sym_memq, yyvsp[0]); }
  3029. break;
  3030. case 248:
  3031. #line 1270 "r2l.y"
  3032. { yyval = cons(sym_neq, yyvsp[0]); }
  3033. break;
  3034. case 249:
  3035. #line 1271 "r2l.y"
  3036. { yyval = cons(sym_eq, yyvsp[0]); }
  3037. break;
  3038. case 250:
  3039. #line 1272 "r2l.y"
  3040. { yyval = cons(sym_geq, yyvsp[0]); }
  3041. break;
  3042. case 251:
  3043. #line 1273 "r2l.y"
  3044. { yyval = cons(sym_leq, yyvsp[0]); }
  3045. break;
  3046. case 252:
  3047. #line 1274 "r2l.y"
  3048. { yyval = cons(sym_freeof, yyvsp[0]); }
  3049. break;
  3050. #line 3148 "r2l.c"
  3051. }
  3052. yyssp -= yym;
  3053. yyvsp -= yym;
  3054. yym = yylhs[yyn];
  3055. yystate = *yyssp;
  3056. if (yystate == 0 && yym == 0)
  3057. {
  3058. #if YYDEBUG
  3059. if (yydebug)
  3060. printf("yydebug: after reduction, shifting from state 0 to\
  3061. state %d\n", YYFINAL);
  3062. #endif
  3063. yystate = YYFINAL;
  3064. *++yyssp = YYFINAL;
  3065. *++yyvsp = yyval;
  3066. if (yychar < 0)
  3067. {
  3068. if ((yychar = yylex()) < 0) yychar = 0;
  3069. #if YYDEBUG
  3070. if (yydebug)
  3071. {
  3072. yys = 0;
  3073. if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
  3074. if (!yys) yys = "illegal-symbol";
  3075. printf("yydebug: state %d, reading %d (%s)\n",
  3076. YYFINAL, yychar, yys);
  3077. }
  3078. #endif
  3079. }
  3080. if (yychar == 0) goto yyaccept;
  3081. goto yyloop;
  3082. }
  3083. yyn = yygindex[yym];
  3084. if (yyn != 0
  3085. && ((yyn += yystate), ((unsigned)yyn <= (unsigned)YYTABLESIZE))
  3086. && yycheck[yyn] == yystate)
  3087. yystate = yytable[yyn];
  3088. else
  3089. yystate = yydgoto[yym];
  3090. #if YYDEBUG
  3091. if (yydebug)
  3092. printf("yydebug: after reduction, shifting from state %d \
  3093. to state %d\n", *yyssp, yystate);
  3094. #endif
  3095. goto yypush;
  3096. yyoverflow:
  3097. yyerror("yacc stack overflow");
  3098. yyabort:
  3099. return (1);
  3100. yyaccept:
  3101. return (0);
  3102. }