Pteros  2.0
Molecular modeling library for human beings!
pteros::Selection_parser Class Reference

Selection parser class. More...

#include <selection_parser.h>

Public Member Functions

 Selection_parser (std::vector< int > *subset=nullptr)
virtual ~Selection_parser ()
void create_ast (std::string &sel_str)
 Generates AST from selection string.
void apply (System *system, std::size_t fr, std::vector< int > &result)
 Apply ast to the system. More...

Public Attributes

bool has_coord
 True if there are coordinate keywords in selection. More...

Detailed Description

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.

Member Function Documentation

void Selection_parser::apply ( System system,
std::size_t  fr,
std::vector< int > &  result 

Apply ast to the system.

Fills the vector passed from enclosing System with selection indexes.

Member Data Documentation

bool pteros::Selection_parser::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()

The documentation for this class was generated from the following files: