parsmart.cpp File Reference

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Examples

- File List
- File Members

Namespaces | Defines | Functions | Variables
parsmart.cpp File Reference
`#include <openbabel/babelconfig.h>`
`#include <ctype.h>`
`#include <iomanip>`
`#include <openbabel/mol.h>`
`#include <openbabel/parsmart.h>`
`#include <openbabel/stereo/stereo.h>`
`#include <openbabel/stereo/tetrahedral.h>`

## Namespaces
namespace | OpenBabel
## Defines
#define | ELEMMAX 104
#define | ATOMEXPRPOOL 1
#define | BONDEXPRPOOL 1
#define | ATOMPOOL 1
#define | BONDPOOL 1
#define | BF_NONRINGUNSPEC 0x0001
#define | BF_NONRINGDOWN 0x0002
#define | BF_NONRINGUP 0x0004
#define | BF_NONRINGDOUBLE 0x0008
#define | BF_NONRINGTRIPLE 0x0010
#define | BF_RINGUNSPEC 0x0020
#define | BF_RINGDOWN 0x0040
#define | BF_RINGUP 0x0080
#define | BF_RINGAROM 0x0100
#define | BF_RINGDOUBLE 0x0200
#define | BF_RINGTRIPLE 0x0400
#define | BS_ALL 0x07FF
#define | BS_SINGLE 0x00E7
#define | BS_DOUBLE 0x0208
#define | BS_TRIPLE 0x0410
#define | BS_AROM 0x0100
#define | BS_UP 0x0084
#define | BS_DOWN 0x0042
#define | BS_UPUNSPEC 0x00A5
#define | BS_DOWNUNSPEC 0x0063
#define | BS_RING 0x07E0
#define | BS_DEFAULT 0x01E7
#define | AE_LEAF 0x01
#define | AE_RECUR 0x02
#define | AE_NOT 0x03
#define | AE_ANDHI 0x04
#define | AE_OR 0x05
#define | AE_ANDLO 0x06
#define | AL_CONST 0x01
#define | AL_MASS 0x02
#define | AL_AROM 0x03
#define | AL_ELEM 0x04
#define | AL_HCOUNT 0x05
#define | AL_NEGATIVE 0x06
#define | AL_POSITIVE 0x07
#define | AL_CONNECT 0x08
#define | AL_DEGREE 0x09
#define | AL_IMPLICIT 0x0a
#define | AL_RINGS 0x0b
#define | AL_SIZE 0x0c
#define | AL_VALENCE 0x0d
#define | AL_CHIRAL 0x0e
#define | AL_HYB 0x0f
#define | AL_RINGCONNECT 0x10
#define | AL_CLOCKWISE 1
#define | AL_ANTICLOCKWISE 2
#define | AL_UNSPECIFIED 0
## Functions
static int | GetVectorBinding ()
static int | CreateAtom (Pattern *, AtomExpr *, int, int vb=0)
static void | FatalAllocationError (const char *ptr)
static void | FreePattern (Pattern *)
static Pattern * | CopyPattern (Pattern *)
static AtomExpr * | AllocAtomExpr (void)
static AtomExpr * | CopyAtomExpr (AtomExpr *expr)
static void | FreeAtomExpr (AtomExpr *expr)
static AtomExpr * | BuildAtomLeaf (int prop, int val)
static AtomExpr * | BuildAtomNot (AtomExpr *expr)
static AtomExpr * | BuildAtomBin (int op, AtomExpr *lft, AtomExpr *rgt)
static AtomExpr * | BuildAtomRecurs (Pattern *pat)
static AtomExpr * | GenerateElement (int elem)
static AtomExpr * | GenerateAromElem (int elem, int flag)
static int | IsInvalidAtom (AtomExpr *expr)
static BondExpr * | AllocBondExpr (void)
static BondExpr * | CopyBondExpr (BondExpr *expr)
static bool | EquivalentBondExpr (BondExpr *expr1, BondExpr *expr2)
static void | FreeBondExpr (BondExpr *expr)
static BondExpr * | BuildBondLeaf (int prop, int val)
static BondExpr * | BuildBondNot (BondExpr *expr)
static BondExpr * | BuildBondBin (int op, BondExpr *lft, BondExpr *rgt)
static BondExpr * | GenerateDefaultBond (void)
static Pattern * | AllocPattern (void)
static int | CreateBond (Pattern *pat, BondExpr *expr, int src, int dst)
static void | MarkGrowBonds (Pattern *pat)
static int | GetChiralFlag (AtomExpr *expr)
static AtomExpr * | NotAtomExpr (AtomExpr *)
static AtomExpr * | AndAtomExpr (AtomExpr *, AtomExpr *)
static AtomExpr * | OrAtomExpr (AtomExpr *, AtomExpr *)
static int | IsBooleanAtomLeaf (AtomExpr *expr)
static int | IsNegatingAtomLeaf (AtomExpr *expr)
static int | EqualAtomExpr (AtomExpr *lft, AtomExpr *rgt)
static int | OrderAtomExpr (AtomExpr *lft, AtomExpr *rgt)
static int | AtomLeafConflict (AtomExpr *lft, AtomExpr *rgt)
static int | AtomExprConflict (AtomExpr *lft, AtomExpr *rgt)
static int | AtomLeafImplies (AtomExpr *lft, AtomExpr *rgt)
static int | AtomExprImplied (AtomExpr *lft, AtomExpr *rgt)
static AtomExpr * | AtomExprImplies (AtomExpr *lft, AtomExpr *rgt)
static AtomExpr * | AndAtomExprLeaf (AtomExpr *lft, AtomExpr *rgt)
static AtomExpr * | ConstrainRecursion (AtomExpr *recur, AtomExpr *expr)
static AtomExpr * | OrAtomExprLeaf (AtomExpr *lft, AtomExpr *rgt)
static int | GetExprOrder (BondExpr *expr)
void | SmartsLexReplace (std::string &s, std::vector< std::pair< std::string, std::string > > &vlex)
## Variables
static int | N_parsed_bonds

