Compiler design

Status
Not open for further replies.

digitalage

java is fun.
i was struggling for A program on net that can check the variable declaration in a file for example int, char, etc.

can anyone provide it to me,,,,,
 

red_devil

Back!
a. you think this is the right section ?

b. you want the program to find out if the variable is an integer or a char or float ?
 

dheeraj_kumar

Legen-wait for it-dary!
Whats wrong with the syntax for a declaration statement? Its

datatype varname1 [, varname2, ...] [arrayindex] [= {value1, value2, ...} ]

I might not understand your question correctly. Give an example...
 
he wants to ask for a program that will read a text file and can identify keywords used in it, and verify if they are used correctly.

Hope I am right.
 

ashu888ashu888

Core i7 (nehalem) Owner
I think he jus wats to findout how many KEYWORDS are there present in a given file.. :D
or maybe, still check if he has written them correctly or no (spelling)..

Well, if u are into JAVA, u can use Netbeans or JCreator,and it will highlight the keywords in a different color that the rest of the programming code.. :)
---

btw, wrong section..shud be posted in programming section..
 

QwertyManiac

Commander in Chief
You wish to check if the declarations are right? Why, that's easy. What language do you want your program in?

Or maybe (just guessing) you are looking for tools like LEX and YACC? You can find those here: *dinosaur.compilertools.net/
 

a_k_s_h_a_y

Dreaming
you are trying to create the output of a LEX and YACC. And to that you want to add Syntax corrector algorithm.

Its very tough ;) not a easy job.
Mathematically very challenging.

This is first phase of compiler design, that is lexical analyzer. But not the actual compiler design itself.
 

red_devil

Back!
i'm still not able to understand what he wants to do !!

Do you want to create a program in which at run time you wanna give a file name as input and you want your original program to find out the data types of variables declared in this input file ??
is that what you want ?
 
Status
Not open for further replies.
Top Bottom