From feaf7812e80af2646d1098d2d6af5e828c6e7dde Mon Sep 17 00:00:00 2001 From: Iván Ávalos Date: Fri, 25 Nov 2022 22:08:02 -0600 Subject: Se añade README, licencia y graphable.py (oops) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- compilador/astree/graphable.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 compilador/astree/graphable.py (limited to 'compilador/astree') diff --git a/compilador/astree/graphable.py b/compilador/astree/graphable.py new file mode 100644 index 0000000..99cfebf --- /dev/null +++ b/compilador/astree/graphable.py @@ -0,0 +1,9 @@ +import graphviz as gv +from typing import Protocol, runtime_checkable +from abc import abstractmethod + +@runtime_checkable +class Graphable(Protocol): + @abstractmethod + def graph(self, dot: gv.Digraph, parent: str = None, edge: str = None) -> None: + raise NotImplementedError -- cgit v1.2.3