Intérprete del leguaje Lox en Python3
Lox language interpreter in Python3
Ver/ Abrir
Identificadores
URI: https://hdl.handle.net/10902/30046Registro completo
Mostrar el registro completo DCAutoría
Río Ruiz, Eduardo delFecha
2023-07Director/es
Derechos
Attribution-NonCommercial-NoDerivatives 4.0 International
Disponible después de
2028-07-07
Palabras clave
Intérprete
Parser
Lexer
Lox
Python3
Interpreter
Resumen/Abstract
En este trabajo de fin de grado se propuso crear un intérprete para el lenguaje Lox, tal como se explica en el libro «Crafting Interpreters» de Robert Nystrom. El objetivo es que esta implementación se utilice en la asignatura «Lenguajes de programación».
Se llevó a cabo esta implementación en Python, sin librerías adicionales, realizando las siguientes tareas:
• presentar especificaciones de los tokens e implementación mediante expresiones regulares
• generar una gramática libre de contexto para el lenguaje Lox que sea adecuada para un analizador recursivo descendente
• programar un intérprete, basado en el recorrido del árbol de derivación
• diseñar una batería de tests para comprobar la validez de la implementación.
El diseño ha sido modificado para centrarse en la adquisición de conceptos y la sencillez del código a programar.
In this work, we proposed to create an interpreter for the Lox language, as explained in the book ”Crafting Interpreters” by Robert Nystrom. The objective is that this implementation will be used in the subject ”Programming Languages”.
It was carried out using Python, without additional libraries, by performing the following tasks:
• present token specifications and implementation using regular expressions.
• generate a context-free grammar for the Lox language that is suitable for a downstream recursive parser
• to program an interpreter, based on the path of the derivation tree
• design a battery of tests to check the validity of the implementation.
The design has been modified to focus on concept acquisition and simplicity of the code to be programmed.