SMARTS parser


Functions

bool parse_smarts (char const *str)
 mySMARTS parser
any_atom ::= "*"
atom_symbol ::= any_atom | "H" | "He" | "Li" | "Be" | "B" | "C" | "N" | "O" | "F" | "Ne" | "Na" | "Mg" | "Al" | "Si" | "P" | "S" | "Cl" | "Ar" | "K" | "Ca" | "Sc" | "Ti" | "V" | "Cr" | "Mn" | "Fe" | "Co" | "Ni" | "Cu" | "Zn" | "Ga" | "Ge" | "As" | "Se" | "Br" | "Kr" | "Rb" | "Sr" | "Y" | "Zr" | "Nb" | "Mo" | "Tc" | "Ru" | "Rh" | "Pd" | "Ag" | "Cd" | "In" | "Sn" | "Sb" | "Te" | "I" | "Xe" | "Cs" | "Ba" | "La" | "Ce" | "Pr" | "Nd" | "Pm" | "Sm" | "Eu" | "Gd" | "Tb" | "Dy" | "Ho" | "Er" | "Tm" | "Yb" | "Lu" | "Hf" | "Ta" | "W" | "Re" | "Os" | "Ir" | "Pt" | "Au" | "Hg" | "Tl" | "Pb" | "Bi" | "Po" | "At" | "Rn" | "Fr" | "Ra" | "Ac" | "Th" | "Pa" | "U" | "Np" | "Pu" | "Am" | "Cm" | "Bk" | "Cf" | "Es" | "Fm" | "Md" | "No" | "Lr" | "Rf" | "Db" | "Sg" | "Bh" | "Hs" | "Mt" | "Ds" | "Rg"
atom_number ::= "#1" | "#2" | ... | "#110" | "#111"
atom ::= open_square_bracket ( ([negation | return_sign] atom_symbol) | ([negation | return_sign] atom_number)) [atom_property] close_square_bracket
open_square_bracket ::= "["
close_square_bracket ::= "]"
negation ::= "!"
open_branch ::= "("
close_branch ::= ")"
bond ::= [negation] "-" | [negation] "=" | [negation] "#" | [negation] ":" | "~"
digit ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"
atom_property ::= charge | attached_hydrogens | (charge attached_hydrogens) | (attached_hydrogens charge)
charge ::= "+"[digit] | "-"[digit]
attached_hydrogens ::= "H"[digit]
simple_branch ::= open_branch bond atom[digit] (bond atom[digit])* close_branch
multiple_branch ::= open_branch bond atom[digit] (simple_branch | multiple_branch | bond atom[digit])* close_branch
molecule ::= atom[digit] ( multiple_branch | simple_branch | (bond atom [digit]) )*
operator ::= "or"
query ::= molecule (operator molecule)*
return_sign ::= "§"

Detailed Description

This SMARTS parser is implemented using Spirit an object-oriented recursive-descent parser generator framework. The grammar is derived from the Daylight Theory Manual (Version 4.9). The following grammar explanations are written in Extended Backus–Naur Form (EBNF).

The following features differ from the original Daylight specification.
  1. isotopic specifications such as carbon-12, carbon-13 are omitted
  2. disconnected compounds are omitted
  3. chirality is omitted
  4. all atoms, bonds, charges and attached hydrogens have to be explicitely specified
  5. an additional return_sign "§" was introduced, which specifies atoms whose atom keys are returned after a subgraph match

Generated on Mon Nov 23 08:31:44 2009 for ParaDockS by  doxygen 1.5.8