Re: [v3] Tiny project, state of v3 etc

Michael Powell <[email protected]> Sat, 29 Jun 2024 13:45:58 -0400
Newsgroups gmane.comp.parsers.spirit.general
Message-ID <CAM=aUXpYWYTeOjC7qwUTAcejEhry+GSqoUphw6hh-A0ZYDo1EQ@mail.gmail.com>
--===============4686696308501895393==
Content-Type: multipart/alternative; boundary="000000000000664968061c0af054"

--000000000000664968061c0af054
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Fri, Jun 28, 2024 at 8:09=E2=80=AFPM Michael Powell <[email protected]=
om>
wrote:

>
>
> On Fri, Jun 28, 2024 at 7:18=E2=80=AFPM Seth via Spirit-general <
> [email protected]> wrote:
>
>> On Fri, Jun 28, 2024, at 5:56 PM, Michael Powell wrote:
>>
>> Hello,
>>
>> [...] negative versions should also be supported: "1.2", ".2", "1.", "1"=
.
>>
>> This is very key, although C++ float is probably my only choice there, I
>> do not know. Precision is an absolute must, floating point precision iss=
ues
>> cannot be tolerated.
>>
>>
> Huh, nice, very interesting. The key is
> the boost::multiprecision::cpp_dec_float_50 coordinate value, I suppose.
> Everything else being punctuation, arrangement, etc.
>
> How about for semantic actions? Are they still supported? For instance,
> when I encounter a production, attribute, synthesis, I'd like to raise th=
at
> as a signal, for instance, that a listener subscribing to the parser may
> subscribe and follow, respond, otherwise populate the DSL.
>

Need a bit of guidance where SA are concerned. If I have a rule that wants
to synthesize an enumerated value, let's say, and the RHS was an
alternatives of chars (below), how do I do that, what goes in the SA, and
where?

https://www.boost.org/doc/libs/1_85_0/libs/spirit/doc/x3/html/spirit_x3/qui=
ck_reference/semantic_actions.html

I'm not sure this is very instructive:

Has the form: p[f]
where f is a function with the signatures: void f(Context&);

Not least of all being, I'm not sure I see a way to synthesize the desired
value (or type) that I want, other side of Context.

Another case might be from that decimal float value, and or axis enum,
std:tuple<axis_type, float> or float, depending on the Coordinate rule, to
coordinate instance.

Another thing I might like to do is trigger a signal from said SA, if that
is possible to do, which I am assuming it is. That for abstractions like a
listener component can then respond with appropriate user space call backs,
possibly involving context, probably also the synthesized attribute, and so
on. The precise shape and arguments of said callbacks, tentative until I
get my arms around the X3 SA mechanism.

