当前位置:编程学习 > C#/ASP.NET >>

c#词法检测

测试代码:
program  example2;
var  A,B,C:integer;
     X,Y:bool;
begin  /*  this  is  an  example  
  A:=B*C+37;
  X:=ABC’
end.


编一个程序,检测此代码词法,报错缺少了*/和‘
正确代码:
begin  /*  this  is  an  example  */
X:='ABC’ --------------------编程问答-------------------- 用窗口模式编写 --------------------编程问答-------------------- 看了你的代码,只能告诉你,一是你的程序所谓“词法检测”根本没谱,你需要的不是凑代码,而是把编译原理好好补习下。

这里有些文档/程序你可以参考下

http://www.docin.com/p-59160705.html
http://www.progtools.org/compilers/projects/analyzer/manual.html
http://www.codeguru.com/cpp/cpp/cpp_mfc/parsing/article.php/c831/Mini-Pascal-Compiler.htm --------------------编程问答-------------------- --------------------编程问答-------------------- 去图书馆借本编译原理看看  
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,