Boost logo

Boost Users :

Subject: [Boost-users] [xpressive] questions about semantic actions
From: Nathan Ridge (zeratul976_at_[hidden])
Date: 2012-08-05 02:57:40


Hello,

I am trying to use semantic actions in Boost.Xpressive, and I have a
couple of questions:

1. When a semantic action is attached to a subexpression of a regex, what
   is the meaning of _, s1, s2 etc. in the semantic action? For example,
   suppose you have the following regex:
      ((s1 = xpr1)[action]) >> (s2 = xpr2)
   Inside 'action':
     - is it valid to use '_'?
        - if so does it refer to just the portion matched by xpr1?
     - is it valid to use 's1'?
     - is it valid to use 's2'?

2. Is there a way to access the regex_id of the regex to which a semantic
   action belongs from the semantic action? More generally, can a semantic
   action be written as a custom function object that takes as argument
   some sort of environment (perhaps a match_results<>)?

Thanks,
Nate
                                               


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