aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2022-11-25 22:08:02 -0600
committerIván Ávalos <avalos@disroot.org>2022-11-25 22:08:02 -0600
commitfeaf7812e80af2646d1098d2d6af5e828c6e7dde (patch)
tree1a70e08bb77842dd3b113385ef3787cc1faa3f33
parent6623f6c35f08b08a1e4dddfc3209acdaa57dcc8d (diff)
downloadjavanol-feaf7812e80af2646d1098d2d6af5e828c6e7dde.tar.gz
javanol-feaf7812e80af2646d1098d2d6af5e828c6e7dde.tar.bz2
javanol-feaf7812e80af2646d1098d2d6af5e828c6e7dde.zip
Se añade README, licencia y graphable.py (oops)
-rw-r--r--README.md66
-rw-r--r--compilador/astree/graphable.py9
-rw-r--r--compilador/main.py2
-rw-r--r--interfaz/main.py19
4 files changed, 93 insertions, 3 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..41b1a4e
--- /dev/null
+++ b/README.md
@@ -0,0 +1,66 @@
+# Javañol RGG edition
+
+Javañol es un lenguaje de programación que, a pesar de llamarse como
+aquel lenguaje maldecido por sus usuarios, no se parece nada a él (al
+igual que ese otro lenguaje). Lo que sí es cierto, es que está en
+español, para que la comunidad hispanohablante le entienda.
+
+En su fase actual, es solo un prototipo no funcional; pero quizás
+algún día llegue a convertirse en un lenguaje real tampoco muy
+funcional. Eso depende del tiempo que sus autores dediquen en él; no
+les recomiendo poner su confianza en que suceda.
+
+Este proyecto se realizó para la materia de Lenguajes y Autómatas 2,
+con el profesor I.S.C. Ricardo González González. Somos estudiantes de
+Ingeniería en Sistemas Computacionales, en el [Tecnológico Nacional de
+México en Celaya](https://celaya.tecnm.mx/).
+
+Un agradecimiento especial a [Drew DeVault](https://drewdevault.com/),
+quien creó el lenguaje de programación [Hare](https://harelang.org),
+de cuyo [compilador](https://git.sr.ht/~sircmpwn/hare) tomamos un
+montón de código. Pero, hey, le añadimos algunas sorpresas.
+
+## Instalación
+
+Para que funcione esta cosa, se necesitan las siguientes librerías:
+
+| Librería | Autor | Licencia |
+|-------------------------------------------------------|------------------|-------------|
+| [python-gobject](https://pypi.org/project/PyGObject/) | James Henstridge | GNU LGPLv2+ |
+| [graphviz](https://pypi.org/project/graphviz/) | Sebastian Bank | MIT |
+
+Se requiere tener instalado [GTK4](https://gtk.org/), porque es lo que
+usamos para la interfaz gráfica, y te deseo suerte corriéndolo en
+Windows o macOS, la verdad no lo he probado, porque no uso ninguno de
+los dos. También se necesita [Graphviz](https://graphviz.org/), porque
+es con lo que se renderiza el árbol de sintaxis en PDF (¡sorpresa!)
+
+## Ejecución
+
+Para correr la interfaz gráfica, basta con posicionarte en el
+directorio raíz del proyecto, y ejecutar el siguiente script (solo
+para GNU/Linux):
+
+```bash
+./run_gui.sh
+```
+
+## Licencia
+
+```
+Copyright (C) 2022 Iván Alejandro Ávalos Díaz <avalos@disroot.org>,
+ Edgar Alexis López Martínez <edgarmlmp@gmail.com>
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <https://www.gnu.org/licenses/>.
+```
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
diff --git a/compilador/main.py b/compilador/main.py
index 03f7174..48fb129 100644
--- a/compilador/main.py
+++ b/compilador/main.py
@@ -1,7 +1,5 @@
import sys, getopt, os, traceback
from enum import Enum
-from tkinter import *
-from tkinter import ttk, filedialog
from lexer import *
class Step(Enum):
diff --git a/interfaz/main.py b/interfaz/main.py
index b6c5ac9..2d12af5 100644
--- a/interfaz/main.py
+++ b/interfaz/main.py
@@ -277,9 +277,26 @@ Profesor: I.S.C. Ricardo González González
Tecnológico Nacional de México en Celaya''')
self.about_dialog.set_authors([
"Iván Alejandro Ávalos Díaz (18032572)",
- "Edgar Alexis Martínez López (18030817)"
+ "Edgar Alexis López Martínez (18030817)"
])
self.about_dialog.set_logo_icon_name('applications-development')
+ self.about_dialog.set_license(
+ '''Copyright (C) 2022 Iván Alejandro Ávalos Díaz <avalos@disroot.org>,
+ Edgar Alexis López Martínez <edgarmlmp@gmail.com>
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <https://www.gnu.org/licenses/>.
+ ''')
self.about_dialog.show()
def analisis_lexico(self, button):