测试代码:
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’
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.progtools.org/compilers/projects/analyzer/manual.html
http://www.codeguru.com/cpp/cpp/cpp_mfc/parsing/article.php/c831/Mini-Pascal-Compiler.htm