Pteros
2.0
Molecular modeling library for human beings!
|
Selection parser class. More...
#include <selection_parser.h>
Public Member Functions | |
SelectionParser (std::vector< int > *subset=nullptr) | |
Constructor. | |
virtual | ~SelectionParser () |
Destructor. | |
void | create_ast (std::string &sel_str, System *system) |
Generates AST from selection string. | |
void | apply_ast (std::size_t fr, std::vector< int > &result) |
Apply ast to the given frame. More... | |
Public Attributes | |
bool | has_coord |
True if there are coordinate keywords in selection. More... | |
Selection parser class.
It parses selection text by means of custom recursive-descendent parser The result of parsing in the abstract syntax tree (AST) stored internally in the parser class. The tree is evaluated against the system, which holds the parser. This class should never be used directly.
void SelectionParser::apply_ast | ( | std::size_t | fr, |
std::vector< int > & | result | ||
) |
Apply ast to the given frame.
Fills the vector passed from enclosing System with selection indexes.
bool pteros::SelectionParser::has_coord |
True if there are coordinate keywords in selection.
If true, the parser will persist (not deleted after parsing). As a result the AST is instantly available. If coordinates change the AST may be evaluated against the changed coordinates by means of System.update()