Reference Guide  2.5.0
psyclone.psyir.nodes.commentable_mixin.CommentableMixin Class Reference
Inheritance diagram for psyclone.psyir.nodes.commentable_mixin.CommentableMixin:

Public Member Functions

def preceding_comment (self)
 
def preceding_comment (self, comment)
 
def inline_comment (self)
 
def inline_comment (self, comment)
 

Detailed Description

Mixin that adds the Commentable trait into a PSyIR node. It provides
two attributes that store preceding and inline comments and their
respective property getters and setters.

Definition at line 40 of file commentable_mixin.py.

Member Function Documentation

◆ inline_comment() [1/2]

def psyclone.psyir.nodes.commentable_mixin.CommentableMixin.inline_comment (   self)
:returns: inline comment associated with this statement.
:rtype: str

Definition at line 73 of file commentable_mixin.py.

73  def inline_comment(self):
74  '''
75  :returns: inline comment associated with this statement.
76  :rtype: str
77  '''
78  return self._inline_comment
79 

References psyclone.psyir.nodes.commentable_mixin.CommentableMixin._inline_comment.

Here is the caller graph for this function:

◆ inline_comment() [2/2]

def psyclone.psyir.nodes.commentable_mixin.CommentableMixin.inline_comment (   self,
  comment 
)
:param str comment: inline comment associated with this statement.

Definition at line 81 of file commentable_mixin.py.

81  def inline_comment(self, comment):
82  '''
83  :param str comment: inline comment associated with this statement.
84  '''
85  if not isinstance(comment, str):
86  raise TypeError(f"The inline_comment must be a string but"
87  f" found '{type(comment).__name__}'.")
88  self._inline_comment = comment
89 
90 
91 # For automatic API documentation generation

References psyclone.psyir.nodes.commentable_mixin.CommentableMixin._inline_comment, and psyclone.psyir.nodes.commentable_mixin.CommentableMixin.inline_comment().

Here is the call graph for this function:

◆ preceding_comment() [1/2]

def psyclone.psyir.nodes.commentable_mixin.CommentableMixin.preceding_comment (   self)
:returns: comment preceding this statement.
:rtype: str

Definition at line 55 of file commentable_mixin.py.

55  def preceding_comment(self):
56  '''
57  :returns: comment preceding this statement.
58  :rtype: str
59  '''
60  return self._preceding_comment
61 

References psyclone.psyir.nodes.commentable_mixin.CommentableMixin._preceding_comment.

Here is the caller graph for this function:

◆ preceding_comment() [2/2]

def psyclone.psyir.nodes.commentable_mixin.CommentableMixin.preceding_comment (   self,
  comment 
)
:param str comment: comment preceding this statement.

Definition at line 63 of file commentable_mixin.py.

63  def preceding_comment(self, comment):
64  '''
65  :param str comment: comment preceding this statement.
66  '''
67  if not isinstance(comment, str):
68  raise TypeError(f"The preceding_comment must be a string but"
69  f" found '{type(comment).__name__}'.")
70  self._preceding_comment = comment
71 

References psyclone.psyir.nodes.commentable_mixin.CommentableMixin._preceding_comment, and psyclone.psyir.nodes.commentable_mixin.CommentableMixin.preceding_comment().

Here is the call graph for this function:

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