proxygen
cpp.ast.Function Class Reference
Inheritance diagram for cpp.ast.Function:
cpp.ast._GenericDeclaration cpp.ast._GenericDeclaration cpp.ast._GenericDeclaration cpp.ast.Node cpp.ast.Node cpp.ast.Node cpp.ast.Node cpp.ast.Node cpp.ast.Node cpp.ast.Node cpp.ast.Node cpp.ast.Node cpp.ast.Method cpp.ast.Method cpp.ast.Method

Public Member Functions

def __init__ (self, start, end, name, return_type, parameters, modifiers, templated_types, body, namespace)
 
def IsDeclaration (self)
 
def IsDefinition (self)
 
def IsExportable (self)
 
def Requires (self, node)
 
def __str__ (self)
 
def __init__ (self, start, end, name, return_type, parameters, modifiers, templated_types, body, namespace)
 
def IsDeclaration (self)
 
def IsDefinition (self)
 
def IsExportable (self)
 
def Requires (self, node)
 
def __str__ (self)
 
def __init__ (self, start, end, name, return_type, parameters, modifiers, templated_types, body, namespace)
 
def IsDeclaration (self)
 
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)
 
def __init__ (self, start, end, name, namespace)
 
def FullName (self)
 
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)
 
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)
 
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

 return_type
 
 parameters
 
 modifiers
 
 body
 
 templated_types
 
- Public Attributes inherited from cpp.ast._GenericDeclaration
 name
 
 namespace
 
- Public Attributes inherited from cpp.ast.Node
 start
 
 end
 

Detailed Description

Definition at line 360 of file ast.py.

Constructor & Destructor Documentation

def cpp.ast.Function.__init__ (   self,
  start,
  end,
  name,
  return_type,
  parameters,
  modifiers,
  templated_types,
  body,
  namespace 
)

Definition at line 362 of file ast.py.

Referenced by cpp.ast.Function.__str__().

362  modifiers, templated_types, body, namespace):
363  _GenericDeclaration.__init__(self, start, end, name, namespace)
364  converter = TypeConverter(namespace)
365  self.return_type = converter.CreateReturnType(return_type)
366  self.parameters = converter.ToParameters(parameters)
367  self.modifiers = modifiers
368  self.body = body
369  self.templated_types = templated_types
370 
def cpp.ast.Function.__init__ (   self,
  start,
  end,
  name,
  return_type,
  parameters,
  modifiers,
  templated_types,
  body,
  namespace 
)

Definition at line 362 of file ast.py.

References message.body, cpp.ast.Class.body, cpp.ast.Function.body, cpp.ast.Function.modifiers, cpp.ast.Function.parameters, cpp.ast.Function.return_type, cpp.ast.Class.templated_types, and cpp.ast.Function.templated_types.

362  modifiers, templated_types, body, namespace):
363  _GenericDeclaration.__init__(self, start, end, name, namespace)
364  converter = TypeConverter(namespace)
365  self.return_type = converter.CreateReturnType(return_type)
366  self.parameters = converter.ToParameters(parameters)
367  self.modifiers = modifiers
368  self.body = body
369  self.templated_types = templated_types
370 
def cpp.ast.Function.__init__ (   self,
  start,
  end,
  name,
  return_type,
  parameters,
  modifiers,
  templated_types,
  body,
  namespace 
)

Definition at line 362 of file ast.py.

References message.body, cpp.ast.Class.body, cpp.ast.Function.body, cpp.ast.Function.modifiers, cpp.ast.Function.parameters, cpp.ast.Function.return_type, cpp.ast.Class.templated_types, and cpp.ast.Function.templated_types.

362  modifiers, templated_types, body, namespace):
363  _GenericDeclaration.__init__(self, start, end, name, namespace)
364  converter = TypeConverter(namespace)
365  self.return_type = converter.CreateReturnType(return_type)
366  self.parameters = converter.ToParameters(parameters)
367  self.modifiers = modifiers
368  self.body = body
369  self.templated_types = templated_types
370 

Member Function Documentation

def cpp.ast.Function.__str__ (   self)

Definition at line 391 of file ast.py.

References cpp.ast._GenericDeclaration._TypeStringHelper(), message.body, cpp.ast.Class.body, cpp.ast.Function.body, cpp.ast.Function.modifiers, message.name, cpp.ast.Define.name, cpp.ast.Parameter.name, cpp.ast._GenericDeclaration.name, name, url_test.name, cpp.ast.Function.parameters, and cpp.ast.Function.return_type.

Referenced by cpp.ast.Function.__str__().

391  def __str__(self):
392  # TODO(nnorwitz): add templated_types.
393  suffix = ('%s %s(%s), 0x%02x, %s' %
394  (self.return_type, self.name, self.parameters,
395  self.modifiers, self.body))
396  return self._TypeStringHelper(suffix)
397 
398 
def __str__(self)
Definition: ast.py:391
def _TypeStringHelper(self, suffix)
Definition: ast.py:244
def cpp.ast.Function.__str__ (   self)
def cpp.ast.Function.__str__ (   self)
def cpp.ast.Function.IsDeclaration (   self)

Definition at line 371 of file ast.py.

References message.body, cpp.ast.Class.body, and cpp.ast.Function.body.

