aboutsummaryrefslogtreecommitdiff
path: root/compilador/astree/graphable.py
diff options
context:
space:
mode:
Diffstat (limited to 'compilador/astree/graphable.py')
-rw-r--r--compilador/astree/graphable.py9
1 files changed, 9 insertions, 0 deletions
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