Boost logo

Boost Users :

From: Frank Bergemann (frank67x_at_[hidden])
Date: 2021-01-16 15:50:42


On 16.12.20 18:05, Frank Bergemann via Boost-users wrote:
> in concrete:
> Is it possible to not only get the #no of groups (sub-expressions) via
> basic_regex::mark_count(), but also their position (begin() / end()
> iterators) in the given regex string (c'tor argument)?
>
> more general:
> Can an AST be created for a the given regex string (c'tor argument)?
> E.g with boost::spirit?
I am busy with #2 parsers:

1) RegexParser: Intended to be a full regular expression parser
https://github.com/F-Bergemann/RegexParser

2) RegexSplitter: to just break up regular expression into substrings
for top level regex-group & non-regex-group substrings:
https://github.com/F-Bergemann/RegexSplitter

It's just a start and so much wrong within, i know.
But i have one concrete question for the RegexSplitter:

How can i avoid in RegexSplitter.cpp to use

#157 ( tok_element >> *tok_element ) [ qi::_val = phx::new_<ASTNode>
(qi::_1, qi::_2, ASTNode::COLLECTION_c) ];

I want to pass a SINGLE std::vector<ATSNode *> only to the receiving

#51 // COLLECTION_c
#52 ASTNode::ASTNode(
#53 ASTNode const * first,
#54 std::vector<ASTNode *> & others,
#55 Type const type)

without the SEPARATE parameter 'first'.
I.e. i need to "merge" qi::_1 and qi::_2.


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