Code Monkey home page Code Monkey logo

cfgi-interpreter-gui's Introduction

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

cfgi-interpreter-gui's People

Contributors

minji-mia avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.