I do handwritten lexer. I need to draw one nondeterministic finite automat which contains three finite automat which made previously. I made them for keywords like airplane, cloud, runways. I need help, how to construct the common automata for this three automata. I need some example how to do that? If you know please help me??
Draw the airplane, cloud, and runway automata leaving some room before the starting states. Now, erase their first state. Draw a new, single state in front of them. Connect it to the "irplane" automata with an "a" transition/edge, a "r" edge to "unway", and a "c" edge to "loud". That's it. Done.
For the more general case, it's more complex: First, draw your each of your automata (e.g. airplane, cloud, and runway) leaving some empty space by where they start. Next, draw a state before where they start, and connect it to the beginning of the airplane, cloud, and runway automata's old start states via free edges. (Free edges are also called ε-edges, epsilon edges, λ-edges, or lambda edges).
Next, you perform the subset construction algorithm on them, which you can find video tutorials for on youtube. There's also an online subset construction algorithm tool that will convert non-deterministic finite automata to deterministic finite automata (DFA) for you. That process is called determinization.
Once you have your DFA, you use it to construct state, action, and lookup tables that drive the scanner. That's its own can of worms. People usually use a scanner generator like Lex or Flex to automate that. A similar, user-friendly tool that you can use online is the Online Scanner Generator. You could use it to make the graph by providing the following input:
airplane:airplane
cloud:cloud
runway:runway
It'll give you a DFA for that, like so: