/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2009,2010,2011,2012,2014, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2014,2015, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/exceptions.h"
#include "gromacs/utility/gmxassert.h"
-#include "gromacs/utility/messagestringcollector.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/utility/stringutil.h"
/* Check if the identifier matches with a symbol */
const gmx::SelectionParserSymbol *symbol
- = state->sc->symtab->findSymbol(std::string(yytext, yyleng), false);
+ = state->sc->symtab->findSymbol(std::string(yytext, yyleng));
/* If there is no match, return the token as a string */
if (!symbol)
{
void
_gmx_sel_init_lexer(yyscan_t *scannerp, struct gmx_ana_selcollection_t *sc,
- bool bInteractive, int maxnr, bool bGroups,
- struct gmx_ana_indexgrps_t *grps)
+ gmx::TextWriter *statusWriter, int maxnr,
+ bool bGroups, struct gmx_ana_indexgrps_t *grps)
{
int rc = _gmx_sel_yylex_init(scannerp);
if (rc != 0)
gmx_sel_lexer_t *state = new gmx_sel_lexer_t;
state->sc = sc;
- state->errors = NULL;
state->bGroups = bGroups;
state->grps = grps;
state->nexpsel = (maxnr > 0 ? static_cast<int>(sc->sel.size()) + maxnr : -1);
- state->bInteractive = bInteractive;
+ state->statusWriter = statusWriter;
snew(state->pselstr, STRSTORE_ALLOCSTEP);
state->pselstr[0] = 0;
_gmx_sel_yylex_destroy(scanner);
}
-void
-_gmx_sel_set_lexer_error_reporter(yyscan_t scanner,
- gmx::MessageStringCollector *errors)
-{
- gmx_sel_lexer_t *state = _gmx_sel_yyget_extra(scanner);
- state->errors = errors;
-}
-
void
_gmx_sel_lexer_set_exception(yyscan_t scanner,
const boost::exception_ptr &ex)
}
}
-bool
-_gmx_sel_is_lexer_interactive(yyscan_t scanner)
+gmx::TextWriter *
+_gmx_sel_lexer_get_status_writer(yyscan_t scanner)
{
gmx_sel_lexer_t *state = _gmx_sel_yyget_extra(scanner);
- return state->bInteractive;
+ return state->statusWriter;
}
struct gmx_ana_selcollection_t *
return state->sc;
}
-gmx::MessageStringCollector *
-_gmx_sel_lexer_error_reporter(yyscan_t scanner)
-{
- gmx_sel_lexer_t *state = _gmx_sel_yyget_extra(scanner);
- GMX_RELEASE_ASSERT(state->errors != NULL, "Error reporter not set");
- return state->errors;
-}
-
bool
_gmx_sel_lexer_has_groups_set(yyscan_t scanner)
{
state->currentLocation = location;
}
+const gmx::SelectionLocation &
+_gmx_sel_lexer_get_current_location(yyscan_t scanner)
+{
+ gmx_sel_lexer_t *state = _gmx_sel_yyget_extra(scanner);
+ return state->currentLocation;
+}
+
std::string
_gmx_sel_lexer_get_current_text(yyscan_t scanner)
{