-
Notifications
You must be signed in to change notification settings - Fork 0
/
msdev_vcl.py
865 lines (807 loc) · 32 KB
/
msdev_vcl.py
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
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
# NatLink macro definitions for NaturallySpeaking
# coding: latin-1
# Generated by vcl2py 2.8.1I+, Fri Oct 31 17:34:49 2014
import natlink
from natlinkutils import *
from VocolaUtils import *
class ThisGrammar(GrammarBase):
gramSpec = """
<folder> = ('Temp' ) ;
<file> = ('Temp' ) ;
<1> = ('Open' | 'Close' | 'Recent' | 'Save' ) 'Workspace' ;
<2> = 'Workspace' (1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10) ;
<3> = 'Open File' ;
<4> = 'Open File' <folder> ;
<5> = 'Close' ('File' | 'That' ) ;
<6> = 'Save File' ;
<7> = 'Buffer' <file> ;
<8> = 'Find in Files' ;
<9> = 'Find in Files' <folder> ;
<38> = 'Find in' <folder> ;
<10> = 'Toggle Read Only' ;
<39> = 'Read Only' ;
<11> = 'Full Screen' ;
<12> = 'New' ('Search' | 'Find' ) ;
<13> = 'Find New' ;
<14> = 'Find That' ;
<15> = 'Find' ('Down' | 'Up' ) ;
<16> = 'Next Bookmark' ;
<digit> = ('0' | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9) ;
<17> = 'Line Number' ;
<18> = 'Line Number' <digit> ;
<40> = 'Line' <digit> ;
<19> = 'Line Number' <digit> <digit> ;
<41> = 'Line' <digit> <digit> ;
<20> = 'Line Number' <digit> <digit> <digit> ;
<42> = 'Line' <digit> <digit> <digit> ;
<21> = 'Line Number' <digit> <digit> <digit> <digit> ;
<43> = 'Line' <digit> <digit> <digit> <digit> ;
<22> = 'Output' ('Go' | 'Start' | 'End' ) ;
<23> = 'Output Clear' ;
<24> = 'Rebuild' ;
<25> = 'Rebuild All' ;
<26> = 'Project Settings' ;
<27> = ('Set' | 'Clear' | 'Toggle' ) ('Breakpoint' | 'Bookmark' ) ;
<28> = 'Edit Breakpoints' ;
<44> = 'Breakpoints' ;
<29> = 'Remove All Breakpoints' ;
<45> = 'Remove Breakpoints' ;
<30> = 'Exceptions' ;
<31> = 'Reset Exceptions' ;
<32> = 'Continue' ;
<33> = 'Execute' ;
<34> = 'Restart' ;
<35> = 'Stop Debugging' ;
<36> = 'Break Now' ;
<37> = 'Single Step' ;
<any> = <1>|<2>|<3>|<4>|<5>|<6>|<7>|<8>|<9>|<38>|<10>|<39>|<11>|<12>|<13>|<14>|<15>|<16>|<17>|<18>|<40>|<19>|<41>|<20>|<42>|<21>|<43>|<22>|<23>|<24>|<25>|<26>|<27>|<28>|<44>|<29>|<45>|<30>|<31>|<32>|<33>|<34>|<35>|<36>|<37>;
<sequence> exported = <any>;
"""
def initialize(self):
self.load(self.gramSpec)
self.currentModule = ("","",0)
self.ruleSet1 = ['sequence']
def gotBegin(self,moduleInfo):
# Return if wrong application
window = matchWindow(moduleInfo,'msdev','')
if not window: return None
self.firstWord = 0
# Return if same window and title as before
if moduleInfo == self.currentModule: return None
self.currentModule = moduleInfo
self.deactivateAll()
title = string.lower(moduleInfo[1])
if string.find(title,'') >= 0:
for rule in self.ruleSet1:
try:
self.activate(rule,window)
except natlink.BadWindow:
pass
def convert_number_word(self, word):
if word == '0':
return '0'
else:
return word
def get_folder(self, list_buffer, functional, word):
if word == 'Temp':
list_buffer += 'C:\\Temp'
return list_buffer
def get_file(self, list_buffer, functional, word):
if word == 'Temp':
list_buffer += 'C:\\Temp\\temp.txt'
return list_buffer
# ('Open' | 'Close' | 'Recent' | 'Save') 'Workspace'
def gotResults_1(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Alt+f}'
word = fullResults[0 + self.firstWord][0]
if word == 'Open':
top_buffer += 'w'
elif word == 'Close':
top_buffer += 'k'
elif word == 'Recent':
top_buffer += 'r'
elif word == 'Save':
top_buffer += 'v'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 2
if len(words) > 2: self.gotResults_1(words[2:], fullResults)
except Exception, e:
handle_error('msdev.vcl', 10, '(\'Open\' | \'Close\' | \'Recent\' | \'Save\') \'Workspace\'', e)
self.firstWord = -1
# 'Workspace' 1..10
def gotResults_2(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Alt+f}r'
word = fullResults[1 + self.firstWord][0]
top_buffer += self.convert_number_word(word)
top_buffer = do_flush(False, top_buffer);
self.firstWord += 2
if len(words) > 2: self.gotResults_2(words[2:], fullResults)
except Exception, e:
handle_error('msdev.vcl', 11, '\'Workspace\' 1..10', e)
self.firstWord = -1
# 'Open File'
def gotResults_3(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Ctrl+o}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 1
if len(words) > 1: self.gotResults_3(words[1:], fullResults)
except Exception, e:
handle_error('msdev.vcl', 13, '\'Open File\'', e)
self.firstWord = -1
# 'Open File' <folder>
def gotResults_4(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Ctrl+o}'
word = fullResults[1 + self.firstWord][0]
top_buffer = self.get_folder(top_buffer, False, word)
top_buffer += '{Enter}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 2
except Exception, e:
handle_error('msdev.vcl', 14, '\'Open File\' <folder>', e)
self.firstWord = -1
# 'Close' ('File' | 'That')
def gotResults_5(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Alt+f}c'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 2
if len(words) > 2: self.gotResults_5(words[2:], fullResults)
except Exception, e:
handle_error('msdev.vcl', 15, '\'Close\' (\'File\' | \'That\')', e)
self.firstWord = -1
# 'Save File'
def gotResults_6(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Ctrl+s}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 1
if len(words) > 1: self.gotResults_6(words[1:], fullResults)
except Exception, e:
handle_error('msdev.vcl', 16, '\'Save File\'', e)
self.firstWord = -1
# 'Buffer' <file>
def gotResults_7(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Ctrl+o}'
word = fullResults[1 + self.firstWord][0]
top_buffer = self.get_file(top_buffer, False, word)
top_buffer += '{Enter}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 2
except Exception, e:
handle_error('msdev.vcl', 18, '\'Buffer\' <file>', e)
self.firstWord = -1
# 'Find in Files'
def gotResults_8(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Alt+e}i'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 1
if len(words) > 1: self.gotResults_8(words[1:], fullResults)
except Exception, e:
handle_error('msdev.vcl', 20, '\'Find in Files\'', e)
self.firstWord = -1
# 'Find in Files' <folder>
def gotResults_9(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Alt+e}i{Tab_2}'
word = fullResults[1 + self.firstWord][0]
top_buffer = self.get_folder(top_buffer, False, word)
top_buffer += '{Shift+Tab_2}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 2
except Exception, e:
handle_error('msdev.vcl', 21, '\'Find in Files\' <folder>', e)
self.firstWord = -1
# 'Find in' <folder>
def gotResults_38(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Alt+e}i{Tab_2}'
word = fullResults[1 + self.firstWord][0]
top_buffer = self.get_folder(top_buffer, False, word)
top_buffer += '{Shift+Tab_2}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 2
except Exception, e:
handle_error('msdev.vcl', 21, '\'Find in\' <folder>', e)
self.firstWord = -1
# 'Toggle Read Only'
def gotResults_10(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Alt+f}a{Right}*{Enter}{Shift+Tab}{End}{Shift+F10}r'
top_buffer = do_flush(False, top_buffer);
dragon_arg1 = ''
dragon_arg1 += '1000'
call_Dragon('Wait', 'i', [dragon_arg1])
top_buffer += '{Alt+r}{Enter}{Esc}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 1
if len(words) > 1: self.gotResults_10(words[1:], fullResults)
except Exception, e:
handle_error('msdev.vcl', 24, '\'Toggle Read Only\'', e)
self.firstWord = -1
# 'Read Only'
def gotResults_39(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Alt+f}a{Right}*{Enter}{Shift+Tab}{End}{Shift+F10}r'
top_buffer = do_flush(False, top_buffer);
dragon_arg1 = ''
dragon_arg1 += '1000'
call_Dragon('Wait', 'i', [dragon_arg1])
top_buffer += '{Alt+r}{Enter}{Esc}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 1
if len(words) > 1: self.gotResults_39(words[1:], fullResults)
except Exception, e:
handle_error('msdev.vcl', 24, '\'Read Only\'', e)
self.firstWord = -1
# 'Full Screen'
def gotResults_11(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Alt+v}u'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 1
if len(words) > 1: self.gotResults_11(words[1:], fullResults)
except Exception, e:
handle_error('msdev.vcl', 28, '\'Full Screen\'', e)
self.firstWord = -1
# 'New' ('Search' | 'Find')
def gotResults_12(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{F3}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 2
if len(words) > 2: self.gotResults_12(words[2:], fullResults)
except Exception, e:
handle_error('msdev.vcl', 29, '\'New\' (\'Search\' | \'Find\')', e)
self.firstWord = -1
# 'Find New'
def gotResults_13(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Ctrl+f}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 1
if len(words) > 1: self.gotResults_13(words[1:], fullResults)
except Exception, e:
handle_error('msdev.vcl', 30, '\'Find New\'', e)
self.firstWord = -1
# 'Find That'
def gotResults_14(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Ctrl+F3}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 1
if len(words) > 1: self.gotResults_14(words[1:], fullResults)
except Exception, e:
handle_error('msdev.vcl', 31, '\'Find That\'', e)
self.firstWord = -1
# 'Find' ('Down' | 'Up')
def gotResults_15(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
word = fullResults[1 + self.firstWord][0]
if word == 'Down':
top_buffer += '{F3}'
elif word == 'Up':
top_buffer += '{Shift+F3}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 2
if len(words) > 2: self.gotResults_15(words[2:], fullResults)
except Exception, e:
handle_error('msdev.vcl', 32, '\'Find\' (\'Down\' | \'Up\')', e)
self.firstWord = -1
# 'Next Bookmark'
def gotResults_16(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{F2}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 1
if len(words) > 1: self.gotResults_16(words[1:], fullResults)
except Exception, e:
handle_error('msdev.vcl', 33, '\'Next Bookmark\'', e)
self.firstWord = -1
def get_digit(self, list_buffer, functional, word):
list_buffer += self.convert_number_word(word)
return list_buffer
# 'Line Number'
def gotResults_17(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Ctrl+g}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 1
if len(words) > 1: self.gotResults_17(words[1:], fullResults)
except Exception, e:
handle_error('msdev.vcl', 36, '\'Line Number\'', e)
self.firstWord = -1
# 'Line Number' <digit>
def gotResults_18(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Ctrl+g}'
word = fullResults[1 + self.firstWord][0]
top_buffer = self.get_digit(top_buffer, False, word)
top_buffer += '{Enter}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 2
except Exception, e:
handle_error('msdev.vcl', 37, '\'Line Number\' <digit>', e)
self.firstWord = -1
# 'Line' <digit>
def gotResults_40(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Ctrl+g}'
word = fullResults[1 + self.firstWord][0]
top_buffer = self.get_digit(top_buffer, False, word)
top_buffer += '{Enter}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 2
except Exception, e:
handle_error('msdev.vcl', 37, '\'Line\' <digit>', e)
self.firstWord = -1
# 'Line Number' <digit> <digit>
def gotResults_19(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Ctrl+g}'
word = fullResults[1 + self.firstWord][0]
top_buffer = self.get_digit(top_buffer, False, word)
word = fullResults[2 + self.firstWord][0]
top_buffer = self.get_digit(top_buffer, False, word)
top_buffer += '{Enter}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 3
except Exception, e:
handle_error('msdev.vcl', 38, '\'Line Number\' <digit> <digit>', e)
self.firstWord = -1
# 'Line' <digit> <digit>
def gotResults_41(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Ctrl+g}'
word = fullResults[1 + self.firstWord][0]
top_buffer = self.get_digit(top_buffer, False, word)
word = fullResults[2 + self.firstWord][0]
top_buffer = self.get_digit(top_buffer, False, word)
top_buffer += '{Enter}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 3
except Exception, e:
handle_error('msdev.vcl', 38, '\'Line\' <digit> <digit>', e)
self.firstWord = -1
# 'Line Number' <digit> <digit> <digit>
def gotResults_20(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Ctrl+g}'
word = fullResults[1 + self.firstWord][0]
top_buffer = self.get_digit(top_buffer, False, word)
word = fullResults[2 + self.firstWord][0]
top_buffer = self.get_digit(top_buffer, False, word)
word = fullResults[3 + self.firstWord][0]
top_buffer = self.get_digit(top_buffer, False, word)
top_buffer += '{Enter}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 4
except Exception, e:
handle_error('msdev.vcl', 39, '\'Line Number\' <digit> <digit> <digit>', e)
self.firstWord = -1
# 'Line' <digit> <digit> <digit>
def gotResults_42(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Ctrl+g}'
word = fullResults[1 + self.firstWord][0]
top_buffer = self.get_digit(top_buffer, False, word)
word = fullResults[2 + self.firstWord][0]
top_buffer = self.get_digit(top_buffer, False, word)
word = fullResults[3 + self.firstWord][0]
top_buffer = self.get_digit(top_buffer, False, word)
top_buffer += '{Enter}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 4
except Exception, e:
handle_error('msdev.vcl', 39, '\'Line\' <digit> <digit> <digit>', e)
self.firstWord = -1
# 'Line Number' <digit> <digit> <digit> <digit>
def gotResults_21(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Ctrl+g}'
word = fullResults[1 + self.firstWord][0]
top_buffer = self.get_digit(top_buffer, False, word)
word = fullResults[2 + self.firstWord][0]
top_buffer = self.get_digit(top_buffer, False, word)
word = fullResults[3 + self.firstWord][0]
top_buffer = self.get_digit(top_buffer, False, word)
word = fullResults[4 + self.firstWord][0]
top_buffer = self.get_digit(top_buffer, False, word)
top_buffer += '{Enter}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 5
except Exception, e:
handle_error('msdev.vcl', 40, '\'Line Number\' <digit> <digit> <digit> <digit>', e)
self.firstWord = -1
# 'Line' <digit> <digit> <digit> <digit>
def gotResults_43(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Ctrl+g}'
word = fullResults[1 + self.firstWord][0]
top_buffer = self.get_digit(top_buffer, False, word)
word = fullResults[2 + self.firstWord][0]
top_buffer = self.get_digit(top_buffer, False, word)
word = fullResults[3 + self.firstWord][0]
top_buffer = self.get_digit(top_buffer, False, word)
word = fullResults[4 + self.firstWord][0]
top_buffer = self.get_digit(top_buffer, False, word)
top_buffer += '{Enter}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 5
except Exception, e:
handle_error('msdev.vcl', 40, '\'Line\' <digit> <digit> <digit> <digit>', e)
self.firstWord = -1
# 'Output' ('Go' | 'Start' | 'End')
def gotResults_22(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Alt+2}{Ctrl+'
word = fullResults[1 + self.firstWord][0]
if word == 'Go':
top_buffer += ''
elif word == 'Start':
top_buffer += 'Home'
elif word == 'End':
top_buffer += 'End'
top_buffer += '}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 2
if len(words) > 2: self.gotResults_22(words[2:], fullResults)
except Exception, e:
handle_error('msdev.vcl', 42, '\'Output\' (\'Go\' | \'Start\' | \'End\')', e)
self.firstWord = -1
# 'Output Clear'
def gotResults_23(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer = do_flush(False, top_buffer);
dragon_arg1 = ''
dragon_arg1 += '4'
dragon_arg2 = ''
eval_template2_arg1 = ''
eval_template2_arg1 += '{"n":1, "e":2, "s":3, "w":4, "ne":5, "se":6, "sw":7, "nw":8}[%a]'
eval_template2_arg2 = ''
eval_template2_arg2 += 'sw'
dragon_arg2 += eval_template(eval_template2_arg1, eval_template2_arg2)
call_Dragon('SetMousePosition', 'iii', [dragon_arg1, dragon_arg2])
top_buffer = do_flush(False, top_buffer);
dragon_arg1 = ''
dragon_arg1 += '2'
dragon_arg2 = ''
eval_template2_arg1 = ''
eval_template2_arg1 += '15*%a'
eval_template2_arg2 = ''
eval_template2_arg2 += '3'
dragon_arg2 += eval_template(eval_template2_arg1, eval_template2_arg2)
dragon_arg3 = ''
eval_template2_arg1 = ''
eval_template2_arg1 += '15*%a'
eval_template2_arg2 = ''
eval_template2_arg2 += '-4'
dragon_arg3 += eval_template(eval_template2_arg1, eval_template2_arg2)
call_Dragon('SetMousePosition', 'iii', [dragon_arg1, dragon_arg2, dragon_arg3])
top_buffer = do_flush(False, top_buffer);
dragon_arg1 = ''
dragon_arg1 += '2'
dragon_arg2 = ''
dragon_arg2 += '1'
call_Dragon('ButtonClick', 'ii', [dragon_arg1, dragon_arg2])
top_buffer += 'r'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 1
if len(words) > 1: self.gotResults_23(words[1:], fullResults)
except Exception, e:
handle_error('msdev.vcl', 43, '\'Output Clear\'', e)
self.firstWord = -1
# 'Rebuild'
def gotResults_24(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{F7}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 1
if len(words) > 1: self.gotResults_24(words[1:], fullResults)
except Exception, e:
handle_error('msdev.vcl', 47, '\'Rebuild\'', e)
self.firstWord = -1
# 'Rebuild All'
def gotResults_25(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Alt+b}r'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 1
if len(words) > 1: self.gotResults_25(words[1:], fullResults)
except Exception, e:
handle_error('msdev.vcl', 48, '\'Rebuild All\'', e)
self.firstWord = -1
# 'Project Settings'
def gotResults_26(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Alt+F7}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 1
if len(words) > 1: self.gotResults_26(words[1:], fullResults)
except Exception, e:
handle_error('msdev.vcl', 49, '\'Project Settings\'', e)
self.firstWord = -1
# ('Set' | 'Clear' | 'Toggle') ('Breakpoint' | 'Bookmark')
def gotResults_27(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
word = fullResults[1 + self.firstWord][0]
if word == 'Breakpoint':
top_buffer += '{F9}'
elif word == 'Bookmark':
top_buffer += '{Ctrl+F2}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 2
if len(words) > 2: self.gotResults_27(words[2:], fullResults)
except Exception, e:
handle_error('msdev.vcl', 53, '(\'Set\' | \'Clear\' | \'Toggle\') (\'Breakpoint\' | \'Bookmark\')', e)
self.firstWord = -1
# 'Edit Breakpoints'
def gotResults_28(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Alt+F9}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 1
if len(words) > 1: self.gotResults_28(words[1:], fullResults)
except Exception, e:
handle_error('msdev.vcl', 54, '\'Edit Breakpoints\'', e)
self.firstWord = -1
# 'Breakpoints'
def gotResults_44(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Alt+F9}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 1
if len(words) > 1: self.gotResults_44(words[1:], fullResults)
except Exception, e:
handle_error('msdev.vcl', 54, '\'Breakpoints\'', e)
self.firstWord = -1
# 'Remove All Breakpoints'
def gotResults_29(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Alt+F9}{Alt+l}{Enter}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 1
if len(words) > 1: self.gotResults_29(words[1:], fullResults)
except Exception, e:
handle_error('msdev.vcl', 55, '\'Remove All Breakpoints\'', e)
self.firstWord = -1
# 'Remove Breakpoints'
def gotResults_45(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Alt+F9}{Alt+l}{Enter}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 1
if len(words) > 1: self.gotResults_45(words[1:], fullResults)
except Exception, e:
handle_error('msdev.vcl', 55, '\'Remove Breakpoints\'', e)
self.firstWord = -1
# 'Exceptions'
def gotResults_30(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Alt+d}e'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 1
if len(words) > 1: self.gotResults_30(words[1:], fullResults)
except Exception, e:
handle_error('msdev.vcl', 56, '\'Exceptions\'', e)
self.firstWord = -1
# 'Reset Exceptions'
def gotResults_31(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Alt+d}e{Alt+t}'
top_buffer = do_flush(False, top_buffer);
dragon_arg1 = ''
dragon_arg1 += 'OK'
call_Dragon('ControlPick', 's', [dragon_arg1])
top_buffer = do_flush(False, top_buffer);
self.firstWord += 1
if len(words) > 1: self.gotResults_31(words[1:], fullResults)
except Exception, e:
handle_error('msdev.vcl', 57, '\'Reset Exceptions\'', e)
self.firstWord = -1
# 'Continue'
def gotResults_32(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{F5}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 1
if len(words) > 1: self.gotResults_32(words[1:], fullResults)
except Exception, e:
handle_error('msdev.vcl', 59, '\'Continue\'', e)
self.firstWord = -1
# 'Execute'
def gotResults_33(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Ctrl+F5}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 1
if len(words) > 1: self.gotResults_33(words[1:], fullResults)
except Exception, e:
handle_error('msdev.vcl', 60, '\'Execute\'', e)
self.firstWord = -1
# 'Restart'
def gotResults_34(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Ctrl+Shift+F5}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 1
if len(words) > 1: self.gotResults_34(words[1:], fullResults)
except Exception, e:
handle_error('msdev.vcl', 61, '\'Restart\'', e)
self.firstWord = -1
# 'Stop Debugging'
def gotResults_35(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Shift+F5}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 1
if len(words) > 1: self.gotResults_35(words[1:], fullResults)
except Exception, e:
handle_error('msdev.vcl', 62, '\'Stop Debugging\'', e)
self.firstWord = -1
# 'Break Now'
def gotResults_36(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{Alt+d}b'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 1
if len(words) > 1: self.gotResults_36(words[1:], fullResults)
except Exception, e:
handle_error('msdev.vcl', 63, '\'Break Now\'', e)
self.firstWord = -1
# 'Single Step'
def gotResults_37(self, words, fullResults):
if self.firstWord<0:
return
try:
top_buffer = ''
top_buffer += '{F10}'
top_buffer = do_flush(False, top_buffer);
self.firstWord += 1
if len(words) > 1: self.gotResults_37(words[1:], fullResults)
except Exception, e:
handle_error('msdev.vcl', 64, '\'Single Step\'', e)
self.firstWord = -1
thisGrammar = ThisGrammar()
thisGrammar.initialize()
def unload():
global thisGrammar
if thisGrammar: thisGrammar.unload()
thisGrammar = None