Changeset 39e8406 in mainline for uspace/app/sbi/src/parse.c


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

Update SBI to rev. 128.

File:
1 edited

Legend:

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

    r6ba20a6b r39e8406  
    3535#include <assert.h>
    3636#include <stdlib.h>
     37#include "debug.h"
    3738#include "lex.h"
    3839#include "list.h"
     
    133134        csi = stree_csi_new(cc);
    134135        csi->name = parse_ident(parse);
    135 /*
     136
     137#ifdef DEBUG_PARSE_TRACE
    136138        printf("parse_csi: csi=%p, csi->name = %p (%s)\n", csi, csi->name,
    137139            strtab_get_str(csi->name->sid));
    138 */
     140#endif
    139141        if (lcur_lc(parse) == lc_colon) {
    140142                /* Inheritance list */
     
    193195                symbol->outer_csi = outer_csi;
    194196                fun->symbol = symbol;
     197                fun->proc->outer_symbol = symbol;
    195198                break;
    196199        case lc_var:
     
    213216                symbol->outer_csi = outer_csi;
    214217                prop->symbol = symbol;
     218                if (prop->getter)
     219                        prop->getter->outer_symbol = symbol;
     220                if (prop->setter)
     221                        prop->setter->outer_symbol = symbol;
    215222                break;
    216223        default:
     
    235242        lmatch(parse, lc_lparen);
    236243
     244#ifdef DEBUG_PARSE_TRACE
     245        printf("Parsing function '%s'.\n", strtab_get_str(fun->name->sid));
     246#endif
     247
    237248        list_init(&fun->args);
    238249
     
    242253                while (b_true) {
    243254                        arg = parse_proc_arg(parse);
     255
    244256                        if (stree_arg_has_attr(arg, aac_packed)) {
    245257                                fun->varg = arg;
     
    266278
    267279        lmatch(parse, lc_is);
    268         fun->body = parse_block(parse);
     280        fun->proc = stree_proc_new();
     281        fun->proc->body = parse_block(parse);
    269282        lmatch(parse, lc_end);
    270283
     
    342355                        lskip(parse);
    343356                        lmatch(parse, lc_is);
    344                         if (prop->getter_body != NULL) {
     357                        if (prop->getter != NULL) {
    345358                                printf("Error: Duplicate getter.\n");
    346359                                exit(1);
    347360                        }
    348                         prop->getter_body = parse_block(parse);
     361
     362                        /* Create setter procedure */
     363                        prop->getter = stree_proc_new();
     364                        prop->getter->body = parse_block(parse);
     365
    349366                        lmatch(parse, lc_end);
    350367                        break;
    351368                case lc_set:
    352369                        lskip(parse);
    353                         prop->setter_arg_name = parse_ident(parse);
     370                        prop->setter_arg = stree_proc_arg_new();
     371                        prop->setter_arg->name = parse_ident(parse);
     372                        prop->setter_arg->type = prop->type;
    354373                        lmatch(parse, lc_is);
    355                         if (prop->setter_body != NULL) {
     374                        if (prop->setter != NULL) {
    356375                                printf("Error: Duplicate setter.\n");
    357376                                exit(1);
    358377                        }
    359                         prop->setter_body = parse_block(parse);
     378
     379                        /* Create setter procedure */
     380                        prop->setter = stree_proc_new();
     381                        prop->setter->body = parse_block(parse);
     382
    360383                        lmatch(parse, lc_end);
    361384                        break;
     
    390413        }
    391414
     415#ifdef DEBUG_PARSE_TRACE
     416        printf("Parsed arg attr, type=%p.\n", arg->type);
     417#endif
    392418        return arg;
    393419}
Note: See TracChangeset for help on using the changeset viewer.