For instance, with a minor adjustment, allowing for 3+, in our input and
> not flat rejecting for 4+. Listeners may respond with an index sensitive
> treatment, for example.
>
> auto coord_ =3D num_;
> auto loc_ =3D coord_+;
>
> Or in the case of an axis coordinate rule, pseudo code something like thi=
s:
>
> auto axis_ =3D char_('x') | char_('y') | char_('z');
> auto axis_coord_ =3D axis_ >> '=3D' << num_
> auto axis_loc_ =3D axis_coord_+;
>
> Listeners in the case of an axis approach can receive any number of axis
> based coordinate assignments. The last of which wins, defaults (to the
> listener) always being zed.
>
> Along these lines.
>
> The key to which raising signals at each of the rule productions, if
> possible.
>
> The decimal being "very key" are no issue at all. Here's demo using
>> decimal floats and all the input formats you specified and then some:
>> https://coliru.stacked-crooked.com/a/8aef2c571995464b
>>
>
>
>> #include <boost/fusion/adapted/std_tuple.hpp>
>> #include <boost/multiprecision/cpp_dec_float.hpp>
>> #include <boost/spirit/home/x3.hpp>
>> #include <fmt/ostream.h>
>> #include <fmt/ranges.h>
>> #include <fmt/std.h>
>>
>> using Num   =3D boost::multiprecision::cpp_dec_float_50;
>> using Coord =3D std::tuple<Num, Num, Num>;
>> template <> struct fmt::formatter<Num> : ostream_formatter {};
>>
>> int main() {
>>     namespace x3 =3D boost::spirit::x3;
>>     auto num_    =3D x3::real_parser<Num>{};
>>     auto coord_  =3D num_ >> num_ >> num_;
>>     auto file_   =3D x3::skip(x3::blank)[coord_ % x3::eol];
>>
>>     for (std::string_view input : {
>>              R"(1.1 2.2 3.3
>>                 .1 .2 .3
>>                 1. 2. 3.
>>                 1 2 3)",
>>              R"(-1.1 -2.2 -3.3
>>                 -.1 -.2 -.3
>>                 -1. -2. -3.
>>                 -1 -2 -3)",
>>              R"(1.1e1 2.2e2 3.3e3
>>                 .1e1 .2e2 .3e3
>>                 1.e1 2.e2 3.e3
>>                 1e1 2e2 3e3)",
>>              R"(1.1e-1 2.2e-2 3.3e-3
>>                 .1e-1 .2e-2 .3e-3
>>                 1.e-1 2.e-2 3.e-3
>>                 1e-1 2e-2 3e-3)",
>>              R"(inf -inf nan)",
>>          }) {
>>
>>         std::vector<Coord> coords;
>>         if (parse(begin(input), end(input), file_, coords))
>>             fmt::print("Parsed:\n - {}\n", fmt::join(coords, "\n - "));
>>         else
>>             fmt::print("Failed to parse\n");
>>     }
>> }
>>
>> This prints (live on coliru as well):
>>
>> Parsed:
>>
>>  - (1.1, 2.2, 3.3)
>>
>>  - (0.1, 0.2, 0.3)
>>
>>  - (1, 2, 3)
>>
>>  - (1, 2, 3)
>>
>> Parsed:
>>
>>  - (-1.1, -2.2, -3.3)
>>
>>  - (-0.1, -0.2, -0.3)
>>
>>  - (-1, -2, -3)
>>
>>  - (-1, -2, -3)
>>
>> Parsed:
>>
>>  - (11, 220, 3300)
>>
>>  - (1, 20, 300)
>>
>>  - (10, 200, 3000)
>>
>>  - (10, 200, 3000)
>>
>> Parsed:
>>
>>  - (0.11, 0.022, 0.0033)
>>
>>  - (0.01, 0.002, 0.0003)
>>
>>  - (0.1, 0.02, 0.003)
>>
>>  - (0.1, 0.02, 0.003)
>>
>> Parsed:
>>
>>  - (inf, -inf, nan)
>>
>>
>> In summary, might Spirit, either v2 or v3, possibly work there? I do not
>> expect the rules, synthesis, etc, to be that complex. It will be trickie=
r,
>> perhaps, to message a listener from the parser, but not insurmountable, =
I
>> think.
>>
>> Thoughts?
>>
>> Note that X3 is not yet interface stable, so you might want to prefer Qi=
:
>> https://coliru.stacked-crooked.com/a/1bdbbc130ffba345
>>
>> Please don't use SWIG unless you are wrapping an API for use in other
>> languages like Python or Matlab.
>>
>> Regards, Seth
>>
>> _______________________________________________
>> Spirit-general mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/spirit-general
>>
>

--000000000000664968061c0af054
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Fri, Jun 28, 2024 at 8:09=E2=80=AF=
PM Michael Powell &lt;<a href=3D"mailto:[email protected]">mwpowelllde@=
gmail.com</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=
=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding=
-left:1ex"><div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gm=
ail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Fri, Jun 28, 2024 at 7:=
18=E2=80=AFPM Seth via Spirit-general &lt;<a href=3D"mailto:spirit-general@=
lists.sourceforge.net" target=3D"_blank">[email protected]=
et</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margi=
n:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex=
"><div><u></u><div><div>On Fri, Jun 28, 2024, at 5:56 PM, Michael Powell wr=
ote:<br></div><blockquote type=3D"cite" id=3D"m_-6671402103049721678m_-8326=
008973601726009qt"><div dir=3D"ltr"><div>Hello,<br></div><div><br></div><di=
v>[...] negative versions should also be supported: &quot;1.2&quot;, &quot;=
.2&quot;, &quot;1.&quot;, &quot;1&quot;.<br></div><div><br></div><div>This =
is very key, although C++ float is probably my only choice there, I do not =
know. Precision is an absolute must,=C2=A0floating point precision issues c=
annot be tolerated.</div></div></blockquote></div></div></blockquote><div>=
=C2=A0</div><div>Huh, nice, very interesting. The key is the=C2=A0boost::mu=
ltiprecision::cpp_dec_float_50 coordinate value, I suppose. Everything else=
 being punctuation, arrangement, etc.</div><div><br></div><div>How about fo=
