Changeset 58
- Timestamp:
- Jul 17, 2012, 6:05:13 AM (12 years ago)
- Location:
- trunk/Compiler
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Compiler/Analyze/UAnalyzerPascal.pas
r57 r58 15 15 private 16 16 public 17 function DebugExpressions(List: TListExpression): string; 17 18 function ParseFile(Name: string): Boolean; 18 19 function ParseWhileDo(var WhileDo: TWhileDo; SourceCode: TCommonBlock): Boolean; … … 86 87 { TAnalyzerPascal } 87 88 89 function TAnalyzerPascal.DebugExpressions(List: TListExpression): string; 90 var 91 I: Integer; 92 begin 93 Result := Result + '('; 94 for I := 0 to List.Count - 1 do begin 95 Result := Result + IntToStr(I) + ': '; 96 if Assigned(List[I]) then 97 Result := Result + IntToStr(Integer(TExpression(List[I]).NodeType)) + 98 DebugExpressions(TExpression(List[I]).SubItems); 99 if I < List.Count - 1 then Result := Result + ', '; 100 end; 101 Result := Result + ')'; 102 end; 103 88 104 function TAnalyzerPascal.ParseFile(Name: string): Boolean; 89 105 var … … 150 166 ReadToken; 151 167 end; 152 ShowMessage(IntToStr(TExpression(Expressions.Last).SubItems.Count) + ' ' + TExpression(Expressions.Last).OperatorName); 153 if Assigned(TExpression(Expressions.First)) then 154 ShowMessage('First ' + IntToStr(Integer(TExpression(Expressions.Last).SubItems.First))); 155 if Assigned(TExpression(Expressions.Last)) then 156 ShowMessage('Last ' + IntToStr(Integer(TExpression(Expressions.Last).SubItems.Last))); 168 //ShowMessage(DebugExpressions(Expressions)); 157 169 end; 158 170 … … 325 337 if Assigned(NewExpression) then begin 326 338 TExpression(Expressions.Last).SubItems.Last := NewExpression; 327 with Expressions.Items[Expressions.Add(TExpression.Create)]do339 with TExpression(Expressions.Items[Expressions.Add(TExpression.Create)]) do 328 340 begin 329 341 CommonBlock := SourceCode.CommonBlock; -
trunk/Compiler/Target/Delphi/UProducerPascal.pas
r44 r58 73 73 ModuleName: string; 74 74 begin 75 if UsedModules.Count = 0 then Exit; 75 76 EmitLn('uses'); 76 77 Inc(Indentation);
Note:
See TracChangeset
for help on using the changeset viewer.