needed this c program urgently

write a lexer in C to recognize an identifier with a usual definition . underscores are not allowed in the beginning or at the end.
basically read a input from a file and check for identifiers whether its true or not and keep a count of it.
please give a program for his


  • Now, if you're a student and this is your homework or an exercise in a take-home quiz, the ugly truth is you need to fail this. The field of Computer Science wants experts and needs to spend money to get them. You, on the other hand, want money and NEED to become an expert to get it. Consequently, providing an answer to your question would hurt both Computer Science and you.

    That said, giving some pointers into the right direction is probably not a bad thing. Your best bet is to look into GNU Flex to generate a lexer because what you want to achieve is trivial in Flex after you learn the syntax.

    Otherwise, you need to either think of a solution yourself or learn finite state machines, regular expressions and other compiler theory topics.
  • This post has been deleted.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion