The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
+1 vote

I have one doubt regarding getting viable prefixes for a grammar.

Suppose I am given a grammar G which is told to be LR(0).I have observed, if I draw LR(0) DFA for it, and see if there is a path labeled $\gamma$ from initial state to some state of DFA, then $\gamma$ is a viable prefix.Is my understanding correct?

Sometimes, it is not told what the grammar is.?Like is it LR(0) or SLR(1) or LALR(1) or LR(1) or not LR(1).

Like below

In such cases, how Do i start making DFA? Do i first check directly for LR(1)? 

I want a good process to give me viable prefix in a reasonable amount of time and accurate answer.

Pleas help.


asked in Compiler Design by Boss (24.9k points) | 71 views

Please log in or register to answer this question.

Related questions

+2 votes
1 answer
asked Nov 12, 2016 in Compiler Design by KISHALAY DAS Active (4.9k points) | 1.1k views
+2 votes
1 answer
asked Dec 2, 2015 in Compiler Design by yes Active (1.2k points) | 847 views
+2 votes
1 answer
asked Jul 18, 2015 in Compiler Design by Suvam Chatterjee (437 points) | 829 views
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
49,781 questions
54,511 answers
75,107 users