S → abS S → a is which grammara)Right Linear Grammarb)Left L...
grammars in which all of the rules contain only one non-terminal on the left-hand side, and where in every case that non-terminal is the first symbol are called right Linear.
View all questions of this test
S → abS S → a is which grammara)Right Linear Grammarb)Left L...
Understanding Right Linear Grammar
Right linear grammar is a type of formal grammar where all production rules have a specific structure. Let's break down the given grammar to understand why it qualifies as right linear.
Grammar Rules Analysis
- The provided grammar consists of two production rules:
- S → abS
- S → a
- In right linear grammar, production rules can be represented as:
- A → xB or A → x, where A and B are non-terminal symbols, and x is a string of terminal symbols.
- In this case:
- The rule S → abS has the form of A → xB (S is followed by S, which is a non-terminal).
- The rule S → a fits the form A → x, where 'a' is a terminal.
Why It’s Right Linear?
- Since both production rules adhere to the definition of right linear grammar:
- The non-terminal (S) appears only on the right side of the production.
- There are no production rules where the non-terminal appears on the left side, which would indicate it is a left linear grammar.
Conclusion
- Since the grammar only uses right linear production rules, it is classified as a right linear grammar.
Thus, the correct answer to the question is option 'A' – Right Linear Grammar.