home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2010 November / maximum-cd-2010-11.iso / DiscContents / calibre-0.7.13.msi / file_1587 (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2010-08-06  |  5.4 KB  |  104 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. __all__ = [
  5.     'CSSProductions',
  6.     'MACROS',
  7.     'PRODUCTIONS']
  8. __docformat__ = 'restructuredtext'
  9. __version__ = '$Id: css2productions.py 1394 2008-07-27 13:29:22Z cthedot $'
  10. MACROS = {
  11.     'h': '[0-9a-f]',
  12.     'nonascii': '[^\\0-\\177]',
  13.     'unicode': '\\\\{h}{1,6}(\\r\\n|[ \\t\\r\\n\\f])?',
  14.     'escape': '{unicode}|\\\\[^\\r\\n\\f0-9a-f]',
  15.     'nmstart': '[_a-zA-Z]|{nonascii}|{escape}',
  16.     'nmchar': '[_a-zA-Z0-9-]|{nonascii}|{escape}',
  17.     'string1': '\\"([^\\n\\r\\f\\\\"]|\\\\{nl}|{escape})*\\"',
  18.     'string2': "\\'([^\\n\\r\\f\\\\']|\\\\{nl}|{escape})*\\'",
  19.     'invalid1': '\\"([^\\n\\r\\f\\\\"]|\\\\{nl}|{escape})*',
  20.     'invalid2': "\\'([^\\n\\r\\f\\\\']|\\\\{nl}|{escape})*",
  21.     'comment': '\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\/',
  22.     'ident': '[-]?{nmstart}{nmchar}*',
  23.     'name': '{nmchar}+',
  24.     'num': '-?[0-9]*\\.[0-9]+|[0-9]+',
  25.     'string': '{string1}|{string2}',
  26.     'invalid': '{invalid1}|{invalid2}',
  27.     'url': '([!#$%&*-~]|{nonascii}|{escape})*',
  28.     's': '[ \\t\\r\\n\\f]+',
  29.     'w': '{s}?',
  30.     'nl': '\\n|\\r\\n|\\r|\\f',
  31.     'range': '\\?{1,6}|{h}(\\?{0,5}|{h}(\\?{0,4}|{h}(\\?{0,3}|{h}(\\?{0,2}|{h}(\\??|{h})))))',
  32.     'A': 'a|\\\\0{0,4}(41|61)(\\r\\n|[ \\t\\r\\n\\f])?',
  33.     'C': 'c|\\\\0{0,4}(43|63)(\\r\\n|[ \\t\\r\\n\\f])?',
  34.     'D': 'd|\\\\0{0,4}(44|64)(\\r\\n|[ \\t\\r\\n\\f])?',
  35.     'E': 'e|\\\\0{0,4}(45|65)(\\r\\n|[ \\t\\r\\n\\f])?',
  36.     'F': 'f|\\\\0{0,4}(46|66)(\\r\\n|[ \\t\\r\\n\\f])?',
  37.     'G': 'g|\\\\0{0,4}(47|67)(\\r\\n|[ \\t\\r\\n\\f])?|\\\\g',
  38.     'H': 'h|\\\\0{0,4}(48|68)(\\r\\n|[ \\t\\r\\n\\f])?|\\\\h',
  39.     'I': 'i|\\\\0{0,4}(49|69)(\\r\\n|[ \\t\\r\\n\\f])?|\\\\i',
  40.     'K': 'k|\\\\0{0,4}(4b|6b)(\\r\\n|[ \\t\\r\\n\\f])?|\\\\k',
  41.     'M': 'm|\\\\0{0,4}(4d|6d)(\\r\\n|[ \\t\\r\\n\\f])?|\\\\m',
  42.     'N': 'n|\\\\0{0,4}(4e|6e)(\\r\\n|[ \\t\\r\\n\\f])?|\\\\n',
  43.     'O': 'o|\\\\0{0,4}(51|71)(\\r\\n|[ \\t\\r\\n\\f])?|\\\\o',
  44.     'P': 'p|\\\\0{0,4}(50|70)(\\r\\n|[ \\t\\r\\n\\f])?|\\\\p',
  45.     'R': 'r|\\\\0{0,4}(52|72)(\\r\\n|[ \\t\\r\\n\\f])?|\\\\r',
  46.     'S': 's|\\\\0{0,4}(53|73)(\\r\\n|[ \\t\\r\\n\\f])?|\\\\s',
  47.     'T': 't|\\\\0{0,4}(54|74)(\\r\\n|[ \\t\\r\\n\\f])?|\\\\t',
  48.     'X': 'x|\\\\0{0,4}(58|78)(\\r\\n|[ \\t\\r\\n\\f])?|\\\\x',
  49.     'Z': 'z|\\\\0{0,4}(5a|7a)(\\r\\n|[ \\t\\r\\n\\f])?|\\\\z' }
  50. PRODUCTIONS = [
  51.     ('URI', 'url\\({w}{string}{w}\\)'),
  52.     ('URI', 'url\\({w}{url}{w}\\)'),
  53.     ('FUNCTION', '{ident}\\('),
  54.     ('IMPORT_SYM', '@{I}{M}{P}{O}{R}{T}'),
  55.     ('PAGE_SYM', '@{P}{A}{G}{E}'),
  56.     ('MEDIA_SYM', '@{M}{E}{D}{I}{A}'),
  57.     ('FONT_FACE_SYM', '@{F}{O}{N}{T}\\-{F}{A}{C}{E}'),
  58.     ('CHARSET_SYM', '@charset '),
  59.     ('NAMESPACE_SYM', '@{N}{A}{M}{E}{S}{P}{A}{C}{E}'),
  60.     ('ATKEYWORD', '\\@{ident}'),
  61.     ('IDENT', '{ident}'),
  62.     ('STRING', '{string}'),
  63.     ('INVALID', '{invalid}'),
  64.     ('HASH', '\\#{name}'),
  65.     ('PERCENTAGE', '{num}%'),
  66.     ('LENGTH', '{num}{E}{M}'),
  67.     ('LENGTH', '{num}{E}{X}'),
  68.     ('LENGTH', '{num}{P}{X}'),
  69.     ('LENGTH', '{num}{C}{M}'),
  70.     ('LENGTH', '{num}{M}{M}'),
  71.     ('LENGTH', '{num}{I}{N}'),
  72.     ('LENGTH', '{num}{P}{T}'),
  73.     ('LENGTH', '{num}{P}{C}'),
  74.     ('ANGLE', '{num}{D}{E}{G}'),
  75.     ('ANGLE', '{num}{R}{A}{D}'),
  76.     ('ANGLE', '{num}{G}{R}{A}{D}'),
  77.     ('TIME', '{num}{M}{S}'),
  78.     ('TIME', '{num}{S}'),
  79.     ('FREQ', '{num}{H}{Z}'),
  80.     ('FREQ', '{num}{K}{H}{Z}'),
  81.     ('DIMEN', '{num}{ident}'),
  82.     ('NUMBER', '{num}'),
  83.     ('UNICODE-RANGE', '[0-9A-F?]{1,6}(\\-[0-9A-F]{1,6})?'),
  84.     ('CDO', '\\<\\!\\-\\-'),
  85.     ('CDC', '\\-\\-\\>'),
  86.     ('S', '{s}'),
  87.     ('INCLUDES', '\\~\\='),
  88.     ('DASHMATCH', '\\|\\='),
  89.     ('LBRACE', '\\{'),
  90.     ('PLUS', '\\+'),
  91.     ('GREATER', '\\>'),
  92.     ('COMMA', '\\,'),
  93.     ('IMPORTANT_SYM', '\\!({w}|{comment})*{I}{M}{P}{O}{R}{T}{A}{N}{T}'),
  94.     ('COMMENT', '\\/\\*[^*]*\\*+([^/][^*]*\\*+)*\\/'),
  95.     ('CLASS', '\\.'),
  96.     ('CHAR', '[^"\\\']')]
  97.  
  98. class CSSProductions(object):
  99.     pass
  100.  
  101. for i, t in enumerate(PRODUCTIONS):
  102.     setattr(CSSProductions, t[0].replace('-', '_'), t[0])
  103.  
  104.