y.tab.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752
  1. # line 102 "cexp.y"
  2. #include <setjmp.h>
  3. /* #define YYDEBUG 1 */
  4. static int yylex ();
  5. static yyerror ();
  6. int expression_value;
  7. static jmp_buf parse_return_error;
  8. /* some external tables of character types */
  9. extern unsigned char is_idstart[], is_idchar[];
  10. # line 116 "cexp.y"
  11. typedef union {
  12. long lval;
  13. int voidval;
  14. char *sval;
  15. } YYSTYPE;
  16. # define INT 257
  17. # define CHAR 258
  18. # define NAME 259
  19. # define ERROR 260
  20. # define OR 261
  21. # define AND 262
  22. # define EQUAL 263
  23. # define NOTEQUAL 264
  24. # define LEQ 265
  25. # define GEQ 266
  26. # define LSH 267
  27. # define RSH 268
  28. # define UNARY 269
  29. #define yyclearin yychar = -1
  30. #define yyerrok yyerrflag = 0
  31. extern int yychar;
  32. extern short yyerrflag;
  33. #ifndef YYMAXDEPTH
  34. #define YYMAXDEPTH 150
  35. #endif
  36. YYSTYPE yylval, yyval;
  37. # define YYERRCODE 256
  38. # line 209 "cexp.y"
  39. /* During parsing of a C expression, the pointer to the next character
  40. is in this variable. */
  41. static char *lexptr;
  42. /* Take care of parsing a number (anything that starts with a digit).
  43. Set yylval and return the token type; update lexptr.
  44. LEN is the number of characters in it. */
  45. /* maybe needs to actually deal with floating point numbers */
  46. static int
  47. parse_number (olen)
  48. int olen;
  49. {
  50. register char *p = lexptr;
  51. register long n = 0;
  52. register int c;
  53. register int base = 10;
  54. register len = olen;
  55. char *err_copy;
  56. extern double atof ();
  57. for (c = 0; c < len; c++)
  58. if (p[c] == '.') {
  59. /* It's a float since it contains a point. */
  60. yyerror ("floating point numbers not allowed in #if expressions");
  61. return ERROR;
  62. /* ****************
  63. yylval.dval = atof (p);
  64. lexptr += len;
  65. return FLOAT;
  66. **************** */
  67. }
  68. if (len >= 3 && (!strncmp (p, "0x", 2) || !strncmp (p, "0X", 2))) {
  69. p += 2;
  70. base = 16;
  71. len -= 2;
  72. }
  73. else if (*p == '0')
  74. base = 8;
  75. while (len-- > 0) {
  76. c = *p++;
  77. n *= base;
  78. if (c >= '0' && c <= '9')
  79. n += c - '0';
  80. else {
  81. if (c >= 'A' && c <= 'Z') c += 'a' - 'A';
  82. if (base == 16 && c >= 'a' && c <= 'f')
  83. n += c - 'a' + 10;
  84. else if (len == 0 && c == 'l')
  85. ;
  86. else {
  87. yyerror ("Invalid number in #if expression");
  88. return ERROR;
  89. }
  90. }
  91. }
  92. lexptr = p;
  93. yylval.lval = n;
  94. return INT;
  95. }
  96. struct token {
  97. char *operator;
  98. int token;
  99. };
  100. #define NULL 0
  101. static struct token tokentab2[] = {
  102. {"&&", AND},
  103. {"||", OR},
  104. {"<<", LSH},
  105. {">>", RSH},
  106. {"==", EQUAL},
  107. {"!=", NOTEQUAL},
  108. {"<=", LEQ},
  109. {">=", GEQ},
  110. {NULL, ERROR}
  111. };
  112. /* Read one token, getting characters through lexptr. */
  113. static int
  114. yylex ()
  115. {
  116. register int c;
  117. register int namelen;
  118. register char *tokstart;
  119. register struct token *toktab;
  120. retry:
  121. tokstart = lexptr;
  122. c = *tokstart;
  123. /* See if it is a special token of length 2. */
  124. for (toktab = tokentab2; toktab->operator != NULL; toktab++)
  125. if (c == *toktab->operator && tokstart[1] == toktab->operator[1]) {
  126. lexptr += 2;
  127. return toktab->token;
  128. }
  129. switch (c) {
  130. case 0:
  131. return 0;
  132. case ' ':
  133. case '\t':
  134. case '\n':
  135. lexptr++;
  136. goto retry;
  137. case '\'':
  138. lexptr++;
  139. c = *lexptr++;
  140. if (c == '\\')
  141. c = parse_escape (&lexptr);
  142. yylval.lval = c;
  143. c = *lexptr++;
  144. if (c != '\'') {
  145. yyerror ("Invalid character constant in #if");
  146. return ERROR;
  147. }
  148. return CHAR;
  149. case '/': /* possible comment */
  150. if (*lexptr != '*')
  151. return c;
  152. for (;;) {
  153. while (*lexptr != '\0') {
  154. if (*lexptr++ == '*' && *lexptr == '/') {
  155. lexptr++;
  156. goto retry;
  157. }
  158. }
  159. }
  160. /* some of these chars are invalid in constant expressions;
  161. maybe do something about them later */
  162. case '+':
  163. case '-':
  164. case '*':
  165. case '%':
  166. case '|':
  167. case '&':
  168. case '^':
  169. case '~':
  170. case '!':
  171. case '@':
  172. case '<':
  173. case '>':
  174. case '(':
  175. case ')':
  176. case '[':
  177. case ']':
  178. case '.':
  179. case '?':
  180. case ':':
  181. case '=':
  182. case '{':
  183. case '}':
  184. case ',':
  185. lexptr++;
  186. return c;
  187. case '"':
  188. yyerror ("double quoted strings not allowed in #if expressions");
  189. return ERROR;
  190. }
  191. if (c >= '0' && c <= '9') {
  192. /* It's a number */
  193. for (namelen = 0;
  194. c = tokstart[namelen], is_idchar[c] || c == '.';
  195. namelen++)
  196. ;
  197. return parse_number (namelen);
  198. }
  199. if (!is_idstart[c]) {
  200. yyerror ("Invalid token in expression");
  201. return ERROR;
  202. }
  203. /* It is a name. See how long it is. */
  204. for (namelen = 0; is_idchar[tokstart[namelen]]; namelen++)
  205. ;
  206. lexptr += namelen;
  207. return NAME;
  208. }
  209. /* Parse a C escape sequence. STRING_PTR points to a variable
  210. containing a pointer to the string to parse. That pointer
  211. is updated past the characters we use. The value of the
  212. escape sequence is returned.
  213. A negative value means the sequence \ newline was seen,
  214. which is supposed to be equivalent to nothing at all.
  215. If \ is followed by a null character, we return a negative
  216. value and leave the string pointer pointing at the null character.
  217. If \ is followed by 000, we return 0 and leave the string pointer
  218. after the zeros. A value of 0 does not mean end of string. */
  219. static int
  220. parse_escape (string_ptr)
  221. char **string_ptr;
  222. {
  223. register int c = *(*string_ptr)++;
  224. switch (c)
  225. {
  226. case 'a':
  227. return '\a';
  228. case 'b':
  229. return '\b';
  230. case 'e':
  231. return 033;
  232. case 'f':
  233. return '\f';
  234. case 'n':
  235. return '\n';
  236. case 'r':
  237. return '\r';
  238. case 't':
  239. return '\t';
  240. case 'v':
  241. return '\v';
  242. case '\n':
  243. return -2;
  244. case 0:
  245. (*string_ptr)--;
  246. return 0;
  247. case '^':
  248. c = *(*string_ptr)++;
  249. if (c == '\\')
  250. c = parse_escape (string_ptr);
  251. if (c == '?')
  252. return 0177;
  253. return (c & 0200) | (c & 037);
  254. case '0':
  255. case '1':
  256. case '2':
  257. case '3':
  258. case '4':
  259. case '5':
  260. case '6':
  261. case '7':
  262. {
  263. register int i = c - '0';
  264. register int count = 0;
  265. while (++count < 3)
  266. {
  267. if ((c = *(*string_ptr)++) >= '0' && c <= '7')
  268. {
  269. i *= 8;
  270. i += c - '0';
  271. }
  272. else
  273. {
  274. (*string_ptr)--;
  275. break;
  276. }
  277. }
  278. return i;
  279. }
  280. default:
  281. return c;
  282. }
  283. }
  284. static
  285. yyerror (s)
  286. char *s;
  287. {
  288. error (s);
  289. longjmp (parse_return_error, 1);
  290. }
  291. /* This page contains the entry point to this file. */
  292. /* Parse STRING as an expression, and complain if this fails
  293. to use up all of the contents of STRING. */
  294. int
  295. parse_c_expression (string)
  296. char *string;
  297. {
  298. lexptr = string;
  299. if (lexptr == 0 || *lexptr == 0) {
  300. error ("empty #if expression");
  301. return 0; /* don't include the #if group */
  302. }
  303. /* if there is some sort of scanning error, just return 0 and assume
  304. the parsing routine has printed an error message somewhere.
  305. there is surely a better thing to do than this. */
  306. if (setjmp(parse_return_error))
  307. return 0;
  308. if (yyparse ())
  309. return 0; /* actually this is never reached
  310. the way things stand. */
  311. if (*lexptr)
  312. error ("Junk after end of expression.");
  313. return expression_value; /* set by yyparse() */
  314. }
  315. #ifdef TEST_EXP_READER
  316. /* main program, for testing purposes. */
  317. main()
  318. {
  319. int n;
  320. char buf[1024];
  321. extern int yydebug;
  322. /*
  323. yydebug = 1;
  324. */
  325. initialize_random_junk ();
  326. for (;;) {
  327. printf("enter expression: ");
  328. n = 0;
  329. while ((buf[n] = getchar()) != '\n')
  330. n++;
  331. buf[n] = '\0';
  332. printf("parser returned %d\n", parse_c_expression(buf));
  333. }
  334. }
  335. /* table to tell if char can be part of a C identifier. */
  336. char is_idchar[256];
  337. /* table to tell if char can be first char of a c identifier. */
  338. char is_idstart[256];
  339. /* table to tell if c is horizontal space. isspace() thinks that
  340. newline is space; this is not a good idea for this program. */
  341. char is_hor_space[256];
  342. /*
  343. * initialize random junk in the hash table and maybe other places
  344. */
  345. initialize_random_junk()
  346. {
  347. register int i;
  348. /*
  349. * Set up is_idchar and is_idstart tables. These should be
  350. * faster than saying (is_alpha(c) || c == '_'), etc.
  351. * Must do set up these things before calling any routines tthat
  352. * refer to them.
  353. */
  354. for (i = 'a'; i <= 'z'; i++) {
  355. ++is_idchar[i - 'a' + 'A'];
  356. ++is_idchar[i];
  357. ++is_idstart[i - 'a' + 'A'];
  358. ++is_idstart[i];
  359. }
  360. for (i = '0'; i <= '9'; i++)
  361. ++is_idchar[i];
  362. ++is_idchar['_'];
  363. ++is_idstart['_'];
  364. /* horizontal space table */
  365. ++is_hor_space[' '];
  366. ++is_hor_space['\t'];
  367. }
  368. error (msg)
  369. {
  370. printf("error: %s\n", msg);
  371. }
  372. #endif
  373. short yyexca[] ={
  374. -1, 1,
  375. 0, -1,
  376. -2, 0,
  377. };
  378. # define YYNPROD 30
  379. # define YYLAST 371
  380. short yyact[]={
  381. 14, 25, 30, 11, 14, 12, 15, 2, 16, 12,
  382. 13, 1, 14, 25, 13, 34, 0, 12, 15, 0,
  383. 16, 56, 13, 23, 55, 24, 30, 11, 0, 5,
  384. 30, 0, 0, 0, 0, 23, 7, 24, 30, 14,
  385. 25, 4, 0, 0, 12, 15, 0, 16, 0, 13,
  386. 14, 25, 0, 0, 0, 12, 15, 26, 16, 0,
  387. 13, 0, 23, 0, 24, 30, 0, 0, 0, 26,
  388. 0, 0, 0, 23, 0, 24, 30, 0, 14, 25,
  389. 0, 0, 0, 12, 15, 0, 16, 27, 13, 0,
  390. 0, 0, 14, 25, 0, 0, 26, 12, 15, 27,
  391. 16, 23, 13, 24, 30, 0, 14, 26, 0, 0,
  392. 0, 12, 15, 0, 16, 23, 13, 24, 30, 0,
  393. 0, 0, 6, 0, 0, 0, 27, 0, 14, 23,
  394. 0, 24, 30, 12, 15, 26, 16, 27, 13, 14,
  395. 0, 0, 0, 0, 12, 15, 0, 16, 0, 13,
  396. 0, 23, 0, 24, 30, 3, 0, 0, 0, 0,
  397. 31, 32, 33, 0, 0, 30, 0, 35, 36, 37,
  398. 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  399. 48, 49, 50, 51, 52, 53, 54, 14, 0, 0,
  400. 0, 0, 12, 15, 0, 16, 0, 13, 0, 0,
  401. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  402. 0, 0, 57, 30, 0, 0, 0, 0, 0, 0,
  403. 0, 0, 0, 0, 29, 28, 19, 20, 21, 22,
  404. 17, 18, 0, 0, 0, 0, 29, 28, 19, 20,
  405. 21, 22, 17, 18, 0, 0, 0, 0, 0, 0,
  406. 0, 0, 0, 8, 9, 10, 0, 0, 0, 0,
  407. 0, 0, 0, 0, 28, 19, 20, 21, 22, 17,
  408. 18, 0, 0, 0, 0, 0, 19, 20, 21, 22,
  409. 17, 18, 0, 0, 0, 0, 0, 0, 0, 0,
  410. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  411. 0, 0, 0, 0, 19, 20, 21, 22, 17, 18,
  412. 0, 0, 0, 0, 0, 0, 0, 0, 19, 20,
  413. 21, 22, 17, 18, 0, 0, 0, 0, 0, 0,
  414. 0, 0, 19, 20, 21, 22, 17, 18, 0, 0,
  415. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  416. 0, 0, 0, 0, 0, 0, 21, 22, 17, 18,
  417. 0, 0, 0, 0, 0, 0, 0, 0, 0, 17,
  418. 18 };
  419. short yypact[]={
  420. -4,-1000, -41, -25, -4, -4, -4, -4,-1000,-1000,
  421. -1000, -4, -4, -4, -4, -4, -4, -4, -4, -4,
  422. -4, -4, -4, -4, -4, -4, -4, -4, -4, -4,
  423. -4, -61, -61, -61, -17, -25, -61, -61, -61, -33,
  424. -33, 150, 150, 91, 91, 102, 102, 102, 102, 69,
  425. 55, 41, 13, 2, -37,-1000, -4, -25 };
  426. short yypgo[]={
  427. 0, 155, 7, 11 };
  428. short yyr1[]={
  429. 0, 3, 2, 2, 1, 1, 1, 1, 1, 1,
  430. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  431. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
  432. short yyr2[]={
  433. 0, 1, 1, 3, 2, 2, 2, 3, 3, 3,
  434. 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
  435. 3, 3, 3, 3, 3, 3, 5, 1, 1, 1 };
  436. short yychk[]={
  437. -1000, -3, -2, -1, 45, 33, 126, 40, 257, 258,
  438. 259, 44, 42, 47, 37, 43, 45, 267, 268, 263,
  439. 264, 265, 266, 60, 62, 38, 94, 124, 262, 261,
  440. 63, -1, -1, -1, -2, -1, -1, -1, -1, -1,
  441. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  442. -1, -1, -1, -1, -1, 41, 58, -1 };
  443. short yydef[]={
  444. 0, -2, 1, 2, 0, 0, 0, 0, 27, 28,
  445. 29, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  446. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  447. 0, 4, 5, 6, 0, 3, 8, 9, 10, 11,
  448. 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
  449. 22, 23, 24, 25, 0, 7, 0, 26 };
  450. #ifndef lint
  451. static char yaccpar_sccsid[] = "@(#)yaccpar 4.1 (Berkeley) 2/11/83";
  452. #endif not lint
  453. #
  454. # define YYFLAG -1000
  455. # define YYERROR goto yyerrlab
  456. # define YYACCEPT return(0)
  457. # define YYABORT return(1)
  458. /* parser for yacc output */
  459. #ifdef YYDEBUG
  460. int yydebug = 0; /* 1 for debugging */
  461. #endif
  462. YYSTYPE yyv[YYMAXDEPTH]; /* where the values are stored */
  463. int yychar = -1; /* current input token number */
  464. int yynerrs = 0; /* number of errors */
  465. short yyerrflag = 0; /* error recovery flag */
  466. yyparse() {
  467. short yys[YYMAXDEPTH];
  468. short yyj, yym;
  469. register YYSTYPE *yypvt;
  470. register short yystate, *yyps, yyn;
  471. register YYSTYPE *yypv;
  472. register short *yyxi;
  473. yystate = 0;
  474. yychar = -1;
  475. yynerrs = 0;
  476. yyerrflag = 0;
  477. yyps= &yys[-1];
  478. yypv= &yyv[-1];
  479. yystack: /* put a state and value onto the stack */
  480. #ifdef YYDEBUG
  481. if( yydebug ) printf( "state %d, char 0%o\n", yystate, yychar );
  482. #endif
  483. if( ++yyps> &yys[YYMAXDEPTH] ) { yyerror( "yacc stack overflow" ); return(1); }
  484. *yyps = yystate;
  485. ++yypv;
  486. *yypv = yyval;
  487. yynewstate:
  488. yyn = yypact[yystate];
  489. if( yyn<= YYFLAG ) goto yydefault; /* simple state */
  490. if( yychar<0 ) if( (yychar=yylex())<0 ) yychar=0;
  491. if( (yyn += yychar)<0 || yyn >= YYLAST ) goto yydefault;
  492. if( yychk[ yyn=yyact[ yyn ] ] == yychar ){ /* valid shift */
  493. yychar = -1;
  494. yyval = yylval;
  495. yystate = yyn;
  496. if( yyerrflag > 0 ) --yyerrflag;
  497. goto yystack;
  498. }
  499. yydefault:
  500. /* default state action */
  501. if( (yyn=yydef[yystate]) == -2 ) {
  502. if( yychar<0 ) if( (yychar=yylex())<0 ) yychar = 0;
  503. /* look through exception table */
  504. for( yyxi=yyexca; (*yyxi!= (-1)) || (yyxi[1]!=yystate) ; yyxi += 2 ) ; /* VOID */
  505. while( *(yyxi+=2) >= 0 ){
  506. if( *yyxi == yychar ) break;
  507. }
  508. if( (yyn = yyxi[1]) < 0 ) return(0); /* accept */
  509. }
  510. if( yyn == 0 ){ /* error */
  511. /* error ... attempt to resume parsing */
  512. switch( yyerrflag ){
  513. case 0: /* brand new error */
  514. yyerror( "syntax error" );
  515. yyerrlab:
  516. ++yynerrs;
  517. case 1:
  518. case 2: /* incompletely recovered error ... try again */
  519. yyerrflag = 3;
  520. /* find a state where "error" is a legal shift action */
  521. while ( yyps >= yys ) {
  522. yyn = yypact[*yyps] + YYERRCODE;
  523. if( yyn>= 0 && yyn < YYLAST && yychk[yyact[yyn]] == YYERRCODE ){
  524. yystate = yyact[yyn]; /* simulate a shift of "error" */
  525. goto yystack;
  526. }
  527. yyn = yypact[*yyps];
  528. /* the current yyps has no shift onn "error", pop stack */
  529. #ifdef YYDEBUG
  530. if( yydebug ) printf( "error recovery pops state %d, uncovers %d\n", *yyps, yyps[-1] );
  531. #endif
  532. --yyps;
  533. --yypv;
  534. }
  535. /* there is no state on the stack with an error shift ... abort */
  536. yyabort:
  537. return(1);
  538. case 3: /* no shift yet; clobber input char */
  539. #ifdef YYDEBUG
  540. if( yydebug ) printf( "error recovery discards char %d\n", yychar );
  541. #endif
  542. if( yychar == 0 ) goto yyabort; /* don't discard EOF, quit */
  543. yychar = -1;
  544. goto yynewstate; /* try again in the same state */
  545. }
  546. }
  547. /* reduction by production yyn */
  548. #ifdef YYDEBUG
  549. if( yydebug ) printf("reduce %d\n",yyn);
  550. #endif
  551. yyps -= yyr2[yyn];
  552. yypvt = yypv;
  553. yypv -= yyr2[yyn];
  554. yyval = yypv[1];
  555. yym=yyn;
  556. /* consult goto table to find next state */
  557. yyn = yyr1[yyn];
  558. yyj = yypgo[yyn] + *yyps + 1;
  559. if( yyj>=YYLAST || yychk[ yystate = yyact[yyj] ] != -yyn ) yystate = yyact[yypgo[yyn]];
  560. switch(yym){
  561. case 1:
  562. # line 143 "cexp.y"
  563. { expression_value = yypvt[-0].lval; } break;
  564. case 3:
  565. # line 149 "cexp.y"
  566. { yyval.lval = yypvt[-0].lval; } break;
  567. case 4:
  568. # line 154 "cexp.y"
  569. { yyval.lval = - yypvt[-0].lval; } break;
  570. case 5:
  571. # line 156 "cexp.y"
  572. { yyval.lval = ! yypvt[-0].lval; } break;
  573. case 6:
  574. # line 158 "cexp.y"
  575. { yyval.lval = ~ yypvt[-0].lval; } break;
  576. case 7:
  577. # line 160 "cexp.y"
  578. { yyval.lval = yypvt[-1].lval; } break;
  579. case 8:
  580. # line 165 "cexp.y"
  581. { yyval.lval = yypvt[-2].lval * yypvt[-0].lval; } break;
  582. case 9:
  583. # line 167 "cexp.y"
  584. { yyval.lval = yypvt[-2].lval / yypvt[-0].lval; } break;
  585. case 10:
  586. # line 169 "cexp.y"
  587. { yyval.lval = yypvt[-2].lval % yypvt[-0].lval; } break;
  588. case 11:
  589. # line 171 "cexp.y"
  590. { yyval.lval = yypvt[-2].lval + yypvt[-0].lval; } break;
  591. case 12:
  592. # line 173 "cexp.y"
  593. { yyval.lval = yypvt[-2].lval - yypvt[-0].lval; } break;
  594. case 13:
  595. # line 175 "cexp.y"
  596. { yyval.lval = yypvt[-2].lval << yypvt[-0].lval; } break;
  597. case 14:
  598. # line 177 "cexp.y"
  599. { yyval.lval = yypvt[-2].lval >> yypvt[-0].lval; } break;
  600. case 15:
  601. # line 179 "cexp.y"
  602. { yyval.lval = (yypvt[-2].lval == yypvt[-0].lval); } break;
  603. case 16:
  604. # line 181 "cexp.y"
  605. { yyval.lval = (yypvt[-2].lval != yypvt[-0].lval); } break;
  606. case 17:
  607. # line 183 "cexp.y"
  608. { yyval.lval = (yypvt[-2].lval <= yypvt[-0].lval); } break;
  609. case 18:
  610. # line 185 "cexp.y"
  611. { yyval.lval = (yypvt[-2].lval >= yypvt[-0].lval); } break;
  612. case 19:
  613. # line 187 "cexp.y"
  614. { yyval.lval = (yypvt[-2].lval < yypvt[-0].lval); } break;
  615. case 20:
  616. # line 189 "cexp.y"
  617. { yyval.lval = (yypvt[-2].lval > yypvt[-0].lval); } break;
  618. case 21:
  619. # line 191 "cexp.y"
  620. { yyval.lval = (yypvt[-2].lval & yypvt[-0].lval); } break;
  621. case 22:
  622. # line 193 "cexp.y"
  623. { yyval.lval = (yypvt[-2].lval ^ yypvt[-0].lval); } break;
  624. case 23:
  625. # line 195 "cexp.y"
  626. { yyval.lval = (yypvt[-2].lval | yypvt[-0].lval); } break;
  627. case 24:
  628. # line 197 "cexp.y"
  629. { yyval.lval = (yypvt[-2].lval && yypvt[-0].lval); } break;
  630. case 25:
  631. # line 199 "cexp.y"
  632. { yyval.lval = (yypvt[-2].lval || yypvt[-0].lval); } break;
  633. case 26:
  634. # line 201 "cexp.y"
  635. { yyval.lval = yypvt[-4].lval ? yypvt[-2].lval : yypvt[-0].lval; } break;
  636. case 27:
  637. # line 203 "cexp.y"
  638. { yyval.lval = yylval.lval; } break;
  639. case 28:
  640. # line 205 "cexp.y"
  641. { yyval.lval = yylval.lval; } break;
  642. case 29:
  643. # line 207 "cexp.y"
  644. { yyval.lval = 0; } break;
  645. }
  646. goto yystack; /* stack new state and value */
  647. }