As far as I understand, you would want something that parses any of the following:
"aa" "bb" "cc" "dd"
The simplest way would be something like:
($a asParser , $a asParser) / ($b asParser , $b asParser) ...
The problem is that this will result in many objects and redundant checks.
I think I would implement it as a specialization of PPPredicateSequenceParser in which you store the first element, and add the extra condition that any of the following elements must be the same.
Cheers, Doru
On 3 Feb 2011, at 14:23, sback wrote:
$a asParser min: n
is fine for one character, but what if I want to specify that I want any character, or digit, repeated at least n times?
I could do:
($a asParser min: n) / ($b asParser min: n) / ...
but that would be a bit ugly :)
Thanks
View this message in context: http://moose-dev.97923.n3.nabble.com/PetitParser-same-character-multiple-tim... Sent from the moose-dev mailing list archive at Nabble.com. _______________________________________________ Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- www.tudorgirba.com
"Presenting is storytelling."