 I am Mrs. Sunitha Doh topic cover here is bottom up passing operator precedence passing. In this video we are going to cover operator precedence grammar which is a kind of shift reduce passing method. Learning outcome at the end of the session students will be able to pass the string using operator precedence passing. A grammar that satisfy the following two condition is called as the operator precedence grammar. First condition there exists no production rule which contains the epsilon on its right hand side and the second one that is there exists no production rule which contain two non-terminal adjacent to each other on its right hand side. E derives E of E or id and then of derives plus or the multiplication. The above grammar is not an operator grammar but if the operator of is replaced by the plus or the multiplication then the grammar E derives E plus E or E into E or id is an operator grammar. In operator precedence passing we define three disjoint precedence relation between certain pair of terminals. First A dot greater than B means that the terminal A has the highest precedence than the terminal B. So, A dot greater than B means A takes precedence over B. Second A less than dot B means the terminal A has the lower precedence than the terminal B. So, A less than dot B means A yields precedence to B. And third A equals to dot B means that the terminal A and B both have the same precedence. So A equals to dot B means A has the same precedence as B. These relation B appears similar to the arithmetic relations greater than, less than and equal to but the precedence relation have quite different properties. For example, we could have A yields precedence to B and A takes precedence over B for the same language. The determination of the correct precedence relation between the terminals are based on the traditional notion of associativity and the precedence of operator. Remember that id has the higher precedence than any other symbol and the dollar has the lowest precedence. Now consider the operator precedence relation from the associativity and the precedence. If operator theta 1 has the higher precedence than the operator theta 2, then make theta 1 takes precedence over theta 2 and theta 2 yields precedence to theta 1. For example, multiplication takes precedence over plus and the plus yields precedence to multiplication. If theta 1 and theta 2 are the operators of equal precedence, then make theta 1 takes precedence over theta 2 and the theta 2 takes precedence over theta 1 if the operators are left associative or make theta 1 yields precedence to theta 2 and theta 2 yields precedence to theta 1 if they are right associative. For example, plus takes the precedence over plus and the plus takes precedence over minus as plus and minus are the left associative. Upward arrow that is the pointer in the Pascal yields precedence to pointer as the pointer is right associative. Also make theta yields precedence to id, id take precedence over theta, theta yields precedence to left parenthesis, left parenthesis yields precedence to theta, right parenthesis takes precedence over theta, theta takes precedence over right parenthesis, theta takes precedence over dollar and dollar yields precedence to theta for all operator theta. Also left parenthesis has equal precedence as right parenthesis, dollar yields precedence to left parenthesis, dollar yields precedence to id, left parenthesis yields precedence to left parenthesis, id takes the precedence over dollar, right parenthesis take precedence over dollar, left parenthesis ill precedence to id, id take precedence over right parenthesis and right parenthesis take precedence over the right parenthesis. So, the process to find the handle is given here on this slide. Then the input string dollar A1, A2 and so on up to A and dollar insert the precedence relation between the pairs of the terminal. Consider this example and the operator precedence relation table even here. Then the input string id plus id into id with the precedence relation inserted will be dollar ill precedence to id, take precedence over plus ill precedence to id, take precedence over multiplication ill precedence to id, take precedence over dollar. Here the details steps to reduce the string id plus id into id is given on this slide. Here we scan the string from left until the first take precedence over relation is encountered. Hence enter the take precedence over relation between id and the plus. Then we scan towards the left over all the equal precedence until the first left most ill precedence to relation is encountered. Hence we enter the ill precedence to relation between the dollar and the id. Here id is the current handle as it is between the relation ill precedence to and takes precedence over. So we reduce id to e. After following the same procedure we obtain the right sentential form e plus e into e. All the terminals from dollar e plus e into e dollar. String will be now dollar plus multiplication symbol dollar. Indicating the precedence relation we get dollar ill precedence to plus ill precedence to multiplication takes precedence over dollar. Indicating that the left end of the handle lies between the plus and the multiplication and the right end between the dollar between the multiplication and the dollar. This precedence relation indicate that in the right sentential form e plus e into e the handle is e into e. So now the is surrounding the multiplication become the part of the handle to reduce it. After this step dollar ill precedence to plus take precedence over dollar is remaining. This now e surrounding the plus become the part of handle algorithm operator precedence passing algorithm input and input string w and a table of precedence relations output. If w is well formed a skeletal pass tree with a place holder non-terminal e labeling all interior nodes otherwise error indication. Method initially the stack contains dollar and the input buffer the string w dollar. Consider method set the input pointer ip to point to the first symbol of w dollar. If dollar is on the top of the stack and the input pointer points to dollar means there is no symbol on the top of the stack as well as in the input. So then return s begin let a be the topmost terminal symbol on the stack and b be the symbol pointed by the input pointer ip. Ill precedence to b or a has precedence has same precedence as b that is top of the stack symbol ill precedence to or has the same precedence as the input symbol then begin push the input symbol b onto the stack and advance the input pointer ip to the next input symbol. Else if a takes the precedence over relation b that is the top of the stack symbol takes the precedence over the input symbol then repeat pop the stack until the top stack terminal is related by ill precedence to relation to the terminal most recently pop s error in. So now consider the example e derives e plus e or e into e or id and the string id plus id into id. So if top of the stack symbol ill precedence to or has the same precedence as the input symbol then push the input symbol onto the stack and advance the input pointer to the next input symbol. If top of the stack symbol take the precedence over the input symbol then pop the stack until the top stack terminal is related by ill precedence to relation to the terminal most recently pop. So for this example the stack contain input contain and the action related to the string id e plus id into id is given on this slide till now we consider what is operator precedence grammar and also the operator precedence 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 restart playing this video. The question is pass the string using the operator precedence passing using falling table of precedence relation. So the string is id plus id into id. I hope all of you have completed this activity. Here passing of the string in parenthesis id plus id into id using the operator precedence passing is given in detail in the table with the help of operator precedence relation table. This is the reference for preparing this presentation. Thank you.