tesseract v5.3.3.20231005
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)
 

Public Attributes

 token_type
 
 name
 
 start
 
 end
 
 whence
 

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 61 of file tokenize.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 71 of file tokenize.py.

71 def __init__(self, token_type, name, start, end):
72 self.token_type = token_type
73 self.name = name
74 self.start = start
75 self.end = end
76 self.whence = WHENCE_STREAM
77

Member Function Documentation

◆ __str__()

def cpp.tokenize.Token.__str__ (   self)

Definition at line 78 of file tokenize.py.

78 def __str__(self):
79 if not utils.DEBUG:
80 return 'Token(%r)' % self.name
81 return 'Token(%r, %s, %s)' % (self.name, self.start, self.end)
82

Member Data Documentation

◆ end

cpp.tokenize.Token.end

Definition at line 75 of file tokenize.py.

◆ name

cpp.tokenize.Token.name

Definition at line 73 of file tokenize.py.

◆ start

cpp.tokenize.Token.start

Definition at line 74 of file tokenize.py.

◆ token_type

cpp.tokenize.Token.token_type

Definition at line 72 of file tokenize.py.

◆ whence

cpp.tokenize.Token.whence

Definition at line 76 of file tokenize.py.


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