r semantic actions? Are they still supported? For instance, when I encounte=
r a production, attribute, synthesis, I&#39;d like to raise that as a signa=
l, for instance, that a listener subscribing to the parser may subscribe an=
d follow, respond, otherwise populate the DSL.</div></div></div></blockquot=
e><div><br></div><div>Need a bit of guidance where SA are concerned. If I h=
ave a rule that wants to synthesize an enumerated value, let&#39;s say, and=
 the RHS was an alternatives of chars (below), how do I do that, what goes =
in the SA, and where?</div><div><br></div><div><a href=3D"https://www.boost=
.org/doc/libs/1_85_0/libs/spirit/doc/x3/html/spirit_x3/quick_reference/sema=
ntic_actions.html">https://www.boost.org/doc/libs/1_85_0/libs/spirit/doc/x3=
/html/spirit_x3/quick_reference/semantic_actions.html</a><br></div><div><br=
></div><div>I&#39;m not sure this is very instructive:</div><div><br></div>=
<div>Has the form:=C2=A0p[f]</div><div>where f is a function with the signa=
tures:=C2=A0void f(Context&amp;);<br></div><div><br></div><div>Not least of=
 all being, I&#39;m not sure I see a way to synthesize the desired value (o=
r type) that I want, other side of Context.</div><div><br></div><div>Anothe=
r case might be from that decimal float value, and or axis enum, std:tuple&=
lt;axis_type, float&gt; or float, depending on the Coordinate rule, to coor=
dinate instance.</div><div><br></div><div>Another thing I might like to do =
is trigger a signal from said SA, if that is possible to do, which I am ass=
uming it is. That for abstractions like a listener component can then respo=
nd with appropriate user space call backs, possibly involving context, prob=
ably also the synthesized attribute, and so on. The precise shape and argum=
ents of said callbacks, tentative until=C2=A0I get my arms around the X3 SA=
 mechanism.</div><div><br></div><blockquote class=3D"gmail_quote" style=3D"=
margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-lef=
t:1ex"><div dir=3D"ltr"><div class=3D"gmail_quote"><div>For instance, with =
a minor adjustment, allowing for 3+, in our input and not flat rejecting fo=
r 4+. Listeners may respond with an index sensitive treatment, for example.=
<br></div><div><br></div><div>auto coord_ =3D num_;</div><div>auto loc_ =3D=
 coord_+;</div><div><br></div><div>Or in the case of an axis coordinate rul=
