Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ansleysze/bracketpda

Simulate a PDA by final state in Python that accepts a string containing balanced brackets of different types. A valid string starts and ends with an exclamation point (!)
https://github.com/ansleysze/bracketpda

Last synced: 12 days ago
JSON representation

Simulate a PDA by final state in Python that accepts a string containing balanced brackets of different types. A valid string starts and ends with an exclamation point (!)

Awesome Lists containing this project

README

        

Created for a school project requirement

# BracketPDA
This Python project implements a Pushdown Automaton (PDA) to validate strings for balanced bracket sequences. The PDA simulates the behavior of a stack machine to check whether the brackets in a given string are properly balanced. Provide input strings when prompted. Make sure the input string starts and ends with an exclamation mark (!) .

The program should simulate the way a PDA would process strings. The PDA’s components (e.g. states, transitions, stack) should be represented through some methods or data structures in Python.
Debugged by Teodoro Cruz III

# Features

Validates strings for balanced bracket sequences.

Handles the following bracket types: (), [], {}, <>.

Handles nested brackets.

Provides detailed error messages for invalid strings.

Implemented using Python.