Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ridadogrul/program-for-lexical-analysis

Simple lexical analyzer program in C++ programming
https://github.com/ridadogrul/program-for-lexical-analysis

Last synced: about 1 month ago
JSON representation

Simple lexical analyzer program in C++ programming

Awesome Lists containing this project

README

        

# Program-for-Lexical-Analysis
Simple lexical analyzer program in C++ programming

WHAT IS A COMPILER

Most of the programs we type in are in English (or some other language). A computer cannot understand English; it can interpret only a stream of 1’s and 0’s. Hence, it is necessary to convert these “high-level” language programs to binary before the computer can understand the instructions. That is exactly what a compiler and an interpreter are used for. They make our programs comprehensible to the computer.

WHAT IS LEXICAL ANALYSIS

Lexical analysis is the first phase of a compiler. It takes modified source code from language preprocessors that are written in the form of sentences. The lexical analyzer breaks these syntaxes into a series of tokens, by removing any whitespace or comments in the source code. 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.