Ejemplo n.º 1
0
/*!
 * \param[in,out] sc    Selection collection to use for output.
 * \param[in]     str   String to parse selections from.
 * \param[in]     grps  External index groups (can be NULL).
 * \returns       0 on success, -1 on error.
 *
 * The number of selections parsed can be accessed with
 * gmx_ana_selcollection_get_count() (note that if you call the parser
 * multiple times, this function returns the total count).
 */
int
gmx_ana_selcollection_parse_str(gmx_ana_selcollection_t *sc, char *str,
                                gmx_ana_indexgrps_t *grps)
{
    gmx_sel_lexer_t *scanner;

    _gmx_sel_init_lexer(&scanner, sc, FALSE);
    _gmx_sel_set_lex_input_str(scanner, str);
    return _gmx_sel_run_parser(scanner, sc, grps, -1);
}
Ejemplo n.º 2
0
SelectionList
SelectionCollection::parseFromString(const std::string &str)
{
    yyscan_t scanner;

    _gmx_sel_init_lexer(&scanner, &impl_->sc_, false, -1,
                        impl_->bExternalGroupsSet_,
                        impl_->grps_);
    _gmx_sel_set_lex_input_str(scanner, str.c_str());
    return runParser(scanner, false, -1, std::string());
}
Ejemplo n.º 3
0
void
SelectionCollection::parseFromString(const std::string &str,
                                     std::vector<Selection *> *output)
{
    yyscan_t scanner;

    _gmx_sel_init_lexer(&scanner, &_impl->_sc, false, -1,
                        _impl->hasFlag(Impl::efExternalGroupsSet),
                        _impl->_grps);
    _gmx_sel_set_lex_input_str(scanner, str.c_str());
    _impl->runParser(scanner, -1, output);
}