⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dividewords.c

📁 编译原理的词法分析模块
💻 C
字号:
#include <stdio.h>#include "list/list.h"#include "common.h"#include <string.h>int main(char **avgs, int avgc){    List myList,*pList;    FILE *fp;    char c,buff[1024],*pb,c1[2];    pb = buff;    pList = &myList;    CreateList(pList);    //printf("%s \n",*avgs);    //getchar();    fp = fopen("text1.txt","r");    if(!fp)        Error("open file error.\n");    *pb = 0;    c1[1] = 0;    printf(">> \n");    while(!feof(fp))    {        c = fgetc(fp);        if(strchr("\n\a\t ",c) > 0)        {            InsertListNode(pList->count,buff,pList);            pb = buff;            *pb = '\0';        }        else if(strchr("~!@#$%^&*()+|`-=\\[{]};:'\",<.>/?",c) >0)        {            InsertListNode(pList->count,buff,pList);            pb = buff;            *pb = c;            *(pb + 1) = '\0';            InsertListNode(pList->count,buff,pList);            pb = buff;            *pb = 0;        }        else        {            *(pb++) = c;            *pb = '\0';        }    }    ShowListEntry(pList);    getchar();    return 0;}

⌨️ 快捷键说明

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