search for: nongreedy

Displaying 4 results from an estimated 4 matches for "nongreedy".

2009 Jun 11
1
[LLVMdev] PEG parsers? (was Re: Regular Expressions)
...the runtime libraries. Does the prospect of a PEG based syntax interest the team for the TableGen? They are wonderfully simple to maintain since they don't allow ambiguity of any type. Their downfall is that since they use a greedy algorithm they sometimes degrade performance to O(n) where a nongreedy algorithm would result in O(1). Since the YARDparser is template-based, it should be possible to slip a stringmap into the keyword lookup to bring the performance back up to a more resonable specification. Let me know what you think. --Sam Crow ----- Original Message ---- > From: Chris Lat...
2009 Jun 11
0
[LLVMdev] Regular Expressions
On Jun 9, 2009, at 12:39 PM, David Greene wrote: > On Tuesday 09 June 2009 14:34, Dan Gohman wrote: >> Can you describe what problem you're trying to solve here? Does it >> really need Regular Expressions? > > Yes. I want TableGen to be able to infer lots of stuff > programmatically. > This helps tremendously when specifying things like, oh, AVX. :) I
2009 Jun 09
3
[LLVMdev] Regular Expressions
On Tuesday 09 June 2009 14:34, Dan Gohman wrote: > Can you describe what problem you're trying to solve here? Does it > really need Regular Expressions? Yes. I want TableGen to be able to infer lots of stuff programmatically. This helps tremendously when specifying things like, oh, AVX. :) We could invent our own pattern matching syntax, but why?
2007 Oct 21
0
Taking a stab at a pure Ruby Dir.glob
...# Convert all remaining literal ''?'' to a ''.'' (any single char). pattern.sub!(/^\?/, ''^.'') pattern.tr!(''?'', ''.'') # Convert all ''*'' to ''.*?'' to get the (nongreedy) intended result. pattern.gsub!("*", ".*?") # Convert {x, y} to (x|y) pattern.gsub!(/\{(.*?)\}/, ''(\1)'') pattern.gsub!(/\,\s*/, ''|'') # Convert {x, y} to (x|y) pattern.gsub!(/\{(.*?)\}/, ''(\1...