comparison lwlib/lw_expr.c @ 336:401587ab6a09

checkpoint
author lost
date Fri, 05 Mar 2010 02:34:16 +0000
parents 9f58e3bca6e3
children 04c80c51b16a
comparison
equal deleted inserted replaced
335:9f58e3bca6e3 336:401587ab6a09
343 o -> next = E -> operands; 343 o -> next = E -> operands;
344 E -> operands = o; 344 E -> operands = o;
345 o = o2; 345 o = o2;
346 } 346 }
347 } 347 }
348 }
349
350 void lw_expr_sortoperandlist(struct lw_expr_opers **o)
351 {
352 fprintf(stderr, "lw_expr_sortoperandlist() not yet implemented\n");
348 } 353 }
349 354
350 // return 1 if the operand lists match, 0 if not 355 // return 1 if the operand lists match, 0 if not
351 // may re-order the argument lists 356 // may re-order the argument lists
352 int lw_expr_simplify_compareoperandlist(struct lw_expr_opers **ol1, struct lw_expr_opers **ol2) 357 int lw_expr_simplify_compareoperandlist(struct lw_expr_opers **ol1, struct lw_expr_opers **ol2)
419 // another "times" 424 // another "times"
420 for (op2 = o2 -> p -> operands; op2; op2 = op2 -> next) 425 for (op2 = o2 -> p -> operands; op2; op2 = op2 -> next)
421 if (op2 -> p -> type != lw_expr_type_int) 426 if (op2 -> p -> type != lw_expr_type_int)
422 break; 427 break;
423 428
424 if (lw_expr_compareoperandlist(&op1, &op2)) 429 if (lw_expr_simplify_compareoperandlist(&op1, &op2))
425 { 430 {
426 // we have like terms here 431 // we have like terms here
427 // do something about it 432 // do something about it
428 } 433 }
429 } 434 }