Lines Matching full:at

38 	struct expression *ex, *at;  in alloc_and_hook_expr()  local
49 at = *last_p; in alloc_and_hook_expr()
50 if (at == NULL) { in alloc_and_hook_expr()
55 at->next = ex; in alloc_and_hook_expr()
56 ex->prev = at; in alloc_and_hook_expr()
94 /* We are at x + y + in validate_expr()
210 struct expression *at, *ex; in walk_back_and_insert_paren() local
221 at = frm->prev; in walk_back_and_insert_paren()
222 if (at == *beg) { in walk_back_and_insert_paren()
223 /* We are inserting at the head of the list */ in walk_back_and_insert_paren()
225 ex->next = at; in walk_back_and_insert_paren()
226 at->prev = ex; in walk_back_and_insert_paren()
229 } else if ((at->type == TYPE_VALUE_CON) || in walk_back_and_insert_paren()
230 (at->type == TYPE_VALUE_PMC)) { in walk_back_and_insert_paren()
233 ex->prev = at->prev; in walk_back_and_insert_paren()
235 ex->next = at; in walk_back_and_insert_paren()
236 at->prev = ex; in walk_back_and_insert_paren()
238 } else if (at->type == TYPE_PARN_CLOSE) { in walk_back_and_insert_paren()
242 at = at->prev; in walk_back_and_insert_paren()
244 if (at->type == TYPE_PARN_CLOSE) { in walk_back_and_insert_paren()
246 } else if (at->type == TYPE_PARN_OPEN) { in walk_back_and_insert_paren()
252 at = at->prev; in walk_back_and_insert_paren()
254 if (at == *beg) { in walk_back_and_insert_paren()
255 /* At beginning we insert */ in walk_back_and_insert_paren()
262 __FUNCTION__, at->type); in walk_back_and_insert_paren()
270 struct expression *at, *ex; in walk_fwd_and_insert_paren() local
281 at = frm->next; in walk_fwd_and_insert_paren()
282 if ((at->type == TYPE_VALUE_CON) || in walk_fwd_and_insert_paren()
283 (at->type == TYPE_VALUE_PMC)) { in walk_fwd_and_insert_paren()
286 ex->next = at->next; in walk_fwd_and_insert_paren()
287 ex->prev = at; in walk_fwd_and_insert_paren()
288 at->next = ex; in walk_fwd_and_insert_paren()
290 } else if (at->type == TYPE_PARN_OPEN) { in walk_fwd_and_insert_paren()
292 at = at->next; in walk_fwd_and_insert_paren()
294 if (at->type == TYPE_PARN_OPEN) { in walk_fwd_and_insert_paren()
296 } else if (at->type == TYPE_PARN_CLOSE) { in walk_fwd_and_insert_paren()
302 at = at->next; in walk_fwd_and_insert_paren()
308 at->type); in walk_fwd_and_insert_paren()
323 struct expression *at, *newone; in add_precendence() local
326 at = start; in add_precendence()
328 while(at != end) { in add_precendence()
329 if (at->type == TYPE_PARN_OPEN) { in add_precendence()
332 if (at->type == TYPE_PARN_CLOSE) { in add_precendence()
336 if ((at->type == TYPE_OP_MULT) || in add_precendence()
337 (at->type == TYPE_OP_DIVIDE)) { in add_precendence()
338 walk_back_and_insert_paren(beg, at); in add_precendence()
339 walk_fwd_and_insert_paren(at, &newone); in add_precendence()
340 at = newone->next; in add_precendence()
344 at = at->next; in add_precendence()
352 struct expression *at, *start, *end; in set_math_precidence() local
359 start = at = exp; in set_math_precidence()
361 while(at) { in set_math_precidence()
362 if (at->type == TYPE_PARN_CLOSE) { in set_math_precidence()
365 *stopped = at; in set_math_precidence()
373 if (at->type == TYPE_PARN_OPEN) { in set_math_precidence()
374 set_math_precidence(beg, at->next, &end); in set_math_precidence()
375 at = end; in set_math_precidence()
377 } else if ((at->type == TYPE_OP_PLUS) || in set_math_precidence()
378 (at->type == TYPE_OP_MINUS)) { in set_math_precidence()
380 } else if ((at->type == TYPE_OP_DIVIDE) || in set_math_precidence()
381 (at->type == TYPE_OP_MULT)) { in set_math_precidence()
384 at = at->next; in set_math_precidence()
395 pmc_name_set(struct expression *at) in pmc_name_set() argument
399 if (at->name[0] == '%') { in pmc_name_set()
401 idx = strtol(&at->name[1], NULL, 0); in pmc_name_set()
404 at->name, valid_pmc_cnt); in pmc_name_set()
407 strcpy(at->name, valid_pmcs[idx]); in pmc_name_set()
410 if (strcmp(valid_pmcs[i], at->name) == 0) { in pmc_name_set()
417 at->name); in pmc_name_set()
426 struct expression *exp=NULL, *last=NULL, *at; in parse_expression() local
471 at = alloc_and_hook_expr(&exp, &last); in parse_expression()
472 at->type = TYPE_PARN_OPEN; in parse_expression()
474 at = alloc_and_hook_expr(&exp, &last); in parse_expression()
475 at->type = TYPE_PARN_CLOSE; in parse_expression()
483 at = alloc_and_hook_expr(&exp, &last); in parse_expression()
484 at->type = TYPE_OP_PLUS; in parse_expression()
486 at = alloc_and_hook_expr(&exp, &last); in parse_expression()
487 at->type = TYPE_OP_MINUS; in parse_expression()
489 at = alloc_and_hook_expr(&exp, &last); in parse_expression()
490 at->type = TYPE_OP_DIVIDE; in parse_expression()
492 at = alloc_and_hook_expr(&exp, &last); in parse_expression()
493 at->type = TYPE_OP_MULT; in parse_expression()
496 at = alloc_and_hook_expr(&exp, &last); in parse_expression()
498 at->type = TYPE_VALUE_CON; in parse_expression()
500 at->type = TYPE_VALUE_PMC; in parse_expression()
509 at->name[x] = str[i]; in parse_expression()
512 if (x >=(sizeof(at->name)-1)) { in parse_expression()
514 (int)x, (int)(sizeof(at->name)-1)); in parse_expression()
525 if (at->type == TYPE_VALUE_CON) { in parse_expression()
526 at->state = STATE_FILLED; in parse_expression()
527 at->value = strtod(at->name, NULL); in parse_expression()
529 pmc_name_set(at); in parse_expression()
672 struct expression *at; in calc_expr() local
676 for(at = exp; at != NULL; at = at->next) { in calc_expr()
677 if (at->type == TYPE_VALUE_PMC) { in calc_expr()
678 at->state = STATE_UNSET; in calc_expr()
682 for(at = exp; at != NULL; at = at->next) { in calc_expr()
683 if (at->type == TYPE_VALUE_PMC) { in calc_expr()
684 at->value = (random() * 1.0); in calc_expr()
685 at->state = STATE_FILLED; in calc_expr()
686 if (at->value == 0.0) { in calc_expr()
688 at->value = 1.0; in calc_expr()