e, pseudo code something like this:</div><div><br></div><div>auto axis_ =3D=
 char_(&#39;x&#39;) | char_(&#39;y&#39;) | char_(&#39;z&#39;);</div><div>au=
to axis_coord_ =3D axis_ &gt;&gt; &#39;=3D&#39; &lt;&lt; num_</div><div>aut=
o axis_loc_ =3D axis_coord_+;</div><div><br></div><div>Listeners in the cas=
e of an axis approach can receive any number of axis based coordinate assig=
nments. The last of which wins, defaults (to the listener) always being zed=
.</div><div><br></div><div>Along these lines.</div><div><br></div><div>The =
key to which raising signals at each of the rule=C2=A0productions, if possi=
ble.</div><div><br></div><blockquote class=3D"gmail_quote" style=3D"margin:=
0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">=
<div><div><div><div></div><div>The decimal being &quot;very key&quot; are n=
o issue at all. Here&#39;s demo using decimal floats and all the input form=
ats you specified and then some: <a href=3D"https://coliru.stacked-crooked.=
com/a/8aef2c571995464b" target=3D"_blank">https://coliru.stacked-crooked.co=
m/a/8aef2c571995464b</a></div></div></div></div></blockquote><div>=C2=A0</d=
iv><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;bord=
er-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div><div><div><s=
pan style=3D"font-size:0.889em;font-family:menlo,consolas,monospace,sans-se=
rif">#include &lt;boost/fusion/adapted/std_</span><span style=3D"font-size:=
0.889em;font-family:menlo,consolas,monospace,sans-serif">tuple.hpp&gt;</spa=
n><br></div><div><span style=3D"font-family:menlo,consolas,monospace,sans-s=
erif"><span style=3D"font-size:0.889em">#include &lt;boost/multiprecision/c=
pp_dec_float.hpp&gt;</span></span><br></div><div><span style=3D"font-family=
:menlo,consolas,monospace,sans-serif"><span style=3D"font-size:0.889em">#in=
clude &lt;boost/spirit/home/x3.hpp&gt;</span></span><br></div><div><span st=
yle=3D"font-family:menlo,consolas,monospace,sans-serif"><span style=3D"font=
-size:0.889em">#include &lt;fmt/ostream.h&gt;</span></span><br></div><div><=
span style=3D"font-family:menlo,consolas,monospace,sans-serif"><span style=
=3D"font-size:0.889em">#include &lt;fmt/ranges.h&gt;</span></span><br></div=
><div><span style=3D"font-family:menlo,consolas,monospace,sans-serif"><span=
 style=3D"font-size:0.889em">#include &lt;fmt/std.h&gt;</span></span><br></=
div><div><br></div><div><span style=3D"font-family:menlo,consolas,monospace=
,sans-serif"><span style=3D"font-size:0.889em">using Num=C2=A0=C2=A0 =3D bo=
ost::multiprecision::cpp_dec_float_50;</span></span><br></div><div><span st=
yle=3D"font-family:menlo,consolas,monospace,sans-serif"><span style=3D"font=
-size:0.889em">using Coord =3D std::tuple&lt;Num, Num, Num&gt;;</span></spa=
n><br></div><div><span style=3D"font-family:menlo,consolas,monospace,sans-s=
erif"><span style=3D"font-size:0.889em">template &lt;&gt; struct fmt::forma=
tter&lt;Num&gt; : ostream_formatter {};</span></span><br></div><div><br></d=
iv><div><span style=3D"font-family:menlo,consolas,monospace,sans-serif"><sp=
an style=3D"font-size:0.889em">int main() {</span></span><br></div><div><sp=
an style=3D"font-family:menlo,consolas,monospace,sans-serif"><span style=3D=
"font-size:0.889em">=C2=A0=C2=A0=C2=A0 namespace x3 =3D boost::spirit::x3;<=
/span></span><br></div><div><span style=3D"font-family:menlo,consolas,monos=
pace,sans-serif"><span style=3D"font-size:0.889em">=C2=A0=C2=A0=C2=A0 auto =
num_=C2=A0=C2=A0=C2=A0 =3D x3::real_parser&lt;Num&gt;{};</span></span><br><=
/div><div><span style=3D"font-family:menlo,consolas,monospace,sans-serif"><=
span style=3D"font-size:0.889em">=C2=A0=C2=A0=C2=A0 auto coord_=C2=A0 =3D n=
um_ &gt;&gt; num_ &gt;&gt; num_;</span></span><br></div><div><span style=3D=
"font-family:menlo,consolas,monospace,sans-serif"><span style=3D"font-size:=
0.889em">=C2=A0=C2=A0=C2=A0 auto file_=C2=A0=C2=A0 =3D x3::skip(x3::blank)[=
coord_ % x3::eol];</span></span><br></div><div><br></div><div><span style=
=3D"font-family:menlo,consolas,monospace,sans-serif"><span style=3D"font-si=
ze:0.889em">=C2=A0=C2=A0=C2=A0 for (std::string_view input : {</span></span=
><br></div><div><span style=3D"font-family:menlo,consolas,monospace,sans-se=
rif"><span style=3D"font-size:0.889em">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 R&quot;(1.1 2.2 3.3</span></span><br><=
/div><div><span style=3D"font-family:menlo,consolas,monospace,sans-serif"><=
span style=3D"font-size:0.889em">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 .1 .2 .3</span></span><br>=
</div><div><span style=3D"font-family:menlo,consolas,monospace,sans-serif">=
<span style=3D"font-size:0.889em">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 1. 2. 3.</span></span><=
br></div><div><span style=3D"font-family:menlo,consolas,monospace,sans-seri=
f"><span style=3D"font-size:0.889em">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 1 2 3)&quot;,</span>=
</span><br></div><div><span style=3D"font-family:menlo,consolas,monospace,s=
ans-serif"><span style=3D"font-size:0.889em">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 R&quot;(-1.1 -2.2 -3.3</span></s=
pan><br></div><div><span style=3D"font-family:menlo,consolas,monospace,sans=
-serif"><span style=3D"font-size:0.889em">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 -.1 -.2 -.3</span=
></span><br></div><div><span style=3D"font-family:menlo,consolas,monospace,=
sans-serif"><span style=3D"font-size:0.889em">=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 -1. -2. -3.=
</span></span><br></div><div><span style=3D"font-family:menlo,consolas,mono=
space,sans-serif"><span style=3D"font-size:0.889em">=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 -1 -2=
 -3)&quot;,</span></span><br></div><div><span style=3D"font-family:menlo,co=
