devana.utility

devana.utility.errors

exception CodeError[source]

Bases: ValueError

Expressions in the code as C/C++ standard.

exception ParserError[source]

Bases: CodeError

Parsing error, most commonly due to backend errors or the use of unsupported syntax.

devana.utility.fakeenum

class FakeEnum(name, bases, args)[source]

Bases: type

Helper metaclass for provide enums with variable values in instance-level (standard enum do it in class-level). You must provide enum_source argument.

devana.utility.lazy

class LazyNotInit[source]

Bases: object

Value used by lazy_invoke to determine property is initialized or not. Set this type to value of property in init function to inform that value must be initialized. For example, self._name = LazyNotInit

lazy_invoke(func)[source]

devana.utility.traits

class IBasicCreatable[source]

Bases: IDefaultCreatable, IFromCursorCreatable, ABC

An interface that describes a set of constructors for a code element.

class ICursorValidate[source]

Bases: ABC

An interface that specifies that an object can only work with certain types of clang cursors.

abstract static is_cursor_valid(cursor)[source]

It checks if it is possible to create a valid object on the basis of the rate.

Return type

bool

class IDefaultCreatable[source]

Bases: ABC

The interface of an object that can be created with default sets of values.

abstract classmethod create_default(parent=None)[source]

Create a default, valid instance. Cls parameter allows implementing this method once if init meets requirements in all derivative types.

class IFromCursorCreatable[source]

Bases: ABC

The interface of an object that can be created from many clang cursor.

abstract classmethod from_cursor(cursor, parent=None)[source]

Create an instance from parsed information from clang. Return None if creation is not possible. Cls parameter allows implementing this method once if init meets requirements in all derivative types.

class IFromParamsCreatable[source]

Bases: ABC

The interface of an object that can be created from many parameters.

abstract classmethod from_params(*argv)[source]

Multi-parameter constructor. Similar to the default value, except that it allows you to set some basic properties.

Return type

ISyntaxElement

Sets of utility classes.