Track locations for selection parsing products
authorTeemu Murtola <teemu.murtola@gmail.com>
Wed, 5 Nov 2014 19:32:46 +0000 (21:32 +0200)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Tue, 9 Dec 2014 17:43:45 +0000 (18:43 +0100)
commit701533da2cacd01d8e4d0ffd399996c6e2d6a992
treee6d32d6e488cbe599cd851a107fdc71f09dd51dc
parenta40f02f5c8b014b8746ffb7f33643bb39e6d8ce0
Track locations for selection parsing products

SelectionTreeElement and all intermediate structures used for selection
method parameter parsing now track the location in the input string.
By itself, this change does nothing, but it enables the subsequent
change that switches to exceptions to use this information for much
better context information in the error messages.

The location is kept as a SelectionLocation instead of as a string to
avoid spending a lot of memory for these strings with complex
selections: in general, each node in the tree contains the concatenation
of the strings from its child nodes, and there can be quite a few nodes
at the top that all contain have the full selection as their location.

Related to #655.

Change-Id: I7b1a317e043c6ff791b25f5fa357d8166c577fae
src/gromacs/selection/compiler.cpp
src/gromacs/selection/params.cpp
src/gromacs/selection/parser.cpp
src/gromacs/selection/parser.y
src/gromacs/selection/parsetree.cpp
src/gromacs/selection/parsetree.h
src/gromacs/selection/scanner.h
src/gromacs/selection/scanner_internal.cpp
src/gromacs/selection/selelem.cpp
src/gromacs/selection/selelem.h
src/gromacs/selection/sm_keywords.cpp