Compilers project to be also implemented
₹900-1100 INR
Paid on delivery
Design and implement a lexical analyzer from scratch whose specification are given below, by
using your favorite programming language (preferably C). The lexical analyzer identifies and
outputs tokens (valid words and punctuations) in the source program.
id = letter alphanum*
alphanum = letter | digit | _
num = integer | float
integer = nonzero digit* | 0
float = integer fraction
fraction = .digit* nonzero | .0
letter = a..z |A..Z
digit = 0..9
nonzero = 1..9
Operators, punctuation and reserved words
== + ( if void
<> ) then main
< * { else
> / } for
<= = [ class
>= and ] int
; not /* float
, or */ get
. // put return
If a token belongs to both category, the code should output the one that is written higher (5
should be identified as alphanum, not integer; a should be identified as id, not alphanum)
Your code should ignore whatever is written inside the comment block (whatever is written
inside the /* */ block)
If no match is found, report it as an error token.
If you need to assume something, assume it but with correct justification. Any assumption
should not result in diminishing the expressive power of the language.
Sample Input:
void main( )
{
int a=15, b_, c=5;
float d=2.2;
if (c%2==0) /* checking if c is even */
{
printf(“a”);
}
}
Sample Output:
Operators, punctuations, and reserved words:
void main ( ) { int , , = ; float = ;
if ( == ) { ( ) ; } }
id:
a b_ c d
alphanum:
5 2 0
num:
15 2.2
error token:
% printf “ ”
Project ID: #9085617
About the project
9 freelancers are bidding on average ₹4539 for this job
I have already done similar project in java. Feel free to contact me with more details. I can do it in C. Compiler design is not small project. Building from scratch is more difficult than developing from zero ground. More
hello, i have already one such project implemented with me. this is little different than it. i can easily do it. we can have a chat about it. thanks
Hi there, I have the relevant experiences regarding lexical analyzer, tokenizer in C language. Will provide the work on time with the explanation. Thanks
Hello! I have developed many c++ programs last 10 years. I have rich experience for the development of c++ project. If c/c++, I can do with closing eyes. If you hire me, I will do my best to you. Regards. Thanks.
i hace compilers course in IIT Madras .... in C language using lex-yacc tools ....... ur project is similar to it ........ contact soon if interested
i have vast experience in developing C/C++ applications. I have special interest in compiler construction. hope i can help you in the best way.