Re: boost::regex: regex meta data or AST for regex?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: boost::regex: regex meta data or AST for regex?

Boost - Users mailing list
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 mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users