Location:
Search - token separator
Search list
Description: 使用面向对象方法完成“快速拼写检查程序”的分析、设计和实现过程。快速拼写检查程序基本要求说明如下: 1.进行拼写检查的文件以文本文件形式存储于外存上;2.只检查文件中英文单词的拼写错误;3.单词是用字母(a…z或A…Z)定义,任一非字母字符作为分隔符;4.判断单词拼写正误的依据是词典,词典以文本文件形式存放于外存上;5.词典文件第1行为词典的名称,以后每一行存放一个单词;6.输出结果以文本文件形式存储,其格式为:第1行:被拼写检查的文件名 + 词典名 第2行后的每一行: 出错单词 位于第x行7.设计一个合理的GUI,注意GUI界面类与功能类的关系应比较松散。-use of object-oriented method to complete the "quick spell-check procedure" in the analysis, design and implementation process. Rapid screening procedures spelling basic requirements as follows : 1. Spell-checking documents to text files stored in the form of Disk; 2. Just check the documents in both Chinese and English word spelling errors; 3. Word is letters (a z or A ... ... Z) definition, as a non-alphabetic character as the separator; 4. Judge spelling error is the basis of dictionaries, dictionaries in the form of text files stored in external memory; 5. Dictionary document acts of a dictionary of names, each line deposited a word; 6. Output form of a text document storage, its format : Line 1 : The spell-check dictionary file name from the second line after each line : at
Platform: |
Size: 8857 |
Author: 罗春威 |
Hits:
Description: 使用面向对象方法完成“快速拼写检查程序”的分析、设计和实现过程。快速拼写检查程序基本要求说明如下: 1.进行拼写检查的文件以文本文件形式存储于外存上;2.只检查文件中英文单词的拼写错误;3.单词是用字母(a…z或A…Z)定义,任一非字母字符作为分隔符;4.判断单词拼写正误的依据是词典,词典以文本文件形式存放于外存上;5.词典文件第1行为词典的名称,以后每一行存放一个单词;6.输出结果以文本文件形式存储,其格式为:第1行:被拼写检查的文件名 + 词典名 第2行后的每一行: 出错单词 位于第x行7.设计一个合理的GUI,注意GUI界面类与功能类的关系应比较松散。-use of object-oriented method to complete the "quick spell-check procedure" in the analysis, design and implementation process. Rapid screening procedures spelling basic requirements as follows : 1. Spell-checking documents to text files stored in the form of Disk; 2. Just check the documents in both Chinese and English word spelling errors; 3. Word is letters (a z or A ... ... Z) definition, as a non-alphabetic character as the separator; 4. Judge spelling error is the basis of dictionaries, dictionaries in the form of text files stored in external memory; 5. Dictionary document acts of a dictionary of names, each line deposited a word; 6. Output form of a text document storage, its format : Line 1 : The spell-check dictionary file name from the second line after each line : at
Platform: |
Size: 8192 |
Author: 罗春威 |
Hits:
Description: 一、 实验内容
S语言的编译程序的词法分析部分实现
从左到右扫描每行S语言源程序的符号,拼成单词,换成内部表示(token)
二、 实验要求
要求实现编译器的以下功能:
组织源程序的输入
按规则拼写单词,并转换成二元形式
删除空格及无用符号(如回车符,字符常数的引号符等)
发现并定位错误
建立单词表、符号表、常数表等文件
三、 实现方法
数据结构
1、 输入
S语言源程序,为文本文件
2、 输出
词法分析程序的运行结果是:产生一个单词序列文件(token文件)和一个常数表、一个符号表文件,并输出错误信息。
(1) token文件结构
token文件用于存放从S语言源程序中扫描出来的一个个单词符号的机内表示,其文件结构如下:
typedef struct token
{
nt label
char name[30]
int code
int addr
}token
说明:
label:单词序号;
name[30]:单词本身;
code:单词的编辑;
addr:地址,单词本身保留字时值为-1,为标识符成常数时为大于0常数,即该标识符成常数在符号表中的入口地址。
-one, Experiment S language compiler of lexical analysis to achieve whatever S scanning each line of source language symbols, makes up words, replaced internal said (token) 2, the experimental requirements call for compiler of the following functions :
Platform: |
Size: 77824 |
Author: 范鹏 |
Hits:
Description: 词法分析的目的是将输入的源程序进行划分,给出基本符号(token)的序列,并掠过注解和空格等分隔符号。基本符号是与输入的语言定义的词法所规定的终结符。-Lexical analysis is the input source to be divided, given the basic symbol (token) sequence, and passing notes and spaces, such as separator. Basic symbols of the language closely related to the importation of the lexical definition provided in the end of FU.
Platform: |
Size: 2048 |
Author: chenli |
Hits:
Description: 定义C语言或其子集的单词并给出编号,根据给定的语言子集构造词法分析器,从输入的源程序中,识别出各个具有独立意义的单词,即基本保留字、标识符、常量、运算符、分隔符五大类。并依次输出各个单词的内部编码及单词符号自身值(遇到错误时可显示“Error”,然后跳过错误部分继续显示),要求输出以文件形式存放的Token串。-The definition of C language or a subset of the word and give numbers, according to a subset of a given language construct lexical analyzer, from the input source, the identified individual has the independent meaning of words, that is basically reserved words, identifiers, constant, operator, separator five categories. And turn out every word in its own internal code and the word symbolic value (an error is encountered can be displayed "Error", then skip the error part of the continued to show), requiring form of a document stored in the output string Token.
Platform: |
Size: 5120 |
Author: xiaoding |
Hits:
Description: 是将输入的源程序进行划分,给出基本符号(token)的序列,并掠过注解和空格等分隔符号。基本符号是与输入的语言定义的词法所规定的终结符。
本实验要求学生编制一个读单词过程,从输入的源程序中,识别出各个具有独立意义的单词,即基本保留字、标识符、常数、运算符、分隔符五大类。并依次输出各个单词的内部编码及单词符号自身值。(遇到错误时可显示“Error”,然后跳过错误部分继续进行
-Is the input source program division, and gives the basic symbol (token) sequence, and skim over comments and Spaces and separator. Basic symbol is with the input language definition of the morphology by the end of the operator.
The experiment students are required to prepare a read words process, from the input source program, identify each independent meaning of words, namely basic reserved words, identifier, constant, operators, separator five categories. And in turn output each word internal coding and word sign their own value. (meet mistake can show "Error", and then skip the wrong part to continue
Platform: |
Size: 2048 |
Author: chenxia |
Hits:
Description: strtok(char s[], const char *delim) 用来将字符串分割成一个个片段。参数s指向欲分割的字符串,参数delim则为分割字符串中包含的所有字符。当strtok()在参数s的字符串中发现参数delim中包涵的分割字符时,则会将该字符改为\0 字符。在第一次调用时,strtok()必需给予参数s字符串,往后的调用则将参数s设置成NULL。每次调用成功则返回指向被分割出片段的指针。-strtok- break down a string into tokens (ANSI)
A sequence of calls to this routine breaks the string <string> into a
sequence of tokens, each of which is delimited by a character from the
string <separator>. The first call in the sequence has <string> as its
first argument, and is followed by calls with a null pointer as their
first argument. The separator string may be different from call to call.
The first call in the sequence searches <string> for the first character
that is not contained in the current separator string. If the character
is not found, there are no tokens in <string> and strtok() returns a
null pointer. If the character is found, it is the start of the first
token.
strtok() then searches from there for a character that is contained in the
current separator string. If the character is not found, the current
token expands to the end of the string pointed to by <string>, and
subsequent searches for a token wil
Platform: |
Size: 4096 |
Author: roc |
Hits: