Question: Please answer ALL questions or none at all. Thank you in advance. 7. Write a program in your favorite scripting language to remove comments from

Please answer ALL questions or none at all. Thank you in advance.

7. Write a program in your favorite scripting language to remove comments from programs in the calculator language

8. The Unix make utility allows the programmer to specify dependencies among the separately compiled pieces of a program. If file A depends on file B and file B is modified, make deduces that A must be recompiled, in case any of the changes to B would affect the code produced for A. How accurate is this sort of dependence management? Under what circumstances will it lead to unnecessary work? Under what circumstances will it fail to recompile something that needs to be recompiled?

9. (a) Describe in English the language defined by the regular expression a*(b a* b a*)*. Your description should be a high-level characterizationone that would still make sense if we were using a different regular expression for the same language.

(b) Write an unambiguous context-free grammar that generates the same language.

(c) Using your grammar from part (b), give a canonical (right-most) derivation of the string b a a b a a a b b.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!