Package schrodinger :: Package utils :: Module ligfilter :: Class DefinitionParser
[hide private]
[frames] | no frames]

Class DefinitionParser

A class for parsing a (possibly multi-line) specification of a Definition.

Instance Methods [hide private]
 
__init__(self)
 
error(self, err)
Print an error and exit.
 
parse(self, lines, line_num=None, group=None)
Return a Definition from a list of lines.
Method Details [hide private]

parse(self, lines, line_num=None, group=None)

 

Return a Definition from a list of lines. No expansion of
definitions is done.

General pattern of the specification is 

DEFINE <name> <SMARTS pattern>

or

DEFINE <name>
    (+ include_definition)*
    (- exclude_definition)*

Where the asterisk indicates zero or more of each of the include and
exclude definitions.

Options:
    line_num - current line of the file being parsed (for error handling)
    group - name of the definition group (or None, if there is no group)