Skip to content
This repository
Newer
Older
100644 411 lines (363 sloc) 10.68 kb
cd93cb47 » fperrad
2009-04-26 [codingstd] add missing Copyright
1 # Copyright (C) 2005-2009, Parrot Foundation.
b843eae2 » fperrad
2009-04-15 [codingstd] add missing $Id
2 # $Id$
9cbdcbc2 » pmichaud
2006-04-27 Merge pge-pm branch with updated PGE into trunk.
3
1ebf2db7 » tene
2008-10-10 Merge hllmagic branch into trunk.
4 .namespace [ "PGE";"P5Regex" ]
9cbdcbc2 » pmichaud
2006-04-27 Merge pge-pm branch with updated PGE into trunk.
5
6 .sub "compile_p5regex"
7 .param pmc source
8 .param pmc adverbs :slurpy :named
9
10 $I0 = exists adverbs['grammar']
8e57fe83 » allisonrandal
2007-10-17 [pdd15oo] Merging the pdd15oo branch at r22176 back into trunk.
11 if $I0 goto have_grammar
1c757c96 » pmichaud
2006-05-11 [PGE]:
12 adverbs['grammar'] = 'PGE::Grammar'
8e57fe83 » allisonrandal
2007-10-17 [pdd15oo] Merging the pdd15oo branch at r22176 back into trunk.
13 have_grammar:
9cbdcbc2 » pmichaud
2006-04-27 Merge pge-pm branch with updated PGE into trunk.
14
15 .local string target
16 target = adverbs['target']
e1f7b0ca » pmichaud
2006-11-08 [PGE]:
17 target = downcase target
9cbdcbc2 » pmichaud
2006-04-27 Merge pge-pm branch with updated PGE into trunk.
18
48890757 » pmichaud
2009-03-27 [pge]: Update P5Regex so that its parser recognizes specific stop tok…
19 ## If we're passed the results of a previous parse, use it.
9cbdcbc2 » pmichaud
2006-04-27 Merge pge-pm branch with updated PGE into trunk.
20 .local pmc match
48890757 » pmichaud
2009-03-27 [pge]: Update P5Regex so that its parser recognizes specific stop tok…
21 $I0 = isa source, ['PGE';'Match']
22 if $I0 == 0 goto parse
23 $P0 = source['expr']
24 if null $P0 goto parse
25 $I0 = isa $P0, ['PGE';'Exp']
26 if $I0 == 0 goto parse
27 match = source
28 goto analyze
29
30 parse:
e1f7b0ca » pmichaud
2006-11-08 [PGE]:
31 $P0 = get_global "p5regex"
48890757 » pmichaud
2009-03-27 [pge]: Update P5Regex so that its parser recognizes specific stop tok…
32 match = $P0(source, adverbs :flat :named)
9cbdcbc2 » pmichaud
2006-04-27 Merge pge-pm branch with updated PGE into trunk.
33 if target != 'parse' goto check
34 .return (match)
35
36 check:
37 unless match goto check_1
38 $S0 = source
39 $S1 = match
40 if $S0 == $S1 goto analyze
41 check_1:
42 null $P0
43 .return ($P0)
44
45 analyze:
46 .local pmc exp, pad
47 exp = match['expr']
b3ef02fa » pmichaud
2007-06-28 [pge]:
48 pad = new 'Hash'
9cbdcbc2 » pmichaud
2006-04-27 Merge pge-pm branch with updated PGE into trunk.
49 pad['subpats'] = 0
50 exp = exp.'p5analyze'(pad)
f7e5e328 » coke
2008-11-11 RT #58974 - .return is deprecated when .tailcall could be used.
51 .tailcall exp.'compile'(adverbs :flat :named)
9cbdcbc2 » pmichaud
2006-04-27 Merge pge-pm branch with updated PGE into trunk.
52 .end
53
54
55 .sub "p5regex"
56 .param pmc mob
48890757 » pmichaud
2009-03-27 [pge]: Update P5Regex so that its parser recognizes specific stop tok…
57 .param pmc adverbs :slurpy :named
58
59 .local string stop, tighter
60 .local pmc stopstack, optable
61
62 stopstack = get_hll_global ['PGE';'P5Regex'], '@!stopstack'
1ebf2db7 » tene
2008-10-10 Merge hllmagic branch into trunk.
63 optable = get_hll_global ["PGE";"P5Regex"], "$optable"
48890757 » pmichaud
2009-03-27 [pge]: Update P5Regex so that its parser recognizes specific stop tok…
64
65 stop = adverbs['stop']
66 tighter = adverbs['tighter']
67 push stopstack, stop
68 $P0 = optable."parse"(mob, 'stop'=>stop, 'tighter'=>tighter)
69 $S0 = pop stopstack
70
9cbdcbc2 » pmichaud
2006-04-27 Merge pge-pm branch with updated PGE into trunk.
71 .return ($P0)
72 .end
73
74
c346e6b6 » pmichaud
2005-11-17 * Added initial version of compreg "PGE::P5Regexp"
75 .include "cclass.pasm"
76
77 .const int PGE_INF = 2147483647
78
79 .sub "__onload" :load
80 .local pmc optable
81
1ebf2db7 » tene
2008-10-10 Merge hllmagic branch into trunk.
82 optable = new ['PGE';'OPTable']
83 set_hll_global ["PGE";"P5Regex"], "$optable", optable
c346e6b6 » pmichaud
2005-11-17 * Added initial version of compreg "PGE::P5Regexp"
84
1ebf2db7 » tene
2008-10-10 Merge hllmagic branch into trunk.
85 $P0 = get_hll_global ["PGE";"P5Regex"], "parse_lit"
1e544bab » coke
2008-11-13 use of bareword method names is [DEPRECATED]
86 optable.'newtok'('term:', 'precedence'=>'=', 'nows'=>1, 'parsed'=>$P0)
0700c336 » particle
2006-09-30 [PGE]: convert deprecated 'addtok' calls to 'newtok'
87
1e544bab » coke
2008-11-13 use of bareword method names is [DEPRECATED]
88 optable.'newtok'('term:\b', 'equiv'=>'term:', 'nows'=>1, 'match'=>'PGE::Exp::Anchor')
89 optable.'newtok'('term:\B', 'equiv'=>'term:', 'nows'=>1, 'match'=>'PGE::Exp::Anchor')
90 optable.'newtok'('term:^', 'equiv'=>'term:', 'nows'=>1, 'match'=>'PGE::Exp::Anchor')
91 optable.'newtok'('term:$', 'equiv'=>'term:', 'nows'=>1, 'match'=>'PGE::Exp::Anchor')
0700c336 » particle
2006-09-30 [PGE]: convert deprecated 'addtok' calls to 'newtok'
92
1e544bab » coke
2008-11-13 use of bareword method names is [DEPRECATED]
93 optable.'newtok'('term:\d', 'equiv'=>'term:', 'nows'=>1, 'match'=>'PGE::Exp::CCShortcut')
94 optable.'newtok'('term:\D', 'equiv'=>'term:', 'nows'=>1, 'match'=>'PGE::Exp::CCShortcut')
95 optable.'newtok'('term:\s', 'equiv'=>'term:', 'nows'=>1, 'match'=>'PGE::Exp::CCShortcut')
96 optable.'newtok'('term:\S', 'equiv'=>'term:', 'nows'=>1, 'match'=>'PGE::Exp::CCShortcut')
97 optable.'newtok'('term:\w', 'equiv'=>'term:', 'nows'=>1, 'match'=>'PGE::Exp::CCShortcut')
98 optable.'newtok'('term:\W', 'equiv'=>'term:', 'nows'=>1, 'match'=>'PGE::Exp::CCShortcut')
0700c336 » particle
2006-09-30 [PGE]: convert deprecated 'addtok' calls to 'newtok'
99
1e544bab » coke
2008-11-13 use of bareword method names is [DEPRECATED]
100 optable.'newtok'('circumfix:( )', 'equiv'=>'term:', 'nows'=>1, 'nullterm'=>1, 'match'=>'PGE::Exp::CGroup')
101 optable.'newtok'('circumfix:(?: )', 'equiv'=>'term:', 'nows'=>1, 'nullterm'=>1, 'match'=>'PGE::Exp::Group')
0700c336 » particle
2006-09-30 [PGE]: convert deprecated 'addtok' calls to 'newtok'
102
1ebf2db7 » tene
2008-10-10 Merge hllmagic branch into trunk.
103 $P0 = get_hll_global ['PGE';'P5Regex'], 'parse_enumclass'
1e544bab » coke
2008-11-13 use of bareword method names is [DEPRECATED]
104 optable.'newtok'('term:[', 'precedence'=>'=', 'nows'=>1, 'parsed'=>$P0)
105 optable.'newtok'('term:.', 'precedence'=>'=', 'nows'=>1, 'parsed'=>$P0)
0700c336 » particle
2006-09-30 [PGE]: convert deprecated 'addtok' calls to 'newtok'
106
1ebf2db7 » tene
2008-10-10 Merge hllmagic branch into trunk.
107 $P0 = get_hll_global ['PGE';'P5Regex'], 'parse_quant'
1e544bab » coke
2008-11-13 use of bareword method names is [DEPRECATED]
108 optable.'newtok'('postfix:*', 'looser'=>'term:', 'left'=>1, 'nows'=>1, 'parsed'=>$P0)
109 optable.'newtok'('postfix:+', 'equiv'=>'postfix:*', 'left'=>1, 'nows'=>1, 'parsed'=>$P0)
110 optable.'newtok'('postfix:?', 'equiv'=>'postfix:*', 'left'=>1, 'nows'=>1, 'parsed'=>$P0)
111 optable.'newtok'('postfix:{', 'equiv'=>'postfix:*', 'left'=>1, 'nows'=>1, 'parsed'=>$P0)
0700c336 » particle
2006-09-30 [PGE]: convert deprecated 'addtok' calls to 'newtok'
112
1e544bab » coke
2008-11-13 use of bareword method names is [DEPRECATED]
113 optable.'newtok'('infix:', 'looser'=>'postfix:*', 'right'=>1, 'nows'=>1, 'match'=>'PGE::Exp::Concat')
114 optable.'newtok'('infix:|', 'looser'=>'infix:', 'left'=>1, 'nows'=>1, 'match'=>'PGE::Exp::Alt')
0700c336 » particle
2006-09-30 [PGE]: convert deprecated 'addtok' calls to 'newtok'
115
1e544bab » coke
2008-11-13 use of bareword method names is [DEPRECATED]
116 optable.'newtok'('close:}', 'looser'=>'infix:|', 'nows'=>1) # XXX: hack
c346e6b6 » pmichaud
2005-11-17 * Added initial version of compreg "PGE::P5Regexp"
117
48890757 » pmichaud
2009-03-27 [pge]: Update P5Regex so that its parser recognizes specific stop tok…
118 # Create a stack for holding stop tokens
119 $P0 = new 'ResizablePMCArray'
120 set_hll_global ['PGE';'P5Regex'], '@!stopstack', $P0
121
1ebf2db7 » tene
2008-10-10 Merge hllmagic branch into trunk.
122 $P0 = get_hll_global ["PGE";"P5Regex"], "compile_p5regex"
9cbdcbc2 » pmichaud
2006-04-27 Merge pge-pm branch with updated PGE into trunk.
123 compreg "PGE::P5Regex", $P0
c346e6b6 » pmichaud
2005-11-17 * Added initial version of compreg "PGE::P5Regexp"
124 .end
125
126
1af8ba31 » particle
2006-10-02 [PGE]: #40106: [PATCH] 15 more tests work for PGE::P5Regex
127 .sub 'parse_error'
128 .param pmc mob
129 .param int pos
130 .param string message
abb2d744 » particle
2007-01-09 [pge]: p5regex compiler now throws exception upon parse error
131 $P0 = getattribute mob, '$.pos'
132 $P0 = pos
b3ef02fa » pmichaud
2007-06-28 [pge]:
133 $P0 = new 'Exception'
abb2d744 » particle
2007-01-09 [pge]: p5regex compiler now throws exception upon parse error
134 $S0 = 'p5regex parse error: '
135 $S0 .= message
136 $S0 .= ' at offset '
137 $S1 = pos
138 $S0 .= $S1
139 $S0 .= ", found '"
140 $P1 = getattribute mob, '$.target'
141 $S1 = $P1
142 $S1 = substr $S1, pos, 1
143 $S0 .= $S1
144 $S0 .= "'"
2255840f » allisonrandal
2008-08-02 [pdd17pmc] Merging the pdd25cx branch into trunk for r26555 to r29949.
145 $P0 = $S0
abb2d744 » particle
2007-01-09 [pge]: p5regex compiler now throws exception upon parse error
146 throw $P0
1af8ba31 » particle
2006-10-02 [PGE]: #40106: [PATCH] 15 more tests work for PGE::P5Regex
147 .return ()
148 .end
149
150
c346e6b6 » pmichaud
2005-11-17 * Added initial version of compreg "PGE::P5Regexp"
151 .sub "parse_lit"
152 .param pmc mob
153 .local string target
154 .local int pos, lastpos
155 .local int litstart, litlen
156 .local string initchar
281fd4b4 » pmichaud
2007-10-05 [pge]:
157 (mob, pos, target) = mob.'new'(mob, 'grammar'=>'PGE::Exp::Literal')
c346e6b6 » pmichaud
2005-11-17 * Added initial version of compreg "PGE::P5Regexp"
158 lastpos = length target
159 initchar = substr target, pos, 1
1af8ba31 » particle
2006-10-02 [PGE]: #40106: [PATCH] 15 more tests work for PGE::P5Regex
160 unless initchar == '*' goto initchar_ok
161 parse_error(mob, pos, "Quantifier follows nothing")
162
163 initchar_ok:
9cbdcbc2 » pmichaud
2006-04-27 Merge pge-pm branch with updated PGE into trunk.
164 if initchar == ')' goto end
c346e6b6 » pmichaud
2005-11-17 * Added initial version of compreg "PGE::P5Regexp"
165 inc pos
166 if initchar != "\\" goto term_literal
167 term_backslash:
168 initchar = substr target, pos, 1
169 inc pos
1af8ba31 » particle
2006-10-02 [PGE]: #40106: [PATCH] 15 more tests work for PGE::P5Regex
170 if pos <= lastpos goto term_backslash_ok
171 parse_error(mob, pos, "Search pattern not terminated")
172 term_backslash_ok:
c346e6b6 » pmichaud
2005-11-17 * Added initial version of compreg "PGE::P5Regexp"
173 $I0 = index "nrteab", initchar
174 if $I0 < 0 goto term_literal
175 initchar = substr "\n\r\t\e\a\b", $I0, 1
176 term_literal:
177 litstart = pos
178 litlen = 0
48890757 » pmichaud
2009-03-27 [pge]: Update P5Regex so that its parser recognizes specific stop tok…
179 .local string stop
180 .local int stoplen
181 $P0 = get_hll_global ['PGE';'P5Regex'], '@!stopstack'
182 stop = $P0[-1]
183 stoplen = length stop
c346e6b6 » pmichaud
2005-11-17 * Added initial version of compreg "PGE::P5Regexp"
184 term_literal_loop:
185 if pos >= lastpos goto term_literal_end
48890757 » pmichaud
2009-03-27 [pge]: Update P5Regex so that its parser recognizes specific stop tok…
186 if stoplen == 0 goto not_stop
187 $S0 = substr target, pos, stoplen
188 if $S0 == stop goto term_literal_end
189 not_stop:
c346e6b6 » pmichaud
2005-11-17 * Added initial version of compreg "PGE::P5Regexp"
190 $S0 = substr target, pos, 1
191 $I0 = index "[](){}*?+\\|^$.", $S0
1af8ba31 » particle
2006-10-02 [PGE]: #40106: [PATCH] 15 more tests work for PGE::P5Regex
192 # if not in circumfix:( ) throw error on end paren
c346e6b6 » pmichaud
2005-11-17 * Added initial version of compreg "PGE::P5Regexp"
193 if $I0 >= 0 goto term_literal_end
194 inc pos
195 inc litlen
196 goto term_literal_loop
197 term_literal_end:
198 if litlen < 1 goto term_literal_one
199 dec pos
200 term_literal_one:
201 $I0 = pos - litstart
202 $S0 = substr target, litstart, $I0
203 $S0 = concat initchar, $S0
aae0ee90 » pmichaud
2009-03-31 Merge pge1 branch back into trunk (partial resolution of TT #460).
204 mob.'!make'($S0)
c346e6b6 » pmichaud
2005-11-17 * Added initial version of compreg "PGE::P5Regexp"
205 goto end
206 end:
281fd4b4 » pmichaud
2007-10-05 [pge]:
207 mob.'to'(pos)
c346e6b6 » pmichaud
2005-11-17 * Added initial version of compreg "PGE::P5Regexp"
208 .return (mob)
209 .end
210
211 .sub "parse_quant"
212 .param pmc mob
213 .local string target
9cbdcbc2 » pmichaud
2006-04-27 Merge pge-pm branch with updated PGE into trunk.
214 .local int min, max, backtrack
c346e6b6 » pmichaud
2005-11-17 * Added initial version of compreg "PGE::P5Regexp"
215 .local int pos, lastpos
9cbdcbc2 » pmichaud
2006-04-27 Merge pge-pm branch with updated PGE into trunk.
216 .local string key
217 key = mob['KEY']
281fd4b4 » pmichaud
2007-10-05 [pge]:
218 (mob, pos, target) = mob.'new'(mob, 'grammar'=>'PGE::Exp::Quant')
c346e6b6 » pmichaud
2005-11-17 * Added initial version of compreg "PGE::P5Regexp"
219 lastpos = length target
220 min = 0
221 max = PGE_INF
9cbdcbc2 » pmichaud
2006-04-27 Merge pge-pm branch with updated PGE into trunk.
222 backtrack = 0
223 if key == '{' goto quant_range
224 if key != '+' goto quant_max
c346e6b6 » pmichaud
2005-11-17 * Added initial version of compreg "PGE::P5Regexp"
225 min = 1
226 quant_max:
9cbdcbc2 » pmichaud
2006-04-27 Merge pge-pm branch with updated PGE into trunk.
227 if key != "?" goto quant_lazy
c346e6b6 » pmichaud
2005-11-17 * Added initial version of compreg "PGE::P5Regexp"
228 max = 1
229 goto quant_lazy
230 quant_range:
231 $I1 = find_not_cclass .CCLASS_NUMERIC, target, pos, lastpos
232 if $I1 <= pos goto quant_range_max
233 $S0 = substr target, pos
234 min = $S0
235 max = $S0
236 pos = $I1
237 quant_range_max:
238 $S0 = substr target, pos, 1
239 if $S0 != "," goto quant_range_end
240 inc pos
241 max = PGE_INF
242 $I1 = find_not_cclass .CCLASS_NUMERIC, target, pos, lastpos
243 if $I1 <= pos goto quant_range_end
244 $S0 = substr target, pos
245 max = $S0
246 pos = $I1
247 quant_range_end:
248 $S0 = substr target, pos, 1
249 if $S0 != "}" goto err_range
250 inc pos
251 quant_lazy:
252 $S0 = substr target, pos, 1
253 if $S0 != "?" goto end
9cbdcbc2 » pmichaud
2006-04-27 Merge pge-pm branch with updated PGE into trunk.
254 backtrack = PGE_BACKTRACK_EAGER
c346e6b6 » pmichaud
2005-11-17 * Added initial version of compreg "PGE::P5Regexp"
255 inc pos
256 end:
257 mob["min"] = min
258 mob["max"] = max
9cbdcbc2 » pmichaud
2006-04-27 Merge pge-pm branch with updated PGE into trunk.
259 mob["backtrack"] = backtrack
281fd4b4 » pmichaud
2007-10-05 [pge]:
260 mob.'to'(pos)
c346e6b6 » pmichaud
2005-11-17 * Added initial version of compreg "PGE::P5Regexp"
261 .return (mob)
262 err_range:
263 parse_error(mob, pos, "Error in quantified range")
264 .end
265
266
267 .sub parse_group
268 .param pmc mob
269 .local string target
270 .local int pos, lastpos
281fd4b4 » pmichaud
2007-10-05 [pge]:
271 (mob, pos, target) = mob.'new'(mob, 'grammar'=>'PGE::Exp::CGroup')
c346e6b6 » pmichaud
2005-11-17 * Added initial version of compreg "PGE::P5Regexp"
272 inc pos
273 $S0 = substr target, pos, 2
274 if $S0 == "?:" goto nocapture
275 goto end
276 nocapture:
277 pos += 2
278 end:
281fd4b4 » pmichaud
2007-10-05 [pge]:
279 mob.'to'(pos)
c346e6b6 » pmichaud
2005-11-17 * Added initial version of compreg "PGE::P5Regexp"
280 .return (mob)
281 .end
282
283 .sub "parse_enumclass"
284 .param pmc mob
285 .local string target
286 .local int pos, lastpos
287 .local int isrange
288 .local string charlist
9cbdcbc2 » pmichaud
2006-04-27 Merge pge-pm branch with updated PGE into trunk.
289 .local string key
290 key = mob['KEY']
281fd4b4 » pmichaud
2007-10-05 [pge]:
291 (mob, pos, target) = mob.'new'(mob, 'grammar'=>'PGE::Exp::EnumCharList')
9cbdcbc2 » pmichaud
2006-04-27 Merge pge-pm branch with updated PGE into trunk.
292 if key == '.' goto dot
c346e6b6 » pmichaud
2005-11-17 * Added initial version of compreg "PGE::P5Regexp"
293 lastpos = length target
294 charlist = ""
295 mob["isnegated"] = 0
296 isrange = 0
297 $S0 = substr target, pos, 1
9cbdcbc2 » pmichaud
2006-04-27 Merge pge-pm branch with updated PGE into trunk.
298 if $S0 != "^" goto scan_first
c346e6b6 » pmichaud
2005-11-17 * Added initial version of compreg "PGE::P5Regexp"
299 mob["isnegated"] = 1
300 inc pos
9cbdcbc2 » pmichaud
2006-04-27 Merge pge-pm branch with updated PGE into trunk.
301 scan_first:
302 if pos >= lastpos goto err_close
303 $S0 = substr target, pos, 1
304 inc pos
305 if $S0 == "\\" goto backslash
306 goto addchar
c346e6b6 » pmichaud
2005-11-17 * Added initial version of compreg "PGE::P5Regexp"
307 scan:
308 if pos >= lastpos goto err_close
309 $S0 = substr target, pos, 1
310 inc pos
311 if $S0 == "]" goto endclass
312 if $S0 == "-" goto hyphenrange
313 if $S0 != "\\" goto addchar
314 backslash:
315 $S0 = substr target, pos, 1
316 inc pos
317 $I0 = index "nrtfae0b", $S0
318 if $I0 == -1 goto addchar
319 $S0 = substr "\n\r\t\f\a\e\0\b", $I0, 1
320 addchar:
321 if isrange goto addrange
322 charlist .= $S0
323 goto scan
324 addrange:
325 isrange = 0
326 $I2 = ord charlist, -1
327 $I0 = ord $S0
1af8ba31 » particle
2006-10-02 [PGE]: #40106: [PATCH] 15 more tests work for PGE::P5Regex
328 if $I0 < $I2 goto err_range
c346e6b6 » pmichaud
2005-11-17 * Added initial version of compreg "PGE::P5Regexp"
329 addrange_1:
330 inc $I2
331 if $I2 > $I0 goto scan
332 $S1 = chr $I2
333 charlist .= $S1
334 goto addrange_1
335 hyphenrange:
336 if isrange goto addrange
337 isrange = 1
338 goto scan
339 endclass:
340 if isrange == 0 goto end
341 charlist .= "-"
342 goto end
343 dot:
344 charlist = "\n"
345 mob["isnegated"] = 1
346 end:
281fd4b4 » pmichaud
2007-10-05 [pge]:
347 mob.'to'(pos)
aae0ee90 » pmichaud
2009-03-31 Merge pge1 branch back into trunk (partial resolution of TT #460).
348 mob.'!make'(charlist)
c346e6b6 » pmichaud
2005-11-17 * Added initial version of compreg "PGE::P5Regexp"
349 .return (mob)
1af8ba31 » particle
2006-10-02 [PGE]: #40106: [PATCH] 15 more tests work for PGE::P5Regex
350
c346e6b6 » pmichaud
2005-11-17 * Added initial version of compreg "PGE::P5Regexp"
351 err_close:
1af8ba31 » particle
2006-10-02 [PGE]: #40106: [PATCH] 15 more tests work for PGE::P5Regex
352 parse_error(mob, pos, "Unmatched [")
353 err_range:
354 $S0 = 'Invalid [] range "'
355 $S1 = chr $I2
356 $S0 .= $S1
357 $S0 .= '-'
358 $S1 = chr $I0
359 $S0 .= $S1
360 $S0 .= '"'
361 parse_error(mob, pos, $S0)
c346e6b6 » pmichaud
2005-11-17 * Added initial version of compreg "PGE::P5Regexp"
362 .end
1af8ba31 » particle
2006-10-02 [PGE]: #40106: [PATCH] 15 more tests work for PGE::P5Regex
363
c346e6b6 » pmichaud
2005-11-17 * Added initial version of compreg "PGE::P5Regexp"
364
1ebf2db7 » tene
2008-10-10 Merge hllmagic branch into trunk.
365 .namespace [ "PGE";"Exp" ]
c346e6b6 » pmichaud
2005-11-17 * Added initial version of compreg "PGE::P5Regexp"
366
367 .sub "p5analyze" :method
368 .param pmc pad
369 .local pmc exp
370 $I0 = 0
371 loop:
372 $I1 = defined self[$I0]
9cbdcbc2 » pmichaud
2006-04-27 Merge pge-pm branch with updated PGE into trunk.
373 if $I1 == 0 goto end
c346e6b6 » pmichaud
2005-11-17 * Added initial version of compreg "PGE::P5Regexp"
374 $P0 = self[$I0]
375 $P0 = $P0."p5analyze"(pad)
376 self[$I0] = $P0
377 inc $I0
378 goto loop
379 end:
380 .return (self)
381 .end
382
1ebf2db7 » tene
2008-10-10 Merge hllmagic branch into trunk.
383 .namespace [ "PGE";"Exp";"CGroup" ]
c346e6b6 » pmichaud
2005-11-17 * Added initial version of compreg "PGE::P5Regexp"
384
385 .sub "p5analyze" :method
386 .param pmc pad
387 .local pmc exp
388
389 self["iscapture"] = 0
390 if self != "(" goto end
391 self["iscapture"] = 1
392 self["isscope"] = 0
393 self["isarray"] = 0
394 $I0 = pad["subpats"]
395 self["cname"] = $I0
396 inc $I0
397 pad["subpats"] = $I0
398 end:
399 exp = self[0]
400 exp = exp."p5analyze"(pad)
401 self[0] = exp
402 .return (self)
403 .end
404
405
99869c47 » paultcochrane
2007-03-18 [pge] Added pir coda as per coding standards (part 5)
406
407 # Local Variables:
408 # mode: pir
409 # fill-column: 100
410 # End:
95eed077 » coke
2008-02-18 [codingstd]
411 # vim: expandtab shiftwidth=4 ft=pir:
Something went wrong with that request. Please try again.