//Language: Python


// tokens
Token=tnone
Token=tpystring
Token=tpycomment
Token=tpyident
Token=tpyinteger
Token=tpyfloat
Token=tpyresword
Token=tpysymbol
Token=tpyfunction
Token=tpyexception
Token=turl
Token=twhitespace


// states
State=spynormal
State=spystring1
State=spystring2
State=spystring3
State=spystring4
State=spystring5
State=spystring6
State=spystring7
State=spystring8
State=spycomment1


//delims
Delimiters=;.,:'"{}[]()?!@#$%^&*-+=|\/

// symbols
spynormal  [\{\}\[\]\(\)<>\.,=;&|!%/@\+\-\*]         spynormal  tpysymbol

// reswords
spynormal 'and'      spynormal tpyresword
spynormal 'as'       spynormal tpyresword
spynormal 'assert'   spynormal tpyresword
spynormal 'break'    spynormal tpyresword
spynormal 'class'    spynormal tpyresword
spynormal 'continue' spynormal tpyresword
spynormal 'def'      spynormal tpyresword
spynormal 'del'      spynormal tpyresword
spynormal 'elif'     spynormal tpyresword
spynormal 'else'     spynormal tpyresword
spynormal 'except'   spynormal tpyresword
spynormal 'exec'     spynormal tpyresword
spynormal 'finally'  spynormal tpyresword
spynormal 'for'      spynormal tpyresword
spynormal 'from'     spynormal tpyresword
spynormal 'global'   spynormal tpyresword
spynormal 'if'       spynormal tpyresword
spynormal 'import'   spynormal tpyresword
spynormal 'in'       spynormal tpyresword
spynormal 'is'       spynormal tpyresword
spynormal 'lambda'   spynormal tpyresword
spynormal 'not'      spynormal tpyresword
spynormal 'or'       spynormal tpyresword
spynormal 'pass'     spynormal tpyresword
spynormal 'print'    spynormal tpyresword
spynormal 'raise'    spynormal tpyresword
spynormal 'return'   spynormal tpyresword
spynormal 'try'      spynormal tpyresword
spynormal 'while'    spynormal tpyresword
spynormal 'with'     spynormal tpyresword
spynormal 'yield'    spynormal tpyresword

// built-in constants
spynormal 'True'     spynormal tpyresword
spynormal 'False'    spynormal tpyresword
spynormal 'None'     spynormal tpyresword
spynormal 'NotImplemented' spynormal tpyresword
spynormal 'Ellipsis'       spynormal tpyresword
spynormal '__debug__'      spynormal tpyresword

