 We want to now use an external stack for simulation. And then we have a parse table. And the grammar is encoded in the table of form. And then what we did was we started looking at how this parser works. We actually took an example. And we took an example of parse table in the grammar. Before that, we did certain transformations on the grammar. And the parse table actually is indexed by non-terminals and terminals of the language. And for each of the combinations of non-terminals and terminals, we determine what is the action to be taken and that action is encoded in the table itself. And this is the grammar to begin with. This is the expression grammar from which we have removed the left recursion. And then this is how the table looks for the non-letters in law. So what this table is saying is that I have this indexing on non-terminals and indexing on terminals. Dollar is a special symbol, which sits at the end of the input string and at the bottom of the stack. And what we want to say is that if this is a symbol on top of the stack, and this is my lookahead symbol, then expand using this rule. And all the entries corresponding to these rules, they are corresponding to expansion and all the entries corresponding to the blanks. They have error states, which say that if this is my top of stack symbol and this is my lookahead, then input string is incorrect. We cannot do parsing from that point. And then we looked at the parsing algorithm. So parsing algorithm bars that whenever we have a situation where we can do expansion, that means top of the stack is a non-terminal and lookahead symbol is obviously a terminal, then I'll expand this rule. And when I say I expand by this rule, what that means is that I'm going to pop this symbol from the stack and I'm going to push the right hand side of the rule in the reverse order on the stack. And whenever top of stack is going to be a terminal symbol and it matches the input symbol, then I'm going to advance the input by one. I'm going to discard what is in the top of the stack. And if both bottom of the stack and the lookahead symbol, they have dollar, then we stop saying that this string has been accepted, otherwise this is an error state. So this is what my parsing does, that we match top of the stack. If it is dollar, then we halt. If it is terminal, then we pop and implement input point by one. And if it is non-terminal, then I must expand by a rule. And when I expand by this rule, what that means is I'm popping X from the stack and I'm pushing UVW in reverse order on the stack. And otherwise I'm going to go into an error state. So this is what we were discussing in the previous class. And then we took an example of saying that if this is my initial condition and this is the string I'm trying to parse, then how do I go about doing it? And we go about doing it by saying that my initial condition is dollar is sitting at the bottom of the stack. Then this is the start symbol and this is the string to be parsed, which is an input of dollar. And when I say that top of stack is E and my look ahead is ID, then I go and look at. So let me take this parse table and then we look at EID which says pop E from the stack and push, TE prime in the reverse order on the stack. So those of you who miss this part, please go back and study this part. And what we are going to do now is that once we know what the algorithm is, then we want to construct. So we went through this example completely and we finally reached a state where we came to a hot state where top of stack was dollar, input is dollar, etc. This is where the parsing terminates. So next task in front of us is that now we want to construct the parse table. So there are two parts, so let me go back to the parser once again. And here we said that this is the parser, we have discussed this algorithm. And this parse table which is encoding off this grammar into a table or form like this, this is what you want to understand now. That how we are going to take this grammar and convert this into a table. Is it making sense or you want me to take another extra class and repeat everything what we did in the previous class? So we will then move on from this part. Okay, so what we are going to do now is let's take this grammar. Which is this grammar and then see how do I convert this grammar into a table or form. So this is my grammar which I'll keep using. So let me just write it as I go through this set of slides. So e prime is going to plus e prime or epsilon and then t is going to f t prime and t prime is going to power f t prime or epsilon. And f is going to bracket an expression of i t, this is what my grammar is. And what we'll start doing is we'll start analyzing this grammar. And then we will come to somehow see that this grammar can be actually rewritten into a form like this which will help me doing the parser. That is the part which is immediately in front of us. So how do we start doing it? So first thing we start in looking at was, we said we are going to define what we know as a set of first symbols. Now I'm also going to define another set of symbols which I call as follow symbols. And then I will define how do I compute first and follow sets. But basically what this means is that if I say that there is some start symbol which is s which is deriving w which is a string in my language. And then some other symbols let's say a which is a non-terminal which derives this part of the string. Now I say that since a derives this symbol and obviously this is a string of terminals. Let me say that the first symbol that can occur any derivation starting from a that I'm going to call as the first symbol. And whatever is the symbol which can come into a string which is or which come immediately after the string which is derived from a that I'm going to call as follow symbol. And what we need to do is we need to compute for all the non-terminals here the first and the follow sets. And once I compute this then I'll show you that using that information how I'm going to put this information in a tabular form so that I can then do parking from that point on this. So that is the task in front of us. How do we compute first set and how do we compute follow sets? So let's start by computing the first sets. So I'll keep this definition in front of you and then slowly I will try to develop the algorithm for this. Now this is that if I start any derivation from a non-terminal then let me just find out what are the possible sets of or what is the possible set of terminal symbols which can come. So let's look at this. If I start a derivation from E then what are the possible terminal symbols which can come into a string which can be derived from E. Now how many rules do I have for E? Only one rule which says E goes to T prime. That means if I'm trying to compute first of E then since T comes in the beginning it must be same as first of T cannot be anything else. And therefore we say that this is first of T and if I now look at productions of T there is only one production corresponding to T which says T goes to F T prime. Which means that any string which can be derived from T must start from something which is in first of F. Cannot be anything else. And therefore we say that this is going to be same as first of F. And then if I look at first of F what are the terminal symbols which can come in the beginning of any derivation starting from F. Left parenthesis and id. These are the only two symbols which can come into any string which can be derived from F. So therefore I say that this is nothing but left parenthesis and id. So first of E first of T and first of F they are the same and this is the set. Now what about first of E prime? So I am doing this computation for all the non-terminal thing my ground. So if I say first of E prime, sorry so let me first compute first of E prime let me go in that order. So if I look at first of E prime how many productions do I have for E prime? Two productions. So this says E prime goes to plus T prime or this says E prime goes to X prime. So what are the symbols which can come into any string which can be derived from E prime? So basically this is nothing but plus and epsilon. Now this I will discuss in little more detail. Because how do I get epsilon here? This is slightly tricky. What this means is that E prime can derive epsilon. So the way to interpret this is that E prime when I say that E prime plus is in the first of E prime what that means is that if I start deriving from strings which start with E prime then string must begin with plus but E prime can also derive epsilon. Now when I say it can derive epsilon I have to look now slightly more general. So suppose I say I have a situation like this which says A1 goes to X1, X2 or to say Xn. And I am trying to compute first of A. Now what is first of A? First of A first of X1. So now you have already got it. So it is first of X1 but if X1 derives epsilon suppose I have a production of this form it says X1 derives epsilon. Then it is possible that in some derivation I can say A derives X1, X2 up to this and then I say X1 derives epsilon and then anything which is beginning with X2 can also be part of this. So therefore we do not say that first of A is equal to first of X1 but what we say is first of A contains X1 except but if first of X1 contains epsilon which means I have this production then it also contains. So I will now take a union it contains first of X2 and now it is possible that I have a production of this form which says X2 also goes to epsilon that is possible. So then I will say this contains first of X2 except epsilon and I will keep on doing this. And if all of first of X1, first of X2 and first of Xn all of them contain epsilon in the first symbol then I will say that A can therefore derive epsilon and therefore epsilon is also containing first of A. So this is the logic I am using here that first of E prime contains plus and epsilon and if I now look at first of T prime, what is first of T prime? Star and epsilon. I have only two productions T prime going to star of T prime and T prime going to epsilon. So now it will be, so this is what my first X are for all the non-terminals in the language. Now let us get on to computation of the follow sets. So let me keep this figure because that is going to give you some hints of how I am going through the computation of the follow set. So suppose S is my star symbol and I say that S is deriving any string in the language I have. Yes, W is any string in the language which can be derived from S as is the star symbol in my grammar. Then what is containing follow of S? Look at this figure. Now what are the symbols which can follow W? Because that will be follow of S. I introduced a special symbol remember. So dollar always is in follow of S. That is why I introduced dollar. We do not want to worry about end of string and so on. And we are saying that always we are saying by putting a special symbol here dollar is in follow of S. That is the first definition. That is the first initiation or first initialization. So always take the star symbol of your grammar and say that dollar is in follow of that star symbol. And remember that since you are doing the top down parsing, we will start from top down and keep on computing all these follow sets. Now let me look at patterns. So my first tool is dollar is in follow of S. Now suppose I have a pattern like this. A goes to suppose I have a pattern like this. And I want to compute the follow of B. Then what is follow of B? Follow of B contains beta. Follow of B contains beta. Beta is a string of terminals and non-terminal. It contains first of beta. So follow of B. If beta goes to epsilon, then follow of B also contains first follow of A. So we will come to that later. First thing we are saying is that follow of B contains first of beta except epsilon. See in follow sets epsilon is trivial. I mean after any symbol you can just put an epsilon there and say this is in follow of. So I can purely put any number of epsilon. And therefore you will notice that follow sets actually do not contain epsilon. The first which contains epsilon is because it can derive epsilon. So if I have a pattern like this, then I will say follow of B contains first of beta except epsilon. Everyone agrees with this? Everyone is comfortable with this? Next pattern. It was just brought out. If I have a pattern like this and beta derives epsilon. Then what will happen? I will now say that follow of B contains whatever is in follow of B. And I can have only one more pattern. The pattern is if I say A goes to alpha B, where B is another number. Then again the same rule will apply and I will say that follow of B contains everything in follow of A. So it is A which is deriving alpha B. So my pattern is something like this. A derives alpha B. And this is therefore this was my initialization. So I started with the start symbol. Then I am going down in the tree. Follow of A will contain follow of B. From the context. We can derive something like this. So follow of B contains. Can you think of any other pattern? Actually I have taken care of all the pattern where non-terminal occurs at the end. Non-terminal occurs in the middle. Where epsilon is not followed by the non-terminal or non-terminal occurs in the middle. And epsilon is followed by this non-terminal. There is no other pattern I can think of. So using this and exactly what I am writing here is derived from just this figure. If you can conceptually understand what this figure is saying. Then these rules are nothing but just a conversion of what we are seeing in this video. So now a trick. And that trick is that if you see rule number 3 and rule number 4. Here I am defining following terms of following. And therefore what may happen is that I compute one follow set. And then I look at another rule which again is going to change the follow set. This is a recursive definition. So what may happen is that if I keep on computing this. I must recompute it again. Because it is possible that depending upon the order of the rules I pick up. These follow sets can change. And I must recompute follow sets using rule number 3 and 4. So long as I cannot really add anything new. But can I go into infinite loop because of this. I can keep on computing and I never stop. Is that possible? Yes, no. So look at this context. Every time what is it that I am doing? I am adding something. I am never removing anything from the follow set. I am only adding. And then if I add something and how many terminal symbols I can have in my grammar. Is that known? There is not a bound on that. So is it monotonic function? If it is monotonic then you know that it will converge. So I do not have to worry about saying that I can keep on computing this. And I may never terminate. So either I am adding something or I am keeping it constant. But since I know if I keep on adding I can only reach the maximum number of non-terminals. And therefore I have to stop there. So let us compute now follow sets of same grammar. And let us compute the follow sets. Let me do one thing. Let me remove this screen and let me just do the computation of the same grammar. And then construct the pass table right away. Because once I compute first the follow set and converting this into a pass table is straight forward. So let me write all the symbols here. And symbols are E, E prime, T, C prime, left. And if I apply rule number one. So what I am going to do is I have written the four rules here. And I keep on applying them again and again. So if I apply the first rule. First rule says E is my start symbol and therefore dollar is in follow. That is what the first rule is saying. Nothing. Second rule says now look at patterns where a non-terminal occurs somewhere in the middle. So I am now looking at this pattern. Where I say that T occurs somewhere. It has a symbol which is on the right hand side. And using this rule when I apply rule number two. I will say that everything in first of E prime except epsilon is in follow of T. That is what this rule says. So let us look at first of E prime which I have already computed here. Which is plus and epsilon. So follow of T will contain plus. Remember everything except epsilon. What about this? Here there is again a non-terminal. But this pattern is same so it is not going to add anything. Now what about this? I will say that follow of F contains everything in first of T prime except epsilon. Now what is first of T prime? First of T prime is star epsilon. So follow of F will contain star. And this pattern does not give me anything new. This is the same pattern. And what about this? Follow of E will contain right parenthesis. So follow of E will also contain right parenthesis. This applies the third rule. And third rule says, so just mechanically go about applying these rules. And third rule says that look for patterns where B occurs or a non-terminal occurs somewhere in the middle. But the right hand side of the non-terminal is epsilon. So if I apply the third rule this says this one, this pattern. This says E prime goes to epsilon. So first of, follow of T will contain everything in follow of E. So follow of T will contain everything in follow of E which is dollar and right parenthesis. I have already computed follow of E. And that is where you see the problem starts coming. That I will have to go over and over again. Because one follow is defined in terms of another problem. And if I look at this, this says follow of T because E prime derives epsilon. Therefore follow of T will contain everything in follow of E prime. So follow of T will contain everything in follow of E prime which is empty so far. So it does not get anything added. What about this? This says follow of F will contain everything in follow of T. Because T prime is deriving epsilon. So what is follow of T plus dollar right parenthesis. So follow of F will contain plus dollar right parenthesis. And what about this one? This one says because T prime derives epsilon. Therefore follow of F will contain everything in follow of T prime which does not add anything. What about this? Can I apply this rule on this pattern? No. No. Because this is not none. What about this? This is not a non-terminal. So I stop. Now I apply rule number 4. And in rule number 4, I am looking at patterns where I say that a non-terminal is in the rightmost position. So here is a non-terminal which is in rightmost position. So follow of E prime will contain everything in follow of E. So this will be dollar right parenthesis. And here it says follow of E prime contains everything in follow of E prime. It is trivial. Follow of T prime contains everything in follow of T. So this will contain now plus dollar right parenthesis. And this one says follow of T prime contains follow of T prime does not add anything. Here I do not have any non-terminal on the right function. So I stop. Now this rule number 3 and 4 have to be applied again and again to recompose. Still I know that I cannot add anything more to the set. So it is application of the rules clear what we are doing here. Now let me simultaneously start making the part here. So my past table remember that it was indexed by the symbols which were E, E prime, T, T prime, S which were my non-terminal symbols. And then it was also indexed by all the terminal symbols. So what are my terminal symbols? Terminal symbols in this case are id plus star left parenthesis, right parenthesis and dollar which is something I have introduced. So I have plus star left parenthesis, right parenthesis id and then dollar. So now what we say is that because we are saying that E goes to id. Now what that means is really that look at all possible patterns. Look at all possible rules and if I have a rule like this which says E goes to alpha. Then what this means is that if I now have a table and I look at A and first of alpha. So I am looking at corresponding to this rule. I am looking at an entry in the table which corresponds to this non-terminal and anything first of alpha. What should be the entry in the table corresponding to this entry? All I am saying here is that what is the entry corresponding to? This saying that if I, this is top of my stack and this is the look ahead symbol. Then what should I do? Did I have using this particular rule? So corresponding to this entry in the parse table corresponding to this non-terminal and for all first of alpha except epsilon use this rule for derivation. So when I start using this rule what it says is that if I look at first of E. First of E contains left parenthesis and id. So E goes to TE prime is the rule here because all I am saying is that corresponding to this and left parenthesis this rule I have. Now this also telling you something very interesting and that interesting thing is that all valid strings in this language must start either from id or from left parenthesis. They cannot start from either plus or multiplication of right parenthesis. That will be all. E prime says that all valid strings which can be derived from E prime must start with plus. So forget about epsilon productions for the time. So this says that if I now look at first of this that is plus. So E prime and plus is going to give me a rule which says E prime goes to plus E prime. What about this rule? This says T goes to F T prime and what is first of F? First of F is left parenthesis and id. So corresponding to T I will say that T id is going to T goes to F T prime and left parenthesis is here. So this says T goes to. What about this rule? This says T prime goes to star F T prime. That means whenever I see star and this is the non-terminal then I can use this rule. So this says T prime and star is here. So this is T prime goes to star F T prime. So just align this. This is roughly here. This corresponds to plus. This corresponds to left parenthesis and so on. So if I look at this rule which says F goes to bracketed expression then what do I do? What rule do I use? And what is the entry I am making here? So corresponding to F and left parenthesis I will say F goes to bracketed expression and corresponding to F id I say F goes to I. So just by looking at the first set I can make these entries in my past table. I don't want to do anything else. Is this clear? Now let's come to epsilon productions. How it says that somewhere E prime goes to epsilon. I don't have any entry because there is a rule. Possibly there will be an entry corresponding to E prime going to epsilon. Now what are the situations under which the concept will be now visualized. So I am not giving you algorithm. Algorithm I can describe much later. Conceptually if you can understand that will be much clear. So what are the situations under which E prime goes to an epsilon? So look at a situation like this. Again from the derivation point of view that if I say somewhere A goes to so let me slightly redraw this figure and little more space. So somewhere I have a situation like this. A goes to let's say some alpha and let's say E prime and then E prime goes to epsilon and alpha is something. What are the situations under which I will use this production which says that E prime goes to epsilon? No other production is working. That's too vague. Because when you say no other production is working what that means is that I can make those entries only when I am parsing this thing. But I make parsed table before I start the parser. Before I start the processing of parser. Goes to id. E prime can never go to id. There is no room. Right? So if I encounter id and the terminal symbol is E prime not terminal symbol is E prime then I will use epsilon. But in input I will see only terminal symbols. I will never see any non-terminal symbols. No. I write E prime and I saw id. Then I will use E prime. But that's another. You said something. What are you saying? So when I see a symbol in follow of E prime then I know that I can just throw E prime reduce it to epsilon because that's a valid entry. Remember that I talked about sentential forms. I am saying that what are the possible all possible innovations which can happen from this. So I must all the time have valid sentential forms. So therefore in any valid sentential form I am capturing this information either by first or follow sets. So now I am saying that in case E prime goes to epsilon then look at follow set of E prime. And in that entry so I say that if I have an entry like this A prime going to epsilon then look at entry corresponding to this and follow off and that entry is going to be. Can you see this? What is happening here? So this is all I need to do. That's why I computed follow sets. So now if I see that I have a production which says E prime goes to epsilon let me look at what is the follow set of E prime. And if I say follow set of E prime is dollar like parenthesis then I say corresponding to this E prime goes to epsilon and E prime goes to epsilon. Because these are the two symbols which are in follow of E prime. Similarly I will say I have a production which says E prime goes to epsilon. So I look at follow set of E prime and I say that corresponding to plus so where is E prime corresponding to plus I will say E prime going to epsilon corresponding to right parenthesis E prime going to epsilon and corresponding to right parenthesis corresponding to dollar E prime going to epsilon. See I did not take you through next level of application of three and four. I mean that you can do. But basically this is the logic I use for construction of the past case. And this is really what I have done. I started with this grammar. Then I computed my first sets. I compute my follow sets and I encode this first and follow information. This tells you all value substantial forms which can come in this language and rest of it can be just tagged as an error state. Because anything else will say that this is not a value substantial form and therefore should be discarded. It should be flagged as an error state. Questions? Anything else? If something is not clear ask me now. So just by pre-processing this information computing first and follow sets and everything comes from just this figure. Really there is nothing else. If you can just remember this that I deriving this particular string and part of it derived from A and here is first and here is follow then everything can be just visualized and everything can be encoded from this. Now let me come to a different situation. Now suppose you encounter a situation where somewhere, so let's take this particular set. Now you encounter a situation where you say that top of my stack is replying. My input is star. What does that mean? It's an error, right? Still flagging error. But then what will you do beyond that? Will you stop the process of parsing and say your input is incorrect or will you do something more? You said recover, right? So we were saying that at some point of time it's not sufficient to say that I have an error but it is what is required is that I should recover from that error and should do more parsing and find more and more error. Now what does recovery mean? I've got into a situation where I say that my input is let's say star and my top of stack is replying. This is my input pointer, this is my stack pointer and parser says I have reached an error state, right? So how will parser continue from here? Has reached an error state? How do I continue? I can continue only by if I reach one of these entries. Now how can I reach one of these entries? I must manipulate my stack and input to reach one of these entries. So first attempt, okay? Suppose I say I know that this input is incorrect. So look at this. Suppose I'm trying to parse clear up a little more space. Suppose I'm trying to parse p plus star i. Now I'm not trying to guess the intention of the user. I'm not trying to guess because I already know this is incorrect. And by guessing I may create more mess. But I want to find more and more errors. There's no guarantee that I'll be able to give all right errors. But suppose I say id has been consumed plus has been consumed then I see star here. What I was expecting was something else. I could either have got an id here or I could have got a left parenthesis here. So if I discard this input and I reach this, can I continue parsing? I can, right? So what is the general principle therefore? What are the symbols I have on this card? Till you hit a symbol which is in first off, e-time. So if I say that my top of stack is e-time and I have reached an error state, I say start discarding symbols. Till you hit a symbol which is in first off the non-terminal which is on top of stack and then I'll find an entry corresponding to that in the pass table and hopefully I'll be able to continue parsing from there. That is one step. So is that it? By discarding part of the input I can continue parsing. So another way, so if I pick up an example from programming languages. So suppose I have statement one followed by semi-colon statement two followed by semi-colon statement three statement four, okay? Now suppose, or let me say there is a semi-colon here but let's say this statement was something like this, okay? And I found that something is missing here, okay? Then what makes me look at this is let me discard this input, okay? And when I hit here, okay? Then hopefully I'll be able to continue parsing from that one, okay? Now remember that when we talk of error recovery there is no hard and fast tool which you say that I'll be able to recover from this error because it is possible that the idea of recovery I may actually discard more errors, okay? And in some situation worst cases I may reach end of the program, okay? But this strategy is telling me that at least there is a hope that I'll be able to recover from this and continue parsing, okay? So first strategy we use is that if top of stack symbol is A then discard input till I hit something which is in first of A and then try to continue parsing from there. That is one, okay? Can somebody suggest me? One more strategy, please? So another strategy is continue discarding input till you hit a symbol which is in follow-off A and then pop A and try to continue parsing from there. So these are the two strategies which are used and this is also known as panic mode error recovery where we say that I will either discard some symbols. Now can I keep that as part of my parsed level? What are the symbols? Because I know the first and follow-offs, right? So I can always compute that if I'm using now follow-offs, okay? I can say I know follow-off E and what are the symbols which are in follow-off E? Follow-off E contains trite parenthesis and dollar. So let me say I call that as a sync symbol. So I'm saying if I get into error state then I can sync on this and syncing on this means that keep looking for symbol which is in the sync set then pop this symbol and continue parsing from there. Works, okay? So these are the two strategies which are commonly used. The other strategies people have worked on so there is a lot of literature which may be available if you see where you will find that people will try to guess intent of the user and will try to correct but that's really the dangerous area and not many compilers try to do that, okay? And therefore the common error recovery mode that is used is that first you try to find a symbol which is in first off top of stack discard everything up to that symbol from the input try to continue parsing and the second strategy is look for a symbol which is in follow-off what is on top of stack pop this symbol and try to continue parsing from there. That's all about top-down parsing. So now we know how the parser works now we know how to take a grammar modify the grammar to remove all kind of recursion from that convert that into a parse table and how to do error recovery what more do we want? there is nothing else we need to talk about so let me now quickly take you through this slide size sort of discarded and then so in the slides you will find the same thing what we have discussed here and I will just take you through that so it will give you little more structure than what I was discussing in the book alright so first I compute first x so we say that x is a terminal if it's a terminal symbol then first of x is t value x and if there is a production of this form then we say epsilon is in first of x and if I have a situation which says x goes to y1 to yk and each of y1 is yi is included in first of x epsilon and if all of the yi's contain epsilon then we say that first of x also contains epsilon so this is what we did in the computation of first set and this is what I just computed that first of e, t and f is left parenthesis and id and first of e prime and first of t prime are these sets and then we computed follow sets so we said dollar is in follow of s which is the start symbol and then I looked at various patterns which says a goes to alpha b beta a goes to alpha beta and it goes to alpha b beta where first of beta contains epsilon and then we computed follow sets and for the same grammar this is the follow set we come out with and once we have these follow sets we construct parts table and what do we say that for all rules of this form a goes to alpha we say that if a is in first of alpha then I am going to include it here and for all symbols if epsilon is in first of a then I am going to use b here which is in follow of a and any grammar which has a pass table without any multiple entries is also called l l 1 grammar so in this case my look ahead is one so this is another test which is used that you actually construct a pass table and see whether you have multiple entries for some grammars you will not be able to construct a pass table with only single entries in each set so a grammar whose pass table has no multiple entries is also known as l l 1 and these are the various generators which are available to us which are top down parsers antler is one very popular parser but then there is l l jn l l next jn and then you can search on that so there is something called a tiny parser generator y parser generator slk and so on so these are all top down parsers which are available to us error handling if we stop at the first error and just give an error message that may be very friendly to us as compiler writer definitely is not something which is desirable from the user's point of view so we must do error recovery and every compiler actually recovers from errors and tries to identify as many errors as possible so panic mode so I will straight away take you to what I discussed you can read rest of it there are many methods of doing error recovery so nobody actually will try to do correction except some compilers where you say that anything can be compiled like plc had a compiler where they were saying doesn't matter what you write they will try to always compile it by guessing your intentions was not very successful so error recovery the way it works in ll1 parser we have just discussed error circuit when you have a pass table entry which is empty and so skip symbols in the input until you see a selected set of tokens which is in sync set and what are these tokens I can either place symbols which are in follow of a in the sync set then skip terminals until you see something in follow of a pop a and continue parsing from there or add symbols which are in first of a in the sync set and then it is possible to resume parsing according to it if you can then skip symbols till you get something in the sync set right so this is we are going to stop today next class we are going to start bottom