nsolas,monospace,sans-serif"><span style=3D"font-size:0.889em">=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 R&quot;(1.1e1 =
2.2e2 3.3e3</span></span><br></div><div><span style=3D"font-family:menlo,co=
nsolas,monospace,sans-serif"><span style=3D"font-size:0.889em">=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0 .1e1 .2e2 .3e3</span></span><br></div><div><span style=3D"font-family:m=
enlo,consolas,monospace,sans-serif"><span style=3D"font-size:0.889em">=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0 1.e1 2.e2 3.e3</span></span><br></div><div><span style=3D"font=
-family:menlo,consolas,monospace,sans-serif"><span style=3D"font-size:0.889=
em">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0 1e1 2e2 3e3)&quot;,</span></span><br></div><div><span=
 style=3D"font-family:menlo,consolas,monospace,sans-serif"><span style=3D"f=
ont-size:0.889em">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 R&quot;(1.1e-1 2.2e-2 3.3e-3</span></span><br></div><div><s=
pan style=3D"font-family:menlo,consolas,monospace,sans-serif"><span style=
=3D"font-size:0.889em">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 .1e-1 .2e-2 .3e-3</span></span><br>=
</div><div><span style=3D"font-family:menlo,consolas,monospace,sans-serif">=
<span style=3D"font-size:0.889em">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 1.e-1 2.e-2 3.e-3</span=
></span><br></div><div><span style=3D"font-family:menlo,consolas,monospace,=
sans-serif"><span style=3D"font-size:0.889em">=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 1e-1 2e-2 3=
e-3)&quot;,</span></span><br></div><div><span style=3D"font-family:menlo,co=
nsolas,monospace,sans-serif"><span style=3D"font-size:0.889em">=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 R&quot;(inf -i=
nf nan)&quot;,</span></span><br></div><div><span style=3D"font-family:menlo=
,consolas,monospace,sans-serif"><span style=3D"font-size:0.889em">=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }) {</span></span><br></div><div><b=
r></div><div><span style=3D"font-family:menlo,consolas,monospace,sans-serif=
"><span style=3D"font-size:0.889em">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0 std::vector&lt;Coord&gt; coords;</span></span><br></div><div><span styl=
e=3D"font-family:menlo,consolas,monospace,sans-serif"><span style=3D"font-s=
ize:0.889em">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (parse(begin(inp=
ut), end(input), file_, coords))</span></span><br></div><div><span style=3D=
"font-family:menlo,consolas,monospace,sans-serif"><span style=3D"font-size:=
0.889em">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
 fmt::print(&quot;Parsed:\n - {}\n&quot;, fmt::join(coords, &quot;\n - &quo=
t;));</span></span><br></div><div><span style=3D"font-family:menlo,consolas=
,monospace,sans-serif"><span style=3D"font-size:0.889em">=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0 else</span></span><br></div><div><span style=3D"fo=
nt-family:menlo,consolas,monospace,sans-serif"><span style=3D"font-size:0.8=
89em">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 fm=
t::print(&quot;Failed to parse\n&quot;);</span></span><br></div><div><span =
style=3D"font-family:menlo,consolas,monospace,sans-serif"><span style=3D"fo=
nt-size:0.889em">=C2=A0=C2=A0=C2=A0 }</span></span><br></div><div><span sty=
le=3D"font-family:menlo,consolas,monospace,sans-serif"><span style=3D"font-=
size:0.889em">}</span></span><br></div><div><br></div><div>This prints (liv=
e on coliru as well):<br></div><div><br></div><div><pre style=3D"display:in=
line-block;margin:0px;padding:0px">Parsed:<br></pre></div><div><pre style=
=3D"display:inline-block;margin:0px;padding:0px"> - (1.1, 2.2, 3.3)<br></pr=
e></div><div><pre style=3D"display:inline-block;margin:0px;padding:0px"> - =
(0.1, 0.2, 0.3)<br></pre></div><div><pre style=3D"display:inline-block;marg=
in:0px;padding:0px"> - (1, 2, 3)<br></pre></div><div><pre style=3D"display:=
inline-block;margin:0px;padding:0px"> - (1, 2, 3)<br></pre></div><div><pre =
style=3D"display:inline-block;margin:0px;padding:0px">Parsed:<br></pre></di=
v><div><pre style=3D"display:inline-block;margin:0px;padding:0px"> - (-1.1,=
 -2.2, -3.3)<br></pre></div><div><pre style=3D"display:inline-block;margin:=
