Implement symbol table

Assignment Help C/C++ Programming
Reference no: EM133141578

Question:

Project you are going to generate code in C language.

How the code generation takes place.

B. You will also implement symbol table. I am uploading a small write up on symbol table. Also I did explain it in the class how symbol table works

C. After symbol table implementation, your compiler can catch errors.

Implement catching at least 3 errors - for example using undeclared variable, type mismtach etc etc.

Submit all the files .....Y, .c files (.c and .h written by you and npot generated by bison or flex)

Finally, signup to demo your project. I will ask the grader to prepare a signup sheet on google.

Please read the following before you run the program

1. List of files
================

Filename Description
--------------------------------------------------------------------------------------------------------------------
lexer.l => code for lexical analyzer
semantic.y => code for semantic analysis

types.h => C header (interface) for type checking
types.c => C source for type checking

symbol_table.h => C header (interface) for symbol table
symbol_table.c => C source for symbol table

makefile => a make file for compiling the sources

Tests/test_success => test for success case
Tests/test_error => test for error case

2. Running the parser
=======================

Fire the following commands from terminal:

make

Optionally, you can build the source by executing

bison -d parser.y // generates parser.tab.c and parser.tab.h for use in lexer.l
flex lexer.l // this creates a lex.yy.c file

gcc parser.tab.c lex.yy.c symbol_table.c hash_table.c -o parser // links lex.yy.c, symbol_table.c and hash_table.c to parser.tab.c and generates a parser

You can then run the parser as follows:

./parser

Alternatively, run the scanner with given test cases:
make test_success // for success case
make test_error // for error case

3. NOTES
========

The program is designed using Flex 2.5.35 and bison 3.0.2 on Ubuntu 14.04 machine.

To install both flex and bison run:

sudo apt-get install flex
sudo apt-get install bison

N0te: Need help on part A. not able to generate C code. B & C working fine.

Attachment:- Symbol table-Compiler Design.rar

Reference no: EM133141578

Questions Cloud

What factors facilitate self-empowerment : What factors facilitate self-empowerment? What factors hinder self-empowerment? How can seniors use the Health Belief Model to empower themselves
Ted talk intern : Select a TED Talk video relevant to the business course you are currently enrolled in and/or your internship assignment.
Effect or pareto analysis in a case study : Explain the problem, and how the company uses the model to solve the problem and the result they got
Explain the function of warehouse clubs : 3. Explain the function of warehouse clubs (BJs, Costco, SAMs, etc.). Why are they classified as both wholesalers and retailers?
Implement symbol table : Implement symbol table - Implement catching at least 3 errors - for example using undeclared variable, type mismtach etc etc
Types of quality audits and outline steps for planning : Discuss the different types of quality audits and Outline the steps for planning, conducting, and reporting an audit.
About the importance of audience analysis : You learned about the importance of audience analysis when making a presentation.
Discuss whether information presented : Discuss whether the information presented would be contain correct information needed for acquiring resources requested in the proposal.
Aware of performance expectations gap : The company is aware of a "performance expectations gap" in an area of concern to their stakeholders but they lack a clear understanding of the problem.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd