proxygen
cpp.tokenize.Token Class Reference
Inheritance diagram for cpp.tokenize.Token:

Public Member Functions

def __init__ (self, token_type, name, start, end)
 
def __str__ (self)
 
def __init__ (self, token_type, name, start, end)
 
def __str__ (self)
 
def __init__ (self, token_type, name, start, end)
 
def __str__ (self)
 

Public Attributes

 token_type
 
 name
 
 start
 
 end
 
 whence
 

Static Private Attributes

 __repr__ = __str__
 

Detailed Description

Data container to represent a C++ token.

Tokens can be identifiers, syntax char(s), constants, or
pre-processor directives.

start contains the index of the first char of the token in the source
end contains the index of the last char of the token in the source

Definition at line 64 of file tokenize.py.

Constructor & Destructor Documentation

def cpp.tokenize.Token.__init__ (   self,
  token_type,
  name,
  start,
  end 
)

Definition at line 74 of file tokenize.py.

Referenced by cpp.tokenize.Token.__init__().

74  def __init__(self, token_type, name, start, end):
75  self.token_type = token_type
76  self.name = name
77  self.start = start
78  self.end = end
79  self.whence = WHENCE_STREAM
80 
def __init__(self, token_type, name, start, end)
Definition: tokenize.py:74
def cpp.tokenize.Token.__init__ (   self,
  token_type,
  name,
  start,
  end 
)
def cpp.tokenize.Token.__init__ (   self,
  token_type,
  name,
  start,
  end 
)

Member Function Documentation

def cpp.tokenize.Token.__str__ (   self)

Definition at line 81 of file tokenize.py.

References cpp.tokenize.Token.end, cpp.ast.Node.end, message.name, cpp.tokenize.Token.name, cpp.ast.Define.name, cpp.ast.Parameter.name, cpp.ast._GenericDeclaration.name, cpp.ast.Type.name, name, url_test.name, cpp.tokenize.Token.start, and cpp.ast.Node.start.

Referenced by cpp.tokenize.Token.__str__().

81  def __str__(self):
82  if not utils.DEBUG:
83  return 'Token(%r)' % self.name
84  return 'Token(%r, %s, %s)' % (self.name, self.start, self.end)
85 
def __str__(self)
Definition: tokenize.py:81

Member Data Documentation

cpp.tokenize.Token.__repr__ = __str__
staticprivate

Definition at line 86 of file tokenize.py.

cpp.tokenize.Token.end
cpp.tokenize.Token.name

Definition at line 76 of file tokenize.py.

Referenced by cpp.tokenize.Token.__init__(), and cpp.tokenize.Token.__str__().

cpp.tokenize.Token.start
cpp.tokenize.Token.token_type
cpp.tokenize.Token.whence

Definition at line 79 of file tokenize.py.

Referenced by cpp.tokenize.Token.__init__().


The documentation for this class was generated from the following file: