bentson@sri-unix (11/22/82)
Help! I'm trying to figure out how to convince lex to recognize multi-line comments. If I try the simple rule "/*".*"*/" it'll quit at the end of the line. The lex document says that if I change that to "/*"[.\n]"*/" it'll keep scanning to the last "*/" in the file (or die trying). I can't see where I can say "scan over everything but the comment closure" with something like "/*"[^(*/)]"*/", or can I? I've looked in the Unix sources and all the lexical analyzers that I've found are all hand crafted so that's no help. The only hope so far is the overbrief description of "yymore()". Can I have lex look for something like "/*"[^*] and if the next character isn't a "/", then I have to scan forward looking for a "*/" pair? If that's practical, then how does one consume input, etc? I'm going to dive into lex.yy.c to see if I can figure it out, but I'd like some assurances and pointers to interesting code. This is rather urgent, so if you're close, and it's convenient, please give me a call. If that's not possible, then netmail would be appreciated. Randy Bentson Colo State U - Comp Sci {menlo70!hao or ucbvax!hplabs}!csu-cs!bentson 303 491 7016