Changeset 37f527b in mainline for uspace/app/sbi/src/stree.c


Ignore:
Timestamp:
2010-03-26T21:55:23Z (14 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4204ad9
Parents:
b535aeb
Message:

Update SBI to rev. 144.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/sbi/src/stree.c

    rb535aeb r37f527b  
    136136}
    137137
     138stree_symbol_attr_t *stree_symbol_attr_new(symbol_attr_class_t sac)
     139{
     140        stree_symbol_attr_t *symbol_attr;
     141
     142        symbol_attr = calloc(1, sizeof(stree_symbol_attr_t));
     143        if (symbol_attr == NULL) {
     144                printf("Memory allocation failed.\n");
     145                exit(1);
     146        }
     147
     148        symbol_attr->sac = sac;
     149        return symbol_attr;
     150}
     151
    138152stree_proc_t *stree_proc_new(void)
    139153{
     
    414428}
    415429
     430stree_as_t *stree_as_new(void)
     431{
     432        stree_as_t *as_expr;
     433
     434        as_expr = calloc(1, sizeof(stree_as_t));
     435        if (as_expr == NULL) {
     436                printf("Memory allocation failed.\n");
     437                exit(1);
     438        }
     439
     440        return as_expr;
     441}
     442
    416443stree_nameref_t *stree_nameref_new(void)
    417444{
     
    572599
    573600        return program;
     601}
     602
     603/** Determine if @a symbol has attribute of class @a sac. */
     604bool_t stree_symbol_has_attr(stree_symbol_t *symbol, symbol_attr_class_t sac)
     605{
     606        list_node_t *node;
     607        stree_symbol_attr_t *attr;
     608
     609        node = list_first(&symbol->attr);
     610        while (node != NULL) {
     611                attr = list_node_data(node, stree_symbol_attr_t *);
     612                if (attr->sac == sac)
     613                        return b_true;
     614
     615                node = list_next(&symbol->attr, node);
     616        }
     617
     618        return b_false;
    574619}
    575620
Note: See TracChangeset for help on using the changeset viewer.