Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- use warnings;
- use strict;
- #
- my $fp;
- my $generic_on = 0;
- my $input = "test.txt";
- if (not open($fp, "<$input")) {
- print STDERR "Can not open file: $input -> $!\n";
- exit(1);
- };
- while (my $line = <$fp>) {
- chomp($line);
- if (($line =~ m/(\w+)\s*:\s*(\w+)(\s*range\s+(\w+)\s+to\s+(\w+)\s*)?(\s*:=\s*(\w+))?/gi) and ($generic_on == 1)) {
- print "GENERIC FOUND: $1, $2, $7\n";
- };
- # if ($line =~ m/entity\s+(\w+)\s+is/gi) {
- # print "Entity: $line\n";
- # };
- # Check for port
- if ($line =~ m/port\s*\(/gi) {
- print "In port: $line\n";
- };
- };
Advertisement
Add Comment
Please, Sign In to add comment