Changeset 145 for branches/easy compiler/USourceGenerator.pas
- Timestamp:
- Jan 17, 2018, 1:11:56 PM (7 years ago)
- Location:
- branches/easy compiler
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/easy compiler
- Property svn:ignore
-
old new 2 2 *.exe 3 3 *.lps 4 heaptrclog.trc
-
- Property svn:ignore
-
branches/easy compiler/USourceGenerator.pas
r143 r145 81 81 with TSourceFunctionCall(Instruction) do begin 82 82 if Name = 'print' then begin 83 Result := Result + IndentStr + 'Write(' + GenerateRef( Parameters[0]) + ');' +83 Result := Result + IndentStr + 'Write(' + GenerateRef(TSourceReference(Parameters[0])) + ');' + 84 84 LineEnding; 85 85 end else 86 86 if Name = 'println' then begin 87 Result := Result + IndentStr + 'WriteLn(' + GenerateRef( Parameters[0]) + ');' +87 Result := Result + IndentStr + 'WriteLn(' + GenerateRef(TSourceReference(Parameters[0])) + ');' + 88 88 LineEnding; 89 89 end else 90 90 if Name = 'assign' then begin 91 Result := Result + IndentStr + GenerateRef( Parameters[0]) + ' := ' +92 GenerateRef( Parameters[1]) + ';' + LineEnding;91 Result := Result + IndentStr + GenerateRef(TSourceReference(Parameters[0])) + ' := ' + 92 GenerateRef(TSourceReference(Parameters[1])) + ';' + LineEnding; 93 93 end else 94 94 if Name = 'inputln' then begin 95 Result := Result + IndentStr + 'ReadLn(' + GenerateRef( Parameters[0]) + ');' + LineEnding;95 Result := Result + IndentStr + 'ReadLn(' + GenerateRef(TSourceReference(Parameters[0])) + ');' + LineEnding; 96 96 end else 97 97 if Name = 'increment' then begin 98 Result := Result + IndentStr + 'Inc(' + GenerateRef( Parameters[0]) + ', ' +99 GenerateRef( Parameters[1]) + ');' + LineEnding;98 Result := Result + IndentStr + 'Inc(' + GenerateRef(TSourceReference(Parameters[0])) + ', ' + 99 GenerateRef(TSourceReference(Parameters[1])) + ');' + LineEnding; 100 100 end else 101 101 raise Exception.Create('Unsupported instruction name.');
Note:
See TracChangeset
for help on using the changeset viewer.