First, theoretical knowledge
1. The task of lexical analysis phase is to scan and decompose the string composing the source program from left to right, and identify a word symbol with independent meaning according to the lexical rules of the language.
2, the word law is the formation of the word symbol rules. It is divided into basic words, identifiers, constants, operators, and bound characters.
Second, the experimental experience
1, before always put other functions together into the main function, after this experiment, the function of the call more familiar.
2, learned a new input method, using scanf ("%[^#]s", input) can be the end of the logo as #, simple and convenient.
3, the string ends with a, so when reading to the last time to set the case.
4, the string as a small part of the read. Read the character, encounter a space or other special symbols to the subscript back one bit, judge just plain string basic words, identifiers, constants, operators, bounds, and then output, read part, output part, loop. The first thing to consider is that the input is a space and the output character is not within the defined range or is not entered.
5, read, splicing, loop, subscript back, output
A summary of lexical analysis experiments