Compilers project to be also implemented

Closed Posted Dec 9, 2015 Paid on delivery
Closed 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 “ ”

C Programming Research Writing Technical Writing

Project ID: #9085617

About the project

9 proposals Remote project Active Jan 15, 2016

9 freelancers are bidding on average ₹4539 for this job

hbxfnzwpf

I am very proficient in c, c++. I have 16 years c++ developing experience now, and I have worked for 6 years. My work is online game developing, and mainly focus on server side, the language is c++ under linux. I used More

₹15000 INR in 2 days
(56 Reviews)
6.2
mailmesalah

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

₹11111 INR in 5 days
(7 Reviews)
4.0
utkarshkatiyar19

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

₹3200 INR in 3 days
(16 Reviews)
3.8
MWaqar5246

Hi there, I have the relevant experiences regarding lexical analyzer, tokenizer in C language. Will provide the work on time with the explanation. Thanks

₹2250 INR in 3 days
(6 Reviews)
3.1
greatsummit

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.

₹1250 INR in 3 days
(0 Reviews)
0.0
b2wintechnology

A proposal has not yet been provided

₹1250 INR in 3 days
(0 Reviews)
0.0
kavinKumarS

i hace compilers course in IIT Madras .... in C language using lex-yacc tools ....... ur project is similar to it ........ contact soon if interested

₹1750 INR in 1 day
(0 Reviews)
0.0
muhammad913

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.

₹1150 INR in 5 days
(0 Reviews)
0.0