Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lexer_fdfattor_2025-1.0.0.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lexer_fdfattor_2025-1.0.0-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

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

Hashes for lexer_fdfattor_2025-1.0.0.tar.gz
Algorithm Hash digest
SHA256 6e772c995f6c0888656160a352215246159e3b07cce29ce303d15731565291b7
MD5 da2a3af5fb54b5a422f2193eb2c445bc
BLAKE2b-256 54e09aef0fb9b7e90bd86ad94953eb037c0adc7caf75802257cdbfb95d0497ef

See more details on using hashes here.

File details

Details for the file lexer_fdfattor_2025-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for lexer_fdfattor_2025-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 107ae40625d378760c3b1634a3f75fc80375ae098ddaed94626eb95980664c38
MD5 1885d3aa72dfbe119564ddb97f9a3ad1
BLAKE2b-256 73d1aa10219d5b483bdc20147c6fc866252bf7afe69e58d8e588be7eb8970133

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page