I
ids
Hi,
I'm new to Perl. I'm trying to use Perl to write a C++ Style Checker
to validate various coding standards followed in our organization.
Some of the things I need to do in this tool include:
- verifying whether identifier naming conventions have been followed
- differentiating between member variables and local variables
(because their naming conventions are different)
- determining method/function boundaries
- identifying control structures such as 'if', 'while' etc to see
whether they are written with code blocks (i.e. { }) all the time
- check whether statements are more than a given width (say 100
column)
- etc. etc.
This need not go in to semantics of the program; what I need is a
basic style checker.
What I see is that parsing line by line independently is not going to
help. This parser needs to build context and remember stuff across
lines to satisfy above goals.
Are there any existing Perl based style checkers? If not, can you give
some advice on how best to structure this program? Or else can you
give some good references on *design* aspects of Perl?
(I have a C/C++ background. So I'm familiar with OO design. I'm trying
to develop a *similar mental model* for Perl programs.)
Thanks in advance,
Ishan.
I'm new to Perl. I'm trying to use Perl to write a C++ Style Checker
to validate various coding standards followed in our organization.
Some of the things I need to do in this tool include:
- verifying whether identifier naming conventions have been followed
- differentiating between member variables and local variables
(because their naming conventions are different)
- determining method/function boundaries
- identifying control structures such as 'if', 'while' etc to see
whether they are written with code blocks (i.e. { }) all the time
- check whether statements are more than a given width (say 100
column)
- etc. etc.
This need not go in to semantics of the program; what I need is a
basic style checker.
What I see is that parsing line by line independently is not going to
help. This parser needs to build context and remember stuff across
lines to satisfy above goals.
Are there any existing Perl based style checkers? If not, can you give
some advice on how best to structure this program? Or else can you
give some good references on *design* aspects of Perl?
(I have a C/C++ background. So I'm familiar with OO design. I'm trying
to develop a *similar mental model* for Perl programs.)
Thanks in advance,
Ishan.