Question: Ex: C code with preprocessor directives: Expanded code:Store the array information in an array table. Use the following data structure for array table:Parse each line
Ex:
C code with preprocessor directives:
Expanded code:Store the array information in an array table. Use the following data structure for array table:Parse each line of the source code that contains a directive, and store the tokens in the parse table in the following format:You may declare the Array Table and Parse Table as global.Preprocessor variables Pdot, Psum, Paver must be declared in a header file named Pheader. h The header file must have the following contents:int Pdot;int Psum;int Paver;
Your preprocessor will do the following:Finally, write a shell script with the name P that takes the name of a C code as command line argument and generates expanded.c as output.
Ex:
P myCprog.c
You must use gee compiler in Linux environment. Prior to project submission, you must make sure that your project executes correctly with the specified setting. Projects producing errors during the demonstrations due to the differences in the platform will not be accepted.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
