{
gmx::MessageStringCollector *errors = _gmx_sel_lexer_error_reporter(scanner);
// FIXME: Use an arbitrary length buffer.
- char buf[1024];
+ char buf[1024];
va_list ap;
va_start(ap, fmt);
vsprintf(buf, fmt, ap);
}
bool
-_gmx_selparser_handle_exception(yyscan_t scanner, const std::exception &/*ex*/)
+_gmx_selparser_handle_exception(yyscan_t scanner, const std::exception & /*ex*/)
{
_gmx_sel_lexer_set_exception(scanner, boost::current_exception());
return false;
*/
SelectionParserParameter::SelectionParserParameter(
- const char *name,
+ const char *name,
SelectionParserValueListPointer values)
: name_(name != NULL ? name : ""),
values_(values ? move(values)
- : SelectionParserValueListPointer(new SelectionParserValueList))
+ : SelectionParserValueListPointer(new SelectionParserValueList))
{
}
*/
void
_gmx_selelem_update_flags(const SelectionTreeElementPointer &sel,
- yyscan_t scanner)
+ yyscan_t scanner)
{
- bool bUseChildType=false;
+ bool bUseChildType = false;
bool bOnlySingleChildren;
/* Return if the flags have already been set */
{
case SEL_CONST:
case SEL_GROUPREF:
- sel->flags |= SEL_SINGLEVAL;
+ sel->flags |= SEL_SINGLEVAL;
bUseChildType = false;
break;
break;
case SEL_ARITHMETIC:
- sel->flags |= SEL_ATOMVAL;
+ sel->flags |= SEL_ATOMVAL;
bUseChildType = false;
break;
*/
void
_gmx_selelem_init_method_params(const SelectionTreeElementPointer &sel,
- yyscan_t scanner)
+ yyscan_t scanner)
{
int nparams;
gmx_ana_selparam_t *orgparam;
*/
void
_gmx_selelem_set_method(const SelectionTreeElementPointer &sel,
- gmx_ana_selmethod_t *method,
- yyscan_t scanner)
+ gmx_ana_selmethod_t *method,
+ yyscan_t scanner)
{
_gmx_selelem_set_vtype(sel, method->type);
sel->setName(method->name);
{
SelectionTreeElementPointer sel(new SelectionTreeElement(SEL_ARITHMETIC));
sel->v.type = REAL_VALUE;
- switch(op)
+ switch (op)
{
case '+': sel->u.arith.type = ARITH_PLUS; break;
case '-': sel->u.arith.type = (right ? ARITH_MINUS : ARITH_NEG); break;
const char *cmpop, yyscan_t scanner)
{
gmx::MessageStringCollector *errors = _gmx_sel_lexer_error_reporter(scanner);
- gmx::MessageStringContext context(errors, "In comparison initialization");
+ gmx::MessageStringContext context(errors, "In comparison initialization");
- SelectionTreeElementPointer sel(new SelectionTreeElement(SEL_EXPRESSION));
+ SelectionTreeElementPointer sel(new SelectionTreeElement(SEL_EXPRESSION));
_gmx_selelem_set_method(sel, &sm_compare, scanner);
SelectionParserParameterList params;
- const char *name;
+ const char *name;
// Create the parameter for the left expression.
name = left->v.type == INT_VALUE ? "int1" : "real1";
params.push_back(SelectionParserParameter::createFromExpression(name, left));
// Create the parameter for the operator.
params.push_back(
SelectionParserParameter::create(
- "op", SelectionParserValue::createString(cmpop)));
+ "op", SelectionParserValue::createString(cmpop)));
if (!_gmx_sel_parse_params(params, sel->u.expr.method->nparams,
sel->u.expr.method->param, sel, scanner))
{
SelectionParserValueListPointer args,
const char *rpost, yyscan_t scanner)
{
- gmx_ana_selcollection_t *sc = _gmx_sel_lexer_selcollection(scanner);
+ gmx_ana_selcollection_t *sc = _gmx_sel_lexer_selcollection(scanner);
gmx::MessageStringCollector *errors = _gmx_sel_lexer_error_reporter(scanner);
char buf[128];
{
// TODO: Would assert be better?
GMX_THROW(gmx::InternalError(
- "Keyword initialization called with non-keyword method"));
+ "Keyword initialization called with non-keyword method"));
}
SelectionTreeElementPointer root(new SelectionTreeElement(SEL_EXPRESSION));
case STR_VALUE: kwmethod = &sm_keyword_str; break;
default:
GMX_THROW(gmx::InternalError(
- "Unknown type for keyword selection"));
+ "Unknown type for keyword selection"));
}
/* Initialize the selection element */
root.reset(new SelectionTreeElement(SEL_EXPRESSION));
const char *rpost, yyscan_t scanner)
{
GMX_RELEASE_ASSERT(method->type == STR_VALUE,
- "String keyword method called for a non-string-valued method");
+ "String keyword method called for a non-string-valued method");
GMX_RELEASE_ASSERT(args && !args->empty(),
- "String keyword matching method called without any values");
+ "String keyword matching method called without any values");
return init_keyword_internal(method, matchType, move(args), rpost, scanner);
}
SelectionParserParameterListPointer params,
const char *rpost, yyscan_t scanner)
{
- gmx_ana_selcollection_t *sc = _gmx_sel_lexer_selcollection(scanner);
- int rc;
+ gmx_ana_selcollection_t *sc = _gmx_sel_lexer_selcollection(scanner);
+ int rc;
gmx::MessageStringCollector *errors = _gmx_sel_lexer_error_reporter(scanner);
char buf[128];
gmx::MessageStringCollector *errors = _gmx_sel_lexer_error_reporter(scanner);
char buf[128];
sprintf(buf, "In position evaluation");
- gmx::MessageStringContext context(errors, buf);
+ gmx::MessageStringContext context(errors, buf);
SelectionTreeElementPointer root(new SelectionTreeElement(SEL_EXPRESSION));
_gmx_selelem_set_method(root, &sm_keyword_pos, scanner);
SelectionTreeElementPointer
_gmx_sel_init_const_position(real x, real y, real z)
{
- rvec pos;
+ rvec pos;
SelectionTreeElementPointer sel(new SelectionTreeElement(SEL_CONST));
_gmx_selelem_set_vtype(sel, POS_VALUE);
_gmx_selelem_set_vtype(sel, GROUP_VALUE);
sel->setName(name);
sel->u.gref.name = strdup(name);
- sel->u.gref.id = -1;
+ sel->u.gref.id = -1;
return sel;
}
if (!grps)
SelectionTreeElementPointer sel(new SelectionTreeElement(SEL_GROUPREF));
_gmx_selelem_set_vtype(sel, GROUP_VALUE);
sel->u.gref.name = NULL;
- sel->u.gref.id = id;
+ sel->u.gref.id = id;
return sel;
}
if (!grps)
* gmx::SelectionTreeElement objects for selections.
*/
SelectionTreeElementPointer
-_gmx_sel_init_selection(const char *name,
+_gmx_sel_init_selection(const char *name,
const SelectionTreeElementPointer &sel,
- yyscan_t scanner)
+ yyscan_t scanner)
{
gmx::MessageStringCollector *errors = _gmx_sel_lexer_error_reporter(scanner);
char buf[1024];
{
/* FIXME: Better handling of this error */
GMX_THROW(gmx::InternalError(
- "Each selection must evaluate to a position"));
+ "Each selection must evaluate to a position"));
}
SelectionTreeElementPointer root(new SelectionTreeElement(SEL_ROOT));
* element are both created.
*/
SelectionTreeElementPointer
-_gmx_sel_assign_variable(const char *name,
+_gmx_sel_assign_variable(const char *name,
const SelectionTreeElementPointer &expr,
- yyscan_t scanner)
+ yyscan_t scanner)
{
- gmx_ana_selcollection_t *sc = _gmx_sel_lexer_selcollection(scanner);
- const char *pselstr = _gmx_sel_lexer_pselstr(scanner);
- SelectionTreeElementPointer root;
+ gmx_ana_selcollection_t *sc = _gmx_sel_lexer_selcollection(scanner);
+ const char *pselstr = _gmx_sel_lexer_pselstr(scanner);
+ SelectionTreeElementPointer root;
gmx::MessageStringCollector *errors = _gmx_sel_lexer_error_reporter(scanner);
char buf[1024];
*/
SelectionTreeElementPointer
_gmx_sel_append_selection(const SelectionTreeElementPointer &sel,
- SelectionTreeElementPointer last,
- yyscan_t scanner)
+ SelectionTreeElementPointer last,
+ yyscan_t scanner)
{
gmx_ana_selcollection_t *sc = _gmx_sel_lexer_selcollection(scanner);
{
gmx::SelectionDataPointer selPtr(
new gmx::internal::SelectionData(
- sel.get(), _gmx_sel_lexer_pselstr(scanner)));
+ sel.get(), _gmx_sel_lexer_pselstr(scanner)));
sc->sel.push_back(gmx::move(selPtr));
}
}
void
_gmx_sel_handle_empty_cmd(yyscan_t scanner)
{
- gmx_ana_selcollection_t *sc = _gmx_sel_lexer_selcollection(scanner);
+ gmx_ana_selcollection_t *sc = _gmx_sel_lexer_selcollection(scanner);
gmx_ana_indexgrps_t *grps = _gmx_sel_lexer_indexgrps(scanner);
int i;
if (!_gmx_sel_is_lexer_interactive(scanner))
+ {
return;
+ }
if (grps)
{
*/
void
_gmx_sel_handle_help_cmd(const SelectionParserValueListPointer &topic,
- yyscan_t scanner)
+ yyscan_t scanner)
{
gmx_ana_selcollection_t *sc = _gmx_sel_lexer_selcollection(scanner);
}
gmx::HelpWriterContext context(&gmx::File::standardError(),
gmx::eHelpOutputFormat_Console);
- gmx::HelpManager manager(*sc->rootHelp, context);
+ gmx::HelpManager manager(*sc->rootHelp, context);
try
{
SelectionParserValueList::const_iterator value;