Changeset 39e8406 in mainline for uspace/app/sbi/src/parse.c
- Timestamp:
- 2010-03-20T21:57:13Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b535aeb
- Parents:
- 6ba20a6b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/sbi/src/parse.c
r6ba20a6b r39e8406 35 35 #include <assert.h> 36 36 #include <stdlib.h> 37 #include "debug.h" 37 38 #include "lex.h" 38 39 #include "list.h" … … 133 134 csi = stree_csi_new(cc); 134 135 csi->name = parse_ident(parse); 135 /* 136 137 #ifdef DEBUG_PARSE_TRACE 136 138 printf("parse_csi: csi=%p, csi->name = %p (%s)\n", csi, csi->name, 137 139 strtab_get_str(csi->name->sid)); 138 */ 140 #endif 139 141 if (lcur_lc(parse) == lc_colon) { 140 142 /* Inheritance list */ … … 193 195 symbol->outer_csi = outer_csi; 194 196 fun->symbol = symbol; 197 fun->proc->outer_symbol = symbol; 195 198 break; 196 199 case lc_var: … … 213 216 symbol->outer_csi = outer_csi; 214 217 prop->symbol = symbol; 218 if (prop->getter) 219 prop->getter->outer_symbol = symbol; 220 if (prop->setter) 221 prop->setter->outer_symbol = symbol; 215 222 break; 216 223 default: … … 235 242 lmatch(parse, lc_lparen); 236 243 244 #ifdef DEBUG_PARSE_TRACE 245 printf("Parsing function '%s'.\n", strtab_get_str(fun->name->sid)); 246 #endif 247 237 248 list_init(&fun->args); 238 249 … … 242 253 while (b_true) { 243 254 arg = parse_proc_arg(parse); 255 244 256 if (stree_arg_has_attr(arg, aac_packed)) { 245 257 fun->varg = arg; … … 266 278 267 279 lmatch(parse, lc_is); 268 fun->body = parse_block(parse); 280 fun->proc = stree_proc_new(); 281 fun->proc->body = parse_block(parse); 269 282 lmatch(parse, lc_end); 270 283 … … 342 355 lskip(parse); 343 356 lmatch(parse, lc_is); 344 if (prop->getter _body!= NULL) {357 if (prop->getter != NULL) { 345 358 printf("Error: Duplicate getter.\n"); 346 359 exit(1); 347 360 } 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 349 366 lmatch(parse, lc_end); 350 367 break; 351 368 case lc_set: 352 369 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; 354 373 lmatch(parse, lc_is); 355 if (prop->setter _body!= NULL) {374 if (prop->setter != NULL) { 356 375 printf("Error: Duplicate setter.\n"); 357 376 exit(1); 358 377 } 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 360 383 lmatch(parse, lc_end); 361 384 break; … … 390 413 } 391 414 415 #ifdef DEBUG_PARSE_TRACE 416 printf("Parsed arg attr, type=%p.\n", arg->type); 417 #endif 392 418 return arg; 393 419 }
Note:
See TracChangeset
for help on using the changeset viewer.