Back to index

python3.2  3.2.2
Functions | Variables
lib2to3.pgen2.tokenize Namespace Reference

Functions

def group
def any
def maybe

Variables

string __author__ = 'Ka-Ping Yee <ping@lfw.org>'
 __credits__ = \
list __all__ = [x for x in dir(token) if x[0] != '_']
 bytes = str
string Whitespace = r'[ \f\t]*'
string Comment = r'#[^\r\n]*'
tuple Ignore = Whitespace+any(r'\\\r?\n' + Whitespace)
string Name = r'[a-zA-Z_]\w*'
string Binnumber = r'0[bB][01]*'
string Hexnumber = r'0[xX][\da-fA-F]*[lL]?'
string Octnumber = r'0[oO]?[0-7]*[lL]?'
string Decnumber = r'[1-9]\d*[lL]?'
tuple Intnumber = group(Binnumber, Hexnumber, Octnumber, Decnumber)
string Exponent = r'[eE][-+]?\d+'
tuple Pointfloat = group(r'\d+\.\d*', r'\.\d+')
string Expfloat = r'\d+'
tuple Floatnumber = group(Pointfloat, Expfloat)
tuple Imagnumber = group(r'\d+[jJ]', Floatnumber + r'[jJ]')
tuple Number = group(Imagnumber, Floatnumber, Intnumber)
string Single = r"[^'\\]*(?:\\.[^'\\]*)*'"
string Double = r'[^"\\]*(?:\\.[^"\\]*)*"'
string Single3 = r"[^'\\]*(?:(?:\\.|'(?!''))[^'\\]*)*'''"
string Double3 = r'[^"\\]*(?:(?:\\.|"(?!""))[^"\\]*)*"""'

Function Documentation

def lib2to3.pgen2.tokenize.any (   choices)

Definition at line 49 of file tokenize.py.

00049 
def any(*choices): return group(*choices) + '*'
def lib2to3.pgen2.tokenize.group (   choices)

Definition at line 48 of file tokenize.py.

00048 
def group(*choices): return '(' + '|'.join(choices) + ')'
def lib2to3.pgen2.tokenize.maybe (   choices)

Definition at line 50 of file tokenize.py.

00050 
00051 def maybe(*choices): return group(*choices) + '?'


Variable Documentation

list lib2to3.pgen2.tokenize.__all__ = [x for x in dir(token) if x[0] != '_']

Definition at line 37 of file tokenize.py.

string lib2to3.pgen2.tokenize.__author__ = 'Ka-Ping Yee <ping@lfw.org>'

Definition at line 28 of file tokenize.py.

Definition at line 29 of file tokenize.py.

Definition at line 57 of file tokenize.py.

Definition at line 46 of file tokenize.py.

Definition at line 53 of file tokenize.py.

Definition at line 60 of file tokenize.py.

string lib2to3.pgen2.tokenize.Double = r'[^"\\]*(?:\\.[^"\\]*)*"'

Definition at line 72 of file tokenize.py.

string lib2to3.pgen2.tokenize.Double3 = r'[^"\\]*(?:(?:\\.|"(?!""))[^"\\]*)*"""'

Definition at line 76 of file tokenize.py.

Definition at line 64 of file tokenize.py.

Definition at line 62 of file tokenize.py.

Definition at line 65 of file tokenize.py.

string lib2to3.pgen2.tokenize.Hexnumber = r'0[xX][\da-fA-F]*[lL]?'

Definition at line 58 of file tokenize.py.

Definition at line 54 of file tokenize.py.

tuple lib2to3.pgen2.tokenize.Imagnumber = group(r'\d+[jJ]', Floatnumber + r'[jJ]')

Definition at line 66 of file tokenize.py.

Definition at line 61 of file tokenize.py.

Definition at line 55 of file tokenize.py.

Definition at line 67 of file tokenize.py.

string lib2to3.pgen2.tokenize.Octnumber = r'0[oO]?[0-7]*[lL]?'

Definition at line 59 of file tokenize.py.

tuple lib2to3.pgen2.tokenize.Pointfloat = group(r'\d+\.\d*', r'\.\d+')

Definition at line 63 of file tokenize.py.

string lib2to3.pgen2.tokenize.Single = r"[^'\\]*(?:\\.[^'\\]*)*'"

Definition at line 70 of file tokenize.py.

string lib2to3.pgen2.tokenize.Single3 = r"[^'\\]*(?:(?:\\.|'(?!''))[^'\\]*)*'''"

Definition at line 74 of file tokenize.py.

Definition at line 52 of file tokenize.py.