文件名称:shiyan2
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:2.76kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
本函数是一个词法分析器,其分析主要从几个方面入手:
*
* 1.先判别是不是注释。一旦读入的字符出现 / * ,则用一个while循环一直读取下面的字符,直到出现* /为止。
*
* 2.接着判断是不是以数值开头的。如果是以数值开头则再分情况讨论:
* A.在遇到空格之前,后面读进来的都是数值的话,则很明显,这是一个数。然后将其种别码输出来(37,-)
* B.在遇到空格之前,后面读进来的都是数值的话,譬如123ac 那么这是一个非法字符,输出错误-This function is a lexical analyzer, its analysis mainly from the aspects:** 1. Discriminant is not the first comment. Once read into the character appears/*, it has been using a while loop to read the following characters until*/date.** 2. And then judge is beginning to value. If the value is based on the situation at the beginning of the discussion is further divided into:* A. Prior to encounter a space, followed by reading the values are entered, then obviously, this is a number. And then other kinds of code output (37,-)* B. Prior to encounter a space, followed by reading the words of the incoming values are, for example, 123ac then it is an illegal character, output error
*
* 1.先判别是不是注释。一旦读入的字符出现 / * ,则用一个while循环一直读取下面的字符,直到出现* /为止。
*
* 2.接着判断是不是以数值开头的。如果是以数值开头则再分情况讨论:
* A.在遇到空格之前,后面读进来的都是数值的话,则很明显,这是一个数。然后将其种别码输出来(37,-)
* B.在遇到空格之前,后面读进来的都是数值的话,譬如123ac 那么这是一个非法字符,输出错误-This function is a lexical analyzer, its analysis mainly from the aspects:** 1. Discriminant is not the first comment. Once read into the character appears/*, it has been using a while loop to read the following characters until*/date.** 2. And then judge is beginning to value. If the value is based on the situation at the beginning of the discussion is further divided into:* A. Prior to encounter a space, followed by reading the values are entered, then obviously, this is a number. And then other kinds of code output (37,-)* B. Prior to encounter a space, followed by reading the words of the incoming values are, for example, 123ac then it is an illegal character, output error
(系统自动生成,下载前可以参看下载内容)
下载文件列表
shiyan2.cpp
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.