Answer:
The C programming language distinguishes character constants from string constants by
using single quotation marks for characters and double quotation marks for strings. Thus,
'c' is the character c, while "c" is a string of length 1 consisting of the single character c.
Why do you think this distinction is made? Is it useful?
(b) Python, on the other hand, uses double quotation marks for both characters and strings
(thus, "c" is either a character or string, depending on context). Discuss the advantages and
disadvantages of these two approaches.
6.3 Discuss the pros and cons of ignoring or requiring “white space” (i.e., blanks, end-of-lines, and
tabs) when recognizing tokens.
6.4 Many programming languages (like C) do not allow nested comments. Why is this requirement
made? Modula-2 and a few other languages do allow nested comments. Why is this useful?
6.5 (a) Describe the strings that are represented by the regular expression:
[0-9]+((E|e)(\+|\-)?[0-9]+)?
(b) Write a regular expression for C identifiers consisting of letters, digits, and the underscore
character ‘_’, and starting with a letter or underscore.
Explanation: