blob: 94636da00eb49c336ee5de6bc69f09c142778561 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
#include <stdio.h>
#include "symtab.h"
#include "eval.h"
#include "constant.h"
#include "errrpt.h"
void main(int argc, char *argv[])
{
char expression[MAXLINELEN], output[MAXLINELEN];
int truth;
readsyms("switches");
printf("If expression evaluator test program\n");
for(;;)
{
printf("Evaluate: #if ");
gets(expression);
evaluate(output, &truth, expression);
switch (truth)
{
case DEFINED:
puts("DEFINED");
break;
case UNDEFINED:
puts("UNDEFINED");
break;
case IGNORE:
printf("IGNORE - condition %s\n",output);
break;
}
}
}
|