void SRExpressionsParser::compare(double* r) { double t = 0; Token op = token; bitwiseShift(r); op = token; while( (!strcmp(op.value(),"<")) || (!strcmp(op.value(),">"))|| (!strcmp(op.value(),">="))|| (!strcmp(op.value(),"<="))) { parse(); bitwiseShift(&t); if (!strcmp(op.value(),"<")) { *r = (double)(*r < t); } if (!strcmp(op.value(),">")) { *r = (double)(*r > t); } if (!strcmp(op.value(),">=")) { *r = (double)(*r >= t); } if (!strcmp(op.value(),"<=")) { *r = (double)(*r <= t); } op=token; } }
int main () { int a=10, b=20; printf("a = %d\n", a); printf("b = %d\n", b); if (a==5 && b++) printf(""); printf("a = %d\n", a); printf("b = %d\n", b); bitwiseAnd(); // bitwiseMasking(); bitwiseShift(); }