Gromacs
5.1
|
Functions | |
bool | promptLine (File *infile, bool bInteractive, std::string *line) |
Reads a single selection line from stdin. More... | |
int | runParserLoop (yyscan_t scanner, _gmx_sel_yypstate *parserState, bool bInteractive) |
Helper function for tokenizing the input and pushing them to the parser. More... | |
void | printCurrentStatus (gmx_ana_selcollection_t *sc, gmx_ana_indexgrps_t *grps, size_t firstSelection, int maxCount, const std::string &context, bool bFirst) |
Print current status in response to empty line in interactive input. More... | |
void | printHelp (gmx_ana_selcollection_t *sc, const std::string &line) |
Prints selection help in interactive selection input. More... | |
SelectionList | runParser (yyscan_t scanner, bool bStdIn, int maxnr, const std::string &context) |
Helper function that runs the parser once the tokenizer has been initialized. More... | |
void | checkExternalGroups (const SelectionTreeElementPointer &root, int natoms, ExceptionInitializer *errors) |
Checks that index groups have valid atom indices. More... | |
void gmx::anonymous_namespace{selectioncollection.cpp}::checkExternalGroups | ( | const SelectionTreeElementPointer & | root, |
int | natoms, | ||
ExceptionInitializer * | errors | ||
) |
Checks that index groups have valid atom indices.
[in] | root | Root of selection tree to process. |
[in] | natoms | Maximum number of atoms that the selections are set to evaluate. |
errors | Object for reporting any error messages. |
std::bad_alloc | if out of memory. |
Recursively checks the selection tree for index groups. Each found group is checked that it only contains atom indices that match the topology/maximum number of atoms set for the selection collection. Any issues are reported to errors
.
void gmx::anonymous_namespace{selectioncollection.cpp}::printCurrentStatus | ( | gmx_ana_selcollection_t * | sc, |
gmx_ana_indexgrps_t * | grps, | ||
size_t | firstSelection, | ||
int | maxCount, | ||
const std::string & | context, | ||
bool | bFirst | ||
) |
Print current status in response to empty line in interactive input.
[in] | sc | Selection collection data structure. |
[in] | grps | Available index groups. |
[in] | firstSelection | Index of first selection from this interactive session. |
[in] | maxCount | Maximum number of selections. |
[in] | context | Context to print for what the selections are for. |
[in] | bFirst | Whether this is the header that is printed before any user input. |
Prints the available index groups and currently provided selections.
void gmx::anonymous_namespace{selectioncollection.cpp}::printHelp | ( | gmx_ana_selcollection_t * | sc, |
const std::string & | line | ||
) |
Prints selection help in interactive selection input.
[in] | sc | Selection collection data structure. |
[in] | line | Line of user input requesting help (starting with help ). |
Initializes the selection help if not yet initialized, and finds the help topic based on words on the input line.
bool gmx::anonymous_namespace{selectioncollection.cpp}::promptLine | ( | File * | infile, |
bool | bInteractive, | ||
std::string * | line | ||
) |
Reads a single selection line from stdin.
[in] | infile | File to read from (typically File::standardInput()). |
[in] | bInteractive | Whether to print interactive prompts. |
[out] | line | The read line in stored here. |
Handles line continuation, reading also the continuing line(s) in one call.
SelectionList gmx::anonymous_namespace{selectioncollection.cpp}::runParser | ( | yyscan_t | scanner, |
bool | bStdIn, | ||
int | maxnr, | ||
const std::string & | context | ||
) |
Helper function that runs the parser once the tokenizer has been initialized.
[in,out] | scanner | Scanner data structure. |
[in] | bStdIn | Whether to use a line-based reading algorithm designed for interactive input. |
[in] | maxnr | Maximum number of selections to parse (if -1, parse as many as provided by the user). |
[in] | context | Context to print for what the selections are for. |
std::bad_alloc | if out of memory. |
InvalidInputError | if there is a parsing error. |
Used internally to implement parseFromStdin(), parseFromFile() and parseFromString().
int gmx::anonymous_namespace{selectioncollection.cpp}::runParserLoop | ( | yyscan_t | scanner, |
_gmx_sel_yypstate * | parserState, | ||
bool | bInteractive | ||
) |
Helper function for tokenizing the input and pushing them to the parser.
scanner | Tokenizer data structure. | |
parserState | Parser data structure. | |
[in] | bInteractive | Whether to operate in interactive mode. |
Repeatedly reads tokens using scanner
and pushes them to the parser with parserState
until there is no more input, or until enough input is given (only in interactive mode).