?? main.c
字號:
/*++
module name: main.c
--*/
#include <stdio.h>
#include "word_analysis.h"
int main(int argc, char *argv[] )
{
ENTRY entry;
if( argc < 2 )
{
printf(" usage: 詞法分析 filename\n" );
return -1;
}
if( !file_to_buffer(argv[1] ) )
{
printf("bad file name...\n" );
return -1;
}
do
{
if( is_end() ) /* 是否到達結尾 */
break;
entry = get_token( );
if( entry.type == TYPE_UNDEF )
{
//printf("deal to ..........\n%s\n", p_char );
}
else if( entry.type == TYPE_CONST_NUM )
printf("entry <type, *pointer> <%3d , %d >\n", entry.type, *(int*)entry.p_item );
else if( entry.type == TYPE_CONST_REAL )
printf("entry <type, *pointer> <%3d , %f >\n", entry.type, *(double*)entry.p_item );
else if (entry.type == TYPE_CONST_CHAR )
printf("entry <type, *pointer> <%3d , %c >\n", entry.type, *(char*)entry.p_item );
else
printf("entry <type, *pointer> <%3d , %s >\n", entry.type, entry.p_item );
}while(TRUE );
print_error();
return 0;
}
/****************************end of file************************/
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -