Skip to content

XerckM/Python-Lexer-and-Parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Lexer and Parser

Welcome to the Python Lexer and Parser repository! This project is dedicated to creating a lexer and parser for a mini-language using Python, without relying on external libraries like 're'.

Overview

This repository contains a custom lexer and parser designed to interpret a simplified programming language. The project is implemented in Python 3.10, leveraging the match case feature. It's an excellent resource for learning about lexical analysis and parsing in compiler design.

Features

  • Custom Lexer: A lexer that tokenizes input based on predefined rules, without using regular expressions.
  • Custom Parser: A parser that analyzes the tokenized input to understand its structure and syntax.
  • Mini-Language Syntax: A defined syntax for a mini-language, including basic programming constructs like variables, conditionals, and loops.
  • Error Handling: Custom error handling to manage illegal characters and syntax errors.
  • Example Programs: Sample programs in the mini-language to demonstrate the lexer and parser in action.

Installation and Usage

  1. Clone the repository to your local machine.
  2. Ensure you have Python 3.10 installed.
  3. Navigate to the 'Python Mini-Language' directory.
  4. Run main.py to execute the lexer and parser on the provided examples.

Contributing

Contributions to the Python Lexer and Parser are welcome! Feel free to fork the repository, make changes, and submit pull requests. If you have ideas for new features or improvements, don't hesitate to open an issue.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Custom lexer and parser designed to interpret a simplified programming language written in Python.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published