GithubHelp home page GithubHelp logo

suraj44 / compiler-design Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 1.0 593 KB

A miniature compiler for a subset of the C programming language

C++ 4.75% Lex 34.36% C 28.00% Yacc 32.68% Shell 0.20%
compiler-design

compiler-design's People

Contributors

darshandv avatar mahirjain25 avatar suraj44 avatar

Watchers

 avatar

Forkers

darshandv

compiler-design's Issues

Lots of tokens left to be identified

  • Constants in dec, hexa, things like 1L and 1e10 etc

  • Check if ordering of the rules is correct

  • Identify errors, like for example if a multiline comment is opened, is there a corresponding close, if there are additional close comments (*/)for the same open comment. If there's a semicolon at the end of a #include <stdio.h> for example

  • Work on integrating the symbol table in main() using a different file called symboltable.h

need to check if variable is declared in outer scopes

Consider :

#include <stdio.h>

int main()
{   char b,c,d;
    //int b;

    if(1) {
        int a;
        b = a;
        //func();
    }
}

Current logic only checks if b was declared in its current scope
But what needs to actually happen is, it needs to go to current_scope->parent recursively till it goes to scope 0 to look for an instance of b.
The change needs to be made in parser.y in the logic corresponding to the production id: IDENTIFIER

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.