-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcpp2c_main.nfm
454 lines (454 loc) · 9.75 KB
/
cpp2c_main.nfm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
object Main: TMain
Left = 274
Top = 50
Caption = 'Cpp2C By: Mohammad Shams Javi'
ClientHeight = 561
ClientWidth = 719
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
Position = poDesigned
Constraints.MinHeight = 300
Constraints.MinWidth = 400
OnCreate = FormCreate
PixelsPerInch = 96
TextHeight = 13
object Splitter2: TSplitter
Align = alTop
Beveled = True
Cursor = crVSplit
ResizeStyle = rsUpdate
Width = 719
Left = 0
Top = 321
Height = 5
ExplicitTop = 369
ExplicitWidth = 630
end
object gridPre: TStringGrid
ColCount = 2
FixedCols = 0
RowCount = 1
FixedRows = 0
ScrollBars = ssVertical
TabOrder = 1
Left = 86
Top = 81
Width = 147
Height = 189
Tag = ''
Visible = False
ColWidths = (
64
64)
end
object prg: TProgressBar
Align = alBottom
TabOrder = 0
Left = 0
Top = 548
Width = 719
Height = 13
Step = 1
end
object Panel1: TPanel
Align = alTop
BevelOuter = bvNone
TabOrder = 2
Left = 0
Top = 0
Width = 719
Height = 321
object Splitter3: TSplitter
Beveled = True
ResizeStyle = rsUpdate
Width = 5
Left = 321
Top = 0
Height = 321
ExplicitLeft = 177
end
object grp2: TGroupBox
Align = alLeft
Caption = 'C++ Sources'
TabOrder = 0
Left = 0
Top = 0
Width = 321
Height = 321
DesignSize = (
321
321)
object txtSrc: TMemo
Align = alClient
Font.Charset = ARABIC_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = 'Courier New'
Font.Style = []
Lines.Strings = (
'#include <iostream.h>'
'#include <graph.h>'
''
'class stack{'
'private:'
#9'int *v;'
#9'int top;'
#9'int size;'
'public:'
#9'stack(int n=200)'
#9#9'{'
#9#9'v=new int[n];'
#9#9'top=-1;'
#9#9'size=n;'
#9#9'}'
#9'int isEmpty()'
#9#9'{return(top==-1)?1:0;'
#9#9'}'
#9'int isFull()'
#9#9'{return(top==size)?1:0;'
#9#9'}'
#9'void Push(int n);'
#9'void Pop();'
#9'int Top();'
#9'};'
''
''
'class queue{'
'private:'
#9'int *v;'
#9'int front;'
#9'int rear;'
#9'int size;'
#9'int c;'
'public:'
#9'queue(int n=150)'
#9#9'{'
#9#9'v=new int[n];'
#9#9'size=n;'
#9#9'c=0;'
#9#9'rear=0;'
#9#9'front=0;'
#9#9'}'
#9'int isEmpty()'
#9#9'{return !c;'
#9#9'}'
#9'int isFull()'
#9#9'{return(c==size)?1:0;'
#9#9'}'
#9'void Put(int a);'
#9'int Get();'
#9'};'
''
''
'void stack::Push(int n)'
#9'{'
#9'if (!isFull() && n>0) '
#9#9'v[++top]=n;'
#9'}'
''
'void stack::Pop()'
#9'{'
#9'if(!isEmpty()) '
#9#9'--top;'
#9'}'
''
'int stack::Top()'
#9'{'
#9'if (!isEmpty())'
#9#9'return v[top]'
#9'else'
#9#9'return -666;'
#9'}'
''
'void queue::Put(int a)'
#9'{'
#9'if(!isFull() && a>0)'
#9#9'{'
#9#9'v[rear++]=a;'
#9#9'c++;'
#9#9'rear=(rear>n)?0:rear;'
#9#9'}'
#9'}'
''
'int queue::Get()'
#9'{'
#9'if (!isEmpty())'
#9#9'{'
#9#9'c--;'
#9#9'int temp;'
#9#9'temp=v[front++];'
#9#9'if (front>n) '
#9#9#9'front=0;'
#9#9'return temp;'
#9#9'}'
#9'else'
#9#9'return -666;'
#9'}'
''
''
'void main()'
#9'{'
#9'stack s;'
#9'int num1=-1;'
#9'int num2=0;'#9
''
#9'printf("Enter stack size:");'
#9'scanf("%d",num2);'
#9'stack t(num2);'
''
#9's.Push(5);'
#9's.Push(6);'
#9's.Get();'
''
#9'num2=s.top();'
''
#9'if (num2==6)'
#9#9'printf("Its true!");'
''
#9't.Push(10);'
#9't.Pop();'
''
#9'queue q(10);'
''
#9'printf("Enter int number:");'
#9'scanf("%d",num1);'
#9'q.Put(num1);'
''
#9'q.Put(12);'
#9'num1=q.get();'
#9'}')
ParentFont = False
ScrollBars = ssBoth
TabOrder = 0
WantTabs = True
Left = 2
Top = 15
Width = 317
Height = 304
end
object btnLoad: TButton
Left = 224
Top = 21
Width = 73
Height = 23
Caption = 'Load'
TabOrder = 1
Anchors = [akLeft, akTop, akRight]
AlignWithMargins = True
OnClick = btnLoadClick
end
object btnsave: TButton
Left = 224
Top = 44
Width = 73
Height = 23
Caption = 'Save'
TabOrder = 2
Anchors = [akLeft, akTop, akRight]
AlignWithMargins = True
OnClick = btnsaveClick
end
end
object grp5: TGroupBox
Align = alClient
Caption = 'C Translated'
TabOrder = 1
Left = 326
Top = 0
Width = 313
Height = 321
object txtDst: TMemo
Align = alClient
Font.Charset = ARABIC_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = 'Courier New'
Font.Style = []
ParentFont = False
ReadOnly = True
ScrollBars = ssBoth
TabOrder = 0
Left = 2
Top = 15
Width = 309
Height = 304
end
end
object grp3: TPanel
Align = alRight
BevelOuter = bvNone
TabOrder = 2
Left = 639
Top = 0
Width = 80
Height = 321
object grp6: TGroupBox
Align = alClient
Caption = 'Data Types'
TabOrder = 0
Left = 0
Top = 145
Width = 80
Height = 176
object gridTypes: TStringGrid
Align = alClient
ColCount = 1
FixedCols = 0
RowCount = 1
FixedRows = 0
ScrollBars = ssVertical
TabOrder = 0
Left = 2
Top = 15
Width = 76
Height = 159
Tag = ''
ColWidths = (
64)
end
end
object grp7: TGroupBox
Align = alTop
Caption = 'Action'
TabOrder = 1
Left = 0
Top = 0
Width = 80
Height = 145
object btnCnv: TButton
Left = 2
Top = 79
Width = 76
Height = 32
Caption = '3- Translate'
TabOrder = 2
Align = alTop
Enabled = False
OnClick = btnCnvClick
end
object btnGo: TButton
Left = 2
Top = 47
Width = 76
Height = 32
Caption = '2- Parse'
TabOrder = 1
Align = alTop
Enabled = False
OnClick = btnGoClick
end
object btnPre: TButton
Left = 2
Top = 15
Width = 76
Height = 32
Caption = '1- Pre Proc'
TabOrder = 0
Align = alTop
OnClick = btnPreClick
end
object btnHlp: TButton
Left = 2
Top = 111
Width = 76
Height = 32
Caption = 'Help'
TabOrder = 3
Align = alTop
OnClick = btnHlpClick
end
end
end
end
object Panel2: TPanel
Align = alClient
BevelOuter = bvNone
TabOrder = 3
Left = 0
Top = 326
Width = 719
Height = 222
object Splitter1: TSplitter
Beveled = True
ResizeStyle = rsUpdate
Width = 5
Left = 134
Top = 0
Height = 222
ExplicitLeft = 344
ExplicitTop = -1
ExplicitHeight = 321
end
object grp1: TGroupBox
Align = alClient
Caption = 'Symbol Table'
TabOrder = 0
Left = 139
Top = 0
Width = 580
Height = 222
object gridVars: TStringGrid
Align = alClient
ColCount = 7
FixedCols = 0
RowCount = 2
TabOrder = 0
Left = 2
Top = 15
Width = 576
Height = 205
Tag = ''
Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goRowSizing, goColSizing]
OnDrawCell = gridVarsDrawCell
ColWidths = (
111
58
102
76
76
71
49)
end
end
object grp4: TGroupBox
Align = alLeft
Caption = 'Pre Process'
TabOrder = 1
Left = 0
Top = 0
Width = 134
Height = 222
object txtPre: TMemo
Align = alClient
ReadOnly = True
ScrollBars = ssBoth
TabOrder = 0
Left = 2
Top = 15
Width = 130
Height = 205
end
end
end
object ev: TApplicationEvents
OnException = evException
Left = 136
Top = 440
end
object dlgopen: TOpenDialog
Options = [ofOverwritePrompt, ofHideReadOnly, ofEnableSizing]
Title = 'Load From'
Left = 200
Top = 440
end
object dlgsave: TSaveDialog
Options = [ofOverwritePrompt, ofHideReadOnly, ofEnableSizing]
Title = 'Save As'
Left = 168
Top = 440
end
end