pyccel.codegen.wrapper.wrapper module#

Module describing the base code-wrapping class : Wrapper.

class pyccel.codegen.wrapper.wrapper.Wrapper(verbose)[source]#

Bases: object

The base class for code-wrapping subclasses.

The base class for any classes designed to create a wrapper around code. Such wrappers are necessary to create an interface between two different languages.

Parameters:

verbose (int) – The level of verbosity.

exit_scope()[source]#

Exit the current scope and return to the enclosing scope.

Exit the current scope and set the scope back to the value of the enclosing scope.

property scope#

Get the current scope.

Get the scope for the current context.

See also

pyccel.parser.scope.Scope

The type of the returned object.

start_language = None#
target_language = None#
wrap(expr)[source]#

Get the wrapped version of the AST object.

Return the AST object which allows the object expr printed in the start language to be accessed from the target language.

Parameters:

expr (pyccel.ast.basic.PyccelAstNode) – The expression that should be wrapped.

Returns:

The AST which describes the object that lets you access the expression.

Return type:

pyccel.ast.basic.PyccelAstNode