## Detailed Description

Implementation of Daylight SMARTS parser.

## Define Documentation

#define ELEMMAX 104

Referenced by OBSmartsPattern::ParseComplexAtomPrimitive().

#define ATOMEXPRPOOL 1

#define BONDEXPRPOOL 1

#define ATOMPOOL 1

Referenced by OpenBabel::CreateAtom().

#define BONDPOOL 1

Referenced by OpenBabel::CreateBond().

#define BF_NONRINGUNSPEC 0x0001

#define BF_NONRINGDOWN 0x0002

#define BF_NONRINGUP 0x0004

#define BF_NONRINGDOUBLE 0x0008

#define BF_NONRINGTRIPLE 0x0010

#define BF_RINGUNSPEC 0x0020

#define BF_RINGDOWN 0x0040

#define BF_RINGUP 0x0080

#define BF_RINGAROM 0x0100

#define BF_RINGDOUBLE 0x0200

#define BF_RINGTRIPLE 0x0400

#define BS_ALL 0x07FF

#define BS_SINGLE 0x00E7

#define BS_DOUBLE 0x0208

#define BS_TRIPLE 0x0410

#define BS_AROM 0x0100

#define BS_UP 0x0084

#define BS_DOWN 0x0042

#define BS_UPUNSPEC 0x00A5

#define BS_DOWNUNSPEC 0x0063

#define BS_RING 0x07E0

#define BS_DEFAULT 0x01E7

#define AE_LEAF 0x01

Referenced by OpenBabel::AndAtomExpr(), OpenBabel::AtomLeafConflict(), OpenBabel::AtomLeafImplies(), OpenBabel::BuildAtomLeaf(), OpenBabel::CopyAtomExpr(), OpenBabel::CopyBondExpr(), OpenBabel::EqualAtomExpr(), OpenBabel::EquivalentBondExpr(), OBSmartsMatcher::EvalAtomExpr(), OBSmartsPattern::GetAtomicNum(), OBSmartsPattern::GetCharge(), OpenBabel::GetChiralFlag(), OpenBabel::IsInvalidAtom(), OpenBabel::NotAtomExpr(), OpenBabel::OrAtomExpr(), and OpenBabel::OrderAtomExpr().

