PyZ3950/ccl | index /home/asl2/src/PyZ2/PyZ3950/PyZ3950/ccl.py |
Implements part of CCL, the Common Command Language, ISO 8777. I'm
working from the description in the YAZ toolkit
(http://www.indexdata.dk/yaz/doc/tools.php), rather than the ISO
spec. Two extensions:
- qualifiers can be literal "(attrtyp, attrval)" pairs, so, e.g., the
following is a legitimate for ISBN: "(1,7)=0312033095"
- the optional ATTRSET (attrset/query) which must appear at the beginning
of the string.
Allowed values are:
BIB1 (default)
XD1
UTIL
ZTHES1
EXP1
or an oid expressed as a dotted string. (A leading dot implies a
prefix of 1.2.840.1003.3, so, e.g., .1 is the same as BIB1.)
Eventually I will support v3-style mixing attribute sets within
a single query, but for now I don't.
Modules | ||||||
|
Classes | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Data | ||
__file__ = './PyZ3950/ccl.pyc' __name__ = 'PyZ3950/ccl' _attrdict = {'bib1': OID: 1 2 840 10003 3 1, 'exp1': OID: 1 2 840 10003 3 2, 'utility': OID: 1 2 840 10003 3 11, 'xd1': OID: 1 2 840 10003 3 12, 'zthes1': OID: 1 2 840 10003 3 13} default_quals = ['ANY'] default_relop = '=' in_setup = 0 lexer = <lex.Lexer instance> nested_scopes = _Feature((2, 1, 0, 'beta', 1), (2, 2, 0, 'alpha', 0), 16) precedence = (('left', 'LOGOP'),) qual_dict = {'AIF': (3, 3), 'ANY': (1, 1016), 'AU': (1, 1003), 'FIF': (3, 1), 'ISBN': (1, 7), 'LCCN': (1, 9), 'NOTRUNC': (5, 100), 'RTRUNC': (5, 1), 'TI': (1, 4)} r = '>' relop_to_attrib = {'<': 1, '<=': 2, '<>': 6, '=': 3, '>': 5, '>=': 4} t_COMMA = ',' t_LPAREN = r'\(' t_RELOP = '(>=)|(<>)|(<=)|(=)|(<)|(>)' t_RPAREN = r'\)' t_SLASH = '/' t_WORD = r"([a-z]|[A-Z]|[0-9]|&|:)([a-z]|[A-Z]|[0-9]|&|:|,|\.|')*" t_ignore = ' \t' tokens = ('LPAREN', 'RPAREN', 'COMMA', 'SET', 'ATTRSET', 'QUAL', 'QUOTEDVALUE', 'RELOP', 'WORD', 'LOGOP', 'SLASH') word_init = '[a-z]|[A-Z]|[0-9]|&|:' word_non_init = r",|\.|'" |