The Lexical Analysis of a Computer Program is performed by the Lexical Analyzer. The Computer Program written in a high level language is used by the Lexical Analyzer. Such a Program is written using a finite set of symbols.
The task of making a distinction among Program Elements such as Reserved Words, Operators, Data Types, Variables, Constants, Delimiters, Sequencers, Iterators is performed by the Lexical Analyzer.
The task of Lexical Analysis segregates the Program Elements such as Data Types, Operators, and Variables. These Elements are grouped to form clusters.
We have a cluster of Data Types present in a Computer Program. Operators that are in the Program are clustered separately. Similarly we have other clusters that represent distinct Program Elements.
The Program Elements that are recognized by the Lexical Analyzer are called tokens. We can say that Reserved Words, Data Types, and Constants are the tokens that find recognition as such during Lexical Analysis.
It can be observed that grouping of Program Elements speeds up the use of such Elements. The Compiler Phases subsequent to the Lexical Analysis make use of such Elemental groupings. Processing efficiency is achieved by performing Lexical Analysis.
As for example we can make fast use of Program operators when we require to evaluate a complex arithmetic expression containing multiple arithmetic operators. It is because of the availability of arithmetic operators at one place. Such location focused availability has been the result of Lexical Analysis.
Similarly, retrievals of Programming Elements such as variables becomes simple. This is because such retrievals require only a lookup. Faster retrieval of data units (Variables) means improvement of efficiency of such usage.
The third task of Lexical Analyzer is replacement at the level of Program Elements. A piece or section of Program Element is transformed. Such transformation may occur when a lowercase letter of a Program word is replaced by an uppercase equivalent.
_____________________________
_____________________________
Goodbye!
Have a great day!!
_____________________________
_____________________________
Comments
Post a Comment