line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. |
2
|
|
|
|
|
|
|
# This program is free software; you can redistribute it and/or |
3
|
|
|
|
|
|
|
# modify it under the same terms as Perl itself. |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
# This file was generated from the 'picsrc.xml' file of the syntax highlight |
6
|
|
|
|
|
|
|
# engine of the kate text editor (http://www.kate-editor.org |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
#kate xml version 1.07 |
9
|
|
|
|
|
|
|
#kate version 2.3 |
10
|
|
|
|
|
|
|
#kate author Alain GIBAUD (alain.gibaud@univ-valenciennes.fr) |
11
|
|
|
|
|
|
|
#generated: Sun Feb 3 22:02:06 2008, localtime |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
package Syntax::Highlight::Engine::Kate::PicAsm; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
our $VERSION = '0.07'; |
16
|
|
|
|
|
|
|
|
17
|
1
|
|
|
1
|
|
1193
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
51
|
|
18
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
37
|
|
19
|
1
|
|
|
1
|
|
7
|
use base('Syntax::Highlight::Engine::Kate::Template'); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
2424
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub new { |
22
|
2
|
|
|
2
|
0
|
807
|
my $proto = shift; |
23
|
2
|
|
33
|
|
|
13
|
my $class = ref($proto) || $proto; |
24
|
2
|
|
|
|
|
19
|
my $self = $class->SUPER::new(@_); |
25
|
2
|
|
|
|
|
39
|
$self->attributes({ |
26
|
|
|
|
|
|
|
'Alert' => 'Alert', |
27
|
|
|
|
|
|
|
'Based Numbers' => 'BaseN', |
28
|
|
|
|
|
|
|
'Char' => 'Char', |
29
|
|
|
|
|
|
|
'Comment' => 'Comment', |
30
|
|
|
|
|
|
|
'Directives' => 'Others', |
31
|
|
|
|
|
|
|
'Error' => 'Error', |
32
|
|
|
|
|
|
|
'GPASM-macros' => 'BString', |
33
|
|
|
|
|
|
|
'InstructionAttr' => 'Operator', |
34
|
|
|
|
|
|
|
'Instructions' => 'Keyword', |
35
|
|
|
|
|
|
|
'Normal Text' => 'Normal', |
36
|
|
|
|
|
|
|
'Prep. Lib' => 'Others', |
37
|
|
|
|
|
|
|
'Preprocessor' => 'Others', |
38
|
|
|
|
|
|
|
'String' => 'String', |
39
|
|
|
|
|
|
|
'Symbol' => 'Variable', |
40
|
|
|
|
|
|
|
'Unbased Numbers' => 'DecVal', |
41
|
|
|
|
|
|
|
}); |
42
|
2
|
|
|
|
|
15
|
$self->listAdd('conditional', |
43
|
|
|
|
|
|
|
'else', |
44
|
|
|
|
|
|
|
'endif', |
45
|
|
|
|
|
|
|
'endw', |
46
|
|
|
|
|
|
|
'idef', |
47
|
|
|
|
|
|
|
'if', |
48
|
|
|
|
|
|
|
'ifndef', |
49
|
|
|
|
|
|
|
'include', |
50
|
|
|
|
|
|
|
'while', |
51
|
|
|
|
|
|
|
'{', |
52
|
|
|
|
|
|
|
'}', |
53
|
|
|
|
|
|
|
); |
54
|
2
|
|
|
|
|
11
|
$self->listAdd('directives', |
55
|
|
|
|
|
|
|
'CBLOCK', |
56
|
|
|
|
|
|
|
'CONSTANT', |
57
|
|
|
|
|
|
|
'DA', |
58
|
|
|
|
|
|
|
'DATA', |
59
|
|
|
|
|
|
|
'DB', |
60
|
|
|
|
|
|
|
'DE', |
61
|
|
|
|
|
|
|
'DT', |
62
|
|
|
|
|
|
|
'DW', |
63
|
|
|
|
|
|
|
'END', |
64
|
|
|
|
|
|
|
'ENDC', |
65
|
|
|
|
|
|
|
'ENDM', |
66
|
|
|
|
|
|
|
'EQU', |
67
|
|
|
|
|
|
|
'ERROR', |
68
|
|
|
|
|
|
|
'ERRORLEVEL', |
69
|
|
|
|
|
|
|
'EXITM', |
70
|
|
|
|
|
|
|
'FILL', |
71
|
|
|
|
|
|
|
'LIST', |
72
|
|
|
|
|
|
|
'LOCAL', |
73
|
|
|
|
|
|
|
'MACRO', |
74
|
|
|
|
|
|
|
'MESSG', |
75
|
|
|
|
|
|
|
'NOEXPAND', |
76
|
|
|
|
|
|
|
'NOLIST', |
77
|
|
|
|
|
|
|
'ORG', |
78
|
|
|
|
|
|
|
'PAGE', |
79
|
|
|
|
|
|
|
'PROCESSOR', |
80
|
|
|
|
|
|
|
'RADIX', |
81
|
|
|
|
|
|
|
'RES', |
82
|
|
|
|
|
|
|
'SET', |
83
|
|
|
|
|
|
|
'SPACE', |
84
|
|
|
|
|
|
|
'SUBTITLE', |
85
|
|
|
|
|
|
|
'TITLE', |
86
|
|
|
|
|
|
|
'VARIABLE', |
87
|
|
|
|
|
|
|
'__BADRAM', |
88
|
|
|
|
|
|
|
'__CONFIG', |
89
|
|
|
|
|
|
|
'__IDLOCS', |
90
|
|
|
|
|
|
|
'__MAXRAM', |
91
|
|
|
|
|
|
|
'cblock', |
92
|
|
|
|
|
|
|
'constant', |
93
|
|
|
|
|
|
|
'da', |
94
|
|
|
|
|
|
|
'data', |
95
|
|
|
|
|
|
|
'db', |
96
|
|
|
|
|
|
|
'de', |
97
|
|
|
|
|
|
|
'dt', |
98
|
|
|
|
|
|
|
'dw', |
99
|
|
|
|
|
|
|
'end', |
100
|
|
|
|
|
|
|
'endc', |
101
|
|
|
|
|
|
|
'endm', |
102
|
|
|
|
|
|
|
'equ', |
103
|
|
|
|
|
|
|
'error', |
104
|
|
|
|
|
|
|
'errorlevel', |
105
|
|
|
|
|
|
|
'exitm', |
106
|
|
|
|
|
|
|
'fill', |
107
|
|
|
|
|
|
|
'list', |
108
|
|
|
|
|
|
|
'local', |
109
|
|
|
|
|
|
|
'macro', |
110
|
|
|
|
|
|
|
'messg', |
111
|
|
|
|
|
|
|
'noexpand', |
112
|
|
|
|
|
|
|
'nolist', |
113
|
|
|
|
|
|
|
'org', |
114
|
|
|
|
|
|
|
'page', |
115
|
|
|
|
|
|
|
'processor', |
116
|
|
|
|
|
|
|
'radix', |
117
|
|
|
|
|
|
|
'res', |
118
|
|
|
|
|
|
|
'set', |
119
|
|
|
|
|
|
|
'space', |
120
|
|
|
|
|
|
|
'subtitle', |
121
|
|
|
|
|
|
|
'title', |
122
|
|
|
|
|
|
|
'variable', |
123
|
|
|
|
|
|
|
); |
124
|
2
|
|
|
|
|
9
|
$self->listAdd('gpasm_macro', |
125
|
|
|
|
|
|
|
'ADDCF', |
126
|
|
|
|
|
|
|
'B', |
127
|
|
|
|
|
|
|
'CLRC', |
128
|
|
|
|
|
|
|
'CLRZ', |
129
|
|
|
|
|
|
|
'MOVFW', |
130
|
|
|
|
|
|
|
'SETC', |
131
|
|
|
|
|
|
|
'SETZ', |
132
|
|
|
|
|
|
|
'SKPC', |
133
|
|
|
|
|
|
|
'SKPNC', |
134
|
|
|
|
|
|
|
'SKPNZ', |
135
|
|
|
|
|
|
|
'SKPZ', |
136
|
|
|
|
|
|
|
'SUBCF', |
137
|
|
|
|
|
|
|
'TSTF', |
138
|
|
|
|
|
|
|
'addcf', |
139
|
|
|
|
|
|
|
'b', |
140
|
|
|
|
|
|
|
'clrc', |
141
|
|
|
|
|
|
|
'clrz', |
142
|
|
|
|
|
|
|
'movfw', |
143
|
|
|
|
|
|
|
'setc', |
144
|
|
|
|
|
|
|
'setz', |
145
|
|
|
|
|
|
|
'skpc', |
146
|
|
|
|
|
|
|
'skpnc', |
147
|
|
|
|
|
|
|
'skpnz', |
148
|
|
|
|
|
|
|
'skpz', |
149
|
|
|
|
|
|
|
'subcf', |
150
|
|
|
|
|
|
|
'tstf', |
151
|
|
|
|
|
|
|
); |
152
|
2
|
|
|
|
|
8
|
$self->listAdd('instruction_attr', |
153
|
|
|
|
|
|
|
'A', |
154
|
|
|
|
|
|
|
'ACCESS', |
155
|
|
|
|
|
|
|
'BANKED', |
156
|
|
|
|
|
|
|
'F', |
157
|
|
|
|
|
|
|
'W', |
158
|
|
|
|
|
|
|
); |
159
|
2
|
|
|
|
|
15
|
$self->listAdd('instructions', |
160
|
|
|
|
|
|
|
'ADDLW', |
161
|
|
|
|
|
|
|
'ADDWF', |
162
|
|
|
|
|
|
|
'ADDWFC', |
163
|
|
|
|
|
|
|
'ANDLW', |
164
|
|
|
|
|
|
|
'ANDWF', |
165
|
|
|
|
|
|
|
'BC', |
166
|
|
|
|
|
|
|
'BCF', |
167
|
|
|
|
|
|
|
'BN', |
168
|
|
|
|
|
|
|
'BNC', |
169
|
|
|
|
|
|
|
'BNOV', |
170
|
|
|
|
|
|
|
'BNZ', |
171
|
|
|
|
|
|
|
'BOV', |
172
|
|
|
|
|
|
|
'BRA', |
173
|
|
|
|
|
|
|
'BSF', |
174
|
|
|
|
|
|
|
'BTFSC', |
175
|
|
|
|
|
|
|
'BTFSS', |
176
|
|
|
|
|
|
|
'BTG', |
177
|
|
|
|
|
|
|
'BZ', |
178
|
|
|
|
|
|
|
'CALL', |
179
|
|
|
|
|
|
|
'CLRF', |
180
|
|
|
|
|
|
|
'CLRW', |
181
|
|
|
|
|
|
|
'CLRWDT', |
182
|
|
|
|
|
|
|
'COMF', |
183
|
|
|
|
|
|
|
'CPFSEQ', |
184
|
|
|
|
|
|
|
'CPFSGT', |
185
|
|
|
|
|
|
|
'CPFSLT', |
186
|
|
|
|
|
|
|
'DAW', |
187
|
|
|
|
|
|
|
'DCFSNZ', |
188
|
|
|
|
|
|
|
'DECF', |
189
|
|
|
|
|
|
|
'DECFSZ', |
190
|
|
|
|
|
|
|
'GOTO', |
191
|
|
|
|
|
|
|
'INCF', |
192
|
|
|
|
|
|
|
'INCFSZ', |
193
|
|
|
|
|
|
|
'INFSNZ', |
194
|
|
|
|
|
|
|
'IORLW', |
195
|
|
|
|
|
|
|
'IORWF', |
196
|
|
|
|
|
|
|
'LFSR', |
197
|
|
|
|
|
|
|
'MOVF', |
198
|
|
|
|
|
|
|
'MOVFF', |
199
|
|
|
|
|
|
|
'MOVLB', |
200
|
|
|
|
|
|
|
'MOVLW', |
201
|
|
|
|
|
|
|
'MOVWF', |
202
|
|
|
|
|
|
|
'MULLW', |
203
|
|
|
|
|
|
|
'MULWF', |
204
|
|
|
|
|
|
|
'NEGF', |
205
|
|
|
|
|
|
|
'NOP', |
206
|
|
|
|
|
|
|
'OPTION', |
207
|
|
|
|
|
|
|
'POP', |
208
|
|
|
|
|
|
|
'PUSH', |
209
|
|
|
|
|
|
|
'RCALL', |
210
|
|
|
|
|
|
|
'RESET', |
211
|
|
|
|
|
|
|
'RETFIE', |
212
|
|
|
|
|
|
|
'RETLW', |
213
|
|
|
|
|
|
|
'RETURN', |
214
|
|
|
|
|
|
|
'RLCF', |
215
|
|
|
|
|
|
|
'RLF', |
216
|
|
|
|
|
|
|
'RLNCF', |
217
|
|
|
|
|
|
|
'RRCF', |
218
|
|
|
|
|
|
|
'RRF', |
219
|
|
|
|
|
|
|
'RRNCF', |
220
|
|
|
|
|
|
|
'SETF', |
221
|
|
|
|
|
|
|
'SLEEP', |
222
|
|
|
|
|
|
|
'SUBFWB', |
223
|
|
|
|
|
|
|
'SUBLW', |
224
|
|
|
|
|
|
|
'SUBWF', |
225
|
|
|
|
|
|
|
'SUBWFB', |
226
|
|
|
|
|
|
|
'SWAPF', |
227
|
|
|
|
|
|
|
'TBLRD', |
228
|
|
|
|
|
|
|
'TBLWT', |
229
|
|
|
|
|
|
|
'TSTFSZ', |
230
|
|
|
|
|
|
|
'XORLW', |
231
|
|
|
|
|
|
|
'XORWF', |
232
|
|
|
|
|
|
|
'addlw', |
233
|
|
|
|
|
|
|
'addwf', |
234
|
|
|
|
|
|
|
'addwfc', |
235
|
|
|
|
|
|
|
'andlw', |
236
|
|
|
|
|
|
|
'andwf', |
237
|
|
|
|
|
|
|
'bc', |
238
|
|
|
|
|
|
|
'bcf', |
239
|
|
|
|
|
|
|
'bn', |
240
|
|
|
|
|
|
|
'bnc', |
241
|
|
|
|
|
|
|
'bnov', |
242
|
|
|
|
|
|
|
'bnz', |
243
|
|
|
|
|
|
|
'bov', |
244
|
|
|
|
|
|
|
'bra', |
245
|
|
|
|
|
|
|
'bsf', |
246
|
|
|
|
|
|
|
'btfsc', |
247
|
|
|
|
|
|
|
'btfss', |
248
|
|
|
|
|
|
|
'btg', |
249
|
|
|
|
|
|
|
'bz', |
250
|
|
|
|
|
|
|
'call', |
251
|
|
|
|
|
|
|
'clrf', |
252
|
|
|
|
|
|
|
'clrw', |
253
|
|
|
|
|
|
|
'clrwdt', |
254
|
|
|
|
|
|
|
'comf', |
255
|
|
|
|
|
|
|
'cpfseq', |
256
|
|
|
|
|
|
|
'cpfsgt', |
257
|
|
|
|
|
|
|
'cpfslt', |
258
|
|
|
|
|
|
|
'daw', |
259
|
|
|
|
|
|
|
'dcfsnz', |
260
|
|
|
|
|
|
|
'decf', |
261
|
|
|
|
|
|
|
'decfsz', |
262
|
|
|
|
|
|
|
'goto', |
263
|
|
|
|
|
|
|
'incf', |
264
|
|
|
|
|
|
|
'incfsz', |
265
|
|
|
|
|
|
|
'infsnz', |
266
|
|
|
|
|
|
|
'iorlw', |
267
|
|
|
|
|
|
|
'iorwf', |
268
|
|
|
|
|
|
|
'lfsr', |
269
|
|
|
|
|
|
|
'movf', |
270
|
|
|
|
|
|
|
'movff', |
271
|
|
|
|
|
|
|
'movlb', |
272
|
|
|
|
|
|
|
'movlw', |
273
|
|
|
|
|
|
|
'movwf', |
274
|
|
|
|
|
|
|
'mullw', |
275
|
|
|
|
|
|
|
'mulwf', |
276
|
|
|
|
|
|
|
'negf', |
277
|
|
|
|
|
|
|
'nop', |
278
|
|
|
|
|
|
|
'option', |
279
|
|
|
|
|
|
|
'pop', |
280
|
|
|
|
|
|
|
'push', |
281
|
|
|
|
|
|
|
'rcall', |
282
|
|
|
|
|
|
|
'reset', |
283
|
|
|
|
|
|
|
'retfie', |
284
|
|
|
|
|
|
|
'retlw', |
285
|
|
|
|
|
|
|
'return', |
286
|
|
|
|
|
|
|
'rlcf', |
287
|
|
|
|
|
|
|
'rlf', |
288
|
|
|
|
|
|
|
'rlncf', |
289
|
|
|
|
|
|
|
'rrcf', |
290
|
|
|
|
|
|
|
'rrf', |
291
|
|
|
|
|
|
|
'rrncf', |
292
|
|
|
|
|
|
|
'setf', |
293
|
|
|
|
|
|
|
'sleep', |
294
|
|
|
|
|
|
|
'subfwb', |
295
|
|
|
|
|
|
|
'sublw', |
296
|
|
|
|
|
|
|
'subwf', |
297
|
|
|
|
|
|
|
'subwfb', |
298
|
|
|
|
|
|
|
'swapf', |
299
|
|
|
|
|
|
|
'tblrd', |
300
|
|
|
|
|
|
|
'tblwt', |
301
|
|
|
|
|
|
|
'tstfsz', |
302
|
|
|
|
|
|
|
'xorlw', |
303
|
|
|
|
|
|
|
'xorwf', |
304
|
|
|
|
|
|
|
); |
305
|
2
|
|
|
|
|
58
|
$self->contextdata({ |
306
|
|
|
|
|
|
|
'ASCIIChar' => { |
307
|
|
|
|
|
|
|
callback => \&parseASCIIChar, |
308
|
|
|
|
|
|
|
attribute => 'Char', |
309
|
|
|
|
|
|
|
lineending => '#pop', |
310
|
|
|
|
|
|
|
}, |
311
|
|
|
|
|
|
|
'QuotedNumError' => { |
312
|
|
|
|
|
|
|
callback => \&parseQuotedNumError, |
313
|
|
|
|
|
|
|
attribute => 'Error', |
314
|
|
|
|
|
|
|
lineending => '#pop#pop', |
315
|
|
|
|
|
|
|
}, |
316
|
|
|
|
|
|
|
'binaryDigits' => { |
317
|
|
|
|
|
|
|
callback => \&parsebinaryDigits, |
318
|
|
|
|
|
|
|
attribute => 'Based Numbers', |
319
|
|
|
|
|
|
|
lineending => '#pop', |
320
|
|
|
|
|
|
|
}, |
321
|
|
|
|
|
|
|
'comment' => { |
322
|
|
|
|
|
|
|
callback => \&parsecomment, |
323
|
|
|
|
|
|
|
attribute => 'Comment', |
324
|
|
|
|
|
|
|
lineending => '#pop', |
325
|
|
|
|
|
|
|
}, |
326
|
|
|
|
|
|
|
'decimalDigits' => { |
327
|
|
|
|
|
|
|
callback => \&parsedecimalDigits, |
328
|
|
|
|
|
|
|
attribute => 'Based Numbers', |
329
|
|
|
|
|
|
|
lineending => '#pop', |
330
|
|
|
|
|
|
|
}, |
331
|
|
|
|
|
|
|
'hexDigits' => { |
332
|
|
|
|
|
|
|
callback => \&parsehexDigits, |
333
|
|
|
|
|
|
|
attribute => 'Based Numbers', |
334
|
|
|
|
|
|
|
lineending => '#pop', |
335
|
|
|
|
|
|
|
}, |
336
|
|
|
|
|
|
|
'normal' => { |
337
|
|
|
|
|
|
|
callback => \&parsenormal, |
338
|
|
|
|
|
|
|
attribute => 'Normal Text', |
339
|
|
|
|
|
|
|
}, |
340
|
|
|
|
|
|
|
'octDigits' => { |
341
|
|
|
|
|
|
|
callback => \&parseoctDigits, |
342
|
|
|
|
|
|
|
attribute => 'Based Numbers', |
343
|
|
|
|
|
|
|
lineending => '#pop', |
344
|
|
|
|
|
|
|
}, |
345
|
|
|
|
|
|
|
'string' => { |
346
|
|
|
|
|
|
|
callback => \&parsestring, |
347
|
|
|
|
|
|
|
attribute => 'String', |
348
|
|
|
|
|
|
|
lineending => '#pop', |
349
|
|
|
|
|
|
|
}, |
350
|
|
|
|
|
|
|
}); |
351
|
2
|
|
|
|
|
15
|
$self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); |
352
|
2
|
|
|
|
|
7
|
$self->basecontext('normal'); |
353
|
2
|
|
|
|
|
15
|
$self->keywordscase(0); |
354
|
2
|
|
|
|
|
7
|
$self->initialize; |
355
|
2
|
|
|
|
|
7
|
bless ($self, $class); |
356
|
2
|
|
|
|
|
12
|
return $self; |
357
|
|
|
|
|
|
|
} |
358
|
|
|
|
|
|
|
|
359
|
|
|
|
|
|
|
sub language { |
360
|
0
|
|
|
0
|
0
|
0
|
return 'PicAsm'; |
361
|
|
|
|
|
|
|
} |
362
|
|
|
|
|
|
|
|
363
|
|
|
|
|
|
|
sub parseASCIIChar { |
364
|
0
|
|
|
0
|
0
|
0
|
my ($self, $text) = @_; |
365
|
|
|
|
|
|
|
# attribute => 'Char' |
366
|
|
|
|
|
|
|
# char => ''' |
367
|
|
|
|
|
|
|
# context => '#pop' |
368
|
|
|
|
|
|
|
# type => 'DetectChar' |
369
|
0
|
0
|
|
|
|
0
|
if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'Char')) { |
370
|
0
|
|
|
|
|
0
|
return 1 |
371
|
|
|
|
|
|
|
} |
372
|
|
|
|
|
|
|
# String => '.[^']' |
373
|
|
|
|
|
|
|
# attribute => 'Error' |
374
|
|
|
|
|
|
|
# context => 'QuotedNumError' |
375
|
|
|
|
|
|
|
# type => 'RegExpr' |
376
|
0
|
0
|
|
|
|
0
|
if ($self->testRegExpr($text, '.[^\']', 0, 0, 0, undef, 0, 'QuotedNumError', 'Error')) { |
377
|
0
|
|
|
|
|
0
|
return 1 |
378
|
|
|
|
|
|
|
} |
379
|
0
|
|
|
|
|
0
|
return 0; |
380
|
|
|
|
|
|
|
}; |
381
|
|
|
|
|
|
|
|
382
|
|
|
|
|
|
|
sub parseQuotedNumError { |
383
|
0
|
|
|
0
|
0
|
0
|
my ($self, $text) = @_; |
384
|
|
|
|
|
|
|
# attribute => 'Error' |
385
|
|
|
|
|
|
|
# char => ''' |
386
|
|
|
|
|
|
|
# context => '#pop#pop' |
387
|
|
|
|
|
|
|
# type => 'DetectChar' |
388
|
0
|
0
|
|
|
|
0
|
if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop#pop', 'Error')) { |
389
|
0
|
|
|
|
|
0
|
return 1 |
390
|
|
|
|
|
|
|
} |
391
|
0
|
|
|
|
|
0
|
return 0; |
392
|
|
|
|
|
|
|
}; |
393
|
|
|
|
|
|
|
|
394
|
|
|
|
|
|
|
sub parsebinaryDigits { |
395
|
62
|
|
|
62
|
0
|
95
|
my ($self, $text) = @_; |
396
|
|
|
|
|
|
|
# attribute => 'Based Numbers' |
397
|
|
|
|
|
|
|
# char => ''' |
398
|
|
|
|
|
|
|
# context => '#pop' |
399
|
|
|
|
|
|
|
# type => 'DetectChar' |
400
|
62
|
100
|
|
|
|
205
|
if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'Based Numbers')) { |
401
|
6
|
|
|
|
|
92
|
return 1 |
402
|
|
|
|
|
|
|
} |
403
|
|
|
|
|
|
|
# String => '[^0-1]' |
404
|
|
|
|
|
|
|
# attribute => 'Error' |
405
|
|
|
|
|
|
|
# context => 'QuotedNumError' |
406
|
|
|
|
|
|
|
# type => 'RegExpr' |
407
|
56
|
50
|
|
|
|
189
|
if ($self->testRegExpr($text, '[^0-1]', 0, 0, 0, undef, 0, 'QuotedNumError', 'Error')) { |
408
|
0
|
|
|
|
|
0
|
return 1 |
409
|
|
|
|
|
|
|
} |
410
|
56
|
|
|
|
|
157
|
return 0; |
411
|
|
|
|
|
|
|
}; |
412
|
|
|
|
|
|
|
|
413
|
|
|
|
|
|
|
sub parsecomment { |
414
|
7336
|
|
|
7336
|
0
|
17260
|
my ($self, $text) = @_; |
415
|
|
|
|
|
|
|
# String => '(INPUT|OUTPUT|PARAMETERS|AUTHOR|EMAIL)' |
416
|
|
|
|
|
|
|
# attribute => 'Instructions' |
417
|
|
|
|
|
|
|
# context => '#stay' |
418
|
|
|
|
|
|
|
# type => 'RegExpr' |
419
|
7336
|
50
|
|
|
|
36502
|
if ($self->testRegExpr($text, '(INPUT|OUTPUT|PARAMETERS|AUTHOR|EMAIL)', 0, 0, 0, undef, 0, '#stay', 'Instructions')) { |
420
|
0
|
|
|
|
|
0
|
return 1 |
421
|
|
|
|
|
|
|
} |
422
|
|
|
|
|
|
|
# String => '(FIXME|TODO)' |
423
|
|
|
|
|
|
|
# attribute => 'Alert' |
424
|
|
|
|
|
|
|
# context => '#stay' |
425
|
|
|
|
|
|
|
# type => 'RegExpr' |
426
|
7336
|
50
|
|
|
|
26282
|
if ($self->testRegExpr($text, '(FIXME|TODO)', 0, 0, 0, undef, 0, '#stay', 'Alert')) { |
427
|
0
|
|
|
|
|
0
|
return 1 |
428
|
|
|
|
|
|
|
} |
429
|
7336
|
|
|
|
|
20317
|
return 0; |
430
|
|
|
|
|
|
|
}; |
431
|
|
|
|
|
|
|
|
432
|
|
|
|
|
|
|
sub parsedecimalDigits { |
433
|
76
|
|
|
76
|
0
|
123
|
my ($self, $text) = @_; |
434
|
|
|
|
|
|
|
# attribute => 'Based Numbers' |
435
|
|
|
|
|
|
|
# char => ''' |
436
|
|
|
|
|
|
|
# context => '#pop' |
437
|
|
|
|
|
|
|
# type => 'DetectChar' |
438
|
76
|
100
|
|
|
|
314
|
if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'Based Numbers')) { |
439
|
22
|
|
|
|
|
112
|
return 1 |
440
|
|
|
|
|
|
|
} |
441
|
|
|
|
|
|
|
# String => '\D' |
442
|
|
|
|
|
|
|
# attribute => 'Error' |
443
|
|
|
|
|
|
|
# context => 'QuotedNumError' |
444
|
|
|
|
|
|
|
# type => 'RegExpr' |
445
|
54
|
50
|
|
|
|
215
|
if ($self->testRegExpr($text, '\\D', 0, 0, 0, undef, 0, 'QuotedNumError', 'Error')) { |
446
|
0
|
|
|
|
|
0
|
return 1 |
447
|
|
|
|
|
|
|
} |
448
|
54
|
|
|
|
|
142
|
return 0; |
449
|
|
|
|
|
|
|
}; |
450
|
|
|
|
|
|
|
|
451
|
|
|
|
|
|
|
sub parsehexDigits { |
452
|
0
|
|
|
0
|
0
|
0
|
my ($self, $text) = @_; |
453
|
|
|
|
|
|
|
# attribute => 'Based Numbers' |
454
|
|
|
|
|
|
|
# char => ''' |
455
|
|
|
|
|
|
|
# context => '#pop' |
456
|
|
|
|
|
|
|
# type => 'DetectChar' |
457
|
0
|
0
|
|
|
|
0
|
if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'Based Numbers')) { |
458
|
0
|
|
|
|
|
0
|
return 1 |
459
|
|
|
|
|
|
|
} |
460
|
|
|
|
|
|
|
# String => '[^0-9A-Fa-f]' |
461
|
|
|
|
|
|
|
# attribute => 'Error' |
462
|
|
|
|
|
|
|
# context => 'QuotedNumError' |
463
|
|
|
|
|
|
|
# type => 'RegExpr' |
464
|
0
|
0
|
|
|
|
0
|
if ($self->testRegExpr($text, '[^0-9A-Fa-f]', 0, 0, 0, undef, 0, 'QuotedNumError', 'Error')) { |
465
|
0
|
|
|
|
|
0
|
return 1 |
466
|
|
|
|
|
|
|
} |
467
|
0
|
|
|
|
|
0
|
return 0; |
468
|
|
|
|
|
|
|
}; |
469
|
|
|
|
|
|
|
|
470
|
|
|
|
|
|
|
sub parsenormal { |
471
|
4276
|
|
|
4276
|
0
|
7147
|
my ($self, $text) = @_; |
472
|
|
|
|
|
|
|
# String => 'directives' |
473
|
|
|
|
|
|
|
# attribute => 'Directives' |
474
|
|
|
|
|
|
|
# context => '#stay' |
475
|
|
|
|
|
|
|
# type => 'keyword' |
476
|
4276
|
100
|
|
|
|
22158
|
if ($self->testKeyword($text, 'directives', 0, undef, 0, '#stay', 'Directives')) { |
477
|
78
|
|
|
|
|
307
|
return 1 |
478
|
|
|
|
|
|
|
} |
479
|
|
|
|
|
|
|
# String => 'instructions' |
480
|
|
|
|
|
|
|
# attribute => 'Instructions' |
481
|
|
|
|
|
|
|
# context => '#stay' |
482
|
|
|
|
|
|
|
# type => 'keyword' |
483
|
4198
|
100
|
|
|
|
63402
|
if ($self->testKeyword($text, 'instructions', 0, undef, 0, '#stay', 'Instructions')) { |
484
|
198
|
|
|
|
|
1338
|
return 1 |
485
|
|
|
|
|
|
|
} |
486
|
|
|
|
|
|
|
# String => 'instruction_attr' |
487
|
|
|
|
|
|
|
# attribute => 'InstructionAttr' |
488
|
|
|
|
|
|
|
# context => '#stay' |
489
|
|
|
|
|
|
|
# type => 'keyword' |
490
|
4000
|
100
|
|
|
|
21478
|
if ($self->testKeyword($text, 'instruction_attr', 0, undef, 0, '#stay', 'InstructionAttr')) { |
491
|
22
|
|
|
|
|
82
|
return 1 |
492
|
|
|
|
|
|
|
} |
493
|
|
|
|
|
|
|
# String => 'conditional' |
494
|
|
|
|
|
|
|
# attribute => 'Preprocessor' |
495
|
|
|
|
|
|
|
# context => '#stay' |
496
|
|
|
|
|
|
|
# type => 'keyword' |
497
|
3978
|
100
|
|
|
|
16488
|
if ($self->testKeyword($text, 'conditional', 0, undef, 0, '#stay', 'Preprocessor')) { |
498
|
2
|
|
|
|
|
8
|
return 1 |
499
|
|
|
|
|
|
|
} |
500
|
|
|
|
|
|
|
# String => 'gpasm_macro' |
501
|
|
|
|
|
|
|
# attribute => 'GPASM-macros' |
502
|
|
|
|
|
|
|
# context => '#stay' |
503
|
|
|
|
|
|
|
# type => 'keyword' |
504
|
3976
|
50
|
|
|
|
14965
|
if ($self->testKeyword($text, 'gpasm_macro', 0, undef, 0, '#stay', 'GPASM-macros')) { |
505
|
0
|
|
|
|
|
0
|
return 1 |
506
|
|
|
|
|
|
|
} |
507
|
|
|
|
|
|
|
# attribute => 'Based Numbers' |
508
|
|
|
|
|
|
|
# context => '#stay' |
509
|
|
|
|
|
|
|
# type => 'HlCHex' |
510
|
3976
|
100
|
|
|
|
42555
|
if ($self->testHlCHex($text, 0, undef, 0, '#stay', 'Based Numbers')) { |
511
|
6
|
|
|
|
|
22
|
return 1 |
512
|
|
|
|
|
|
|
} |
513
|
|
|
|
|
|
|
# String => '([ \t,][0-9A-F]+H[ \t,])' |
514
|
|
|
|
|
|
|
# attribute => 'Based Numbers' |
515
|
|
|
|
|
|
|
# context => '#stay' |
516
|
|
|
|
|
|
|
# insensitive => 'TRUE' |
517
|
|
|
|
|
|
|
# type => 'RegExpr' |
518
|
3970
|
50
|
|
|
|
28906
|
if ($self->testRegExpr($text, '([ \\t,][0-9A-F]+H[ \\t,])', 1, 0, 0, undef, 0, '#stay', 'Based Numbers')) { |
519
|
0
|
|
|
|
|
0
|
return 1 |
520
|
|
|
|
|
|
|
} |
521
|
|
|
|
|
|
|
# String => '([ \t,][0-9A-F]+H)$' |
522
|
|
|
|
|
|
|
# attribute => 'Based Numbers' |
523
|
|
|
|
|
|
|
# context => '#stay' |
524
|
|
|
|
|
|
|
# insensitive => 'TRUE' |
525
|
|
|
|
|
|
|
# type => 'RegExpr' |
526
|
3970
|
50
|
|
|
|
23558
|
if ($self->testRegExpr($text, '([ \\t,][0-9A-F]+H)$', 1, 0, 0, undef, 0, '#stay', 'Based Numbers')) { |
527
|
0
|
|
|
|
|
0
|
return 1 |
528
|
|
|
|
|
|
|
} |
529
|
|
|
|
|
|
|
# String => '([ \t,][0-9]+D)' |
530
|
|
|
|
|
|
|
# attribute => 'Based Numbers' |
531
|
|
|
|
|
|
|
# context => '#stay' |
532
|
|
|
|
|
|
|
# insensitive => 'TRUE' |
533
|
|
|
|
|
|
|
# type => 'RegExpr' |
534
|
3970
|
50
|
|
|
|
35170
|
if ($self->testRegExpr($text, '([ \\t,][0-9]+D)', 1, 0, 0, undef, 0, '#stay', 'Based Numbers')) { |
535
|
0
|
|
|
|
|
0
|
return 1 |
536
|
|
|
|
|
|
|
} |
537
|
|
|
|
|
|
|
# String => '([ \t,][0-7]+O)' |
538
|
|
|
|
|
|
|
# attribute => 'Based Numbers' |
539
|
|
|
|
|
|
|
# context => '#stay' |
540
|
|
|
|
|
|
|
# insensitive => 'TRUE' |
541
|
|
|
|
|
|
|
# type => 'RegExpr' |
542
|
3970
|
50
|
|
|
|
30790
|
if ($self->testRegExpr($text, '([ \\t,][0-7]+O)', 1, 0, 0, undef, 0, '#stay', 'Based Numbers')) { |
543
|
0
|
|
|
|
|
0
|
return 1 |
544
|
|
|
|
|
|
|
} |
545
|
|
|
|
|
|
|
# String => '([ \t,][0-1]+B)' |
546
|
|
|
|
|
|
|
# attribute => 'Based Numbers' |
547
|
|
|
|
|
|
|
# context => '#stay' |
548
|
|
|
|
|
|
|
# insensitive => 'TRUE' |
549
|
|
|
|
|
|
|
# type => 'RegExpr' |
550
|
3970
|
50
|
|
|
|
19284
|
if ($self->testRegExpr($text, '([ \\t,][0-1]+B)', 1, 0, 0, undef, 0, '#stay', 'Based Numbers')) { |
551
|
0
|
|
|
|
|
0
|
return 1 |
552
|
|
|
|
|
|
|
} |
553
|
|
|
|
|
|
|
# attribute => 'Unbased Numbers' |
554
|
|
|
|
|
|
|
# context => '#stay' |
555
|
|
|
|
|
|
|
# type => 'Int' |
556
|
3970
|
100
|
|
|
|
17085
|
if ($self->testInt($text, 0, undef, 0, '#stay', 'Unbased Numbers')) { |
557
|
40
|
|
|
|
|
118
|
return 1 |
558
|
|
|
|
|
|
|
} |
559
|
|
|
|
|
|
|
# attribute => 'Char' |
560
|
|
|
|
|
|
|
# context => '#stay' |
561
|
|
|
|
|
|
|
# type => 'HlCChar' |
562
|
3930
|
50
|
|
|
|
16980
|
if ($self->testHlCChar($text, 0, undef, 0, '#stay', 'Char')) { |
563
|
0
|
|
|
|
|
0
|
return 1 |
564
|
|
|
|
|
|
|
} |
565
|
|
|
|
|
|
|
# attribute => 'Char' |
566
|
|
|
|
|
|
|
# char => 'A' |
567
|
|
|
|
|
|
|
# char1 => ''' |
568
|
|
|
|
|
|
|
# context => 'ASCIIChar' |
569
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
570
|
3930
|
50
|
|
|
|
18994
|
if ($self->testDetect2Chars($text, 'A', '\'', 0, 0, 0, undef, 0, 'ASCIIChar', 'Char')) { |
571
|
0
|
|
|
|
|
0
|
return 1 |
572
|
|
|
|
|
|
|
} |
573
|
|
|
|
|
|
|
# attribute => 'Char' |
574
|
|
|
|
|
|
|
# char => 'a' |
575
|
|
|
|
|
|
|
# char1 => ''' |
576
|
|
|
|
|
|
|
# context => 'ASCIIChar' |
577
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
578
|
3930
|
50
|
|
|
|
14567
|
if ($self->testDetect2Chars($text, 'a', '\'', 0, 0, 0, undef, 0, 'ASCIIChar', 'Char')) { |
579
|
0
|
|
|
|
|
0
|
return 1 |
580
|
|
|
|
|
|
|
} |
581
|
|
|
|
|
|
|
# attribute => 'Based Numbers' |
582
|
|
|
|
|
|
|
# char => 'B' |
583
|
|
|
|
|
|
|
# char1 => ''' |
584
|
|
|
|
|
|
|
# context => 'binaryDigits' |
585
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
586
|
3930
|
100
|
|
|
|
13424
|
if ($self->testDetect2Chars($text, 'B', '\'', 0, 0, 0, undef, 0, 'binaryDigits', 'Based Numbers')) { |
587
|
6
|
|
|
|
|
24
|
return 1 |
588
|
|
|
|
|
|
|
} |
589
|
|
|
|
|
|
|
# attribute => 'Based Numbers' |
590
|
|
|
|
|
|
|
# char => 'b' |
591
|
|
|
|
|
|
|
# char1 => ''' |
592
|
|
|
|
|
|
|
# context => 'binaryDigits' |
593
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
594
|
3924
|
50
|
|
|
|
18106
|
if ($self->testDetect2Chars($text, 'b', '\'', 0, 0, 0, undef, 0, 'binaryDigits', 'Based Numbers')) { |
595
|
0
|
|
|
|
|
0
|
return 1 |
596
|
|
|
|
|
|
|
} |
597
|
|
|
|
|
|
|
# attribute => 'Based Numbers' |
598
|
|
|
|
|
|
|
# char => 'H' |
599
|
|
|
|
|
|
|
# char1 => ''' |
600
|
|
|
|
|
|
|
# context => 'hexDigits' |
601
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
602
|
3924
|
50
|
|
|
|
17791
|
if ($self->testDetect2Chars($text, 'H', '\'', 0, 0, 0, undef, 0, 'hexDigits', 'Based Numbers')) { |
603
|
0
|
|
|
|
|
0
|
return 1 |
604
|
|
|
|
|
|
|
} |
605
|
|
|
|
|
|
|
# attribute => 'Based Numbers' |
606
|
|
|
|
|
|
|
# char => 'h' |
607
|
|
|
|
|
|
|
# char1 => ''' |
608
|
|
|
|
|
|
|
# context => 'hexDigits' |
609
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
610
|
3924
|
50
|
|
|
|
13682
|
if ($self->testDetect2Chars($text, 'h', '\'', 0, 0, 0, undef, 0, 'hexDigits', 'Based Numbers')) { |
611
|
0
|
|
|
|
|
0
|
return 1 |
612
|
|
|
|
|
|
|
} |
613
|
|
|
|
|
|
|
# attribute => 'Based Numbers' |
614
|
|
|
|
|
|
|
# char => 'O' |
615
|
|
|
|
|
|
|
# char1 => ''' |
616
|
|
|
|
|
|
|
# context => 'octDigits' |
617
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
618
|
3924
|
50
|
|
|
|
15818
|
if ($self->testDetect2Chars($text, 'O', '\'', 0, 0, 0, undef, 0, 'octDigits', 'Based Numbers')) { |
619
|
0
|
|
|
|
|
0
|
return 1 |
620
|
|
|
|
|
|
|
} |
621
|
|
|
|
|
|
|
# attribute => 'Based Numbers' |
622
|
|
|
|
|
|
|
# char => 'o' |
623
|
|
|
|
|
|
|
# char1 => ''' |
624
|
|
|
|
|
|
|
# context => 'octDigits' |
625
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
626
|
3924
|
50
|
|
|
|
15067
|
if ($self->testDetect2Chars($text, 'o', '\'', 0, 0, 0, undef, 0, 'octDigits', 'Based Numbers')) { |
627
|
0
|
|
|
|
|
0
|
return 1 |
628
|
|
|
|
|
|
|
} |
629
|
|
|
|
|
|
|
# attribute => 'Based Numbers' |
630
|
|
|
|
|
|
|
# char => 'D' |
631
|
|
|
|
|
|
|
# char1 => ''' |
632
|
|
|
|
|
|
|
# context => 'decimalDigits' |
633
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
634
|
3924
|
100
|
|
|
|
14842
|
if ($self->testDetect2Chars($text, 'D', '\'', 0, 0, 0, undef, 0, 'decimalDigits', 'Based Numbers')) { |
635
|
22
|
|
|
|
|
77
|
return 1 |
636
|
|
|
|
|
|
|
} |
637
|
|
|
|
|
|
|
# attribute => 'Based Numbers' |
638
|
|
|
|
|
|
|
# char => 'd' |
639
|
|
|
|
|
|
|
# char1 => ''' |
640
|
|
|
|
|
|
|
# context => 'decimalDigits' |
641
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
642
|
3902
|
50
|
|
|
|
25901
|
if ($self->testDetect2Chars($text, 'd', '\'', 0, 0, 0, undef, 0, 'decimalDigits', 'Based Numbers')) { |
643
|
0
|
|
|
|
|
0
|
return 1 |
644
|
|
|
|
|
|
|
} |
645
|
|
|
|
|
|
|
# attribute => 'String' |
646
|
|
|
|
|
|
|
# char => '"' |
647
|
|
|
|
|
|
|
# context => 'string' |
648
|
|
|
|
|
|
|
# type => 'DetectChar' |
649
|
3902
|
100
|
|
|
|
16684
|
if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'string', 'String')) { |
650
|
2
|
|
|
|
|
6
|
return 1 |
651
|
|
|
|
|
|
|
} |
652
|
|
|
|
|
|
|
# attribute => 'Comment' |
653
|
|
|
|
|
|
|
# char => ';' |
654
|
|
|
|
|
|
|
# context => 'comment' |
655
|
|
|
|
|
|
|
# type => 'DetectChar' |
656
|
3900
|
100
|
|
|
|
14784
|
if ($self->testDetectChar($text, ';', 0, 0, 0, undef, 0, 'comment', 'Comment')) { |
657
|
262
|
|
|
|
|
1129
|
return 1 |
658
|
|
|
|
|
|
|
} |
659
|
|
|
|
|
|
|
# String => '-/*%+=><&|^!~' |
660
|
|
|
|
|
|
|
# attribute => 'Symbol' |
661
|
|
|
|
|
|
|
# context => '#stay' |
662
|
|
|
|
|
|
|
# type => 'AnyChar' |
663
|
3638
|
100
|
|
|
|
29192
|
if ($self->testAnyChar($text, '-/*%+=><&|^!~', 0, 0, undef, 0, '#stay', 'Symbol')) { |
664
|
28
|
|
|
|
|
95
|
return 1 |
665
|
|
|
|
|
|
|
} |
666
|
|
|
|
|
|
|
# String => '#define' |
667
|
|
|
|
|
|
|
# attribute => 'Preprocessor' |
668
|
|
|
|
|
|
|
# context => '#stay' |
669
|
|
|
|
|
|
|
# type => 'StringDetect' |
670
|
3610
|
50
|
|
|
|
18946
|
if ($self->testStringDetect($text, '#define', 0, 0, 0, undef, 0, '#stay', 'Preprocessor')) { |
671
|
0
|
|
|
|
|
0
|
return 1 |
672
|
|
|
|
|
|
|
} |
673
|
|
|
|
|
|
|
# String => '#undefine' |
674
|
|
|
|
|
|
|
# attribute => 'Preprocessor' |
675
|
|
|
|
|
|
|
# context => '#stay' |
676
|
|
|
|
|
|
|
# type => 'StringDetect' |
677
|
3610
|
50
|
|
|
|
24145
|
if ($self->testStringDetect($text, '#undefine', 0, 0, 0, undef, 0, '#stay', 'Preprocessor')) { |
678
|
0
|
|
|
|
|
0
|
return 1 |
679
|
|
|
|
|
|
|
} |
680
|
|
|
|
|
|
|
# String => '#v' |
681
|
|
|
|
|
|
|
# attribute => 'Preprocessor' |
682
|
|
|
|
|
|
|
# context => '#stay' |
683
|
|
|
|
|
|
|
# type => 'StringDetect' |
684
|
3610
|
50
|
|
|
|
16824
|
if ($self->testStringDetect($text, '#v', 0, 0, 0, undef, 0, '#stay', 'Preprocessor')) { |
685
|
0
|
|
|
|
|
0
|
return 1 |
686
|
|
|
|
|
|
|
} |
687
|
3610
|
|
|
|
|
17538
|
return 0; |
688
|
|
|
|
|
|
|
}; |
689
|
|
|
|
|
|
|
|
690
|
|
|
|
|
|
|
sub parseoctDigits { |
691
|
0
|
|
|
0
|
0
|
0
|
my ($self, $text) = @_; |
692
|
|
|
|
|
|
|
# attribute => 'Based Numbers' |
693
|
|
|
|
|
|
|
# char => ''' |
694
|
|
|
|
|
|
|
# context => '#pop' |
695
|
|
|
|
|
|
|
# type => 'DetectChar' |
696
|
0
|
0
|
|
|
|
0
|
if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'Based Numbers')) { |
697
|
0
|
|
|
|
|
0
|
return 1 |
698
|
|
|
|
|
|
|
} |
699
|
|
|
|
|
|
|
# String => '[^0-7]' |
700
|
|
|
|
|
|
|
# attribute => 'Error' |
701
|
|
|
|
|
|
|
# context => 'QuotedNumError' |
702
|
|
|
|
|
|
|
# type => 'RegExpr' |
703
|
0
|
0
|
|
|
|
0
|
if ($self->testRegExpr($text, '[^0-7]', 0, 0, 0, undef, 0, 'QuotedNumError', 'Error')) { |
704
|
0
|
|
|
|
|
0
|
return 1 |
705
|
|
|
|
|
|
|
} |
706
|
0
|
|
|
|
|
0
|
return 0; |
707
|
|
|
|
|
|
|
}; |
708
|
|
|
|
|
|
|
|
709
|
|
|
|
|
|
|
sub parsestring { |
710
|
24
|
|
|
24
|
0
|
30
|
my ($self, $text) = @_; |
711
|
|
|
|
|
|
|
# attribute => 'String' |
712
|
|
|
|
|
|
|
# context => '#stay' |
713
|
|
|
|
|
|
|
# type => 'LineContinue' |
714
|
24
|
50
|
|
|
|
80
|
if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'String')) { |
715
|
0
|
|
|
|
|
0
|
return 1 |
716
|
|
|
|
|
|
|
} |
717
|
|
|
|
|
|
|
# attribute => 'Char' |
718
|
|
|
|
|
|
|
# context => '#stay' |
719
|
|
|
|
|
|
|
# type => 'HlCStringChar' |
720
|
24
|
50
|
|
|
|
83
|
if ($self->testHlCStringChar($text, 0, undef, 0, '#stay', 'Char')) { |
721
|
0
|
|
|
|
|
0
|
return 1 |
722
|
|
|
|
|
|
|
} |
723
|
|
|
|
|
|
|
# attribute => 'String' |
724
|
|
|
|
|
|
|
# char => '"' |
725
|
|
|
|
|
|
|
# context => '#pop' |
726
|
|
|
|
|
|
|
# type => 'DetectChar' |
727
|
24
|
100
|
|
|
|
73
|
if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) { |
728
|
2
|
|
|
|
|
6
|
return 1 |
729
|
|
|
|
|
|
|
} |
730
|
22
|
|
|
|
|
47
|
return 0; |
731
|
|
|
|
|
|
|
}; |
732
|
|
|
|
|
|
|
|
733
|
|
|
|
|
|
|
|
734
|
|
|
|
|
|
|
1; |
735
|
|
|
|
|
|
|
|
736
|
|
|
|
|
|
|
__END__ |