#define AE_RECUR 0x02

Referenced by OpenBabel::AndAtomExpr(), OpenBabel::BuildAtomRecurs(), OpenBabel::CopyAtomExpr(), OpenBabel::EqualAtomExpr(), OBSmartsMatcher::EvalAtomExpr(), OpenBabel::FreeAtomExpr(), OBSmartsPattern::GetAtomicNum(), and OBSmartsPattern::GetCharge().

#define AE_NOT 0x03

Referenced by OpenBabel::AtomLeafConflict(), OpenBabel::AtomLeafImplies(), OpenBabel::BuildAtomNot(), OpenBabel::CopyAtomExpr(), OpenBabel::CopyBondExpr(), OpenBabel::EqualAtomExpr(), OpenBabel::EquivalentBondExpr(), OBSmartsMatcher::EvalAtomExpr(), OpenBabel::FreeAtomExpr(), OBSmartsPattern::GetAtomicNum(), OBSmartsPattern::GetCharge(), OpenBabel::GetChiralFlag(), OpenBabel::NotAtomExpr(), and OpenBabel::OrderAtomExpr().

#define AE_ANDHI 0x04

Referenced by OpenBabel::AndAtomExpr(), OpenBabel::AndAtomExprLeaf(), OpenBabel::AtomExprConflict(), OpenBabel::AtomExprImplied(), OpenBabel::AtomExprImplies(), OpenBabel::CopyAtomExpr(), OpenBabel::CopyBondExpr(), OpenBabel::EquivalentBondExpr(), OBSmartsMatcher::EvalAtomExpr(), OpenBabel::FreeAtomExpr(), OpenBabel::GenerateAromElem(), OBSmartsPattern::GetAtomicNum(), OBSmartsPattern::GetCharge(), OpenBabel::GetChiralFlag(), OpenBabel::NotAtomExpr(), and OBSmartsPattern::ParseAtomExpr().

#define AE_OR 0x05

Referenced by OpenBabel::AndAtomExpr(), OpenBabel::CopyAtomExpr(), OpenBabel::CopyBondExpr(), OpenBabel::EquivalentBondExpr(), OBSmartsMatcher::EvalAtomExpr(), OpenBabel::FreeAtomExpr(), OBSmartsPattern::GetAtomicNum(), OBSmartsPattern::GetCharge(), OpenBabel::GetChiralFlag(), OpenBabel::NotAtomExpr(), OpenBabel::OrAtomExpr(), OpenBabel::OrAtomExprLeaf(), and OBSmartsPattern::ParseAtomExpr().

#define AE_ANDLO 0x06

Referenced by OpenBabel::CopyAtomExpr(), OpenBabel::CopyBondExpr(), OpenBabel::EquivalentBondExpr(), OBSmartsMatcher::EvalAtomExpr(), OpenBabel::FreeAtomExpr(), OBSmartsPattern::GetAtomicNum(), OBSmartsPattern::GetCharge(), OpenBabel::GetChiralFlag(), OpenBabel::NotAtomExpr(), and OBSmartsPattern::ParseAtomExpr().

#define AL_CONST 0x01

Referenced by OpenBabel::AndAtomExpr(), OpenBabel::AndAtomExprLeaf(), OpenBabel::ConstrainRecursion(), OBSmartsMatcher::EvalAtomExpr(), OpenBabel::IsBooleanAtomLeaf(), OpenBabel::IsInvalidAtom(), OpenBabel::OrAtomExpr(), OBSmartsPattern::ParseComplexAtomPrimitive(), and OBSmartsPattern::ParseSimpleAtomPrimitive().

#define AL_MASS 0x02

Referenced by OBSmartsMatcher::EvalAtomExpr(), and OBSmartsPattern::ParseComplexAtomPrimitive().

