- 3
- 0
- 约8.83万字
- 约 19页
- 2017-06-05 发布于河南
- 举报
词法剖析器(C#完成)(国外英文资料)
词法分析器(C#实现)(国外英文资料)
/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* write in the front
Before parsing, preprocess the source code, remove the extra space and line and comment
* words are best separated from words, or they will be recognized as unknown
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
Using System;
Using System. Collections. Generic;
Using System.Com ponentModel;
Using System. The Data;
Using System. Drawing;
Using System. The Collections;
Using System. The Text;
Using System. Windows. Forms;
Using System. IO;
The namespace lexical analysis
{
Public partial class Form1: Form
{
Private static string [] reserved words = { bool , break, case, char, do, double, else,
False, float, for, if, int, long, main, new, null, private, protected, public,
Static, true, try, typeof, unit, void, while, return, short, sizeof, switch
};
Private static string [] operator = { * , /, %, +, -, , , and , = , =,
= =, ! = , , ^, |, , | |, ? : , + =, - =, * =, / =, % =, =, | =, ^ =,
=, =, =};
Private static string [], , , ; , , , (, ) , :, /, , {} , ,/};
Private static string [] identifier;
Private static string [] constant;
Private static string [] unknown symbol;
Private ArrayList temp = new ArrayList ();
Public _click ()
{
InitializeComponent ();
}
Public int Search_Location (string STR, string [] a) / / lookup character encoding
{
For (int I = 0; I a.i.ength; I + +)
{
If (STR = = a [I])
Return the I + 1;
}
The return - 1;
}
The public int InsertId (string STRR, ref string [] a) / / identifier inserts the identifier table back to the location
{
Temp. The Clear ();
If (a = = null)
Temp. Add
您可能关注的文档
- 英语简单句、并列句、复合句解析(国外英文资料).doc
- 英语简单句型剖析教案(国外英文资料).doc
- 英语简单句的五种基础句型及There be结构(国外英文资料).doc
- 英语简单句翻译演习(国外英文资料).doc
- 英语简单句的基础句型(国外英文资料).doc
- 英语系动词回类(国外英文资料).doc
- 英语的定语(国外英文资料).doc
- 英语简单句学案(国外英文资料).doc
- 英语系动词(国外英文资料).doc
- 英语组动词温习教授教化设计六(国外英文资料).doc
- 2026年及未来5年内中国液体氩气行业投资前景及策略咨询研究报告.docx
- 2026年及未来5年内中国黄铜合页行业投资前景及策略咨询研究报告.docx
- 2026年及未来5年内中国竹工艺家具行业投资前景及策略咨询研究报告.docx
- 2025年中国微机数显自动分析仪市场调查研究报告.docx
- 2026年及未来5年内中国微尘白色粉笔行业投资前景及策略咨询研究报告.docx
- 2025年中国微电脑型压胶机市场调查研究报告.docx
- 2026年及未来5年内中国数字化等功游泳训练测试系统行业投资前景及策略咨询研究报告.docx
- 2025年中国圆形花瓶市场调查研究报告.docx
- 2026年及未来5年内中国植物纤维静淀过滤器行业投资前景及策略咨询研究报告.docx
- 2025年中国超音波手套机市场调查研究报告.docx
最近下载
- 农村电商(农产品电商)运营全套教学课件.pptx
- 四川省成都市第七中学2025-2026学年高一上学期11月半期考试英语(含答案).pdf
- (最新)ISO31073-2022风险管理术语(译2022-04)(推荐下载).pdf VIP
- (最新)村干部考试试题(含答案).docx VIP
- zippo图册年度机系列整合(更新至C25).docx VIP
- 多轴车铣复合加工运动转换方法:原理、实践与创新.docx
- 商务礼仪商务礼仪培训专用.ppt VIP
- 《铁路劳动安全》第04章预防机动车辆伤害.pptx VIP
- 化工制图第1章 制图基础.ppt VIP
- 化工制图AutoCAD应用基础-03章.pptx VIP
原创力文档

文档评论(0)