If you have seen my previous posts you will know that I'm desperately trying to write a program that cross references identifers found in a source file with the line number they occur on. I would like to know if there is an easier way to select the words that are identifiers than looking at each word to see if it is a comment, or a literal, or a keyword, or a filename etc without having to code a function to do each of these things. At the moment the only way I can think of is to write very specific code for each check. eg - for a comment I would have to see if the word started with // or */, for a literal I would have to see if it was in "", ' ' etc etc. If there is an easier way that you know of, I would really like to hear it.
Thanks in advance!