0px;padding:0px"> - (-0.1, -0.2, -0.3)<br></pre></div><div><pre style=3D"di=
splay:inline-block;margin:0px;padding:0px"> - (-1, -2, -3)<br></pre></div><=
div><pre style=3D"display:inline-block;margin:0px;padding:0px"> - (-1, -2, =
-3)<br></pre></div><div><pre style=3D"display:inline-block;margin:0px;paddi=
ng:0px">Parsed:<br></pre></div><div><pre style=3D"display:inline-block;marg=
in:0px;padding:0px"> - (11, 220, 3300)<br></pre></div><div><pre style=3D"di=
splay:inline-block;margin:0px;padding:0px"> - (1, 20, 300)<br></pre></div><=
div><pre style=3D"display:inline-block;margin:0px;padding:0px"> - (10, 200,=
 3000)<br></pre></div><div><pre style=3D"display:inline-block;margin:0px;pa=
dding:0px"> - (10, 200, 3000)<br></pre></div><div><pre style=3D"display:inl=
ine-block;margin:0px;padding:0px">Parsed:<br></pre></div><div><pre style=3D=
"display:inline-block;margin:0px;padding:0px"> - (0.11, 0.022, 0.0033)<br><=
/pre></div><div><pre style=3D"display:inline-block;margin:0px;padding:0px">=
 - (0.01, 0.002, 0.0003)<br></pre></div><div><pre style=3D"display:inline-b=
lock;margin:0px;padding:0px"> - (0.1, 0.02, 0.003)<br></pre></div><div><pre=
 style=3D"display:inline-block;margin:0px;padding:0px"> - (0.1, 0.02, 0.003=
)<br></pre></div><div><pre style=3D"display:inline-block;margin:0px;padding=
:0px">Parsed:<br></pre></div><div><pre style=3D"display:inline-block;margin=
:0px;padding:0px"> - (inf, -inf, nan)<br></pre></div><div><br></div></div><=
blockquote type=3D"cite" id=3D"m_-6671402103049721678m_-8326008973601726009=
qt"><div dir=3D"ltr"><div>In summary, might Spirit, either v2 or v3, possib=
ly work there? I do not expect the rules, synthesis, etc, to be that comple=
x. It will be trickier, perhaps, to message a listener from the parser, but=
 not insurmountable, I think.<br></div><div><br></div><div>Thoughts?<br></d=
iv></div></blockquote><div><div><div><div><span style=3D"font-family:menlo,=
consolas,monospace,sans-serif"><span style=3D"font-size:0.889em">Note that =
X3 is not yet interface stable, so you might want to prefer Qi: </span></sp=
an><a href=3D"https://coliru.stacked-crooked.com/a/1bdbbc130ffba345" target=
=3D"_blank">https://coliru.stacked-crooked.com/a/1bdbbc130ffba345</a><br></=
div><div><br></div><div><div>Please don&#39;t use SWIG unless you are wrapp=
ing an API for use in other languages like Python or Matlab.<br></div><div>=
<br></div></div></div>Regards, Seth<br></div></div><div><br></div></div>___=
____________________________________________<br>
Spirit-general mailing list<br>
<a href=3D"mailto:[email protected]" target=3D"_blank">S=
[email protected]</a><br>
<a href=3D"https://lists.sourceforge.net/lists/listinfo/spirit-general" rel=
=3D"noreferrer" target=3D"_blank">https://lists.sourceforge.net/lists/listi=
nfo/spirit-general</a><br>
</div></blockquote></div></div>
</blockquote></div></div>

--000000000000664968061c0af054--


--===============4686696308501895393==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============4686696308501895393==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Spirit-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/spirit-general

--===============4686696308501895393==--