📄 init.c
字号:
/*
* Author: zhangdi
* Date: 2008-11-10
* Description: initialize for lexer
*/
#include "global.h"
#include "symbol.h"
/* Add key word keywords array */
struct entry keywords[] = {
{"if", IF},
{"else", ELSE},
{"while", WHILE},
{"int", INT},
{"float", FLOAT},
{NULL, 0}
};
/* Initialize the symboltable to identify if the symbol is a ID */
void init()
{
struct entry *p;
for (p = keywords; p->token; p++)
{
/* memorize the number of keywords */
keynum++;
/* use the function of symboltable to add key words */
insert(p->lexptr, p->token);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -