 So, bottom of the parsing is the method where you start constructing the parse tree on the read nodes and then try to reduce the whole of the string to the start symbol. And if you succeed in that, then you say that the string belongs to the language that is specified by the language, by the dam. So, in this case you want to construct the parse tree from the input which is read nodes or another way to look at it is that if I say that w is a valid string in the language which is specified, then I should be able to somehow reduce w to the start symbol. That is another way of saying the same thing. So, let us look at grammar and then let us also, so here is a grammar where I have the start symbol s. So, here is a grammar where we have a start symbol and then corresponding to the production of non-terminal a, I have 2s and then I have 1 more 2 for p. And then here is a string I want to parse. So, let us take this grammar and try to see whether this string belongs to the language it is specified by the grammar. And how do we go about doing it? What we want to do is we want to reduce the string to the start symbol. So, what we will try to do is we will try to find out the sub-stream here which matches right hand side of a production and if it matches right hand side of a production then I am going to replace that by its left hand side and we will continue. And hope is that is this is a valid string in the language specified by this grammar then I should be able to reduce the whole thing even really to s. So, the first thing I do is I say that here is b which matches right hand side of a production which says a goes to b. So, I replace this by a and after reduction my string becomes, now this becomes now a sequential problem. Now, again I look through this and I find there is another b. So, I just go ahead and try to replace that by its left hand side and when I do that I get string like this. Now, let us again try to see if I can find a pattern on the right hand side. So, you notice something it is b matches now. So, b can match perhaps this right hand side and if I replace that by b what will happen? So, I am replacing this by b I reach here. Now, how do I proceed from this point? Can you find a pattern on the right hand side which in this string which matches right hand side of one of the productions. So, it appears that the choices I made took me to a situations where we said that this string actually to begin with does not belong to the language which is specified by this one. May I request everyone that from next class onwards either you reach here or sign. You know that there is a class at nine there is no reason to plan. I mean you know that you can plan everything five minutes earlier. Either reach here or time or don't come to this class. I mean it clearly disturbs we have a 15 minute class of which we have already spent seven minutes and keep last coming in and I am sure I mean next 10 minutes will keep on happening. I mean you know that there is a class at nine I mean I can't understand why you cannot come at nine. I mean if you wake up at 6.30 to wake up at 6.00 to wake up at 8.00 wake up five minutes before that you reach here at nine. I mean I don't see any problem in doing that. But this habitual habit of saying that if there is a class at nine I can always touch it to 9.10 if there is a class at 12. I can touch it to 12.10 if there is a class at 2.10 then I can touch it to 2.10 is just not an acceptable situation. So next class onwards make sure either you are here or time or you are not here. Alright so when we started making these choices. So at some point of time suppose I made slightly different choices. Then let's see what could have happened. So when I was so rather than going in this direction let me just keep this here and try to write the rest of the strings on this side and when I say that this reduction happens to A I am going through this situation. And now when I made this choice I was saying that match this B as the right hand side. Instead of that I made a different choice and I say make this match this ABC which is right hand side of a production and then replace it by ABC. So if I do that I am going to get a string like this. And now again if I look at right hand side pattern here which is B which matches right hand side of a production like this. This gives me B and I get a string like this and this matches now right hand side of the first production the whole thing. And therefore I reached the start center and therefore I can conclude that the string I started with is a valid string in the language. I can show it from this string are these steps but only problem which happened in this part was that at some point of time rather than making this as a choice of matching I made this as a choice. Now that's an issue. So the same thing like if you recall we were saying at some point of time when we were doing top down parsing that there were two issues which production to use and which non-terminal to expand. Here the issue is going to be which substring to match and if I have more than one choice then somehow I need to find a stronger method of doing this kind of production which will always identify that this is the right string and this is not the right string to match. So this is what going to be the part of building the bottom of parser that when we process this grammar somehow this information will be captured. So is this point clear that two different choices can lead to a situation which are entirely different from each other. So this is what is captured here but let me also simultaneously observe that if I look at this complete reduction and I also look at the rightmost derivation of the string starting from S then I actually am doing a derivation which is not leftmost but rightmost leftmost was what we did in top down and it gives me the same string and now if you see the steps here this actually is the rightmost derivation that means what I am doing is I am going in reverse of rightmost derivation. Now I will go into the proof of saying that if you are building a bottom of parser then the reduction has to be in the reverse of rightmost derivation that is a result you will have to take for granted and not to discuss the proof of that but this information somehow will be captured when we start constructing the parser for like this when we start constructing the bottom of parser for promise like this the bottom of parsers are really the reverse of rightmost derivation. Now these are also traditionally known as shift reduce parsers now shift reduce somehow I mean you can get this feeling that when you are talking of shift reduce parser you need to use a stat but basically what that means is that I can take any string and when I say that I am taking a string like this and I want to do a reduction conceptually I can see that the some parts I have seen and once I have seen some part then I am doing a reduction. So let us put some imaginary symbol in middle of a string and let me call it dot and then we say that two parts which are separated by the special symbol dot when we say that because I am doing now a reverse of rightmost derivation then the left hand side of dot is going to be a string of terminals and non-terminals and right part of what is on the right of the dot is always going to be a string of terminals. So look here what is happening if I say this is the derivation I am doing then first I derive this then from this D I derive this then from A I derive this and then from this A I derive this. So at any point of time what was happening that I was saying that I will be somewhere here and then I said that I am going to replace this then my dot must have been what I was just reducing here then this dot must have been here and then this dot must have been here. Now imagine that somehow this dot appeared in these positions in my string then what was going on? What was going on was that if you now see the right hand side of the dot you only have either a null which is the final state and you are going to have only a string of terminals here but what you have on the left hand side is a string of terminals and non-terminals. So basically one way to visualize this is my start state is that I will always start when I say that I am beginning this is where I started with that to begin with my dot will be here and then I say I will keep on shifting this dot along the string. So let me pick up another example and keep this example alive so that we can do this comparison but basically what we are doing here is that at any point of time if I say that this is the kind of configuration I have something like this. So what this configuration is telling you is that I have some string of terminals and non-terminals on left of dot and what I have on the right hand side are basically just a string of terminals. Now when I say that I have something called the shift action. Shift action says that the symbol which is immediately on the right of dot must be shifted to the left of dot. So my configuration after this is going to be something like this or if you are confusing W with the whole string let me just replace this by R. My configuration will be something like this and what will be reduce action? Reduce action is saying now see the example there that if you see something which is immediately on the left of dot and which is matching the right hand side of the production then we say that I am going to do a reduce action. So reduce action is saying that if this part of this starting from here matches right hand side of the production match that and replace it by left hand side. Now let me also sort of alert you that when you talk of bottom of parser bottom of parser is not as intuitive as the top down parser. In top down parser what you could see immediately was that you were starting from start symbol and by having a look ahead of one you were able to figure out which production you use. Bottom of parser to begin with will be slightly non-intuitive but as you get into it you will start getting the concept and you will get the definition. So be alert on this part that somehow you will find that this imaginary position of dot is going to create lot of confusion till we really give the definitions. So initially my input is that dot is on the left hand side of the string I am trying to match and what is the final position? Final position is going to be that on the right hand side of dot is going to be null and on the left hand side of dot is going to be start symbol. So my final position is going to be something like this which is here and initial position is going to be something here and then I have to see that what are the situations under which I do a shift and what are the situations under which I do a reduce. So for example I was in this case I said that do a reduce take it to be but when I shifted dot here then I was saying don't do a reduce here but keep on shifting and then do a reduce. So you have a choice between doing either a shift or doing a reduce, blank faces. I can see it is not making sense. So raise questions what is the problem, at least in this part we are not understanding. Magically how dot is shifting is that the sort of issue which is creating problem in everyone's mind? Do you mean the longest terminal is the longest I have not said anything. When we first reduce a in both the cases. On both the cases when the dot is on a on the right side of it. Dot is not on the right hand side of it. Dot is on the right side of b and then I said that whatever is on the left hand immediately left hand side starting from this position it matches and I reduce that to it. So either I could come here or come here. Now in the next step the dot will come on the right side of b. So dot will come here or dot will come here. So in the dump you reduce b to capital A and otherwise you again shift it so why not reduce there exactly. So question is that if I have a choice and the choice is saying that I do a shift or reduce one of the choices this led me to wrong confusion saying string does not belong to the language specified by the ground. But this choice made sense because I could reach my start somewhere. So my parsing method should make sure that I am always making the right choices. How did we decide that right choice? That is what the parsing method is going to be all about. So as I said right now there is some magic happening. Like we did in top down parsing we said we can use this in the production. Which rule? So I computed all these parsing and then I was able to pin down that if we choose this is the non-terminal expansion and if this is the look ahead symbol then use this rule. Similarly here we are saying that if dot is in certain position that means what I have seen on the left of dot and what I am going to see on the left of dot on the right of dot that is going to determine whether I have to do a shift or reduce and if I have to reduce then which rule I should use for reduction. If I can answer that then I have a parsing. Should we? Eventually we will have good somehow. But right now no. Right now I do not have a parsed table. Once I create a parsed table then I will not have to check everything. Then I will be able to deterministically say that take this action only one action. No background. So what is the first step? Sir in which B is getting reduced to A. This one? Here B was getting reduced to A and then? Sir are we shifting the dot in the step? Not shifting I mean reduction is one action shifting is another action. We are two separate actions. So when I said that my dot was here and I said that my dot was here dot will remain here. So what I have done is I found a pattern which is on the immediately left of dot and I found that pattern which is right hand side of production and I just replace that by its left hand side. Similarly when I found that on the left hand side of dot there is a pattern which matches a particular production then I just replace that and I kept the dot here. What I am not shown in between is that from this I must have done this shift before doing this production. So these are two separate actions I either do a shift or I do a reduce. So let's do one thing. Let me take an example. Take you through a full set of shift and reduce and then we come back to this answer. So shift reduce parsing is it will have two actions. Either I can do a shift which says move terminal symbol which is on the right hand side of dot production which says alpha dot p q r then after shift this is going to be alpha p dot q r. So p has been shifted on that dot dot and then I have a reduce action which says that if I match something which is on the left hand side of dot and this pattern matches right hand side of the production then I am going to reduce. So if this is the pattern I have which says alpha beta dot p q r and beta matches right hand side of the production then and the production is A going to beta then my configuration will be alpha A dot p q r. So this is what I reduce actions. So in this case I have reduced beta to A in this case I have shifted p to the left of dot. These are only two actions there is nothing else. So I keep on doing these mix of shift and reduce till I reach either the start symbol or analysis. So that I am in the exact state saying that this is a valid string and a state saying this is not a valid string. These are the only two conclusions I can get. So let's look at this example and try to pass this particular string. So again I will just try to work it out for you so that you can at least get a feel for what is going on. And what we have is we are trying to say that I have id star id plus id this is my start string and my dot is here and the grammar is on the top it says E goes to E plus E or E goes to E star E or E goes to I. So what I will do now is first I will do a shift so my action is shift which says that my string becomes of this configuration and then I will do a reduce because I find that immediately left of dot there is a pattern which message is right inside of the production so my reduce is my action saying that id gets converted into E and my configuration remains this. Now once again I do a shift action I say that E star dot id plus id is the configuration and then I do one more shift and this shift takes me to a configuration like this and then I do a reduce action which says that so let me underline whatever I am matching when I do a reduce action so here is an id before I went to reduce section here is one id which I will now do using a reduce action and then it takes me to something like this now I have a choice whether I want to shift or I say that E star E matches right inside of the production and therefore a reduce action so what I decided at this point of time is that let me do a reduce action I am not telling you why I am making this choice why I am reducing instead of shifting but let us assume that this is the action I take then what happens is this becomes my and then I shift once again and shift action gives me a streak like this and then I once again shift and this shift gives me this configuration and then I decide that I want to do a reduce and if I do a reduce this gives me plus E and then I want to do one more reduce action matching this which gives me now E dot and E is my start symbol dot is immediately on the right hand side so I say this is a valid string which I have identified to action of shift and reduce now you can also see in this case suppose when I have this choice of saying that rather than doing a reduce here I did a shift what would have happened would I have reached this state finally so let us write that what was the second alternative in this case when I was doing so let me say that I am in this state which is E start E dot plus I and rather than doing a reduction I do a shift if I do a shift what will happen I will get something like this one more shift and that takes me to this state now I do one reduce my deduction is now on this so this gives me this configuration then I do one reduce which is I match this as the right hand side and remember that matching I always want to do immediately starting on the dot position so I will not find a string like E star E and I will say I will match that but I will always find a string which is immediately on the starting from left so this will give me this reduction and then if I now do a reduce that gives me E dot why would I have reached the same conclusion whether I did a shift or I did a reduce you almost have an idea perhaps that why this would have like two the wrong things and this is the right set of steps I do so is the second set of steps correct or the first set of steps correct and why because of precedence you find that if I am trying to if I know that this is multiplication and this is addition then this has higher precedence and I want to make sure that this gets evaluated first before this and therefore if I follow this sequence then I am doing things in right order if I follow this sequence and I will say this is a valid string but I will be doing computations in some wrong steps and therefore I will be really pinched at the time of port generation that I will say that my port is intact so I somehow need to take care of all my precedence and associativities also while specifying my grammars and so here is what we have just gone through that finally I reached this E dot step and I said this is accept and now now trick here is as I said that when I start with this string when to do a shift when to do a reduce and then which will be used for reduce if I can answer that then another part and my whole algorithm is going to be based on what equivalent to if I try to look at top down parts and equal to saying the first 10 follow set computation I will do some pre-processing here I will do some similar computations and try to take this error and encode it before parts level so that I can always deterministically take that action which will tell me that better I am doing shift per reduce is it beginning to sink in now that means somewhat low clear than when we started with so continuing on shift reduce parsing now let us also start simultaneously start talking about the implementation so whatever is on the left of dot I can keep that on the stack and whatever is on the right of dot that can be by input state and dot really is nothing but the input point that is also telling you what is your look ahead so look ahead is going to be the symbol which is immediately on the right hand side of the dot if that is the first thing you will see in your input ok and top of stack is always corresponding to this dot and shift pushes a symbol which is a terminal symbol on the stack and what does reduce do reduce really takes something which is immediately after the dot or left of dot which means which is on top of that which matches right hand side of the production and if it matches right hand side of the production what action do I take I am going to pop all those symbols and I am going to push the left hand side this is what I am doing here that when I say that E plus E matches right hand side of sorry sorry production I am going to pop these three symbols on the stack and I am going to push E on the stack that is what my reduce action is so this is what we do and the most important issue we want to raise here is when do we want to shift and when do we want to do a reduction ok so reduce action should be only done when we know that and this is where now let's start thinking about the first example idea that there was a situation when I was doing a reduce action on B reducing that to A and that led to a block saying I cannot proceed and I came to a conclusion saying that this is a wrong swing but if I did the right set of reduce actions then I was able to reach the left hand side ok which is the start symbol so therefore we are saying that reduce action I should take only if the reduction is going to take me somehow to the start symbol if it is a valid swing in the language it is not a valid swing and it doesn't matter it will never take me to the start so this is somehow is this is a fact which needs to be captured somehow when I start creating my parser ok so let's look at some of the properties of bottom of parser before we go any further ok one that this is more powerful parsing technique as compared to the top down parser ok and this class of grammars is known as lr grammars it is more expensive than ll1 or equivalent ll and when I say expensive expensive in terms of creating the parser ok I have to put in more effort to create the parser table parser table also is going to be larger is going to occupy more space ok as far as parsing itself is concerned that is going to be still the linear I will not do any back cutting ok so it's more expensive than ll1 and therefore from tradeoff point of view you can see that it can not only handle left recursive grammars but it can handle almost all programming languages ok and therefore this also remains a method of choice for creating parser for most programming languages and also it is a natural expression for writing the programming syntax so for example when I had these left recursive grammars like e going to e plus e or e ok my top down parser was not able to handle that and I had to rewrite my grammars into this form ok so let me just write this form you can see that if you read this grammar ok it's not very natural to figure out that what we are talking about are part of the expression grammar if I read this I can immediately figure out what I am talking about ok so this is a much more natural way of expressing a language than this kind of notation which is non-left recursive ok because top down bottom parsers can handle left recursive grammars that will not be an issue for them ok also there are tools available in fact the first tools which are made first automatic parser generators were made for bottom up parsers so yak is a prime example which was perhaps the first tool for bottom up parser also another interesting thing is that when it comes to Arabic language bottom up parsers guarantee that it will never do a wrong shift or reduce the class of bottom parsers which will immediately catch an error as soon as we encounter rather than saying discard certain symbols the error will become the method we looked at in this case we immediately be able to pin that down ok and therefore it will always lead to better error rate of view ok so these are some of the properties ok but as we go along you will find that we will be able to then look at these properties and these properties will just stand out as we consider the parser but it is also simultaneously look at what are the issues I am facing bottom up parser ok so the first question which you have not answered is that is when to shift and when to reduce ok so in this case I was doing a use and in this case I was doing a shift I should be able to clearly answer that and then I should also be able to say that which production I want to use for reduction because there may be situations where I may have more than one right hand side matching of a production ok so sometimes I can have this reduction which says x goes to that silent can always be done ok but we do not want to do that ok so this question needs to be answered very clearly ok and sometimes parser can reduce in different ways like here ok it can reduce in different ways so what we have to remember here is that if I take back ok so look at it this way so let me just explain this point and then because then I am doing this example I will go on that side this is an important example which is an example for us so suppose this is my stack ok it has lot of semblance now when I say that I am matching right hand side of the production so this is top of my stack ok I can say this matches right hand side of the production and this matches right hand side of the production ok my grammar can have such patterns that means somewhere I will say that if my stack is containing some string delta which is a string of terminals and non terminals I want to divide this into two parts ok and this really is in one case this is a division in another case this is a division ok so what is the right kind of division ok this my parser needs to answer so this basically saying that suppose I say that delta is my stack configuration and input symbol is a then shift obviously will give me delta ok but when I say reduce reduction can happen that I can either take this part which matches right hand side of the production or I can take this part which matches right hand side of the production and this my parser will have to figure ok so what we start doing now is that how do we keep track of what is the length of this if I say that I can have a combination of alpha and beta and multiple combinations then how do I keep that length of this ok whether this is the right size or this is the right size so what we start doing now is we will start giving some definitions so that at least we start making the parser so after raising all these issues let me give the first definition ok and that is what I call as handle and handle is handle is something which has two properties handle is right hand side of the production if I now look at this ok so what I was really doing was I was matching this id ok I was matching this id then I was matching e star e so handle is something a string that matches right hand side of the production and the second part which is more important is that if I replace this right hand side of the production that is going to give me a step within the reverse of right most derivation ok so unless these two conditions are satisfied something cannot be designated as handle so this was precisely the problem if you recall that first situation I had first situation was I started with this and I said this matches and I replace this by left hand side and then I erroneously said I am going to replace this by it is left hand side ok so it matches right hand side of a pattern but if I look at the reverse of right most derivation then this replacement was not giving me the reverse of right most derivation and therefore this was the wrong choice ok and therefore now if I want to define my shift use pattern in terms of handle I can say keep on identifying handle and keep on replacing handle by it is left hand side if I keep on doing that because I am moving now what is the handle now this is saying it is going to give me a step in the reverse of right most derivation so eventually it will lead me to the start so ok now today I am things do not seem to be the least see if something is not clear you need to raise a question because I mean I can make out from your faces that you are not understanding but I do not know what is it that is not clear unless you ask a question I will have no clue of what is not so this right most derivation is the expected right most derivation of this field there is nothing like expected right most derivation there is a right most derivation of this field so there is a unique pathway from S to W but we do not know that from I mean before we start passing we do not know that so how can we say that that the replacement goes not I am not saying I am just giving a definition not giving you a method is there is a method so somehow this information will have to be captured in the method that each time I do a reduction somehow that is going to lead to a reverse of right most a reverse step in the right most derivation yes sir suppose in that previous example the input string had been id plus id star id id plus id star id then I come to the same rules we would have taken id plus id to be an expression and then it is multiplication with the reverse version but that would have to fight the laws of equations as well what? so let us look at this so if this is this is string you are saying what will I do what I will do is I will start from here I will shift this and then I will do a reduce then I will shift this then I will do a reduce and then I will do either a shift continue to shift this and then shift this to a reduce then replace this and replace this which one is that sir so you tell me which is right I have multiple choices here right so one of them is wrong so that means this grammar is not in a form where I can generate strings without any problem and what is the problem here so what is the problem when I had more than one leftmost derivations what was the problem called ambiguity so I have the same problem here so in bottom up classes it is not that I do not have ambiguous grammars this actually is an ambiguous grammar so I want to make sure that my grammar is ambiguous and therefore I wrote that e goes to e plus b my grammar is in a form where it is not ambiguous whether I do a leftmost derivation or a rightmost derivation but my grammar is ambiguous then I can always come up with more than one past but that is not taking many ways right so I need to make sure that in case of ambiguous grammars I somehow define in my parser saying that this has higher precedence than this and therefore when I had this choice of doing a shift or reduce then I make the right choice and say that no do not do a reduce do a shift first and then do reduction that would have resolved the problem so the problem was something like this suppose my configuration at some point of time was this this would have been the configuration after some time now I have a choice saying that either I do a reduce or I do a shift but because I define somewhere that this has higher precedence than this so this is all in favor of a shift and a shift would have left to situation like this and then if I do a reduction here there is a right reduction how can I do so you do not give precedence in the grammar you use some tool to give a precedence otherwise I said the method should be rewrite the grammar so that you do not have ambiguity it will always be only one leftmost derivation or only one rightmost derivation and therefore I am writing my grammar all the time which is in this form this grammar is not ambiguous this will always give you only one leftmost or one rightmost derivation but if I write grammar like this then in grammar I cannot write it but if I use a tool then I will be able to and we said that these have same associativities and this has higher precedence than this this is part of a tool not part of grammar but grammar is ambiguous so the best method I said was write the grammar which are unambiguous this is the first thing we talked about when we discussed last how did you say that the second period used to reverse it was not because it was not the right side no it was right inside the production but it was not in the reverse of rightmost derivation I showed you the rightmost derivation shall I go back there shall I go back to that file once again so this is the rightmost derivation and if I just start doing reverse of rightmost derivation if I reduce this B to A then that will not give me a stack here but if I do this reduction that is giving me a stack here just A A B so this is the reduction this is the derivation this is the rightmost derivation what is the rightmost derivation or here we do no in this case there is only one rightmost derivation it is not a question of correct rightmost derivation look at this can you find any other rightmost derivation this is basically a top down derivation this is not top down derivation this right the derivation we find out the string from the start symbol then we say that this is the rightmost derivation and we check here whether something is in the reverse of this no please don't confuse between the method and the method so I am saying that if I remember this stack that whenever I do a reduction action or I do a shift action that should lead me to reverse of rightmost derivation does not mean that I first do a rightmost derivation and check it I can always device a method where I can take this grammar and when I convert this into a tabular form this fact is captured there how do we write derivation we check it through derivation no we did not check it through derivation please because I have not shown you how to construct the pass table when I construct the pass table this fact somehow will be captured in the pass table that what is the right handle see ultimately what I have to do is so let me go back to the last point what I was just showing handle so here we are saying that a string that matches right hand side of a production and whose replacement gives a step in the rightmost derivation that means if I can have a method which is capturing this information into identifying a handle then the job is done then I don't have to worry about rightmost derivation so somehow this becomes part of the whole construction of the parser not when parser is actually parsing the string yes sorry if I start the dot from the right hand side then it will be wait wait wait it is not that I mean you can start dot from the right hand side or in the middle or anything there is a matter and we always scan our input from left to right so I am not scanning my input from right to left so you cannot start from an arbitrary place wait wait wait you are going into a territory which you have neither discussed or for which we don't even have proofs so it is not symmetric I mean look at it this way that I define the concept of a look ahead symbol and I was reading it left to right now can I say the same thing about reading from right to left and say that rather than look ahead symbol I have a tail symbol so the symmetry does not apply there so let's stick to the method and not say that I can put dot anywhere arbitrary and if I start from there then you can say that why go through this parsing method I am talking about a specific parsing method there are other parsing methods which will not even worry about dot which will give you all possible pass tables and which will say that doesn't ambiguity is not an issue because I use n cube algorithms and give you all possible parsers there are parsers like that but we want to discuss a parser which in a single pass in linear time will give me whether a string belongs to the language or not so I am discussing that method I am not talking about any parsing method in the world I am talking about a specific parsing method which is a bottom up parser which falls in the class of LR so there is a parser called early parser which gives you all possible parsers in terms of number of symbols when parser runs not when parser is constructed when parser runs because it is giving you all possible parsers so if you keep doing that type and you keep on saying this is a possibility here is another possibility so natural languages where you do not have such clean interpretation of the presidents and associatives they may have depending on the context they may have different associative programming languages we don't so let's do one thing I think we will have to do it in two passes let's move slightly ahead and then keep coming back till this issue gets completely resolved because if we get stuck at a point we may not be able to at this point of time if it is not clear at least by taking an example it will become somewhat clear bottom up parsing LR parsing you know always is an issue when it takes time to sink in then it will be fine with it so let's look at what a handle is and what we are saying is that if I say that I am doing a rightmost derivation what that handle means is that if s in a step of rightmost derivation takes me to a configuration which is alpha Iw and then one step of rightmost derivation says that since w is a string of only terminals and a is the first non terminal on the right hand side and there is a production which says a goes to beta then alpha aw gives me alpha b alpha beta w so this is the rightmost derivation and the reverse of rightmost derivation will be that I look at beta and replace it by a that in the reverse side so in this case we say that beta is a handle so beta is not a handle arbitrarily but beta is a handle only if such a step is possible in the rightmost derivation so for example here b is this b is a handle but this b is not a handle so it is not that something matches right hand side becomes a handle but it should also fulfill this property that it should give me this step so let us take a break here today I will just finish this so what we want to do is we want to reduce only handle and not any right hand side and then what is handle puny handle puny is saying that if beta is a handle and a going to beta is a production then replace beta by a and rightmost derivation in reverse can be obtained by just by handle puny so the question now is in a bottom of parser how do I identify handle because if I can identify handle then my job is done so whole construction of bottom of parser is through handle puny and by method of identifying handle so that is something we will start discussing tomorrow and then by this weekend we will be able to finish at least one version of bottom of parser so let us break here today and then we can go over the second problem