elliptic.Kernel.Contract module¶
-
class
elliptic.Kernel.Contract.
DSLContract
(dsl_impl, expr=None)[source]¶ Bases:
typing.Generic
Defines the contract of the DSL.
The DSL contract is the set of operations that the DSL supports, plus a base operation. Each operation should create an Expression instance and call append_tree with the created expression.
Parameters: - dsl_impl (~DSLImplementationSubclass) – DSL Implementation object.
- expr (
Optional
[Expression
]) – Current DSL operation. If set to None, will be set to the next operation done when calling append_tree.
-
dsl_impl
¶ DSL Implementation object.
-
expr
¶ Current DSL operation.
-
class
elliptic.Kernel.Contract.
DSLImplementation
[source]¶ Bases:
abc.ABC
Abstract class that defines a DSL Implementation. Should be used to connect the corresponding
Context Delegates
.-
base_delegate
()[source]¶ Returns the context delegate for the DSL base context handling.
The base context delegate could be used, for example, to declare variables and initialize dependencies for the generated code.
Return type: Type
[ContextDelegate
]
-