Loading...
Searching...
No Matches
parsmart.cpp File Reference
`#include <openbabel/babelconfig.h>`
`#include <ctype.h>`
`#include <iomanip>`
`#include <cstring>`
`#include <openbabel/mol.h>`
`#include <openbabel/atom.h>`
`#include <openbabel/bond.h>`
`#include <openbabel/parsmart.h>`
`#include <openbabel/stereo/stereo.h>`
`#include <openbabel/stereo/tetrahedral.h>`

## Namespaces

namespace | OpenBabel

## Macros

#define | ATOMPOOL 1
#define | BONDPOOL 1
#define | AE_ANDHI 1
#define | AE_ANDLO 2
#define | AE_OR 3
#define | AE_RECUR 4
#define | AE_NOT 5
#define | AE_TRUE 6
#define | AE_FALSE 7
#define | AE_AROMATIC 8
#define | AE_ALIPHATIC 9
#define | AE_CYCLIC 10
#define | AE_ACYCLIC 11
#define | AE_MASS 12
#define | AE_ELEM 13
#define | AE_AROMELEM 14
#define | AE_ALIPHELEM 15
#define | AE_HCOUNT 16
#define | AE_CHARGE 17
#define | AE_CONNECT 18
#define | AE_DEGREE 19
#define | AE_IMPLICIT 20
#define | AE_RINGS 21
#define | AE_SIZE 22
#define | AE_VALENCE 23
#define | AE_CHIRAL 24
#define | AE_HYB 25
#define | AE_RINGCONNECT 26
#define | AL_CLOCKWISE 1
#define | AL_ANTICLOCKWISE 2
#define | AL_UNSPECIFIED 0
#define | BE_ANDHI 1
#define | BE_ANDLO 2
#define | BE_OR 3
#define | BE_NOT 4
#define | BE_ANY 5
#define | BE_DEFAULT 6
#define | BE_SINGLE 7
#define | BE_DOUBLE 8
#define | BE_TRIPLE 9
#define | BE_QUAD 10
#define | BE_AROM 11
#define | BE_RING 12
#define | BE_UP 13
#define | BE_DOWN 14
#define | BE_UPUNSPEC 15
#define | BE_DOWNUNSPEC 16