Referenced by cpp.ast.Function.IsDeclaration().

371  def IsDeclaration(self):
372  return self.body is None
373 
def IsDeclaration(self)
Definition: ast.py:371
def cpp.ast.Function.IsDeclaration (   self)

Definition at line 371 of file ast.py.

References message.body, cpp.ast.Class.body, cpp.ast.Function.body, and cpp.ast.Function.IsDeclaration().

371  def IsDeclaration(self):
372  return self.body is None
373 
def IsDeclaration(self)
Definition: ast.py:371
def cpp.ast.Function.IsDeclaration (   self)

Definition at line 371 of file ast.py.

References message.body, cpp.ast.Class.body, cpp.ast.Function.body, and cpp.ast.Function.IsDeclaration().

371  def IsDeclaration(self):
372  return self.body is None
373 
def IsDeclaration(self)
Definition: ast.py:371
def cpp.ast.Function.IsDefinition (   self)

Definition at line 374 of file ast.py.

References message.body, cpp.ast.Class.body, and cpp.ast.Function.body.

Referenced by cpp.ast.Function.IsDefinition().

374  def IsDefinition(self):
375  return self.body is not None
376 
def IsDefinition(self)
Definition: ast.py:374
def cpp.ast.Function.IsDefinition (   self)

Definition at line 374 of file ast.py.

References message.body, cpp.ast.Class.body, cpp.ast.Function.body, and cpp.ast.Function.IsDefinition().

374  def IsDefinition(self):
375  return self.body is not None
376 
def IsDefinition(self)
Definition: ast.py:374
def cpp.ast.Function.IsDefinition (   self)

Definition at line 374 of file ast.py.

References message.body, cpp.ast.Class.body, cpp.ast.Function.body, and cpp.ast.Function.IsDefinition().

374  def IsDefinition(self):
375  return self.body is not None
376 
def IsDefinition(self)
Definition: ast.py:374
def cpp.ast.Function.IsExportable (   self)

Definition at line 377 of file ast.py.

References cpp.ast.Function.IsExportable(), cpp.ast.Friend.namespace, cpp.ast._GenericDeclaration.namespace, and cpp.ast.Function.return_type.

377  def IsExportable(self):
378  if self.return_type and 'static' in self.return_type.modifiers:
379  return False
380  return None not in self.namespace
381 
def IsExportable(self)
Definition: ast.py:377
def cpp.ast.Function.IsExportable (   self)

Definition at line 377 of file ast.py.

References cpp.ast.Function.IsExportable(), cpp.ast.Friend.namespace, cpp.ast._GenericDeclaration.namespace, and cpp.ast.Function.return_type.

377  def IsExportable(self):
378  if self.return_type and 'static' in self.return_type.modifiers:
379  return False
380  return None not in self.namespace
381 
def IsExportable(self)
Definition: ast.py:377
def cpp.ast.Function.IsExportable (   self)

Definition at line 377 of file ast.py.

References cpp.ast.Friend.namespace, cpp.ast._GenericDeclaration.namespace, and cpp.ast.Function.return_type.

Referenced by cpp.ast.Function.IsExportable().

377  def IsExportable(self):
378  if self.return_type and 'static' in self.return_type.modifiers:
379  return False
380  return None not in self.namespace
381 
def IsExportable(self)
Definition: ast.py:377
def cpp.ast.Function.Requires (   self,
  node 
)

Definition at line 382 of file ast.py.

References cpp.ast.Function.parameters, and cpp.ast.Function.Requires().

382  def Requires(self, node):
383  if self.parameters:
384  # TODO(nnorwitz): parameters are tokens, do name comparision.
385  for p in self.parameters:
386  if p.name == node.name:
387  return True
388  # TODO(nnorwitz): search in body too.
389  return False
390 
def Requires(self, node)
Definition: ast.py:382
def cpp.ast.Function.Requires (   self,
  node 
)

Definition at line 382 of file ast.py.

References cpp.ast.Function.parameters, and cpp.ast.Function.Requires().

382  def Requires(self, node):
383  if self.parameters:
384  # TODO(nnorwitz): parameters are tokens, do name comparision.
385  for p in self.parameters:
386  if p.name == node.name:
387  return True
388  # TODO(nnorwitz): search in body too.
389  return False
390 
def Requires(self, node)
Definition: ast.py:382
def cpp.ast.Function.Requires (   self,
  node 
)

Definition at line 382 of file ast.py.

References cpp.ast.Function.parameters.

Referenced by cpp.ast.Function.Requires().

382  def Requires(self, node):
383  if self.parameters:
384  # TODO(nnorwitz): parameters are tokens, do name comparision.
385  for p in self.parameters:
386  if p.name == node.name:
387  return True
388  # TODO(nnorwitz): search in body too.
389  return False
390 
def Requires(self, node)
Definition: ast.py:382

Member Data Documentation

cpp.ast.Function.modifiers
cpp.ast.Function.parameters
cpp.ast.Function.return_type
cpp.ast.Function.templated_types

Definition at line 369 of file ast.py.

Referenced by cpp.ast.Function.__init__(), cpp.ast.Type.__init__(), and cpp.ast.Type.__str__().


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