- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to convert FA to Right Linear Regular Grammar?
A grammar with at most one variable at the right side of production is called linear grammar.
Right Linear Grammar
A grammar is right linear grammar where all the non terminals in the right hand sides are at the right end.
Algorithm for conversion
The algorithm to convert the finite automata (FA) to the right linear grammar is as follows −
Step 1 − Begin the process from the start state.
Step 2 − Repeat the process for each state.
Step 3 − Write the production as the output followed by the state on which the transition is going.
Step 4 − And at last, add € (epsilon) to end the derivation.
Let’s consider a Finite automaton (FA) as given below −
Pick the start state A and output is on symbol ‘a’ going to state B
Now we will pick state B and then we will go on each output
Final right linear grammar is as follows −
Start with state A which is an initial state the output on symbol ‘a’ goes to A and B and the output on symbol ‘b’ goes to A. Now the production rule of right linear grammar is −
Now pick state B and then go on each output the right linear grammar is −
The final right linear grammar for the given finite automata is −
- How to convert right linear grammar to left linear grammar?
- How to convert left linear grammar to right linear grammar?
- How to convert FA to Left Linear Grammar in TOC?
- Explain about left linear regular grammar in TOC
- Explain about right linear regular grammars in TOC
- How to convert context free grammar to push down automata?
- How to convert Regular expression to Finite Automata?
- Convert the given Context free grammar to CNF
- What are the restrictions of regular grammar?
- How can we convert subqueries to RIGHT JOIN?
- How to convert the finite automata into regular expressions?
- How to Convert Perl Compatible Regular Expressions (PCRE) into Lua
- Explain Arden’s theorem to convert DFA to Regular Expression
- How to generate the language for context free grammar?
- How to handle right-to-left and left-to-right swipe gestures on Android?