## Functions

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 * | CopyAtomExpr (AtomExpr *expr)
static void | FreeAtomExpr (AtomExpr *expr)
static AtomExpr * | BuildAtomPred (int type)
static AtomExpr * | BuildAtomLeaf (int type, 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 BondExpr * | CopyBondExpr (BondExpr *expr)
static bool | EquivalentBondExpr (BondExpr *expr1, BondExpr *expr2)
static void | FreeBondExpr (BondExpr *expr)
static BondExpr * | BuildBondLeaf (int type)
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 int | GetExprOrder (BondExpr *expr)
static int | GetExprCharge (AtomExpr *expr)
static int | GetExprAtomicNum (AtomExpr *expr)
void | SmartsLexReplace (std::string &, std::vector< std::pair< std::string, std::string > > &)

## Variables

const int | SmartsImplicitRef = -9999

## Detailed Description

Implementation of Daylight SMARTS parser.

## Macro Definition Documentation

## ATOMPOOL

#define ATOMPOOL 1

Referenced by OpenBabel::CreateAtom().

## BONDPOOL

#define BONDPOOL 1

Referenced by OpenBabel::CreateBond().

## AE_ANDHI

#define AE_ANDHI 1

Referenced by OpenBabel::CopyAtomExpr(), OBSmartsMatcher::EvalAtomExpr(), OpenBabel::FreeAtomExpr(), OpenBabel::GetChiralFlag(), OpenBabel::GetExprAtomicNum(), OpenBabel::GetExprCharge(), and OBSmartsPattern::ParseAtomExpr().

## AE_ANDLO

#define AE_ANDLO 2

Referenced by OpenBabel::CopyAtomExpr(), OBSmartsMatcher::EvalAtomExpr(), OpenBabel::FreeAtomExpr(), OpenBabel::GetChiralFlag(), OpenBabel::GetExprAtomicNum(), OpenBabel::GetExprCharge(), and OBSmartsPattern::ParseAtomExpr().

## AE_OR

#define AE_OR 3

Referenced by OpenBabel::CopyAtomExpr(), OBSmartsMatcher::EvalAtomExpr(), OpenBabel::FreeAtomExpr(), OpenBabel::GetChiralFlag(), OpenBabel::GetExprAtomicNum(), OpenBabel::GetExprCharge(), and OBSmartsPattern::ParseAtomExpr().

## AE_RECUR

#define AE_RECUR 4

Referenced by OpenBabel::BuildAtomRecurs(), OpenBabel::CopyAtomExpr(), OBSmartsMatcher::EvalAtomExpr(), and OpenBabel::FreeAtomExpr().

## AE_NOT

#define AE_NOT 5

Referenced by OpenBabel::BuildAtomNot(), OpenBabel::CopyAtomExpr(), OBSmartsMatcher::EvalAtomExpr(), OpenBabel::FreeAtomExpr(), and OpenBabel::GetChiralFlag().

## AE_TRUE

#define AE_TRUE 6

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

## AE_FALSE

#define AE_FALSE 7

Referenced by OBSmartsMatcher::EvalAtomExpr().

## AE_AROMATIC

#define AE_AROMATIC 8

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

## AE_ALIPHATIC

#define AE_ALIPHATIC 9

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

## AE_CYCLIC

#define AE_CYCLIC 10

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

## AE_ACYCLIC

#define AE_ACYCLIC 11

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

## AE_MASS

#define AE_MASS 12

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

## AE_ELEM

#define AE_ELEM 13

Referenced by OBSmartsMatcher::EvalAtomExpr(), OpenBabel::GenerateElement(), and OpenBabel::GetExprAtomicNum().

## AE_AROMELEM

#define AE_AROMELEM 14

Referenced by OBSmartsMatcher::EvalAtomExpr(), OpenBabel::GenerateAromElem(), and OpenBabel::GetExprAtomicNum().

## AE_ALIPHELEM

#define AE_ALIPHELEM 15

Referenced by OBSmartsMatcher::EvalAtomExpr(), OpenBabel::GenerateAromElem(), and OpenBabel::GetExprAtomicNum().

## AE_HCOUNT

#define AE_HCOUNT 16

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

## AE_CHARGE

#define AE_CHARGE 17

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

## AE_CONNECT

#define AE_CONNECT 18

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

## AE_DEGREE

#define AE_DEGREE 19

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

## AE_IMPLICIT

#define AE_IMPLICIT 20

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

## AE_RINGS

#define AE_RINGS 21

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

## AE_SIZE

#define AE_SIZE 22

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

## AE_VALENCE

#define AE_VALENCE 23

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

## AE_CHIRAL

#define AE_CHIRAL 24

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

## AE_HYB

#define AE_HYB 25

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

## AE_RINGCONNECT

#define AE_RINGCONNECT 26

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

## AL_CLOCKWISE

#define AL_CLOCKWISE 1

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

## AL_ANTICLOCKWISE

#define AL_ANTICLOCKWISE 2

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

## AL_UNSPECIFIED

#define AL_UNSPECIFIED 0

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

## BE_ANDHI

#define BE_ANDHI 1

Referenced by OpenBabel::CopyBondExpr(), OpenBabel::EquivalentBondExpr(), OBSmartsMatcher::EvalBondExpr(), OpenBabel::FreeBondExpr(), OpenBabel::GetExprOrder(), and OBSmartsPattern::ParseBondExpr().

## BE_ANDLO

#define BE_ANDLO 2

Referenced by OpenBabel::CopyBondExpr(), OpenBabel::EquivalentBondExpr(), OBSmartsMatcher::EvalBondExpr(), OpenBabel::FreeBondExpr(), OpenBabel::GetExprOrder(), and OBSmartsPattern::ParseBondExpr().

## BE_OR

#define BE_OR 3

Referenced by OpenBabel::CopyBondExpr(), OpenBabel::EquivalentBondExpr(), OBSmartsMatcher::EvalBondExpr(), OpenBabel::FreeBondExpr(), OpenBabel::GetExprOrder(), and OBSmartsPattern::ParseBondExpr().

## BE_NOT

#define BE_NOT 4

Referenced by OpenBabel::BuildBondNot(), OpenBabel::CopyBondExpr(), OpenBabel::EquivalentBondExpr(), OBSmartsMatcher::EvalBondExpr(), and OpenBabel::FreeBondExpr().

## BE_ANY

#define BE_ANY 5

Referenced by OBSmartsMatcher::EvalBondExpr(), and OBSmartsPattern::ParseBondPrimitive().

## BE_DEFAULT

#define BE_DEFAULT 6

Referenced by OBSmartsMatcher::EvalBondExpr(), and OpenBabel::GenerateDefaultBond().

## BE_SINGLE

#define BE_SINGLE 7

Referenced by OBSmartsMatcher::EvalBondExpr(), OpenBabel::GetExprOrder(), and OBSmartsPattern::ParseBondPrimitive().

## BE_DOUBLE

#define BE_DOUBLE 8

Referenced by OBSmartsMatcher::EvalBondExpr(), OpenBabel::GetExprOrder(), and OBSmartsPattern::ParseBondPrimitive().

## BE_TRIPLE

#define BE_TRIPLE 9

Referenced by OBSmartsMatcher::EvalBondExpr(), OpenBabel::GetExprOrder(), and OBSmartsPattern::ParseBondPrimitive().

## BE_QUAD

#define BE_QUAD 10

Referenced by OBSmartsMatcher::EvalBondExpr(), OpenBabel::GetExprOrder(), and OBSmartsPattern::ParseBondPrimitive().

## BE_AROM

#define BE_AROM 11

Referenced by OBSmartsMatcher::EvalBondExpr(), OpenBabel::GetExprOrder(), and OBSmartsPattern::ParseBondPrimitive().

## BE_RING

#define BE_RING 12

Referenced by OBSmartsMatcher::EvalBondExpr(), and OBSmartsPattern::ParseBondPrimitive().

## BE_UP

#define BE_UP 13

Referenced by OpenBabel::GetExprOrder().

## BE_DOWN

#define BE_DOWN 14

Referenced by OpenBabel::GetExprOrder().

## BE_UPUNSPEC

#define BE_UPUNSPEC 15

Referenced by OpenBabel::GetExprOrder().

## BE_DOWNUNSPEC

#define BE_DOWNUNSPEC 16

Referenced by OpenBabel::GetExprOrder().