bianyi.c

来自「简单的词法分析器在Linux上用C语言实现」· C语言 代码 · 共 48 行

C
48
字号
/* ============================================================================ Name        : bianyi.c Author      : xiaohe Version     : Copyright   : Your copyright notice Description : Hello World in C, Ansi-style ============================================================================ */#include <stdio.h>#include <stdlib.h>#include<string.h>#include"option.h"#include"scan.h"int main(int argc,char *argv[]){	scanner_init();/*	if(argc<2)	{		fprintf(stderr,"Please input the name of the source file!\n");		return EXIT_SUCCESS;	}*/	if((source=fopen("source","r"))==NULL)	{		fprintf(stderr,"Cannot open source file %s .\n",argv[1]);		return EXIT_SUCCESS;	}	while(!feof(source))	{		scanner();	}	show_ident();	printf("\n\n");	show_keywords();	printf("\n\n");	show_number();	printf("\n\n");	show_operator();	return EXIT_SUCCESS;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?