Lexer - TP1 de Sintaxis
Project description
TP1 Sintaxis - Analizador Léxico
Trabajo práctico de análisis léxico con autómatas finitos deterministas.
Instalación
# Instalar desde GitHub
pip install git+https://github.com/FDFattor/tp1-sintaxis-2025.git
# Instalar versión específica
pip install git+https://github.com/FDFattor/tp1-sintaxis-2025.git@v1.0.0
Uso
# Forma recomendada - Solo importar la función pública
from source import lexer
# Analizar código
codigo = "program ejemplo var x : int begin x = 5; end"
tokens = lexer(codigo)
print(tokens)
# También funciona (pero menos recomendado)
import source
tokens = source.lexer("program test var x : int")
print(tokens)
Tokens soportados
- Palabras reservadas:
program,var,int,bool,true,false,begin,end,if,else,not,and,or,goto,let - Operadores:
<=,>=,<>,==,<,>,=,+,-,* - Delimitadores:
(,),;,:,.,... - Identificadores y números
Desarrollo
# Clonar y configurar
git clone https://github.com/FDFattor/tp1-sintaxis-2025.git
cd tp1-sintaxis-2025
python -m venv .venv
source .venv/bin/activate # En Windows: .venv\Scripts\activate
# Instalar en modo desarrollo
pip install -e .
# Ejecutar tests
python -m pytest tests.py
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lexer_fdfattor_2025-1.0.0.tar.gz.
File metadata
- Download URL: lexer_fdfattor_2025-1.0.0.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e772c995f6c0888656160a352215246159e3b07cce29ce303d15731565291b7
|
|
| MD5 |
da2a3af5fb54b5a422f2193eb2c445bc
|
|
| BLAKE2b-256 |
54e09aef0fb9b7e90bd86ad94953eb037c0adc7caf75802257cdbfb95d0497ef
|
File details
Details for the file lexer_fdfattor_2025-1.0.0-py3-none-any.whl.
File metadata
- Download URL: lexer_fdfattor_2025-1.0.0-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
107ae40625d378760c3b1634a3f75fc80375ae098ddaed94626eb95980664c38
|
|
| MD5 |
1885d3aa72dfbe119564ddb97f9a3ad1
|
|
| BLAKE2b-256 |
73d1aa10219d5b483bdc20147c6fc866252bf7afe69e58d8e588be7eb8970133
|