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

  Differences of absorption and variable costing

Discuss the advantages and disadvantages of absorption and marginal costing and what factors organisations are required to consider when using each of these methods

  Analyze the nature and purpose of budgeting

Analyze the nature and purpose of budgeting, the stages involved in the preparation of budgets, identifying separately the roles of managers and the budget committee. *Please answer it according to the marks and make it at least 750 words and above.

  Need c++ solution to cover the final stage of euro 2012

From Group Fase to elimination fases, it´s not the user who defines teams, because that must be made automatically according to classification in group fase - considering regulations.

  Write a program that asks the user for a positive integer

Write a program that asks the user for a positive integer N and generates the Nth Fibonacci number.

  Write C program to calculate the amount of fines to be paid

M1H324645 Engineering Computing Assignment, National University of Science & Technology - College of Engineering - Sultanate of Oman

  Program to translates letter grade into number grade

In C++ (should be able to compile in Visual Studio 2010): Write a program to translates letter grade into number grade. Letter grades are A,B,C,D and F, possibly followed by a + or -.

  Print each employee''s identification number

1) in a program you need to store the identification numbers of 10 employees (as ints) and their weekly gross pay (as doubles) A) Define two arrays that may be used in parallel to store the 10 employee indentificcation numbers and gross pay amounts B..

  Write a value-returning function arraymaximum()

Write a C++ program that uses a two dimensional array, testgrades[][], for 10 students and scores from 5 tests.

  Should i now make or buy

I am required to carefully state any assumptions I have made in making my decisions. The solution needs to contain elaborative description along with reference details please

  Write a program that asks the user to enter an integer

Write a program that asks the user to enter an integer between 1 and 15. If the number entered is outside that range, your program should print out an error message and re-prompt for another number.

  Prepare a new test table with at least two distinct test

Prepare a new test table with at least 2 distinct test cases listing inputand expected output for the code you created after step 2.

  What is the relationship between inodes and vnodes

What is the relationship between inodes and vnodes - In a multi-level indexed file system that has 1K blocks what is the maximum file size if the i-nodes contain 8 direct entries, one single and one double indirect entry each?

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