#define AL_AROM 0x03

Referenced by OpenBabel::AtomLeafConflict(), OpenBabel::AtomLeafImplies(), OBSmartsMatcher::EvalAtomExpr(), OpenBabel::GenerateAromElem(), OpenBabel::IsBooleanAtomLeaf(), OBSmartsPattern::ParseComplexAtomPrimitive(), and OBSmartsPattern::ParseSimpleAtomPrimitive().

#define AL_ELEM 0x04

Referenced by OBSmartsMatcher::EvalAtomExpr(), OpenBabel::GenerateAromElem(), OpenBabel::GenerateElement(), and OBSmartsPattern::GetAtomicNum().

#define AL_HCOUNT 0x05

Referenced by OpenBabel::AtomLeafConflict(), OBSmartsMatcher::EvalAtomExpr(), and OBSmartsPattern::ParseComplexAtomPrimitive().

#define AL_NEGATIVE 0x06

Referenced by OpenBabel::AtomLeafConflict(), OpenBabel::AtomLeafImplies(), OBSmartsMatcher::EvalAtomExpr(), OBSmartsPattern::GetCharge(), and OBSmartsPattern::ParseComplexAtomPrimitive().

#define AL_POSITIVE 0x07

Referenced by OpenBabel::AtomLeafConflict(), OpenBabel::AtomLeafImplies(), OBSmartsMatcher::EvalAtomExpr(), OBSmartsPattern::GetCharge(), and OBSmartsPattern::ParseComplexAtomPrimitive().

#define AL_CONNECT 0x08

Referenced by OBSmartsMatcher::EvalAtomExpr(), and OBSmartsPattern::ParseComplexAtomPrimitive().

#define AL_DEGREE 0x09

Referenced by OBSmartsMatcher::EvalAtomExpr(), and OBSmartsPattern::ParseComplexAtomPrimitive().

#define AL_IMPLICIT 0x0a

Referenced by OpenBabel::AtomLeafConflict(), OBSmartsMatcher::EvalAtomExpr(), and OBSmartsPattern::ParseComplexAtomPrimitive().

#define AL_RINGS 0x0b

Referenced by OpenBabel::AtomLeafConflict(), OpenBabel::AtomLeafImplies(), OBSmartsMatcher::EvalAtomExpr(), OpenBabel::IsNegatingAtomLeaf(), and OBSmartsPattern::ParseComplexAtomPrimitive().

#define AL_SIZE 0x0c

Referenced by OpenBabel::AtomLeafImplies(), OBSmartsMatcher::EvalAtomExpr(), and OBSmartsPattern::ParseComplexAtomPrimitive().

#define AL_VALENCE 0x0d

Referenced by OBSmartsMatcher::EvalAtomExpr(), and OBSmartsPattern::ParseComplexAtomPrimitive().

#define AL_CHIRAL 0x0e

Referenced by OBSmartsMatcher::EvalAtomExpr(), OpenBabel::GetChiralFlag(), and OBSmartsPattern::ParseComplexAtomPrimitive().

#define AL_HYB 0x0f

Referenced by OBSmartsMatcher::EvalAtomExpr(), and OBSmartsPattern::ParseComplexAtomPrimitive().

#define AL_RINGCONNECT 0x10

Referenced by OBSmartsMatcher::EvalAtomExpr(), and OBSmartsPattern::ParseComplexAtomPrimitive().

#define AL_CLOCKWISE 1

Referenced by OpenBabel::GetChiralFlag(), OBSmartsMatcher::match(), and OBSmartsPattern::ParseComplexAtomPrimitive().

#define AL_ANTICLOCKWISE 2

Referenced by OpenBabel::GetChiralFlag(), OBSmartsMatcher::match(), and OBSmartsPattern::ParseComplexAtomPrimitive().

#define AL_UNSPECIFIED 0

Referenced by OBSmartsMatcher::match(), and OBSmartsPattern::ParseComplexAtomPrimitive().

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines