高分急求类pascal编译器的源代码(用lex和yacc做的,能够运行成功的 )

来源:百度知道 编辑:UC知道 时间:2024/06/01 02:28:06
最好有简单的说明
实现语言的基本说明语句和简单赋值语句及算术运算表达式语法分析即可
(词法分析部分包括标识符、数字构成规则等部分);
lex yacc编程工具:parser generator
在 windows能和vc++连接
我的邮箱 panzhao163@sina.com

pascal 是虾米哟~~~??

//这是Trubo Pascal7.0的编译器程序
Program WinPascal;

{$X+}
uses Globals, Gen_Code, Errors;

Procedure GetChar;
begin
if Not Eof(Source) then Read(Source,Look)
else Look := '.';

If Look = #13 then Inc(LineCount);
end;

procedure SkipSpace;
begin
While (look in [Cr,Lf,Tab_,' ']) AND (Not Eof(Source)) do
GetChar;
end;

Procedure Parse_Directive;
begin
if Look in ['C','c'] then
Console_App := True;
if Look in ['G','g'] then
Gui_App := True;
end;

Procedure GetToken;
label <