matching multiline C constants 
Author Message
 matching multiline C constants

Currently I use a Perl script to give a basic summary of the types of lines in
a C program.  Here is the part that matches and counts comments:

      while (chop($line = <FP>)) {
         ...
         elsif ($line =~ /^\s*\/\*/) {
            while ($line !~ /\*\//) {
               $cmt++;
               chop($line = <FP>);
            }
            $cmt++;
         }

Is there a better way to do this?

JcL

--
Justin C. Lloyd ______________________________________________________________
Graduate Teaching Assistant                phone: 904/644-0559

Florida State University                   www:   http://www.*-*-*.com/ ~lloyd

                                 P + L = :)



Thu, 29 Jul 1999 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. parsing through constant multiline input

2. matchine multiline C constants

3. multiline, multi pattern match

4. multiline regex matching

5. Multiline regexps with matches

6. bug in anchored, multiline pattern match

7. pattern matching and multilines (sort of)

8. New User Q: MultiLine Match

9. multiline matching fun

10. Matching and removing multiline block in perl 1-liner

11. multiline match in perl 5

12. Multiline Matching

 

 
Powered by phpBB® Forum Software