__init__(self,
filename=' /home/mhoebeke/Devel/lichk/src/licensechecker/data/commentinf ... )
(Constructor)
| source code
|
Builds a new instance of CommentChecker from a text file containing
comment information.
The text file must be formatted as follows:
-
blank lines or lines starting with
# are ignored,
-
other lines must have 2, 3 or 4 whitespace separated fields :
-
the first field is a string with the name of the programming
language (case sensitive),
-
for lines with 2 fields, the second field is the delimiter for
single-line comments,
-
for lines with 3 fields, the second (resp. third field) is the
opening (resp. closing) delimiter for comment blocks,
-
for lines with 4 fields, the three first fields are the same as
in a 3-field line, the 4th field is the delimiter for single-line
comments.
Examples:
# The following line declares Shell-type comments (single-line comments)
shell #
# The following line declares Java-type comments (both block and single-line)
Java /* */ //
- Parameters:
filename - (optional) the name of the file with the comment information. The
default value looks for a file named commentinfo.txt
in this module's data subdirectory.
Note:
there may be multiple lines related to a single programming
language in the same file. Each line adds new delimiters those
already encountered. Example:
# First pair of delimiters for Pascal comment blocks.
Pascal (* *)
# Second pair of delimiters for Pascal comment blocks.
Pascal { }
|