Giter VIP home page Giter VIP logo

compiler's Introduction

Consider a simple C-like language with

Data Type : character (char), and string (string)

Declaration statements can appear anywhere in the program and scope rules are to be maintained accordingly.

Assignments to the variables can be performed at the time of declaration at the beginning of the program. There is no separate Input, output statements.

Loop Constructs: only while loops are supported. There can be nested loops.

Relational operators supported in the loop construct are {>, <, >=, <=}

Arithmetic operators supported are {+, –, ++ and - -}, i.e. addition, subtraction, increment and decrement. Operations can be done on character       variables. Assignment operator `=’ is supported.

Only function is main(), there is no other function. The main() function may     contain arguments, but no return statements.

Part I – Construct a CFG for this language.

Part II – Write a lexical analyser to scan the stream of characters from a program written in the above language and generate stream of tokens.

Part III – Maintain a symbol table with appropriate data structures. The symbol table should also maintain the scope of each variable declared within the program.

Part IV – Write a top-down parser for this language (modules include left recursion removal, FIRST, FOLLOW, parsing table construction and parsing)

compiler's People

Contributors

skm2000 avatar rajarshiroychoudhury avatar

Watchers

James Cloos 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.