snigdha said:
I wanted to write a lex program using an assembly language as
input.Taking assembly language keywords as tokens,But how to write it?
lex and friends are the subject matter of comp.compilers and
comp.unix.programmer where you'll likely get more specialised help.
When you ask there, you'll probably need to be a bit more specific
about what you're trying to do.
"How to write it" is covered in various places, amongst which is
the lex-and-yacc book, see eg
http://oreilly.com/catalog/9781565920002/
You write a bunch of regular expressions and code to do something
when they match.
It's not very polite to barge into a newsgroup, ask a hardly-on-topic
question, and then expect people to do the work for you. You could at
least have showed us what you've tried.