📄 example.c
字号:
// exam.c : Defines the entry point for the console application.
#include <stdlib.h>
#include <stdio.h>
int linesCount=0;
int yaccVerbose=0;
int lexVerbose=0;
struct CSiYuan
{
char m_op[30];
char m_arg1[30];
char m_arg2[30];
char m_arg3[30];
};
extern struct CSiYuan JiLu[100];
extern int nCurrentPosition;
extern int yyparse();
void PrintAll();
int main(int argc, char* argv[])
{
extern FILE *yyin;
printf("Compiling...!\n");
if((yyin=fopen("exprTest.txt","rt"))==NULL){
perror("can not open file exprTest.txt\n") ;
exit(1);
}
if (yyparse()){
fprintf(stderr,"parser error\n");
exit(1);
}
printf("yyparse() completed successfully!\n");
PrintAll();
return 0;
}
void PrintAll()
{
int i;
for(i=0; i<nCurrentPosition; ++i)
{
printf(" %d\t(%10s,%10s,%10s,%10s)\n", i, JiLu[i].m_op,
JiLu[i].m_arg1, JiLu[i].m_arg2, JiLu[i].m_arg3);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -