-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainWindow.xaml
520 lines (516 loc) · 29.9 KB
/
MainWindow.xaml
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
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
<Window x:Class="CPP_EP.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:cpp_ep="clr-namespace:CPP_EP"
xmlns:conv="clr-namespace:CPP_EP.Converter"
d:DataContext="{d:DesignInstance Type=cpp_ep:MainWindowDataContext}"
mc:Ignorable="d"
Title="《编译原理 语法分析》实验平台" Height="720" Width="1280"
Closed="Window_Closed">
<Window.Resources>
<RoutedUICommand x:Key="StartOrContinue" />
<RoutedUICommand x:Key="Stop" />
<RoutedUICommand x:Key="Step" />
<RoutedUICommand x:Key="Next" />
<RoutedUICommand x:Key="Finish" />
<RoutedUICommand x:Key="Save" />
<RoutedUICommand x:Key="SaveAll" />
<RoutedUICommand x:Key="Option" />
<RoutedUICommand x:Key="Exit" />
<RoutedUICommand x:Key="About" />
</Window.Resources>
<Window.InputBindings>
<KeyBinding Gesture="F5" Command="{StaticResource StartOrContinue}" />
<KeyBinding Gesture="Shift+F5" Command="{StaticResource Stop}" />
<KeyBinding Gesture="F11" Command="{StaticResource Step}" />
<KeyBinding Gesture="F10" Command="{StaticResource Next}" />
<KeyBinding Gesture="Shift+F11" Command="{StaticResource Finish}" />
<KeyBinding Gesture="Ctrl+S" Command="{StaticResource Save}" />
<KeyBinding Gesture="Ctrl+Shift+S" Command="{StaticResource SaveAll}" />
</Window.InputBindings>
<Window.CommandBindings>
<CommandBinding
Command="{StaticResource StartOrContinue}"
CanExecute="StartOrContinue_CanExecute"
Executed="StartOrContinue_Executed" />
<CommandBinding
Command="{StaticResource Stop}"
CanExecute="Stop_CanExecute"
Executed="Stop_Executed" />
<CommandBinding
Command="{StaticResource Step}"
CanExecute="Step_CanExecute"
Executed="Step_Executed" />
<CommandBinding
Command="{StaticResource Next}"
CanExecute="Next_CanExecute"
Executed="Next_Executed" />
<CommandBinding
Command="{StaticResource Finish}"
CanExecute="Finish_CanExecute"
Executed="Finish_Executed" />
<CommandBinding
Command="{StaticResource SaveAll}"
CanExecute="SaveAll_CanExecute"
Executed="SaveAll_Executed" />
<CommandBinding
Command="{StaticResource Save}"
CanExecute="Save_CanExecute"
Executed="Save_Executed" />
</Window.CommandBindings>
<Grid>
<Grid.Resources>
<conv:BoolToStringPropConverter x:Key="VisibilityConverter"
TrueValue="Visible"
FalseValue="Collapsed" />
</Grid.Resources>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*" />
<ColumnDefinition Width="3" />
<ColumnDefinition Width="1*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="2*" />
<RowDefinition Height="3" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<ScrollViewer
Grid.Row="0"
Grid.Column="2"
Grid.RowSpan="5"
HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Auto"
Visibility="{Binding DataVisible, Mode=OneWay, Converter={StaticResource VisibilityConverter}}">
<TextBlock
Name="dataStructureView"
FontFamily="Consolas"
FontSize="10pt"
Margin="10,10,0,0"
PreviewMouseWheel="DataStructureView_PreviewMouseWheel">
ruleHead:<Border Background="PaleGreen"><TextBlock>rule</TextBlock></Border><Border Background="Khaki"><TextBlock>production</TextBlock></Border><Border Background="SandyBrown"><TextBlock>symbol</TextBlock></Border>
<LineBreak />
<Border Background="PaleGreen">
<TextBlock>E<Run Foreground="Gray" Text=" -> "/><Border Background="Khaki"><TextBlock>
<Border Background="SandyBrown">
<TextBlock>T</TextBlock>
</Border><TextBlock>E'</TextBlock>
</TextBlock>
</Border>
</TextBlock>
</Border>
<LineBreak/>
<TextBlock>E'<Run Foreground="Gray" Text=" -> "/><TextBlock>
<TextBlock>+TE'</TextBlock><Run Foreground="Gray" Text=" | "/><TextBlock>$</TextBlock>
</TextBlock>
</TextBlock>
<LineBreak/>
<TextBlock>T<Run Foreground="Gray" Text=" -> "/><TextBlock>
<TextBlock>FT'</TextBlock>
</TextBlock>
</TextBlock>
<LineBreak/>
<TextBlock>T'<Run Foreground="Gray" Text=" -> "/><TextBlock>
<TextBlock>*FT'</TextBlock><Run Foreground="Gray" Text=" | "/><TextBlock>$</TextBlock>
</TextBlock>
</TextBlock>
<LineBreak/>
<TextBlock>F<Run Foreground="Gray" Text=" -> "/><TextBlock>
<TextBlock>i</TextBlock><Run Foreground="Gray" Text=" | "/><TextBlock>(E)</TextBlock>
</TextBlock>
</TextBlock>
<LineBreak/>
voidTable:<Border Background="PaleGreen"><TextBlock>rule</TextBlock></Border><Border Background="SandyBrown"><TextBlock>symbol</TextBlock></Border><LineBreak />
<Border Width="52" BorderThickness="1 1 1 1" BorderBrush="Gray" Background="PaleGreen">
<TextBlock>E</TextBlock></Border><Border Width="52" BorderThickness="0 1 1 1" BorderBrush="Gray">
<TextBlock>E'</TextBlock></Border><Border Width="52" BorderThickness="0 1 1 1" BorderBrush="Gray" Background="SandyBrown">
<TextBlock>T</TextBlock></Border><Border Width="52" BorderThickness="0 1 1 1" BorderBrush="Gray">
<TextBlock>T'</TextBlock></Border><Border Width="52" BorderThickness="0 1 1 1" BorderBrush="Gray">
<TextBlock>F</TextBlock></Border><LineBreak />
<Border Width="52" BorderThickness="1 0 1 1" BorderBrush="Gray" Background="PaleGreen">
<TextBlock>0</TextBlock></Border><Border Width="52" BorderThickness="0 0 1 1" BorderBrush="Gray">
<TextBlock>1'</TextBlock></Border><Border Width="52" BorderThickness="0 0 1 1" BorderBrush="Gray" Background="SandyBrown">
<TextBlock>0</TextBlock></Border><Border Width="52" BorderThickness="0 0 1 1" BorderBrush="Gray">
<TextBlock>1'</TextBlock></Border><Border Width="52" BorderThickness="0 0 1 1" BorderBrush="Gray">
<TextBlock>0</TextBlock></Border><LineBreak /><LineBreak />
firstSetList:<Border Background="PaleGreen"><TextBlock>desSet</TextBlock></Border><Border Background="SandyBrown"><TextBlock>srcSet</TextBlock></Border><LineBreak />
<Border Background="PaleGreen"><TextBlock><Run Foreground="Gray" Text="FIRST ( "/>exp<Run Foreground="Gray" Text=" ) = { "/>$<Run Foreground="Gray" Text=" }"/></TextBlock></Border><LineBreak />
<Border Background="SandyBrown"><TextBlock><Run Foreground="Gray" Text="FIRST ( "/>addop<Run Foreground="Gray" Text=" ) = { "/><Run Foreground="Gray" Text=" }"/></TextBlock></Border><LineBreak />
<Run Foreground="Gray" Text="FIRST ( "/>term<Run Foreground="Gray" Text=" ) = { "/>$<Run Foreground="Gray" Text=" }"/><LineBreak />
<Run Foreground="Gray" Text="FIRST ( "/>mulop<Run Foreground="Gray" Text=" ) = { "/><Run Foreground="Gray" Text=" }"/><LineBreak />
<Run Foreground="Gray" Text="FIRST ( "/>factor<Run Foreground="Gray" Text=" ) = { "/><Run Foreground="Gray" Text=" }"/><LineBreak /><LineBreak />
selectSetList:<Border Background="PaleGreen"><TextBlock>selectSet</TextBlock></Border><LineBreak />
<Border Background="PaleGreen"><TextBlock><Run Foreground="Gray" Text="SELECT ( "/>E<Run Foreground="Gray" Text=" -> "/>TE'<Run Foreground="Gray" Text=" ) = { "/>i<Run Foreground="Gray" Text=" , "/>(<Run Foreground="Gray" Text=" }"/></TextBlock></Border><LineBreak />
<Run Foreground="Gray" Text="SELECT ( "/>E'<Run Foreground="Gray" Text=" -> "/>+TE'<Run Foreground="Gray" Text=" ) = { "/>+<Run Foreground="Gray" Text=" }"/><LineBreak />
<Run Foreground="Gray" Text="SELECT ( "/>E'<Run Foreground="Gray" Text=" -> "/>$<Run Foreground="Gray" Text=" ) = { "/>#<Run Foreground="Gray" Text=" , "/>)<Run Foreground="Gray" Text=" }"/><LineBreak />
<Run Foreground="Gray" Text="SELECT ( "/>T<Run Foreground="Gray" Text=" -> "/>FT'<Run Foreground="Gray" Text=" ) = { "/>i<Run Foreground="Gray" Text=" , "/>(<Run Foreground="Gray" Text=" }"/><LineBreak />
<Run Foreground="Gray" Text="SELECT ( "/>T'<Run Foreground="Gray" Text=" -> "/>*FT'<Run Foreground="Gray" Text=" ) = { "/>*<Run Foreground="Gray" Text=" }"/><LineBreak />
<LineBreak />
<!--
followSetList:<LineBreak /><LineBreak />
selectSetList:<LineBreak /><LineBreak />
parsingTable:<Border Background="PaleGreen"><TextBlock>foundProduction</TextBlock></Border><LineBreak />
<Border Width="52" BorderThickness="1 1 1 1" BorderBrush="Gray">
<TextBlock></TextBlock></Border><Border Width="52" BorderThickness="0 1 1 1" BorderBrush="Gray">
<TextBlock>+</TextBlock></Border><Border Width="52" BorderThickness="0 1 1 1" BorderBrush="Gray">
<TextBlock>*</TextBlock></Border><Border Width="52" BorderThickness="0 1 1 1" BorderBrush="Gray">
<TextBlock>i</TextBlock></Border><Border Width="52" BorderThickness="0 1 1 1" BorderBrush="Gray">
<TextBlock>(</TextBlock></Border><Border Width="52" BorderThickness="0 1 1 1" BorderBrush="Gray">
<TextBlock>)</TextBlock></Border><Border Width="52" BorderThickness="0 1 1 1" BorderBrush="Gray">
<TextBlock>#</TextBlock></Border><LineBreak />
<Border Width="52" BorderThickness="1 0 1 1" BorderBrush="Gray">
<TextBlock>E</TextBlock></Border><Border Width="52" BorderThickness="0 0 1 1" BorderBrush="Gray">
<TextBlock></TextBlock></Border><Border Width="52" BorderThickness="0 0 1 1" BorderBrush="Gray">
<TextBlock></TextBlock></Border><Border Width="52" BorderThickness="0 0 1 1" BorderBrush="Gray">
<TextBlock>TE'</TextBlock></Border><Border Width="52" BorderThickness="0 0 1 1" BorderBrush="Gray" Background="PaleGreen">
<TextBlock></TextBlock></Border><Border Width="52" BorderThickness="0 0 1 1" BorderBrush="Gray">
<TextBlock></TextBlock></Border><Border Width="52" BorderThickness="0 0 1 1" BorderBrush="Gray">
<TextBlock></TextBlock></Border><LineBreak />
<Border Width="52" BorderThickness="1 0 1 1" BorderBrush="Gray">
<TextBlock>E'</TextBlock></Border><Border Width="52" BorderThickness="0 0 1 1" BorderBrush="Gray">
<TextBlock></TextBlock></Border><Border Width="52" BorderThickness="0 0 1 1" BorderBrush="Gray">
<TextBlock></TextBlock></Border><Border Width="52" BorderThickness="0 0 1 1" BorderBrush="Gray">
<TextBlock></TextBlock></Border><Border Width="52" BorderThickness="0 0 1 1" BorderBrush="Gray">
<TextBlock></TextBlock></Border><Border Width="52" BorderThickness="0 0 1 1" BorderBrush="Gray">
<TextBlock></TextBlock></Border><Border Width="52" BorderThickness="0 0 1 1" BorderBrush="Gray">
<TextBlock></TextBlock></Border><LineBreak /><Border Width="52" BorderThickness="1 0 1 1" BorderBrush="Gray">
<TextBlock>T</TextBlock></Border><Border Width="52" BorderThickness="0 0 1 1" BorderBrush="Gray">
<TextBlock></TextBlock></Border><Border Width="52" BorderThickness="0 0 1 1" BorderBrush="Gray">
<TextBlock></TextBlock></Border><Border Width="52" BorderThickness="0 0 1 1" BorderBrush="Gray">
<TextBlock></TextBlock></Border><Border Width="52" BorderThickness="0 0 1 1" BorderBrush="Gray">
<TextBlock></TextBlock></Border><Border Width="52" BorderThickness="0 0 1 1" BorderBrush="Gray">
<TextBlock></TextBlock></Border><Border Width="52" BorderThickness="0 0 1 1" BorderBrush="Gray">
<TextBlock></TextBlock></Border><LineBreak /><Border Width="52" BorderThickness="1 0 1 1" BorderBrush="Gray">
<TextBlock>T'</TextBlock></Border><Border Width="52" BorderThickness="0 0 1 1" BorderBrush="Gray">
<TextBlock></TextBlock></Border><Border Width="52" BorderThickness="0 0 1 1" BorderBrush="Gray">
<TextBlock></TextBlock></Border><Border Width="52" BorderThickness="0 0 1 1" BorderBrush="Gray">
<TextBlock></TextBlock></Border><Border Width="52" BorderThickness="0 0 1 1" BorderBrush="Gray">
<TextBlock></TextBlock></Border><Border Width="52" BorderThickness="0 0 1 1" BorderBrush="Gray">
<TextBlock></TextBlock></Border><Border Width="52" BorderThickness="0 0 1 1" BorderBrush="Gray">
<TextBlock></TextBlock></Border><LineBreak /><Border Width="52" BorderThickness="1 0 1 1" BorderBrush="Gray">
<TextBlock>F</TextBlock></Border><Border Width="52" BorderThickness="0 0 1 1" BorderBrush="Gray">
<TextBlock></TextBlock></Border><Border Width="52" BorderThickness="0 0 1 1" BorderBrush="Gray">
<TextBlock></TextBlock></Border><Border Width="52" BorderThickness="0 0 1 1" BorderBrush="Gray">
<TextBlock></TextBlock></Border><Border Width="52" BorderThickness="0 0 1 1" BorderBrush="Gray">
<TextBlock></TextBlock></Border><Border Width="52" BorderThickness="0 0 1 1" BorderBrush="Gray">
<TextBlock></TextBlock></Border><Border Width="52" BorderThickness="0 0 1 1" BorderBrush="Gray">
<TextBlock></TextBlock></Border><LineBreak /><LineBreak /><LineBreak />
-->
string: i+i*i#<LineBreak />
stack:<Border Background="PaleGreen"><TextBlock>topSymbol</TextBlock></Border><LineBreak />
<Border Width="52" BorderThickness="1" BorderBrush="Gray" Background="PaleGreen"><TextBlock>F</TextBlock></Border><LineBreak /><LineBreak />
<Border Width="52" BorderThickness="1 0 1 1" BorderBrush="Gray"><TextBlock>T'</TextBlock></Border><LineBreak />
<Border Width="52" BorderThickness="1 0 1 1" BorderBrush="Gray"><TextBlock>E'</TextBlock></Border><LineBreak />
<Border Width="52" BorderThickness="1 0 1 1" BorderBrush="Gray"><TextBlock>#</TextBlock></Border><LineBreak />
<Run Text="1 # i+i*i# E->TE'"/><LineBreak />
<Run Text="2 #E' i+i*i# T->FT'"/><LineBreak />
<Run Text="3 #E'T' i+i*i# F->i"/><LineBreak />
<LineBreak />
</TextBlock>
</ScrollViewer>
<GridSplitter
Grid.Row="0"
Grid.Column="1"
Grid.RowSpan="5"
Width="3"
HorizontalAlignment="Stretch"
Visibility="{Binding DataVisible, Mode=OneWay, Converter={StaticResource VisibilityConverter}}"/>
<Menu
Grid.Row="0"
Grid.Column="0"
Grid.ColumnSpan="{Binding ColSpan, Mode=OneWay}">
<MenuItem Header="文件(_F)">
<MenuItem Header="打开实验(_O)" Name="openMenus" IsEnabled="{Binding LabSelectEnable, Mode=OneWay}">
<MenuItem Header="空表" Click="OpenMenu_Click"/>
<MenuItem Header="FIRST 集" Click="OpenMenu_Click"/>
<MenuItem Header="FOLLOW 集" Click="OpenMenu_Click"/>
<MenuItem Header="预测分析表" Click="OpenMenu_Click"/>
<MenuItem Header="提取左因子" Click="OpenMenu_Click"/>
<MenuItem Header="消除左递归(无替换)" Click="OpenMenu_Click"/>
<MenuItem Header="消除左递归(有替换)" Click="OpenMenu_Click"/>
<MenuItem Header="预测分析方法" Click="OpenMenu_Click"/>
</MenuItem>
<MenuItem
Command="{StaticResource Save}"
Header="保存(_S)"
InputGestureText="Ctrl+S" />
<MenuItem
Command="{StaticResource SaveAll}"
Header="全部保存(_S)"
InputGestureText="Ctrl+Shift+S" />
<Separator />
<!--
<MenuItem
Click="Option_Click"
Header="选项(_O)" />
<Separator />
-->
<MenuItem
Click="Exit_Click"
Header="退出(_X)"
InputGestureText="Alt+F4" />
</MenuItem>
<MenuItem Header="编辑(_E)">
<MenuItem Command="Undo" Header="撤销(_U)" />
<MenuItem Command="Redo" Header="重做(_R)" />
<Separator />
<MenuItem Command="Cut" Header="剪切(_T)" />
<MenuItem Command="Copy" Header="复制(_C)" />
<MenuItem Command="Paste" Header="粘贴(_P)" />
<MenuItem Command="Delete" Header="删除(_D)" />
</MenuItem>
<MenuItem Header="调试(_D)">
<MenuItem
Header="{Binding StartMenuContent, Mode=OneWay}"
IsEnabled="{Binding StartButtonEnable, Mode=OneWay}"
Command="{StaticResource StartOrContinue}"
InputGestureText="F5">
<MenuItem.Icon>
<Image Source="{Binding StartButtonImage, Mode=OneWay}" />
</MenuItem.Icon>
</MenuItem>
<MenuItem
Header="停止(_E)"
IsEnabled="{Binding StopButtonEnable, Mode=OneWay}"
Command="{StaticResource Stop}"
InputGestureText="Shift+F5">
<MenuItem.Icon>
<Image Source="{Binding StopButtonImage, Mode=OneWay}" />
</MenuItem.Icon>
</MenuItem>
<MenuItem
Header="逐语句(_S)"
IsEnabled="{Binding StepButtonEnable, Mode=OneWay}"
Command="{StaticResource Step}"
InputGestureText="F11">
<MenuItem.Icon>
<Image Source="{Binding StepButtonImage, Mode=OneWay}" />
</MenuItem.Icon>
</MenuItem>
<MenuItem
Header="逐过程(_O)"
IsEnabled="{Binding NextButtonEnable, Mode=OneWay}"
Command="{StaticResource Next}"
InputGestureText="F10">
<MenuItem.Icon>
<Image Source="{Binding NextButtonImage, Mode=OneWay}" />
</MenuItem.Icon>
</MenuItem>
<MenuItem
Header="跳出(_T)"
IsEnabled="{Binding FinishButtonEnable, Mode=OneWay}"
Command="{StaticResource Finish}"
InputGestureText="Shift+F11">
<MenuItem.Icon>
<Image Source="{Binding FinishButtonImage, Mode=OneWay}" />
</MenuItem.Icon>
</MenuItem>
</MenuItem>
<MenuItem Header="视图(_V)">
<MenuItem Header="编译(_C)" IsCheckable="True" IsChecked="{Binding BuildVisible}"/>
<MenuItem Header="输出(_O)" IsCheckable="True" IsChecked="{Binding PrintVisible}"/>
<MenuItem Header="GDB(_G)" IsCheckable="True" IsChecked="{Binding GDBVisible}"/>
<Separator/>
<MenuItem Header="可视化(_V)" IsCheckable="True" IsChecked="{Binding DataVisible}"/>
</MenuItem>
<MenuItem Header="关于(_A)" Click="About_Click" />
</Menu>
<ToolBar
Grid.Row="1"
Grid.Column="0"
Grid.ColumnSpan="{Binding ColSpan, Mode=OneWay}"
ToolBarTray.IsLocked="True" Name="toolBar">
<Button
IsEnabled="{Binding StartButtonEnable, Mode=OneWay}"
Click="StartButton_Click"
Name="startButton">
<StackPanel Orientation="Horizontal">
<Image
Source="{Binding StartButtonImage, Mode=OneWay}"
Width="20px"
Height="20px"
Margin="0,0,3,0" />
<TextBlock
Text="{Binding StartButtonContent, Mode=OneWay}"
VerticalAlignment="Center" />
</StackPanel>
</Button>
<Button
IsEnabled="{Binding StopButtonEnable, Mode=OneWay}"
Click="StopButton_Click"
Name="stopButton">
<StackPanel Orientation="Horizontal">
<Image
Source="{Binding StopButtonImage, Mode=OneWay}"
Width="20px"
Height="20px"
Margin="0,0,3,0" />
<TextBlock
Text="停止"
VerticalAlignment="Center" />
</StackPanel>
</Button>
<Button
IsEnabled="{Binding StepButtonEnable, Mode=OneWay}"
Click="StepButton_Click"
Name="stepButton">
<StackPanel Orientation="Horizontal">
<Image
Source="{Binding StepButtonImage, Mode=OneWay}"
Width="20px"
Height="20px"
Margin="0,0,0,0" />
<TextBlock
Text="逐语句"
VerticalAlignment="Center" />
</StackPanel>
</Button>
<Button
IsEnabled="{Binding NextButtonEnable, Mode=OneWay}"
Click="NextButton_Click"
Name="nextButton">
<StackPanel Orientation="Horizontal">
<Image
Source="{Binding NextButtonImage, Mode=OneWay}"
Width="20px"
Height="20px"
Margin="0,0,3,0" />
<TextBlock
Text="逐过程"
VerticalAlignment="Center" />
</StackPanel>
</Button>
<Button
IsEnabled="{Binding FinishButtonEnable, Mode=OneWay}"
Click="FinishButton_Click"
Name="finishButton">
<StackPanel Orientation="Horizontal">
<Image
Source="{Binding FinishButtonImage, Mode=OneWay}"
Width="20px"
Height="20px"
Margin="0,0,0,0" />
<TextBlock
Text="跳出"
VerticalAlignment="Center" />
</StackPanel>
</Button>
<Separator />
<ComboBox Name="labSelect" SelectionChanged="LabSelect_SelectionChanged" IsEnabled="{Binding LabSelectEnable, Mode=OneWay}">
<ComboBoxItem Content="实验项目" IsSelected="True" />
<ComboBoxItem Content="1.空表" />
<ComboBoxItem Content="2.FIRST 集" />
<ComboBoxItem Content="3.FOLLOW 集" />
<ComboBoxItem Content="4.预测分析表" />
<ComboBoxItem Content="5.提取左因子" />
<ComboBoxItem Content="6.消除左递归(无替换)" />
<ComboBoxItem Content="7.消除左递归(有替换)" />
<ComboBoxItem Content="8.预测分析方法" />
</ComboBox>
</ToolBar>
<TabControl
Name="tabControl"
Grid.Row="2"
Grid.Column="0"
TabStripPlacement="Top"
Focusable="False"
Grid.RowSpan="{Binding RowSpan, Mode=OneWay}"
Grid.ColumnSpan="{Binding ColSpan, Mode=OneWay}">
<TabControl.Template>
<ControlTemplate TargetType="{x:Type TabControl}">
<Grid ClipToBounds="True" KeyboardNavigation.TabNavigation="Local" SnapsToDevicePixels="True">
<Grid.ColumnDefinitions>
<ColumnDefinition Name="ColumnDefinition0" Width="*"/>
<ColumnDefinition Name="ColumnDefinition2" Width="0"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Name="RowDefinition0" Height="Auto"/>
<RowDefinition Name="RowDefinition1" Height="*"/>
</Grid.RowDefinitions>
<DockPanel
Name="HeaderPanel"
Grid.Column="0"
Grid.Row="0"
Margin="2,2,2,0"
Panel.ZIndex="1"
IsItemsHost="True"
KeyboardNavigation.TabIndex="1"/>
<Border
Name="ContentPanel"
Grid.Column="0"
Grid.Row="1"
Background="{TemplateBinding Panel.Background}"
BorderBrush="{TemplateBinding Border.BorderBrush}"
BorderThickness="{TemplateBinding Border.BorderThickness}"
KeyboardNavigation.DirectionalNavigation="Contained"
KeyboardNavigation.TabIndex="2"
KeyboardNavigation.TabNavigation="Local">
<ContentPresenter
Name="PART_SelectedContentHost"
Margin="{TemplateBinding Control.Padding}"
Content="{TemplateBinding TabControl.SelectedContent}"
ContentSource="SelectedContent"
ContentStringFormat="{TemplateBinding TabControl.SelectedContentStringFormat}"
ContentTemplate="{TemplateBinding TabControl.SelectedContentTemplate}"
SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}"/>
</Border>
</Grid>
</ControlTemplate>
</TabControl.Template>
</TabControl>
<GridSplitter
Grid.Row="3"
Grid.Column="0"
Height="3"
HorizontalAlignment="Stretch"
ResizeDirection="Rows"
Grid.ColumnSpan="{Binding ColSpan, Mode=OneWay}"
Visibility="{Binding OutVisible, Mode=OneWay, Converter={StaticResource VisibilityConverter}}"/>
<TabControl
Name="logControl"
Grid.Row="4"
Grid.Column="0"
Grid.ColumnSpan="{Binding ColSpan, Mode=OneWay}"
Visibility="{Binding OutVisible, Mode=OneWay, Converter={StaticResource VisibilityConverter}}">
<TabItem
Header="编译"
IsSelected="True"
Visibility="{Binding BuildVisible, Mode=OneWay, Converter={StaticResource VisibilityConverter}}">
<TextBox
FontSize="10pt"
FontFamily="Consolas"
AcceptsReturn="True"
Name="buildText"
IsReadOnly="true"
TextWrapping = "Wrap"
VerticalScrollBarVisibility="Auto" />
</TabItem>
<TabItem
Header="输出"
Visibility="{Binding PrintVisible, Mode=OneWay, Converter={StaticResource VisibilityConverter}}">
<TextBox
FontSize="10pt"
FontFamily="Consolas"
AcceptsReturn="True"
Name="outputText"
IsReadOnly="true"
VerticalScrollBarVisibility="Auto" />
</TabItem>
<TabItem
Header="GDB"
Visibility="{Binding GDBVisible, Mode=OneWay, Converter={StaticResource VisibilityConverter}}">
<ScrollViewer
VerticalScrollBarVisibility="Visible"
HorizontalScrollBarVisibility="Auto">
<TextBlock
FontSize="10pt"
FontFamily="Consolas"
Name="gdbText" />
</ScrollViewer>
</TabItem>
</TabControl>
</Grid>
</Window>