i want to know that how compiler will get the sequence of character? Keep in mind the concept of lexical analyzer how would you break this input stream “Hard Work is Key to Success”?
What compiler? What language? For C-ish languages the syntactic analysis part breaks up a sequence of characters to (a sequence) tokens, where a token is defined as the longest character sequence separated by whitespace. So in your -- unrealistic -- example the tokens are "Hard", "Work", "is", "Key", "to", "Success". Whitespace characters never show up in tokens. You want longest, because you do not want to see "Hard" as "H", "a", "r", "d". As for how, you generally use a finite state automata (FSA) generated from a description of the regular language.