Changeset 20 for trunk/Compiler
- Timestamp:
- Nov 9, 2010, 12:21:56 PM (14 years ago)
- Location:
- trunk/Compiler
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Compiler/Analyze/UAnalyzer.pas
r12 r20 29 29 end; 30 30 31 TGetSourceEvent = function (Name: string; Source: TStringList): Boolean of object;31 TGetSourceEvent = function (Name: string; var SourceCode: string): Boolean of object; 32 32 33 33 { TAnalyzer } … … 51 51 CodeStreamPosition: Integer; 52 52 CodePosition: TPoint; 53 SourceCode Text: TStringList;53 SourceCode: string; 54 54 Tokens: TObjectList; // TObjectList<TToken> 55 55 TokenIndex: Integer; … … 225 225 Tokens.Clear; 226 226 TokenIndex := 0; 227 while CodeStreamPosition < Length(SourceCode Text.Text) do begin227 while CodeStreamPosition < Length(SourceCode) do begin 228 228 NewToken := TToken.Create; 229 229 GetNextToken; … … 255 255 FNextTokenType := ttNone; 256 256 FParserState := psNone; 257 with SourceCodeText do 257 258 258 while True do begin 259 if CodeStreamPosition < Length( Text) then begin260 CurrentChar := Text[CodeStreamPosition];259 if CodeStreamPosition < Length(SourceCode) then begin 260 CurrentChar := SourceCode[CodeStreamPosition]; 261 261 end else begin 262 262 FNextToken := ''; -
trunk/Compiler/Analyze/UAnalyzerPascal.pas
r19 r20 91 91 try 92 92 Parser := TAnalyzerPascal.Create; 93 Parser.SourceCodeText := TStringList.Create;94 93 Parser.OnDebugLog := OnDebugLog; 95 94 Parser.ProgramCode := ProgramCode; 96 95 Parser.OnGetSource := OnGetSource; 97 96 if Assigned(OnGetSource) then begin 98 if OnGetSource(Name, Parser.SourceCode Text) then begin97 if OnGetSource(Name, Parser.SourceCode) then begin 99 98 Parser.Process; 100 99 Parser.FileName := Name; … … 107 106 end else Result := False; 108 107 finally 109 Parser.SourceCodeText.Free;110 108 Parser.Free; 111 109 end; … … 560 558 NewType: TType; 561 559 begin 560 Log('ParseCommonBlockInterface'); 562 561 with SourceCode do begin 563 562 while (NextToken <> 'implementation') and (NextTokenType <> ttEndOfFile) do begin -
trunk/Compiler/UCompiler.pas
r16 r20 71 71 ProducedCode := TStringList.Create; 72 72 Analyzer.FileName := ModuleName; 73 Analyzer.SourceCode Text := Source;73 Analyzer.SourceCode := Source.Text; 74 74 Analyzer.Process; 75 75 //ShowMessage(IntToHex(Integer(Addr(Analyzer.OnGetSource)), 8));
Note:
See TracChangeset
for help on using the changeset viewer.