Related source code documentation:
File path:
In the GCC directory, these three files:
- c-common.h
- c-common.c
- c-parser.c
- First, change the basic type int to zheng:
Figure 1.1
- Add RID_ZHENG after RID_INT in c-common.h, as shown in Figure 1.1.
Figure 1.2b. Then in c-common.c, add the following line after record_builtin_type (RID_INT, NULL, integer_type_node);:
record_builtin_type (RID_ZHENG, NULL, integer_type_node);
c. In c-parser.c, search for RID_INT, then add the following line after { “int”, RID_INT, 0 },:{ “zheng”, RID_ZHENG, 0 },

Add the following line after case RID_INT::case RID_ZHENG:.

d. Then run the command make CFLAGS=-O2 LDFLAGS=-s to compile and make install to install;
e. Then write a ceShi.c:


Thus, changing the basic type int to zheng is successful!
2. Then change the control keywords if and else to ruguo and fouze: a. In c-common.h, search for RID_IF and RID_ELSE and add RID_RUGUO and RID_FOUZE after them,
b. In c-parser.c, search for RID_IF and RID_ELSE, and modify them as follows:



c. Then run the command make CFLAGS=-O2 LDFLAGS=-s to compile and make install to install;d. Write ceShi.c:


Thus, changing the control keywords if and else to ruguo and fouze is successful!