Changeset 410 for abnfparser
- Timestamp:
- 15/11/08 21:28:06 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
abnfparser/bap/main.c
r409 r410 409 409 break; 410 410 case T_GROUP: 411 if (tflag) 412 printf("{GROUP}"); 413 if (o->u.e.islist) { 414 if (o->u.e.repetition.lo == 0) { 415 printf("( [ *LWS "); 416 printobj_r(o->u.e.e.group, o->type, tflag); 417 printf(" ] *( *LWS \",\" *LWS "); 418 printobj_r(o->u.e.e.group, o->type, tflag); 419 printf(" ) )"); 420 } 421 else if (o->u.e.repetition.lo == 1) { 422 printf("( *LWS "); 423 printobj_r(o->u.e.e.group, o->type, tflag); 424 printf(" *( *LWS \",\" *LWS "); 425 printobj_r(o->u.e.e.group, o->type, tflag); 426 printf(" ) )"); 427 } 428 else { 429 printf("TODO: something is wrong"); 430 } 431 } 432 else { 433 if (o->u.e.repetition.lo == 0 && 434 o->u.e.repetition.hi == 1) { 435 if (!NOBRACKET(o->u.e.e.group)) 436 printf("[ "); 437 } else { 438 printrep(&o->u.e.repetition); 439 if (!NOPAREN(o->u.e.e.group)) 440 printf("( "); 441 } 442 printobj_r(o->u.e.e.group, o->type, tflag); 443 if (o->u.e.repetition.lo == 0 && 444 o->u.e.repetition.hi == 1) { 445 if (!NOBRACKET(o->u.e.e.group)) 446 printf(" ]"); 447 } else { 448 if (!NOPAREN(o->u.e.e.group)) 449 printf(" )"); 450 } 451 } 452 break; 411 if (tflag) 412 printf("{GROUP}"); 413 if (o->u.e.islist) { 414 if (o->u.e.repetition.lo == 0) { 415 printf("[ ( \",\" / "); 416 printobj_r(o->u.e.e.group, o->type, tflag); 417 printf(" ) *( OWS \",\" [ OWS "); 418 printobj_r(o->u.e.e.group, o->type, tflag); 419 printf(" ] ) ]"); 420 } 421 else if (o->u.e.repetition.lo == 1) { 422 printf("*( \",\" OWS ) "); 423 printobj_r(o->u.e.e.group, o->type, tflag); 424 printf(" *( OWS \",\" [ OWS "); 425 printobj_r(o->u.e.e.group, o->type, tflag); 426 printf(" ] )"); 427 } 428 else { 429 printf("TODO: something is wrong"); 430 } 431 } else { 432 if (o->u.e.repetition.lo == 0 && 433 o->u.e.repetition.hi == 1) { 434 if (!NOBRACKET(o->u.e.e.group)) 435 printf("[ "); 436 } else { 437 printrep(&o->u.e.repetition); 438 if (!NOPAREN(o->u.e.e.group)) 439 printf("( "); 440 } 441 printobj_r(o->u.e.e.group, o->type, tflag); 442 if (o->u.e.repetition.lo == 0 && 443 o->u.e.repetition.hi == 1) { 444 if (!NOBRACKET(o->u.e.e.group)) 445 printf(" ]"); 446 } else { 447 if (!NOPAREN(o->u.e.e.group)) 448 printf(" )"); 449 } 450 } 451 break; 453 452 case T_TERMSTR: 454 453 if (tflag)
Note: See TracChangeset
for help on using the changeset viewer.