Smart India Hackathon

Team Members:

  • Pulkit Goyal (14bcs036)
  • Vijay Krishnavanshi (14bcs056)
  • Rushal Verma (14bcs042)
  • Mohit Bajoria (14bcs030)
  • Lavee Singh (14bcs027)
  • Shirisha Kasarla (14bcs022)
  • Ministry Category: Ministry of Atomic Energy​
  • Problem Statement: Programming Guideline checker for C programs
  • Problem Code: DAE15
  • Team Leader Name: Pulkit Goyal

About Problem

Idea Description

We will be making a command line checker using open source Python language which will parse the C/ C++ code and will show the possible runtimes error which may occur in the code. The program will be 100% accurate and will not report any false positives. Few examples of how we will deal with the problem are:

  • We will be mapping variable names to their types in dictionaries (also known as hash tables) and this will ensure further operations on that variable don't result in errors such as unsafe type conversions, bitwise operations on signed data types.

  • Since each statement in C language ends with `;`, it will easy for us to determine what a statement is and will help in checking statement level errors like ones which evaluate differently from left to right and right to left.

  • The program will track loops and conditional statements, in a stack like data structure which will help us to know about the scopes.

Technology Stack

We will using an open source, beautiful and elegant programming language Python.

Use Case

The program will be a command line program which will have following functionality:

  • Each of the check will be given a certain name to ease the process.
  • Users will have to specify the name of the C file on the command line.
  • There can be a lot of checks so the user can even specify the checks he want to run using command line flag or mentioning a file which contains that information.
  • By default the program will print the output on command line but user can print that to another file using a command line flag.
  • The output which will be given by the program will be detailed and clear so that user can easily debug.
  • Program will also have a command which will show help about how to run, something like `Cchecker help`.
  • Program can also output the errors in Machine Readable format such as json, xml using flags which can later feeded to another program to fix the errors.
  • A lot of other flags will also be there like just mentioning the name of the directory, keeping record of errors, suggesting fixes, actually fixing etc.

Dependencies

Our program will use Python 2.7 and newer (even Python 3.6 which was released about a month ago.)

Show Stopper

$ python

>>> print None

None

Made with Slides.com