GithubHelp home page GithubHelp logo

grammar's Issues

Conversion to proper CFG

A proper CFG has the following properties:

  • No unreachable symbols

  • No unproductive symbols

  • No epslon productions

  • No cyles

To get a proper grammar we must implement the following methods:

  • Remove unproductive symbols

  • Remove unreachable

  • Remove epslon productions

  • Remove cycles (simple productions)

We need to apply the above methods in the following order:

  1. Remove epslon productions

  2. Remove useless symbols

    1. Remove unproductive
    2. Remove unreachable
  3. Remove simple productions

Factor

  • Check if the the CGF is factored

  • Check if it can be factored in n steps

Create GUI

The user must be able to:

  • Edit CFGs (via text)

  • Show the intermediary grammars for the proper grammar conversion (without useless symbols etc.)

Grammar properties

Make functions to check the followin properties.

  • Infinite

  • Empty

  • Finite

Left recursion

  • Check if there is left recursion

  • Identify left recursion (direct or indirect)

  • Identify non-terminals that have left recursion

  • Eliminate left recursions

First

First and FirstNT methods.

FirstNT is the same as First, but with the terminal symbols filtered out.

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.