Click here to Skip to main content
15,891,033 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Please any one send this code
i want a compiler so that it can generate token,type,and line no just
for example i write a program
C++
void main()
int a;
a=2

it will show output as
token              type              line no
void               reserve            1
main               reserve            1
int                datatype           2

this program will written in c++ so that it show output in notepad as above
Please anyone help me
Posted
Updated 8-Jan-12 8:04am
v2
Comments
[no name] 8-Jan-12 12:44pm    
I think your looking for a parser and lexical analizer, not for a compiler... Regards

If you are intersted in basics check: http://www.brpreiss.com/books/opus2/book.pdf
Sergey Alexandrovich Kryukov 8-Jan-12 12:54pm    
None of C++ compilers could be called simple. For simpler compiler you would need a simpler language.
--SA

That's the output of a lexical analyzer. You may write your own lexical analyzer or use a tool, for instance flex[^].
 
Share this answer
 
thank idle 63 for answer..canyou send me sorce code of that program
thanks
emailadress=ifo.justchilz@gamil.com
thanks
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900