Changeset 148 for branches/easy compiler/USourceGenerator.pas
- Timestamp:
- Jan 17, 2018, 5:27:23 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/easy compiler/USourceGenerator.pas
r147 r148 44 44 else if ValueType.Name = 'Integer' then 45 45 Result := Result + 'Integer' 46 else if ValueType.Name = 'StringArray' then 47 Result := Result + 'array of string' 48 else if ValueType.Name = 'IntegerArray' then 49 Result := Result + 'array of Integer' 46 50 else raise Exception.Create('Unsupported type'); 47 51 Result := Result + ';' + LineEnding; … … 66 70 if Reference is TSourceReferenceVariable then begin 67 71 Result := Result + TSourceReferenceVariable(Reference).Variable.Name; 72 end else 73 if Reference is TSourceReferenceArray then begin 74 Result := Result + TSourceReferenceArray(Reference).ArrayRef.Name + 75 '[' + GenerateRef(TSourceReferenceArray(Reference).Index) + ']'; 68 76 end else raise Exception.Create('Unsupported parameter type'); 69 77 end; … … 116 124 Result := Result + IndentStr + 'until False;' + LineEnding; 117 125 end else 118 if Command is TCommandIfZero then begin 119 Result := Result + IndentStr + 'if ' + TCommandIfZero(Command).Variable.Variable.Name + ' = 0 then '; 126 if Command is TCommandIfEqual then begin 127 Result := Result + IndentStr + 'if ' + GenerateRef(TCommandIfEqual(Command).Reference1) + 128 ' = ' + GenerateRef(TCommandIfEqual(Command).Reference2) + ' then '; 120 129 end else 121 130 raise Exception.Create('Unsupported instruction');
Note:
See TracChangeset
for help on using the changeset viewer.