Answer: the lexical analysis of the program
Lexical analysis is the first phase of a compiler. It takes
the source code from language preprocessors that are written in the form of
sentences. The lexical analyzer breaks these sentences into a series of tokens,
by removing any white space or comments in the source code.
In programming language, keywords, constants,
identifiers, strings, numbers, operators and punctuations symbols can be
considered as tokens.
If the lexical analyzer finds a token invalid, it
generates an error.
The lexical analyzer works closely with the syntax
analyzer. It reads character streams from the source code, checks for legal
tokens, and passes the data to the syntax analyzer when it demands.
0 comments:
Post a Comment