Lexical Analysis is the first phase of compiler also known as scanner. It converts the input program into a sequence of Tokens.It can be implemented with the regular expressions.
Syntax Analysis or Parsing is the second phase,i.e. after lexical analysis. It checks the syntactical structure of the given input,i.e. whether the given input is in the correct syntax (of the language in which the input has been written) or not. The parse tree is constructed by using the pre-defined Grammar of the language and the input string.
Semantic analysis is the task of ensuring that the declarations and statements of a program are semantically correct, i.e,that their meaning is clear and consistent with the way in which control structures and data types are supposed to be used.
Design memory to save variable’s values.
For complete documentation, check the word file .