Changeset 074444f in mainline for uspace/app/sbi/src/p_expr.c
- Timestamp:
- 2010-04-10T11:15:33Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1ef0fc3, 38aaacc2
- Parents:
- 23de644
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/sbi/src/p_expr.c
r23de644 r074444f 56 56 static stree_expr_t *parse_primitive(parse_t *parse); 57 57 static stree_expr_t *parse_nameref(parse_t *parse); 58 static stree_expr_t *parse_lit_bool(parse_t *parse); 59 static stree_expr_t *parse_lit_char(parse_t *parse); 58 60 static stree_expr_t *parse_lit_int(parse_t *parse); 59 61 static stree_expr_t *parse_lit_ref(parse_t *parse); … … 494 496 expr = parse_nameref(parse); 495 497 break; 498 case lc_false: 499 case lc_true: 500 expr = parse_lit_bool(parse); 501 break; 502 case lc_lit_char: 503 expr = parse_lit_char(parse); 504 break; 496 505 case lc_lit_int: 497 506 expr = parse_lit_int(parse); … … 531 540 } 532 541 542 /** Parse boolean literal. 543 * 544 * @param parse Parser object. 545 */ 546 static stree_expr_t *parse_lit_bool(parse_t *parse) 547 { 548 stree_literal_t *literal; 549 stree_expr_t *expr; 550 bool_t value; 551 552 switch (lcur_lc(parse)) { 553 case lc_false: value = b_false; break; 554 case lc_true: value = b_true; break; 555 default: assert(b_false); 556 } 557 558 lskip(parse); 559 560 literal = stree_literal_new(ltc_bool); 561 literal->u.lit_bool.value = value; 562 563 expr = stree_expr_new(ec_literal); 564 expr->u.literal = literal; 565 566 return expr; 567 } 568 569 /** Parse character literal. 570 * 571 * @param parse Parser object. 572 */ 573 static stree_expr_t *parse_lit_char(parse_t *parse) 574 { 575 stree_literal_t *literal; 576 stree_expr_t *expr; 577 578 lcheck(parse, lc_lit_char); 579 580 literal = stree_literal_new(ltc_char); 581 bigint_clone(&lcur(parse)->u.lit_char.value, 582 &literal->u.lit_char.value); 583 584 lskip(parse); 585 586 expr = stree_expr_new(ec_literal); 587 expr->u.literal = literal; 588 589 return expr; 590 } 591 533 592 /** Parse integer literal. 534 593 *
Note:
See TracChangeset
for help on using the changeset viewer.