// built-in functions
spynormal '__import__'      spynormal tpyfunction
spynormal 'abs'             spynormal tpyfunction
spynormal 'all'             spynormal tpyfunction
spynormal 'any'             spynormal tpyfunction
spynormal 'apply'           spynormal tpyfunction
spynormal 'basestring'      spynormal tpyfunction
spynormal 'bin'             spynormal tpyfunction
spynormal 'bool'            spynormal tpyfunction
spynormal 'buffer'          spynormal tpyfunction
spynormal 'bytearray'       spynormal tpyfunction
spynormal 'callable'        spynormal tpyfunction
spynormal 'chr'             spynormal tpyfunction
spynormal 'classmethod'     spynormal tpyfunction
spynormal 'cmp'             spynormal tpyfunction
spynormal 'coerce'          spynormal tpyfunction
spynormal 'compile'         spynormal tpyfunction
spynormal 'complex'         spynormal tpyfunction
spynormal 'delattr'         spynormal tpyfunction
spynormal 'dict'            spynormal tpyfunction
spynormal 'dir'             spynormal tpyfunction
spynormal 'divmod'          spynormal tpyfunction
spynormal 'enumerate'       spynormal tpyfunction
spynormal 'eval'            spynormal tpyfunction
spynormal 'execfile'        spynormal tpyfunction
spynormal 'file'            spynormal tpyfunction
spynormal 'filter'          spynormal tpyfunction
spynormal 'float'           spynormal tpyfunction
spynormal 'format'          spynormal tpyfunction
spynormal 'frozenset'       spynormal tpyfunction
spynormal 'getattr'         spynormal tpyfunction
spynormal 'globals'         spynormal tpyfunction
spynormal 'hasattr'         spynormal tpyfunction
spynormal 'hash'            spynormal tpyfunction
spynormal 'help'            spynormal tpyfunction
spynormal 'hex'             spynormal tpyfunction
spynormal 'id'              spynormal tpyfunction
spynormal 'input'           spynormal tpyfunction
spynormal 'int'             spynormal tpyfunction
spynormal 'intern'          spynormal tpyfunction
spynormal 'isinstance'      spynormal tpyfunction
spynormal 'issubclass'      spynormal tpyfunction
spynormal 'iter'            spynormal tpyfunction
spynormal 'len'             spynormal tpyfunction
spynormal 'list'            spynormal tpyfunction
spynormal 'locals'          spynormal tpyfunction
spynormal 'long'            spynormal tpyfunction
spynormal 'map'             spynormal tpyfunction
spynormal 'max'             spynormal tpyfunction
spynormal 'memoryview'      spynormal tpyfunction
spynormal 'min'             spynormal tpyfunction
spynormal 'next'            spynormal tpyfunction
spynormal 'object'          spynormal tpyfunction
spynormal 'oct'             spynormal tpyfunction
spynormal 'open'            spynormal tpyfunction
spynormal 'ord'             spynormal tpyfunction
spynormal 'pow'             spynormal tpyfunction
spynormal 'print'           spynormal tpyfunction
spynormal 'property'        spynormal tpyfunction
spynormal 'range'           spynormal tpyfunction
spynormal 'raw_input'       spynormal tpyfunction
spynormal 'reduce'          spynormal tpyfunction
spynormal 'reload'          spynormal tpyfunction
spynormal 'repr'            spynormal tpyfunction
spynormal 'reversed'        spynormal tpyfunction
spynormal 'round'           spynormal tpyfunction
spynormal 'set'             spynormal tpyfunction
spynormal 'setattr'         spynormal tpyfunction
spynormal 'slice'           spynormal tpyfunction
spynormal 'sorted'          spynormal tpyfunction
spynormal 'staticmethod'    spynormal tpyfunction
spynormal 'str'             spynormal tpyfunction
spynormal 'sum'             spynormal tpyfunction
spynormal 'super'           spynormal tpyfunction
spynormal 'tuple'           spynormal tpyfunction
spynormal 'type'            spynormal tpyfunction
spynormal 'unichr'          spynormal tpyfunction
spynormal 'unicode'         spynormal tpyfunction
spynormal 'vars'            spynormal tpyfunction
spynormal 'xrange'          spynormal tpyfunction
spynormal 'zip'             spynormal tpyfunction

// built-in exceptions
spynormal 'ArithmeticError'                spynormal tpyexception
spynormal 'AssertionError'                 spynormal tpyexception
spynormal 'AttributeError'                 spynormal tpyexception
spynormal 'BaseException'                  spynormal tpyexception
spynormal 'BufferError'                    spynormal tpyexception
spynormal 'BytesWarning'                   spynormal tpyexception
spynormal 'DeprecationWarning'             spynormal tpyexception
spynormal 'EOFError'                       spynormal tpyexception
spynormal 'EnvironmentError'               spynormal tpyexception
spynormal 'Exception'                      spynormal tpyexception
spynormal 'FloatingPointError'             spynormal tpyexception
spynormal 'FutureWarning'                  spynormal tpyexception
spynormal 'GeneratorExit'                  spynormal tpyexception
spynormal 'IOError'                        spynormal tpyexception
spynormal 'ImportError'                    spynormal tpyexception
spynormal 'ImportWarning'                  spynormal tpyexception
spynormal 'IndentationError'               spynormal tpyexception
spynormal 'IndexError'                     spynormal tpyexception
spynormal 'KeyError'                       spynormal tpyexception
spynormal 'KeyboardInterrupt'              spynormal tpyexception
spynormal 'LookupError'                    spynormal tpyexception
spynormal 'MemoryError'                    spynormal tpyexception
spynormal 'NameError'                      spynormal tpyexception
spynormal 'NotImplementedError'            spynormal tpyexception
spynormal 'OSError'                        spynormal tpyexception
spynormal 'OverflowError'                  spynormal tpyexception
spynormal 'PendingDeprecationWarning'      spynormal tpyexception
spynormal 'ReferenceError'                 spynormal tpyexception
spynormal 'RuntimeError'                   spynormal tpyexception
spynormal 'RuntimeWarning'                 spynormal tpyexception
spynormal 'StandardError'                  spynormal tpyexception
spynormal 'StopIteration'                  spynormal tpyexception
spynormal 'SyntaxError'                    spynormal tpyexception
spynormal 'SyntaxWarning'                  spynormal tpyexception
spynormal 'SystemError'                    spynormal tpyexception
spynormal 'SystemExit'                     spynormal tpyexception
spynormal 'TabError'                       spynormal tpyexception
spynormal 'TypeError'                      spynormal tpyexception
spynormal 'UnboundLocalError'              spynormal tpyexception
spynormal 'UnicodeDecodeError'             spynormal tpyexception
spynormal 'UnicodeEncodeError'             spynormal tpyexception
spynormal 'UnicodeError'                   spynormal tpyexception
spynormal 'UnicodeTranslateError'          spynormal tpyexception
spynormal 'UnicodeWarning'                 spynormal tpyexception
spynormal 'UserWarning'                    spynormal tpyexception
spynormal 'VMSError'                       spynormal tpyexception
spynormal 'ValueError'                     spynormal tpyexception
spynormal 'Warning'                        spynormal tpyexception
spynormal 'WindowsError'                   spynormal tpyexception
spynormal 'ZeroDivision'                   spynormal tpyexception

