//
//
//
//
//
int Analyzer::parse ( char* filename ) {
FILE *fp;
aToken *iToken = nullptr;
char *parse_token;
int previous_index = 0;
char dummy[256];
char* a_token;
int mode_token = 0;
iToken = new aToken();
fp = fopen ( filename, "rb" );
int file_end = filesize ( fp );
int anz_count = 0;
int inc_count = 0;
for( int i=0; igetToken( fp, &i, &file_end );
if ( m_compare( (char*) "#define", parse_token ) == 1 ) {
iToken->block_to( (char*)"\n", &i, file_end, fp);
a_token = iToken->block;
printf( "#define a_token: |%s|\r\n", a_token );
// 20190923 printed and qualified.
// dummy[0] = iToken->getChar( fp, &i, &file_end);
// dummy[1] = '\0';
// printf("#define next: i:%d dummy: |%s|\r\n", i, dummy );
// exit(-1);
// end of m_fread: 1
// #define next: i:1903 dummy: |#|
anz_count++;
} else if ( m_compare( (char*) "#include", parse_token ) == 1 ) {
iToken->block_to( (char*)"\n", &i, file_end, fp);
a_token = iToken->block;
printf( "#include a_token: |%s|\r\n", a_token );
inc_count++;
} else {
printf( "else: parse_token: |%s| a_token: |%s|\r\n", parse_token, a_token );
printf("Exit(-1): Analyzer::parse: %s\r\n", filename);
exit(-1);
}
iToken->free_main_token ();
if ( inc_count == 6 ) break;
// if ( anz_count == 3 ) break;
switch( mode_token ) {
case 0:
break;
case 1:
break;
}
}
fclose(fp);
return 1;
}
function m_concat: i 0
parse function: substring: CLIPPROP "XV_CLIPBOARD"
ii: 2002 file_end: 48005 counter: 27 acnt: 1 a_token: | CLIPPROP "XV_CLIPBOARD"
| b_token: |
| block_to: |
|
function: m_compare:start function: array_count:
start function: array_count:
start function: array_count:
block_to ends: ii 2002 raw 0 line 1 block | CLIPPROP "XV_CLIPBOARD"
| array_count=27
#define a_token: | CLIPPROP "XV_CLIPBOARD"
|
i: 2003
start of aToken::getToken
end of aToken::getToken return || found 0
function: m_compare:start function: array_count:
start function: array_count:
function: m_compare:start function: array_count:
start function: array_count:
else: parse_token: || a_token: | CLIPPROP "XV_CLIPBOARD"
|
Exit(-1): Analyzer::parse: .\xvcut.c