《C++程序设计教程》教学资源(讲义)PASCAL

大★★大大大大大★大大大大大★大★大大大大大大★★大 PARser大★大大大★★大大★大大★★大大★★★大★★大大大★★} constructor pARser. Create eaIn inherited creat HIstory :=TStringList Create Style des tructor TIParser Destroyi n HIstory. Free inherited Destroy function TIParser To ken: stringi Stskip=['',#10,#13]; I SENDIF RA DE [SIFDEF RA B] Stskip #10#13 I SENDIF RA B] edure Skil P[0] of if EStyle psPascal then F if F nil then IParserError(ieBadRemark, P Fpc Progr am) F+1 f Styl psPascal then IParserError(ie BadRemar k Epc Program)i if (EStyle ps Pascal) and (P[l]=l*)then
{*************************** TIParser ****************************} constructor TIParser.Create; begin inherited Create; FHistory := TStringList.Create; HistorySize := 10; Style := psPascal; end; destructor TIParser.Destroy; begin FHistory.Free; inherited Destroy; end; function TIParser.Token: string; var P, F: PChar; const {$IFDEF RA_D} StSkip = [' ', #10, #13]; {$ENDIF RA_D} {$IFDEF RA_B} StSkip = ' '#10#13; {$ENDIF RA_B} procedure SkipComments; begin case P[0] of '{': if FStyle = psPascal then begin F := StrScan(P + 1, '}'); if F = nil then IParserError(ieBadRemark, P - FpcProgram); P := F + 1; end; '}': if FStyle = psPascal then IParserError(ieBadRemark, P - FpcProgram); '(': if (FStyle = psPascal) and (P[1] = '*') then begin F := P + 2;

hile true do F : Strscan(F if F= nil then IParserError (ieBadRemark, P Fpc Program ifF[1]=') inc(F)i break end: inc(F) end if STyle psPascal then begin f(P[1] )')then IParserError(ieBadRemar k, P Epc Prog end else if EStyle =psCpp then if (P[l] /1) then IParserError(ieBadRemark p if (EStyle in [psPascal, psCpp]) and (P[1]='/')then eg F Str Scan(P 1,#13) if f= nil then F StrEnd(P 1)i else if (EStyle ps Cpp) and (P[l] ='*')then begin while true do beg StrScan(F,i*') if F= nil then IParserError (ieBadRemark, P -Epc Progr am) if F[l1 inc(F) inc(F)
while true do begin F := StrScan(F, '*'); if F = nil then IParserError(ieBadRemark, P - FpcProgram); if F[1] = ')' then begin inc(F); break; end; inc(F); end; P := F + 1; end; '*': if FStyle = psPascal then begin if (P[1] = ')') then IParserError(ieBadRemark, P - FpcProgram) end else if FStyle = psCpp then if (P[1] = '/') then IParserError(ieBadRemark, P - FpcProgram); '/': if (FStyle in [psPascal, psCpp]) and (P[1] = '/') then begin F := StrScan(P + 1, #13); if F = nil then F := StrEnd(P + 1); P := F; end else if (FStyle = psCpp) and (P[1] = '*') then begin F := P + 2; while true do begin F := StrScan(F, '*'); if F = nil then IParserError(ieBadRemark, P - FpcProgram); if F[1] = '/' then begin inc(F); break; end; inc(F); end; P := F + 1;

if (EStyle in [psPython, psPerl])[ ar reProgram) F:= StrScan(P +1,#13 if F= nil then F:= StrEnd(P 1) if EStyle psv then begin F:= StrScan(P 1, #13) if F= nil then F: StrEnd(P 1)
end; '#': if (FStyle in [psPython, psPerl]) { and ((P = FpcProgram) or (P[-1] in [#10, #13])) } then begin F := StrScan(P + 1, #13); if F = nil then F := StrEnd(P + 1); P := F; end; '''': if FStyle = psVB then begin F := StrScan(P + 1, #13); if F = nil then F := StrEnd(P + 1); P := F; end; end; end;
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
- 《C++程序设计教程》教学资源(PPT课件讲稿)第2讲 C++简单程序设计.ppt
- 《C++程序设计教程》教学资源(PPT课件讲稿)第3讲 更好的C.ppt
- 《C++程序设计教程》教学资源(PPT课件讲稿)第4讲 类与对象.ppt
- 《C++程序设计教程》教学资源(PPT课件讲稿)第5讲 C++程序的结构.ppt
- 《C++程序设计教程》教学资源(PPT课件讲稿)第6讲 数组、指针与字符串.ppt
- 《C++程序设计教程》教学资源(PPT课件讲稿)第7讲 MFC简介.ppt
- 《C++程序设计教程》教学资源(PPT课件讲稿)第7讲 继承与派生(1/2).ppt
- 《C++程序设计教程》教学资源(PPT课件讲稿)第8讲 继承与派生(2/2).ppt
- 《C++程序设计教程》教学资源(PPT课件讲稿)第9讲 运算符重载.ppt
- 《C++程序设计教程》教学资源(PPT课件讲稿)第10讲 运算符重载.ppt
- 《C++程序设计教程》教学资源(PPT课件讲稿)第11讲 虚函数(1/2).ppt
- 《C++程序设计教程》教学资源(PPT课件讲稿)第12讲 虚函数(2/2).ppt
- 《C++程序设计教程》教学资源(PPT课件讲稿)MFC简介.ppt
- 《C++程序设计教程》教学资源(PPT课件讲稿)第2讲 MFC简介.ppt
- 《C++程序设计教程》教学资源(PPT课件讲稿)复习.ppt
- 《C++程序设计教程》教学资源(讲义)FORTRAN.doc
- 《C++程序设计教程》教学资源(PPT课件讲稿)第1讲 绪论.ppt
- 清华大学:《多媒体技术》课程教学资源(教材教案讲义)附录ABC.doc
- 清华大学:《多媒体技术》课程教学资源(教材教案讲义)教材介绍.doc
- 清华大学:《多媒体技术》课程教学资源(教材教案讲义)课程介绍.doc
- 《计算机文化基础》创造计算机的神话——比尔·盖茨.ppt
- 《计算机文化基础》课程教学资源(讲解内容).doc
- 《计算机图形学》课程教学资源:第1章 绪论.ppt
- 《计算机图形学》课程教学资源:第2章 图形系统.ppt
- 《计算机图形学》课程教学资源:第3章 基本图形生成算法.ppt
- 《计算机图形学》课程教学资源:第4章 图形变换.ppt
- 《计算机图形学》课程教学资源:第5章 曲线和曲面.ppt
- 《计算机图形学》课程教学资源:第6章 几何造型.ppt
- 《计算机图形学》课程教学资源:第7章 消隐.ppt
- 《计算机图形学》课程教学资源:第8章 真实图形.ppt
- 《C语言程序设计》课程教学资源(PPT课件讲稿)第一章 Hello. C!.ppt
- 《C语言程序设计》课程教学资源(PPT课件讲稿)第二章 基本数据类型.ppt
- 《C语言程序设计》课程教学资源(PPT课件讲稿)第三章 运算符与表达式.ppt
- 《C语言程序设计》课程教学资源(PPT课件讲稿)第四章 顺序结构程序设计.ppt
- 《C语言程序设计》课程教学资源(PPT课件讲稿)第五章 选择结构程序设计.ppt
- 《C语言程序设计》课程教学资源(PPT课件讲稿)第六章 循环程序设计.ppt
- 《C语言程序设计》课程教学资源(PPT课件讲稿)第七章 数组.ppt
- 《C语言程序设计》课程教学资源(PPT课件讲稿)第八章 模块化程序设计.ppt
- 《C语言程序设计》课程教学资源(PPT课件讲稿)第八章 文件.ppt
- 《C语言程序设计》课程教学资源(PPT课件讲稿)第九章 指针.ppt