Changeset 47 for branches/DelphiToC/Produce/UProducerC.pas
- Timestamp:
- Aug 9, 2010, 12:48:14 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DelphiToC/Produce/UProducerC.pas
r46 r47 29 29 procedure GenerateIfThenElse(IfThenElse: TIfThenElse); 30 30 procedure GenerateAssignment(Assignment: TAssignment); 31 procedure GenerateMethodCall(MethodCall: T MethodCall);31 procedure GenerateMethodCall(MethodCall: TFunctionCall); 32 32 function GenerateExpression(Expression: TExpression): string; 33 33 public … … 158 158 else if Command is TIfThenElse then GenerateIfThenElse(TIfThenElse(Command)) 159 159 else if Command is TAssignment then GenerateAssignment(TAssignment(Command)) 160 else if Command is T MethodCall then GenerateMethodCall(TMethodCall(Command));160 else if Command is TFunctionCall then GenerateMethodCall(TFunctionCall(Command)); 161 161 end; 162 162 … … 171 171 Emit('if(' + GenerateExpression(IfThenElse.Condition) + ')'); 172 172 GenerateCommand(IfThenElse.Command); 173 Emit('else '); 174 GenerateCommand(IfThenElse.ElseCommand); 173 if Assigned(IfThenElse.ElseCommand) then begin 174 Emit('else '); 175 GenerateCommand(IfThenElse.ElseCommand); 176 end; 175 177 end; 176 178 … … 180 182 end; 181 183 182 procedure TCProducer.GenerateMethodCall(MethodCall: T MethodCall);183 begin 184 Emit(MethodCall. Method.Name + '();');184 procedure TCProducer.GenerateMethodCall(MethodCall: TFunctionCall); 185 begin 186 Emit(MethodCall.FunctionRef.Name + '();'); 185 187 end; 186 188
Note:
See TracChangeset
for help on using the changeset viewer.