2 votes 2 votes SET OF VIABLE PREFIXES FOR A GIVEN SLR(1) GRAMMAR IS REGULAR LANGUAGE ? Compiler Design compiler-design parsing lr-parser viable-prefix + – Ankit Chourasiya asked Sep 9, 2015 retagged Jun 17, 2022 by Lakshman Bhaiya Ankit Chourasiya 1.4k views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
1 votes 1 votes Importance of Viable Prefixes: 1 ) The entire SLR parsing algorithm is based on the idea that the LR(0) automaton can recognize viable prefixes and reduce them appropriately. 2 ) Equivalently, this means that the set of viable prefixes for a given SLR (1) grammar is a regular language! reference : https://cse.iitkgp.ac.in/~bivasm/notes/scribe/11CS30001.pdf shivam001 answered Jan 5, 2020 shivam001 comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes True I feel it set of viable prefixes of any grammar is regular as we can create a NFA to recognize them ANI answered Sep 9, 2015 ANI comment Share Follow See all 4 Comments See all 4 4 Comments reply Ankit Chourasiya commented Sep 9, 2015 reply Follow Share yes it is true but can you give me one example. 0 votes 0 votes ANI commented Sep 9, 2015 reply Follow Share sorry i never did it. but i had seen it is sum what similar to SLR parsing where we shift the "." from left to right on seeing apropriate symbol but here even ∊ moves are allowed. i got no idea of it don't worry i am sure sirs and others gonna help you here . 0 votes 0 votes Ankit Chourasiya commented Sep 9, 2015 reply Follow Share ANI do you know LIVE VARIABLE concept i mean to say is how to analysis variable is live or dead. 0 votes 0 votes ANI commented Sep 10, 2015 reply Follow Share a variable x is said to be live if there is any statement that uses value of x next to that statement or x is in RHS of any statement as a function or determinant . if x is not refered in the next statement the liveness will be unaltered . if betwn two statement S and S' x is not assinged the value assigned value as any assingment would kill its present value 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes Yes. From dragon book "For every grammar G, the GOTO function of the canonical collection of sets of items defines a DFA that recognizes viable prefixes of G" lowOnATP answered Oct 6, 2015 lowOnATP comment Share Follow See all 0 reply Please log in or register to add a comment.