tesseract v5.3.3.20231005
cpp.ast.Typedef Class Reference
Inheritance diagram for cpp.ast.Typedef:
cpp.ast._GenericDeclaration cpp.ast.Node

Public Member Functions

def __init__ (self, start, end, name, alias, namespace)
 
def IsDefinition (self)
 
def IsExportable (self)
 
def Requires (self, node)
 
def __str__ (self)
 
- Public Member Functions inherited from cpp.ast._GenericDeclaration
def __init__ (self, start, end, name, namespace)
 
def FullName (self)
 
- Public Member Functions inherited from cpp.ast.Node
def __init__ (self, start, end)
 
def IsDeclaration (self)
 
def IsDefinition (self)
 
def IsExportable (self)
 
def Requires (self, node)
 
def XXX__str__ (self)
 
def __repr__ (self)
 

Public Attributes

 alias
 
- Public Attributes inherited from cpp.ast._GenericDeclaration
 name
 
 namespace
 
- Public Attributes inherited from cpp.ast.Node
 start
 
 end
 

Detailed Description

Definition at line 271 of file ast.py.

Constructor & Destructor Documentation

◆ __init__()

def cpp.ast.Typedef.__init__ (   self,
  start,
  end,
  name,
  alias,
  namespace 
)

Reimplemented from cpp.ast._GenericDeclaration.

Definition at line 272 of file ast.py.

272 def __init__(self, start, end, name, alias, namespace):
273 _GenericDeclaration.__init__(self, start, end, name, namespace)
274 self.alias = alias
275

Member Function Documentation

◆ __str__()

def cpp.ast.Typedef.__str__ (   self)

Definition at line 290 of file ast.py.

290 def __str__(self):
291 suffix = '%s, %s' % (self.name, self.alias)
292 return self._TypeStringHelper(suffix)
293
294

◆ IsDefinition()

def cpp.ast.Typedef.IsDefinition (   self)
Returns bool if this node is a definition.

Reimplemented from cpp.ast.Node.

Definition at line 276 of file ast.py.

276 def IsDefinition(self):
277 return True
278

◆ IsExportable()

def cpp.ast.Typedef.IsExportable (   self)
Returns bool if this node exportable from a header file.

Reimplemented from cpp.ast.Node.

Definition at line 279 of file ast.py.

279 def IsExportable(self):
280 return True
281

◆ Requires()

def cpp.ast.Typedef.Requires (   self,
  node 
)
Does this AST node require the definition of the node passed in?

Reimplemented from cpp.ast.Node.

Definition at line 282 of file ast.py.

282 def Requires(self, node):
283 # TODO(nnorwitz): handle namespaces, etc.
284 name = node.name
285 for token in self.alias:
286 if token is not None and name == token.name:
287 return True
288 return False
289

Member Data Documentation

◆ alias

cpp.ast.Typedef.alias

Definition at line 274 of file ast.py.


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