Source Code Bracket Matching Utility Needed 
Author Message
 Source Code Bracket Matching Utility Needed

Bracket matching utility wanted:

Is there a perl utility that will let me check bracket matching in my
script?  I have a large script and I cannot manually find the
mis-matched bracket.

Thanks for any help...

Ralph



Tue, 02 Mar 2004 04:21:00 GMT  
 Source Code Bracket Matching Utility Needed

Quote:

>Bracket matching utility wanted:

>Is there a perl utility that will let me check bracket matching in my
>script?  I have a large script and I cannot manually find the
>mis-matched bracket.

Normally your editor can help with this.  In VI use the % key in emacs I think
there is a feature that shows a matching bracket.

In perl you can get perltidy from http://sourceforge.net/projects/perltidy/
In addition to formatting your perl source files it will help find many problems
in your code ioncluding mis-matched quotes and unbalanced paren, brackets,
braces.

Good Luck
--
    This space intentionally left blank



Tue, 02 Mar 2004 04:51:30 GMT  
 Source Code Bracket Matching Utility Needed
On Fri, 14 Sep 2001 03:21:00 GMT,

Quote:
> Bracket matching utility wanted:

> Is there a perl utility that will let me check bracket matching in my
> script?  I have a large script and I cannot manually find the
> mis-matched bracket.

There is nothing that can parse Perl, except perl.

$ perl -wc program

If you have an editor that can match brackets (like vi), you can use
that to do some rudimentary tests. However, note that unmatched
brackets that appear in comments, regular expressions, and some forms
of strings can severely break this. Perl's syntax can be quite
complex.

Martien
--
Martien Verbruggen              |
Interactive Media Division      | Think of the average person. Half of
Commercial Dynamics Pty. Ltd.   | the people out there are dumber.
NSW, Australia                  |



Tue, 02 Mar 2004 05:33:52 GMT  
 Source Code Bracket Matching Utility Needed
I only have perl v4 in DOS - perltidy didn't run - I got an error -
where can I get dos perl ver 5.0?

Ralph


Quote:



>>Bracket matching utility wanted:

>>Is there a perl utility that will let me check bracket matching in my
>>script?  I have a large script and I cannot manually find the
>>mis-matched bracket.

>Normally your editor can help with this.  In VI use the % key in emacs I think
>there is a feature that shows a matching bracket.

>In perl you can get perltidy from http://sourceforge.net/projects/perltidy/
>In addition to formatting your perl source files it will help find many problems
>in your code ioncluding mis-matched quotes and unbalanced paren, brackets,
>braces.

>Good Luck
>--
>    This space intentionally left blank



Tue, 02 Mar 2004 06:41:59 GMT  
 Source Code Bracket Matching Utility Needed
Perl reports at the end of my script that there is an unmatched
bracket or brace *somewhere* - not much help, my script is 6000+ lines
long.

Ralph


Quote:

>On Fri, 14 Sep 2001 03:21:00 GMT,

>> Bracket matching utility wanted:

>> Is there a perl utility that will let me check bracket matching in my
>> script?  I have a large script and I cannot manually find the
>> mis-matched bracket.

>There is nothing that can parse Perl, except perl.

>$ perl -wc program

>If you have an editor that can match brackets (like vi), you can use
>that to do some rudimentary tests. However, note that unmatched
>brackets that appear in comments, regular expressions, and some forms
>of strings can severely break this. Perl's syntax can be quite
>complex.

>Martien
>--
>Martien Verbruggen              |
>Interactive Media Division      | Think of the average person. Half of
>Commercial Dynamics Pty. Ltd.   | the people out there are dumber.
>NSW, Australia                  |



Tue, 02 Mar 2004 06:44:05 GMT  
 Source Code Bracket Matching Utility Needed
Ralph Freshour chose Fri, 14 Sep 2001 05:41:59 GMT to say this:

Quote:
>I only have perl v4 in DOS - perltidy didn't run - I got an error -
>where can I get dos perl ver 5.0?

http://www.cpan.org/ports/index.html#msdos

If you have a look at http://www.delorie.com/djgpp, you will also find many
other useful unix tools (like vi) ported to DOS, though you should also
have a look at http://www.vim.org.

Cheers,
Damian



Just another Perl Hacker, ### rev 3.3 -- stupidectomy performed :-)



Tue, 02 Mar 2004 07:54:12 GMT  
 Source Code Bracket Matching Utility Needed

Quote:

>Perl reports at the end of my script that there is an unmatched
>bracket or brace *somewhere* - not much help, my script is 6000+ lines
>long.

Maybe you should have tried to run it before it got to be 6000+ lines
long. That way you would have found the missing brace in the last bit of
code you changed/added...

--
Sam Holden



Tue, 02 Mar 2004 08:53:49 GMT  
 Source Code Bracket Matching Utility Needed
It was running OK for a long time and had always passed the perl -c
check - I made several changes the other day and ran the -c check
again when I was finished - thats when I noticed the failure.  I went
back to the area's I modified but could not see any brace mis-matches.

I finally got tidyperl to run on my linux system and it flagged the
suspect area - I saw the mis-matched brace and fixed it - -c then ran
without errors so it is now OK.

Thanks to all who helped me.

Ralph



Quote:

>>Perl reports at the end of my script that there is an unmatched
>>bracket or brace *somewhere* - not much help, my script is 6000+ lines
>>long.

>Maybe you should have tried to run it before it got to be 6000+ lines
>long. That way you would have found the missing brace in the last bit of
>code you changed/added...

>--
>Sam Holden



Tue, 02 Mar 2004 15:10:08 GMT  
 Source Code Bracket Matching Utility Needed


: >Bracket matching utility wanted:
: >
: >Is there a perl utility that will let me check bracket matching in my
: >script?  I have a large script and I cannot manually find the
: >mis-matched bracket.
: >

: Normally your editor can help with this.  

Yes, use it to align your brackets vertically and then you won't have
these problems.

        while ( something )
        {
                do something else
        }

        while ( a long and complex test
                that will take numerous lines
                to put in your code
              )
        {
                more lines
        }

Brackets either align horizontally or vertically.  Horizontal alignment
should not be used for complex logic or code.

Some people hate it, but you can check the above syntax even on a printout
while riding the bus home from work, no special editor or other technology
required.  

Even absurdly long blocks can be matched by putting the cursor on the
bracket and then pressing the up or down arrows to scan the entire file to
see how they align (actually works better than many bracket matching
editors for large blocks) and again, that works in virually any editor.



Tue, 02 Mar 2004 18:41:31 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. Source Code Bracket Matching Utility Needed

2. Utility to indent the perl source code

3. regular expression matching source code: help reqeust.

4. Bezier Perl code needed: have C source

5. Need 5.003 source code for UNIX

6. need to squish my source code

7. Need Perl User Login Source code

8. Need source code for perl5.003

9. Need 5.003 source code for UNIX

10. I need Source code for Spider???

11. Need GIF creator Source code

12. Bezier Perl code needed: have C source

 

 
Powered by phpBB® Forum Software