Boost logo

Boost Users :

Subject: Re: [Boost-users] [Spirit] Parser omits certain characters
From: ruediger (r.berlich_at_[hidden])
Date: 2013-11-04 20:41:31


Am 05.11.13 02:27, schrieb TONGARI J:
> 2013/11/5 beet <r.berlich_at_gemfony.eu <mailto:r.berlich_at_gemfony.eu>>
[...]
> Try this:
> http://www.boost.org/doc/libs/1_54_0/libs/spirit/doc/html/spirit/qi/reference/directive/hold.html
>
>
> This is a bit mysterious to me and I would appreciate your help.

Thanks a lot! Just for the reference of other readers: The following
rule seems to work:

varReference =
(
  hold[attr(0) >> attr("empty") >> uint_]
  | hold[attr(1) >> identifier >> '[' >> uint_ >> ']']
  | hold[attr(2) >> identifier >> attr(0)]
);

where the attribute of varReference is a
boost::tuple<std::size_t, std::string, std::size_t> and identifier
refers to a string consistng of alphanumeric characters and '_' .

Best Regards,
Beet


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net