- 15
- 0
- 约2.92千字
- 约 15页
- 2017-09-15 发布于河南
- 举报
编译原理 词法分析器(Compiler Principle lexical analyzer)
编译原理 词法分析器(Compiler Principle lexical analyzer)
#包括 stdio. h
#包括字符串。”
#定义max_size 128
字符键[ ] [ max_size ] = {“暗淡”、“如果”、“做”、“停止”、“结束”};//定义关键字表
char * Concat(char * strtoken,ch)/连接函数
{
char温度[ 2 ];
温度[ 0 ] = CH;
临时[ 1 ] =“0”;/“0”为结束字符
将连接/ * * /(strtoken,温度);/ /将温度连接到strtoken并返回
返回strtoken;
} //是否为字母
int IsLetter(ch)
{
如果(((CH =‘A’)和(CH = z))| |((CH =‘A’)和(CH =“Z”)))
返回1;
其他的
返回0;
}
/ /是否为数字
int IsDigit(ch)
{
如果(“0”和“9”)
返回1;
其他的
返回0;
}
/ /是否是关键字
国际储备(char * strtoken)
{
为(int i = 0;i 38;i++)/数组标号最大为37,一共有38个数组
{
如果(0 = = strcmp(strtoken,关键[我]))
返回1;
}
返回0;
}
Bool isdim (char * strtoken)
{
您可能关注的文档
- 细木工板制作基本知识(Basic knowledge of blockboard production).doc
- 给咨询员新人的点滴建议(Give advice to the consultant).doc
- 结构设计标准(Structural design standard).doc
- 给婴儿买衣服要注意事项!(Attention should be paid to buying clothes for the baby!).doc
- 给宝宝吃水果的学问(Knowledge of eating fruit for the baby).doc
- 经纬度与3度带,6度带的概念及其转换方法(The concept of latitude and longitude and 3 degree belts and 6 degrees belts and their conversion methods).doc
- 给力流行语(Awesome buzzwords).doc
- 给我七朵花(Give me seven flowers).doc
- 给排水工程中的阀门选用知识(Knowledge of valve selection in water supply and drainage works).doc
- 给我一斤面粉 还你5碗凉皮(Give me a pound of flour do 5 cold noodle bowl).doc
最近下载
- STM32F407ZGT6数据手册中英双语对照_st.pdf VIP
- 2025年无废校园主题班会课.pptx VIP
- 上海人民电器框架断路器RMW1.pdf VIP
- 中国国家标准 GB/T 5783-2025紧固件 六角头螺栓 全螺纹.pdf
- 3360000XX_A4系列伺服快卷门控制系统操作说明CN_20190308.pdf
- 2025年浙江省行政执法资格模拟考试(2).doc VIP
- 2026中国杰出雇主外企名单(含资质+招聘入口).docx VIP
- 2025年浙江省行政执法资格模拟考试(17).doc VIP
- 十八项医疗核心制度.pdf VIP
- 建筑工程图集 16D303-3:常用水泵控制电路图.pdf VIP
原创力文档

文档评论(0)