 to everyone. Welcome to the session on transition diagrams. Transition diagrams are usually used for analyzing a particular pattern, comparing it and generating the tokens. In the lexical analyzer, at the end of this session you will be able to draw transition diagrams for various programming language patterns and you can define various functions for the lexical analyzer. Now see the scenario here. The regular definitions for the tokens are given like if, then, else. These are the keywords. So for the keywords the token generated are if, then, else as it is. It means for the keywords the keyword itself is generating as a token. For a for a particular expression say less than less than equal to equal to not equal to greater than greater than equal to what are these one these are the relation operators. So for this a token generating is reload. Similarly for an identifier the pattern is letter, letter or digit star means every identifier is starting with a letter and it may have letter or digit combinations. So as it is an identifier the token generating for identifier is id. You can say another expression here which is for a simple numeric constant. So it is having the combination of exponentian value, fractional values and all. So for that a token num is returning and for a delimiter which is having a combination of blank space or a tab or a new line, tab space and all the delimiter is called the token is delim. And if more number of delimiters are there then the token it is generating is ws which is called as a white space. So see this table what this table is giving us the information that is if the token is ws that is white space the regular expression then it is not returning any kind of token or it is not returning any attribute values. Whereas if the keywords are there like if then else while for whatever the usual keywords are there for the programming language for them the token it is generating is a keyword itself and it is not returning any attribute values. Whereas if the regular expression is matching with an identifier then the token it is returning is id and the attribute is pointed to the table entry of that identifier. The table may be symbol table, literal table accordingly. So as an identifier symbol table is there for a number it is a literal table or a number table and all. So for num it is returning a token as num and the pointed table entry is given to it. For the relational operators like less than, less than equal to and all these the relational operator is returning the token as reload and the attribute values are accordingly the relational operator. So if it is less than then LT is returning if it is less than equal to LE is returning and so on. See this transition diagram usually the lexical analysis is using the transition diagram for keeping the track of the characters what it is reading and accordingly the forward pointer is moving next. So every input is incrementing. So this is called as a transition diagram which we can call it as a finite automata also. Let us see what are the parts of it. See here the circle indicates a state. So here it is a state zero and every transition diagram is starting with a start state. So here start state is zero and another state is here you may say six number. So from zero to six it is reading a character greater than so this is called as an edge. So the state is moving from one state to another one accordingly. Now for the accepting state if it is a double circle it is called as an accepting state. What it is? It is reading the sign and then equal to. So whenever it is reaching to the state number seven it means that it is accepting greater than equal to. For other means other than any equal to any other character is there it is coming to state number eight and here star means retract that is come back by one character. Whatever the last character it has read again it is coming back by one character that is star indicating. Consider the scenario transition diagram. Let us move on one by one here. Example input is greater than equal to let us move from the beginning. So we are starting with start it will start with zero. Now it has to move to six by reading this greater than sign. It is coming to state number six. Then again we are reading another next character that is equal to and then it is coming to the next state and it is accepting this state seven. So when it is a coming to the seven state as it is double circle it means that it is accepting greater than equal to three. Similarly you can say if the scenario is like this and if we want to read this greater than sign. So it is starting with the start and then it is coming to the zero state. It is reading the greater than sign and then it is coming to the state number six. Then it is reading the character four and for that character four it is coming to the other one and then it is accepting this particular greater than and it is coming back again one four to read the four again for the next thing. Similarly you can say the transition diagram here for the relational operators all the relational operation operators are there. So from state zero it is moving. So if it is less than equal to then it is coming to state number two and it is returning two things here that is token and the attribute. So here you can see that this reload is a token and GE is the attribute value. Similarly for this five it is returning because it is reading equal to so the token is reload and equal to is a attribute value. This is one transition diagram for the relational operator. So accordingly you can see again once again the transition table is there and what this entry specifically is saying that is reload and GE. So this is this is the token and this is the attribute value. Now another transition diagram here which we are using for identifiers and keywords. Now this transition diagram is reading all means it is reading identifiers also and keywords also. So everything is starting with a letter and it may have letter or digits combinations. So it is reading all that one and what it is returning it is returning two things here. The two functions are called here called as get token and install ID. What this get token is? Now get token is returning the token. When it is a keyword then it is returning keyword itself like if then for while all these one. Whereas if it is an identifier then it is returning the token as only ID. Then the install ID function is returning the pointer to that symbol table whatever the identifier is holding. If the entry is not there in the symbol table for the identifier it makes the entry in that and then it returns. If it is a keyword if the token returned is a keyword then install ID is not returning anything. It means it is returning zero. Now pause the video and write the values returned by two functions in the table. What are the two functions get token and install ID? Input strings are given so for this we have to write get token and install ID functions. See what they are returning. As for if and else are the keywords the tokens are keywords itself and install ID is returning zero. Whereas count and num4 are the identifiers so ID is written as a token and their particular entry of that is returning. Now the example another example we are giving analyzing it that this is a lexical analyzer. Here is our input code see if x less than equal to 10 then x else y something and what are the things it is returning is given here properly. You can see token and attribute. So everything from here is made an entry in this table according. Now another scenario transition diagram here unsigned integer numeric constant. So in this one it is starting with a digit and more combinations of the digit. It is accepting all the unsigned integer numeric constants like 349 or 41267 number all these one and it is calling one more function also after retracting that is install num. What this install num is doing it is entering the number into a particular table that is literal table and it is returning the pointer to the entry. Similarly like our identified table the symbol table. Now this transition diagram is for unsigned numbers you can see here the unsigned numbers like the examples are 12.3 e4 that is exponential value only exponential with the fraction values all these it is returning it is working same as the earlier one. So it is having these many states. One more transition diagram only for fractionals this transition diagram is only for fractionals no exponential values are there like 12.3 or 10.15 like this. This is for the white space where the delimiters are there so delim means white space it is having new line tab space or anything. So either one white space or any number of white space it is moving. So this is all about the transition diagrams these are the references thank you.