// numbers
spynormal [0-9]*                                 spynormal  tpyinteger
spynormal 0X[1-9][0-9A-F]+                       spynormal  tpyinteger
spynormal 0x[1-9][0-9A-F]+                       spynormal  tpyinteger
spynormal [0-9]*\.[0-9]*                         spynormal  tpyfloat
spynormal [0-9]*{\.[0-9]+}|e{[\+\-]}|[0-9]+      spynormal  tpyfloat

//idents

spynormal   [a-z_A-Z][a-z_A-Z0-9]*  spynormal   tpyident

//white space
spynormal #32*                      spynormal   twhitespace

//comments
spynormal    \#                       spycomment1 tpycomment
spycomment1  .*                       spynormal   tpycomment
spycomment1 $                         spynormal   tpycomment

//strings
spynormal    \'                     spystring1   tpystring
spystring1   [^\']*                 spystring1   tpystring
spystring1   \'                     spynormal    tpystring
spystring1   \'\'                   spystring1   tpystring
spystring1   \\                     spystring1   tpystring
spystring1   \\\'                   spystring1   tpystring
spystring1   $                      spynormal    tpystring

spynormal    \"                     spystring2   tpystring
spystring2   [^\"]*                 spystring2   tpystring
spystring2   \"                     spynormal    tpystring
spystring2   \"\"                   spystring2   tpystring
spystring2   \\                     spystring2   tpystring
spystring2   \\\"                   spystring2   tpystring
spystring2   $                      spynormal    tpystring

spynormal    {r\'}                  spystring3   tpystring
spystring3   [^\']*                 spystring3   tpystring
spystring3   \'                     spynormal    tpystring
spystring3   \'\'                   spystring3   tpystring
spystring3   $                      spynormal    tpystring

spynormal    {r\"}                  spystring4   tpystring
spystring4   [^\"]*                 spystring4   tpystring
spystring4   \"                     spynormal    tpystring
spystring4   \"\"                   spystring4   tpystring
spystring4   $                      spynormal    tpystring

spynormal    {\'\'\'}                 spystring5   tpystring
spystring5   [^\']*                   spystring5   tpystring
spystring5   \'                       spystring5   tpystring
spystring5   {\'\'}                   spystring5   tpystring
spystring5   \\                       spystring5   tpystring
spystring5   \\{\'\'\'}               spystring5   tpystring
spystring5   {\'\'\'}                 spynormal    tpystring

spynormal    {\"\"\"}               spystring6   tpystring
spystring6   [^\"]*                 spystring6   tpystring
spystring6   \"                     spystring6   tpystring
spystring6   {\"\"}                 spystring6   tpystring
spystring6   \\                     spystring6   tpystring
spystring6   \\{\"\"\"}             spystring6   tpystring
spystring6   {\"\"\"}               spynormal    tpystring

spynormal    {r\'\'\'}              spystring7   tpystring
spystring7   [^\']*                 spystring7   tpystring
spystring7   \'                     spystring7   tpystring
spystring7   {\'\'}                 spystring7   tpystring
spystring7   {\'\'\'}               spynormal    tpystring

spynormal    {r\"\"\"}              spystring8   tpystring
spystring8   [^\"]*                 spystring8   tpystring
spystring8   \"                     spystring8   tpystring
spystring8   {\"\"}                 spystring8   tpystring
spystring8   {\"\"\"}               spynormal    tpystring

