预览加载中,请您耐心等待几秒...
1/3
2/3
3/3

在线预览结束,喜欢就下载吧,查找使用更方便

如果您无法下载资料,请参考说明:

1、部分资料下载需要金币,请确保您的账户上有足够的金币

2、已购买过的文档,再次下载不重复扣费

3、资料包下载后请先用软件解压,在使用对应软件打开

{***************************TIParser****************************} constructorTIParser.Create; begin inheritedCreate; FHistory:=TStringList.Create; HistorySize:=10; Style:=psPascal; end; destructorTIParser.Destroy; begin FHistory.Free; inheritedDestroy; end; functionTIParser.Token:string; var P,F:PChar; const {$IFDEFRA_D} StSkip=['',#10,#13]; {$ENDIFRA_D} {$IFDEFRA_B} StSkip=''#10#13; {$ENDIFRA_B} procedureSkipComments; begin caseP[0]of '{': ifFStyle=psPascalthen begin F:=StrScan(P+1,'}'); ifF=nilthenIParserError(ieBadRemark,P-FpcProgram); P:=F+1; end; '}': ifFStyle=psPascalthenIParserError(ieBadRemark,P-FpcProgram); '(': if(FStyle=psPascal)and(P[1]='*')then begin F:=P+2; whiletruedo begin F:=StrScan(F,'*'); ifF=nilthenIParserError(ieBadRemark,P-FpcProgram); ifF[1]=')'then begin inc(F); break; end; inc(F); end; P:=F+1; end; '*': ifFStyle=psPascalthen begin if(P[1]=')')then IParserError(ieBadRemark,P-FpcProgram) end elseifFStyle=psCppthen if(P[1]='/')thenIParserError(ieBadRemark,P-FpcProgram); '/': if(FStylein[psPascal,psCpp])and(P[1]='/')then begin F:=StrScan(P+1,#13); ifF=nilthenF:=StrEnd(P+1); P:=F; end elseif(FStyle=psCpp)and(P[1]='*')then begin F:=P+2; whiletruedo begin F:=StrScan(F,'*'); ifF=nilthenIParserError(ieBadRemark,P-FpcProgram); ifF[1]='/'then begin inc(F); break; end; inc(F); end; P:=F+1; end; '#': if(FStylein[psPython,psPerl]){and ((P=FpcProgram)or(P[-1]in[#10,#13]))}then begin F:=StrScan(P+1,#13); ifF=nilthenF:=StrEnd(P+1); P:=F; end; '''': ifFStyle=psVBthen begin F:=StrScan(P+1,#13); ifF=nilthenF:=StrEnd(P+1); P:=F; end; end; end;