psyclone.psyir.nodes.reference

This module contains the implementation of the Reference node.

Classes

  • Reference: Node representing a Reference Expression.

class psyclone.psyir.nodes.reference.Reference(symbol, **kwargs)

Node representing a Reference Expression.

Parameters:
  • symbol (psyclone.psyir.symbols.Symbol) – the symbol being referenced.

  • kwargs (unwrapped dict.) – additional keyword arguments provided to the super class.

Inheritance

Inheritance diagram of Reference
property datatype
Returns:

the datatype of this reference.

Return type:

psyclone.psyir.symbols.DataType

get_signature_and_indices()
Returns:

the Signature of this reference, and an empty list of lists as ‘indices’ since this reference does not represent an array access.

Return type:

tuple(psyclone.core.Signature, list of list of indices)

property is_array
Returns:

whether this reference is an array, False if it can not be determined.

Return type:

bool

property name

Return the name of the referenced symbol.

Returns:

Name of the referenced symbol.

Return type:

str

node_str(colour=True)

Create a text description of this node in the schedule, optionally including control codes for colour.

Parameters:

colour (bool) – whether or not to include colour control codes.

Returns:

text description of this node.

Return type:

str

reference_accesses(var_accesses)

Get all variable access information from this node, i.e. it sets this variable to be read. It relies on get_signature_and_indices and will correctly handle array expressions.

Parameters:

var_accesses (psyclone.core.VariablesAccessInfo) – VariablesAccessInfo instance that stores the information about variable accesses.

property symbol

Return the referenced symbol.

Returns:

the referenced symbol.

Return type:

psyclone.psyir.symbols.Symbol