A tuple is, at the least, an alternating integer-dot sequence with at minimum two repetitions of the integer-dot sequence. E.g: 2343.23423. is the minimum that a tuple may be.
I don't know REBOL, although I've looked at it a couple times.
But I do know a bit of Parse::RecDescent. Try this:
tuple: (numberdot){2..} number(?)
{ [@{$item[1]}, @{$item[2]}] }
numberdot: number dot { $item[1] }
number: /(\d+)/
dot: /\./
All the shenanigans are necessary because you want to peer down into the
arrayrefs returned from both $item[1] and $item[2].
Untested, but I think it's pretty close. I might be off an indirection or two. {grin}
-- Randal L. Schwartz, Perl hacker
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|