Skip to main content

Lexical Analyzer

 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

Popular posts from this blog

Interface Message Processor ( IMP )

Interface Message Processor ( IMP ) is a special purpose Computer. The Processor plays a vital role in Host-to-Host communication. IMP is placed between Host Computers.  IMP helps Hosts to exchange information. IMPs ( Interface Message Processors ) form a group. The group dedicates itself towards reliable transmission of Packets. _________________________ Note: An Interface Message Processor can be supposed to have a face. Firstly this supposed face of IMP is in the direction of the first Host, which sends the  message. Secondly, this face is turned towards the other Host.  Now, the IMP,  with its face turned around, communicates with this other Host.  Transformed message from IMP is communicated to this Host. __________________________ Message ( a piece of information ) sent from the Host ( source of information  ) is transformed into Packets. Transformation of the message into Packets is performed by an IMP. These Packets are forwarded to the receiver H...

Understanding Distribution

Distributed presence means that more than one object is there. Also, these objects are situated at more than one location.  One object may establish communication with another object. The first object may deliver some message. The message can be received by another object. It can be said that object distribution is successful, as one object has succeeded in delivering a message. The second object has successfully received the message. Two objects are at a distance. Communication brings them closer. The successful communication has served to highlight that the idea of distribution is meaningful. Distribution helps exchange of information. Many different objects can form a group.  Two groups can occupy different locations.  It may happen that at a particular location there are several objects. But, all these objects talk among themselves.They talk among themselves and make things happen.  There is a resultant of this talk process. All the communicating objects  at...

Message Switching

Message is a piece of information. Switching means movement.  In a Network there are a number of nodes. Nodes are vital junctions of a Network. Message Switching means transmission from one node ( one point ) of a Network to another node ( another point ). So, transmission is from point to point. Transmission from one point to another point is a single hop ( jump ). Message Switching means switch over of a Message. In one step of Message Switching,  Message switches over from one node to another.  The two nodes involved in a Switching operation are on the same Network. It cannot be that the beginning node ( source node) is on one Network and the second node ( sink node ) is on a different Network. In a point to point ( one junction to another junction ) transmission, a Message travels a part of its journey. Message moves from previous point to next point. The Network is Point-to-Point Network. A Switching activity means movement of a message. Indeed, the Message has mov...