Skip to content

Latest commit

 

History

History
65 lines (40 loc) · 2.11 KB

README.md

File metadata and controls

65 lines (40 loc) · 2.11 KB

CFGI-Interpreter-GUI

The project is for a context-free grammar interpreter. The interpreter takes as input a context-free grammar and a string to parse and gives an output whether the test string is either accepted or rejected. The program is implemented in a GUI, using Python.

cfgi

Program Overview

It consists of three files. One is for setting context free grammar and parsing string and another is for setting up UI layout and last one is for setting button signal and slots to use context free grammar interpreter. The below code is developed in Python language.

Demo

image

image

Presentation on Youtube

Watch the video

Example

Context Free Grammar

  • S → aaaaS|A|B|C
  • S → D|E|ɛ
  • A → m|AC
  • A → aB|c|D
  • A → aa
  • B → ae|BE|ɛ|azz
  • B → Cd
  • C → i|D
  • C → u|ɛ|o
  • D → n|E|t|at
  • D → y|ɛ
  • E → j|r|D|F
  • E → CBF
  • F → lolF|h|g
  • F → d|kkk

Derivation Trees

Strings are accepted by grammar:

  • minji

image image

Strings are not accepted by grammar:

  • car: The grammar cannot produce ‘ar’

image

Built with

License

This project is licensed under the MIT License