Changeset 3b02b04 for src/dgp/grammar.cc
- Timestamp:
- 01/17/13 20:50:41 (12 years ago)
- Branches:
- master
- Children:
- d2f119e
- Parents:
- 555c7f8
- git-author:
- Tomasz Obrebski <to@…> (01/17/13 20:50:41)
- git-committer:
- Tomasz Obrebski <to@…> (01/17/13 20:50:41)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/dgp/grammar.cc
ra15e59b r3b02b04 298 298 { 299 299 char cat1[MAXLINE],flags1[MAXLINE],cat2[MAXLINE],flags2[MAXLINE],type[MAXLINE],props[MAXLINE]; 300 301 if(sscanf(arg1,"%[^;];%s",cat1,flags1)==1) *flags1='\0'; 302 if(sscanf(arg2,"%[^;];%s",cat2,flags2)==1) *flags2='\0'; 303 if(sscanf(arg3,"%[^&]%s",type,props)==1) *props='\0'; 300 char* double_slash_position; 301 // pierwszy argument 302 // if(sscanf(arg1,"%[^;];%s",cat1,flags1)==1) *flags1='\0'; 303 if((double_slash_position=strstr(arg1,"//")) != NULL) // czy s± flagi 304 { 305 int cat_length=double_slash_position-arg1; 306 strncpy(cat1, arg1, cat_length); cat1[cat_length]='\0'; 307 strcpy(flags1, arg1+cat_length+2); 308 } 309 else 310 { 311 strcpy(cat1, arg1); 312 flags1[0]='\0'; 313 } 314 // drugi argument 315 // if(sscanf(arg2,"%[^;];%s",cat2,flags2)==1) *flags2='\0'; 316 if((double_slash_position=strstr(arg2,"//")) != NULL) // czy s± flagi 317 { 318 int cat_length=double_slash_position-arg2; 319 strncpy(cat2, arg2, cat_length); cat2[cat_length]='\0'; 320 strcpy(flags2, arg2+cat_length+2); 321 } 322 else 323 { 324 strcpy(cat2,arg2); 325 flags2[0]='\0'; 326 } 327 // trzeci argument 328 if(sscanf(arg3,"%[^&]%s",type,props)==1) props[0]='\0'; 304 329 305 // printf("line=%s\n\tcat1=%s flags1=%s cat2=%s flags2=%s type=%sprops=%s\n",line,cat1,flags1,cat2,flags2,type,props);330 // printf("line=%s\n\tcat1=<%s> flags1=%s cat2=<%s> flags2=%s type=<%s> props=%s\n",line,cat1,flags1,cat2,flags2,type,props); 306 331 307 332 if( chk_cat(cat1) && chk_cat(cat2) && chk_type(type) ) … … 346 371 347 372 // compute_gt(); 348 373 349 374 return true; 350 375
Note: See TracChangeset
for help on using the changeset viewer.