Main Page | Modules | Namespace List | Class Hierarchy | Class List | Namespace Members | Class Members

SmartsParser Class Reference
[Matching of submolecular structures]

SMARTS Parser. More...

#include <smartsParser.h>

List of all members.

Accessors

SPAtomcreateAtom (const String &symbol, bool in_bracket=false)
 creates a new atom of symbol
void setRoot (SPNode *root)
 sets the root SPNode of the tree
SPNodegetRoot () const
 returns the root SPNode of the tree
void dumpTree ()
 dumps the tree to cerr
void clear ()
 clear the tree
void addRingConnection (SPNode *spnode, Size index)
 adds a ring connection, SPNode with an index used in the SMARTS pattern
std::map< Size, std::vector<
SPNode * > > 
getRingConnections () const
 returns the ring connections sorted by index from SMARTS pattern
void setSSSR (const std::vector< std::vector< Atom * > > &sssr)
 sets the SSSR
void setNeedsSSSR (bool needs_sssr)
 sets the sssr needed flag
bool getNeedsSSSR () const
 returns true if the SMARTS pattern contains ring related parts
void setRecursive (bool recursive)
 sets the recursive flag
bool isRecursive () const
 returns true if the tree represents a recursive SMARTS pattern
void setComponentGrouping (bool component_grouping)
 sets the component level flag
bool hasComponentGrouping () const
 returns true if the component level grouping was enabled
const std::set< SPNode * > & getNodes () const
 returns the eodes stored in the tree
const std::set< SPEdge * > & getEdges () const
 returns the edges stored in the tree
void addEdge (SPEdge *edge)
 adds an edge to the tree
void addNode (SPNode *node)
 adds a node to the tree
bool hasRecursiveEdge (SPEdge *edge) const
 returns true if the tree has the given recursive edge
void addRecursiveEdge (SPEdge *edge)
 adds a recursive edge to the tree
void setNextComponentNumberToSubTree (SPNode *spnode)
 gets the next component no and assigns it to the subtree
State state
 static member for the parser itself

Public Types

enum  ZEIsomerType { ANY_ZE = 1, NONE, Z, E }
enum  ChiralClass {
  CHIRAL_CLASS_UNSPECIFIED = 1, NONCHIRAL, NONCHIRAL_OR_UNSPECIFIED, CW_DEFAULT,
  CW_DEFAULT_OR_UNSPECIFIED, CCW_DEFAULT, CCW_DEFAULT_OR_UNSPECIFIED, CW_TH,
  CW_TH_OR_UNSPECIFIED, CCW_TH, CCW_TH_OR_UNSPECIFIED, CW_AL,
  CW_AL_OR_UNSPECIFIED, CCW_AL, CCW_AL_OR_UNSPECIFIED, CW_SP,
  CW_SP_OR_UNSPECIFIED, CCW_SP, CCW_SP_OR_UNSPECIFIED, CW_TB,
  CW_TB_OR_UNSPECIFIED, CCW_TB, CCW_TB_OR_UNSPECIFIED, CW_OH,
  CW_OH_OR_UNSPECIFIED, CCW_OH, CCW_OH_OR_UNSPECIFIED
}
 chiral class definitions CW = clock wise, CCW = counter clock wise
enum  LogicalOperator { AND, OR, AND_LOW, NOOP }
 The logical operator supported by SMARTS-pattern
'&' -> and
',' -> or
';' -> low precedence and
. More...

Public Member Functions

Constructors and Destructors
 SmartsParser ()
 Default constructor.
 SmartsParser (const SmartsParser &parser)
 Copy constructor.
virtual ~SmartsParser ()
 Destructor.
Parsing
void parse (const String &s) throw (Exception::ParseError)
 Parse a SMARTS string.

Protected Member Functions

void dumpTreeRecursive_ (SPNode *node, Size depth)
 dump method for the tree
void dumpTreeRecursive_ (SPEdge *edge, Size depth)
 dump method for the tree

Protected Attributes

bool needs_SSSR_
 sssr needed flag
bool recursive_
 recursive flag
bool component_grouping_
 component level grouping flag
std::map< Size, std::vector<
SPNode * > > 
ring_connections_
 the ring connection sorted by index of the SMARTS pattern
std::set< SPEdge * > edges_
 the edges
std::set< SPNode * > nodes_
 the nodes
std::set< SPEdge * > rec_edges_
 the recursive edges
SPNoderoot_
 the root node of the tree
int component_no_
 the actual component number

Static Protected Attributes

vector< std::set< const Atom * > > * sssr_
 the sssr
SmartsParsercurrent_parser_
 current instance


Detailed Description

SMARTS Parser.

This class implements the parser for SMARTS patterns. The SMARTS string is converted into a tree, which is used for matching it to molecules. The tree has also some additional features, i.e. additional edges which allows also for graph features (kind of cyclic structure).


Member Enumeration Documentation

enum SmartsParser::LogicalOperator
 

The logical operator supported by SMARTS-pattern
'&' -> and
',' -> or
';' -> low precedence and
.

NOOP is just provided for convenience.


Member Function Documentation

void SmartsParser::parse const String s  )  throw (Exception::ParseError)
 

Parse a SMARTS string.