7 void yyerror (char const *);
19 %left EQ NEQ GE LE GT LT
30 | boo '\n' { printf("%s\n",$1?"true":"false"); }
31 | error '\n' { yyerrok; }
34 boo: CONST EQ CONST { $$ = ! strcmp($1, $3); }
35 | CONST NEQ CONST { $$ = !! strcmp($1, $3); }
36 | NUM EQ NUM { $$ = $1 == $3 }
37 | NUM NEQ NUM { $$ = $1 != $3 }
38 | NUM GE NUM { $$ = $1 >= $3 }
39 | NUM LE NUM { $$ = $1 <= $3 }
40 | NUM GT NUM { $$ = $1 > $3 }
41 | NUM LT NUM { $$ = $1 < $3 }
42 | boo '|' boo { $$ = $1 || $3 }
43 | boo '&' boo { $$ = $1 && $3 }
44 | boo '^' boo { $$ = ($1 || $3) && !($1 && $3) }
45 | '!' boo { $$ = ! $2 }
62 while ((c = getchar ()) == ' ' || c == '\t');
67 if (!(yylval.str = malloc(BUFSIZE))){
71 while ((c = getchar()) != '"' || last == '\\'){
85 scanf("%d",&yylval.n);
90 if ((c = getchar ()) == '=')
95 if ((c = getchar ()) == '=')
102 if ((c = getchar ()) == '=')
109 if ((c = getchar ()) == '=')
120 yyerror (char const *s)
122 fprintf (stderr, "%s\n", s);