search
Log In
2 votes
196 views
what is viable prefix in compiler??
in Compiler Design 196 views

1 Answer

2 votes

The set of prefixes of right sentential forms that can appear on the stack of a shift-reduce parser are called viable prefixes. An equivalent definition of a viable prefixis that it is a prefix of right sentential form that does not continue past the right end of the rightmost handle of that sentential form

Link: https://en.wikipedia.org/wiki/Viable_prefix

0
Please give some example
1

@Bikram sir confirm this,

right sentential form viable prefix
E e,E
E+T e,E,E+,E+T
E+F e,E,E+,E+F
E+id e,E,E+,E+id
T+id e,T
T*F+id e,T,T*,T*F
T*id+id e,T,T*,T*id
F*id+id e,F,
id*id+id e,id
0
correct, viable prefix also includes handles..

Related questions

0 votes
1 answer
1
218 views
S → aSbS /bSaS / ϵ S → aABb A→ c/ ϵ B → d/ ϵ Which of the following is LL1. Explain in details.
asked Jun 1, 2019 in Compiler Design Hirak 218 views
0 votes
0 answers
2
156 views
why do first sets can have epsilon symbol but follow sets don’t? P.S: I’ve a silly doubt :P
asked May 12, 2019 in Compiler Design aditi19 156 views
0 votes
1 answer
3
398 views
Predictive parser and non recursive parser are same or non recursive parser is a type of predictive parser. If sure then answer.
asked Dec 9, 2018 in Compiler Design Nivedita Singh 398 views
0 votes
0 answers
4
88 views
what is sequence order of solving LR(K) grammar, if the question is asking about SLR, CLR, LALR? what is sequence after solving SLR(1) (assume till now grammar is not SLR(1)), then proceed for LALR/CLR DFA???
asked Dec 3, 2018 in Compiler Design Hira Thakur 88 views
...