Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xfranme/translator-listas
A programming language translator made from scratch.
https://github.com/xfranme/translator-listas
cplusplus grammar-parser lexical-parser theory-of-computation translation
Last synced: about 1 month ago
JSON representation
A programming language translator made from scratch.
- Host: GitHub
- URL: https://github.com/xfranme/translator-listas
- Owner: xFranMe
- Created: 2024-12-04T09:48:48.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2024-12-04T11:11:10.000Z (about 1 month ago)
- Last Synced: 2024-12-04T11:34:42.788Z (about 1 month ago)
- Topics: cplusplus, grammar-parser, lexical-parser, theory-of-computation, translation
- Language: Yacc
- Homepage:
- Size: 18.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Translator - LISTAS
:warning: Except for this README file, the rest of the documentation (internal and [external](https://github.com/xFranMe/translator-LISTAS/blob/main/Doc_TranslatorLISTAS.pdf)) is written in Spanish.
## What is this
This proyect consists in the development of a translator whose target is to translate a made up programming language called "LISTAS" to C++. This provides a way to run code using custom directives.
## How to run the translator
The translator can be run using the "make" command. It requires one parameter, referenced as "ficheroEntrada", which is the input file that contains the LISTAS directives we want to execute. That file must have the extension ".list". As output, we will obtain a new file named as the input one but with ".cpp" extension.
Command line example: `make ficheroEntrada=input.list`
## Input files
Three input files are provided to test the translator:
* **entrada.list**: contains basic directives.
* **errores.list**: contains directives that cover all possible semantic errors and most of the syntatic ones.
* **entradaAmpliacion.list**: contains only conditional statements, testing nesting.## System requirements
The syntax parser (lists.y) uses the function `freopen (“/dev/tty”, “a”, stdout)`. This function is used to restore the standard output stream to the system terminal after having previously performed a redirection of this stream. This functions works as intended in GNU/Linux systems, environment used to work on the development. However, on other systems it may not work properly.