 Hello everyone, I am Mrs. Sunita Doher. Topic covered here is bottom-up passing ala-passing. In this video we are going to consider bottom-up syntax analysis technique that can be used to pass a large class of context free grammar. Learning outcomes. At the end of the session students will be able to know about ala-passer and pass the string using ala-passer. Ala-passer K is a bottom-up technique to pass a large class of context free grammar. The F is for left to right scanning of the input, the R is for constructing the rightmost derivation in reverse and K is for the number of input symbols of lookaheads that are used in making passing decision. When K is omitted, K is assumed to be 1. Ala-passing is attractive because ala-passer can be constructed to recognize virtually all programming language construct. Ala-passing is most general non-back-tracking shift reduced passing. The class of the grammar that can be passed using ala-method is proper subset of the class of the grammar that can be passed with the predictive passer. And ala-passer can detect a syntactic error as soon as it is possible to do so a left to right scan of the input. The principle drawback of this method is that it is too much work to construct an ala-passer by an hand for a typical programming language grammar. For this specialized tool called ala-passer generator is required. It covers wide range of grammars SLR that is simple ala-passer, then canonical ala that is most general ala-passer, LA-ALA that is intermediate ala-passer. SLR, LR and LA-ALAR work same only their passing tables are different. SLR is easiest to implement but the least powerful of three. Canonical LR is the most powerful and most expensive and look ahead LR is intermediate in power and cause between the other two. A schematic of ala-passer is shown in figure on the slide. It consists of input, output, a stack, a driver program and a passing table that has two parts action and go to. The driver program is the same for all ala-passer only the passing table changes from one passer to another. The parsing program reads the character from an input buffer one at a time. The program uses a stack to store a string of the form s0, x1, s1, x2, s2 and so on up to xm, sm where sm is on the top. Each xi is a grammar symbol and each si is a symbol called state. Each state summarizes the information contained in the stack below it. The combination of the stack symbols on the top of the stack and the current input symbol are used to index the passing table and determine the shift reduce passing action. A configuration of an ala-passer is a pair whose first element is the stack contained and whose second component is an expended input s0, x1, s1 and so on up to xm, sm stack contained, ai, ai plus 1 and so on up to an input. Sm and ai decides the passer action by consulting the parsing action table. Initially stack contained just as 0 and configuration of ala-passer parsing represent the right sentential form x1, x2 up to xm, ai, ai plus 1 up to an dollar. In essentially the same way a shift reduce passer would only the presence of state on the stack is new. Ala-passing action, if the action sm, ai is equal to shift s, the passer execute a shift move entering the configuration as 0, x1, s1 and so on up to xm, sm comma ai, ai plus 1 and so on up to an dollar. So, this derives to s0, x1, s1 and so on up to xm, sm, ai, s comma ai plus 1 and so on up to an dollar. Here the passer has shifted both the correct input symbol ai and the state s on the stack. If the action sm comma ai is equal to reduce a derives b then the passer execute a reduce move entering the configuration given here where s equals to go to sm minus r comma a and r is the small r is the length of b the right side of the production. The passer first pop two r symbols of this stack exposing the state sm minus r. The passer then push both a the left side of the production and s the entry for go to sm minus r comma a onto this stack. The current input symbol is not changed in the in a reduce move. The output of a allow passer is generated after a reduce move by executing the semantic action associated with the reducing production. If action sm comma ai is equal to accept, parsing is completed. Error, passer detected an error. So, that is an empty entry in the action table. Algorithm, allow passing input and input string w and allow passing table with function action and go to for grammar g. Output, if w is in a language of that grammar g a bottom of pass for w otherwise an error indication. Method, initially a passer has a 0 on its stack where a 0 is the initial state and w dollar is in the input buffer. The passer then execute the program until and accept or the error action is encountered. In this algorithm four moves are explained which we already considered on the previous slide. Initially said input pointer ip to point to the first symbol of w dollar. Repeat forever begin, assume that s be the state on the top of the stack and a the symbol pointed by the input pointer ip. If action sm comma ai is equal to shift s dash then push a then s dash on the top of the stack and advance the input pointer ip to point to the next input symbol. If action sm comma ai is equal to reduce a derives p then pop 2 into length of beta right side of the production symbols of the stack. Let s dash be the state now on the top of the stack. So, push a then go to s dash comma a on the stack and output the production a derives beta as if action sm comma ai equals to accept then return as error. Consider the grammar e derives e plus t e derives t, t derives t star f, t derives f and f derives e or id and the passing table for this grammar. In this passing table s i means the shift and the stack state i, r j means reduced by production numbered j, acc means accept state and blank means error. On the input id into id plus id the sequence of the stack and the input contained is shown on the slide. At the line number 1, allow passer is in state 0 with the id the first input symbol. The action in row 0 and the column id of the action filled in the passing table is s 5 meaning shift and cover the stack with the state 5. This is what happened at line number 2. The first token id and the state symbol 5 have been pushed onto the stack and the id has been removed from the input. Then star becomes the current input symbol and the action of state 5 on the input star is to reduce by f derives id. Two symbols pop of the stack, one the state symbol and one grammar symbol. State 0 is then exposed. Since the go to of state 0 on f is 3, so f and 3 are pushed onto the stack. We now have the configuration given on the line number 3. Each of the remaining moves is determined similarly. So till now we consider allow passing algorithm. Now pause this video and reflect on this question for a minute or 2 minute and write your response. Once you return the answer to this question then you can start playing this video. The question is pass the string id into id using allow passing table. I hope all of you have completed this activity. How to pass this string using allow passer is given on this slide. This is the reference used for preparing this presentation. Thank you.