Write a lexical analyzer which reads a c- program

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

Write a lexical analyzer which reads a C- program, strips off comments (denoted by/* comments */), and generates four symbol tablets.

1. The KEYWORD table includes all keywords defined in Louden). Each keyword is associated with an index. You may combine the special symbols into the Keyword table. You may hardcode them.

Keyword Index
Else 1
If 2
int 3

2. The INDENTIFIER table includes all the user-defined identifiers. The table is similar to the keyword table except that it contains identifiers. Each identifier has its unique index.

3. The NUMBER table includes all integers and floats used in the program.

Num index attribute
60 1 integer
3.75 2 float

4. The TOKEN table includes all the tokens in the order that they are generated. The table should include the following information:

Token class index
Int kw 3
Gcd id 1
3.75 num 2

5. For the Regular Grammar for the tokens, refer to the Lexical Conventions of C- (Louden1). The input to your program is the example in Louden3 including the comments. Your program should strips off the comments.

6. The output from the program should include the program with comments stripped off. And all the tables mentioned above.

7. Please do file i/o, i.e. read the data from a file and send output to a file.

Attachment:- Attachments.rar

Reference no: EM131391155

Questions Cloud

Convert the program to a recirculating shift register : Download your design of part (c) to an FPGA IC. Discuss your observations of the q output LEDs with your instructor as you demonstrate the recirculating shift-right operation. Use a debounced switch for n_cp. (The DE-2 has debounced pushbuttons.)
Enzymes responsible for human digestion : What are the various organs and enzymes responsible for human digestion?
What are the stages of protein folding : How the structure of a protein is related to its function and what are the stages of protein folding?
What are the different parts of a plant : What are the different parts of a plant? How can each of the part be taken care?
Write a lexical analyzer which reads a c- program : Write a lexical analyzer which reads a C- program, strips off comments (denoted by/* comments */), and generates four symbol tablets.
Conditions the free energy change for the hydrolysis : Under standard conditions the free energy change for the hydrolysis of ATP is - 31 kJ/mol. What is the actual free-energy change for the reaction at 37oC and pH 7.0, where the concentrations of ATP, ADP and Pi are 8.8 mM, 1.3 mM and 5.5 mM, respec..
Confers a heterozygote advantage : Make up a new allele that confers a heterozygote advantage. State what happens when people are homozygous in both dominant and recessive states.
Treatment to some equipment : You want to give an ILD treatment to some equipment. You may use _____________.
Essay form and at least word scientific content : In essay form and at least 300 word Scientific content (accuracy; fact-supported; clarity; relevancy; paraphrased, i.e. no quotations). there has to be 6 or more in-text citations.

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