SYNTAX ANALYSIS
ROLE OF THE PARSER
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
Regular expression (a|b)* denotes
|
One or more occurrences of a or b
|
|
One or more occurrences of a and b
|
|
Zero or more occurrences of a or b
|
|
Zero or more occurrences of a and b
|
Explanation:
Detailed explanation-1: -a*b* corresponds to the set of strings consisting of zero or more a’s followed by zero or more b’s. a*b+a* corresponds to the set of strings consisting of zero or more a’s followed by one or more b’s followed by zero or more a’s.
Detailed explanation-2: -A regular expression followed by a question mark ( ? ) matches zero or one occurrence of the one-character regular expression. So to match any series of zero or more characters, use “ . * “.
Detailed explanation-3: -Solution: As we know, any number of a’s means a* any number of b’s means b*, any number of c’s means c*. Since as given in problem statement, b’s appear after a’s and c’s appear after b’s. So the regular expression could be: R = a* b* c*
There is 1 question to complete.