Skip to content

whois-zohaib/Lexical-Analyzer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lexical Analyzer in C


This is a simple lexical analyzer written in C language that helps in analyzing the token of a given program. The program reads the input file and scans it character by character. It can recognize keywords, operators, and identifiers. It is built using various libraries such as string.h and stdio.h.

Getting Started


To get started, you can download or clone the repository on your local machine. Once you have done that, compile the program using any C compiler, and you will be ready to use it.

Prerequisites


To run the program, you need to have a C compiler installed on your machine. You can use any C compiler of your choice.

How to Use


To use the program, simply pass the name of the file that you want to analyze as a command-line argument. The program will then read the file and analyze its content. You can simply run it after compiling as follow
LexicalAnalyzer.so hello.cpp

hello.cpp is the file of which you want tokens

Features


  • Recognizes keywords and operators
  • Can efficiently scan the input file character by character
  • Has minimum loss functions for better performance
  • Provides error handling for more accurate analysis

Author


This program is written by an Zohaib Khalid. It has been developed using various libraries and functions such as isKeyword, isOperator, and isAlphaNumeric. The code is written in a clean and optimized way to ensure better performance.

Conclusion


This is a simple and efficient program that can help in analyzing the token of a given program. It has been developed using various libraries and functions to ensure better performance and accuracy. If you have any questions or feedback, feel free to reach out to the me.