FILTER_PATTERNS is working with additional " at the end
[email protected] (Eckard Klotz) Fri, 10 May 2013 10:54:57 +0200
| Newsgroups | gmane.text.doxygen.devel |
|---|---|
| Message-ID | <[email protected]> |
Hello Developers.
After some additional tests and referring the archive again I'm sure
that the configuration of FILTER_PATTERNS is not working or its usage is
not documented completely.
Even if I use
FILTER_PATTERNS = *.m=./folder/subfolder/m2cpp.pl
the c-comment files will be analysed but not the matlab-files.
Doxygen gives me the warning that the perl-script
"./folder/subfolder/m2cpp.pl can not be opened.
Note, the double-quote " is part of the doxygen warning message and
there is no double-quote at the end of the message.
Once a realized that, I tried to insert in the wizard-input as
filter-pattern
*.m=./folder/subfolder/m2cpp.pl" (note the double-quote at the end)
This results in the DOXYFILE the line:
FILTER_PATTERNS = "*.m=./folder/subfolder/m2cpp.pl\""
And last but not least it works now. Since I don't use the filter as
INPUT_FILTER all c-like files will be analysed like expected, while all
m-files will be preprocessed with the filter.
Again an additional double-quote with backslash is needed at the end of
the filter-definition:
FILTER_PATTERNS = "pattern=filter\""
in the doxygen-wizard the input is : pattern=filter"
Please decide if this is the wanted behaviour (then it may be useful to
extend the documentation) or if this is a bug in the part to call the
perl-script.
If you think this is a problem of the used perl-script I have added,
please help me with some information and I will discuss this in the
associated forum of matlab.
I use doxygen 1.8.3.1 on Windows XP SP3
Best regards,
Eckard Klotz.
> Hello Everybody.
>
> For my nassi-shneiderman generator for doxygen
> (https://sourceforge.net/projects/moritz/) I'm working on an interface
> for the programming-language matlab.For a first demo-release I created
> some example-sources which I want to use together with my already
> existing c-based description of the general function of Moritz to
> create with doxygen a documentation. This means I have some txt-files
> with c-comment blocks (where I have defined *.txt as FILE_PATERNS).
> This c-comment-blocks contain doxygen group- and page-definitions
> which are traditionally used from me as description of the language
> independent parts of the documentation. In addition I have some files
> which contain comment-blocks in the programming-language for what I
> want to add examples. For python this works very good, since doxygen
> is already able to understand python-files as well as c-files. But
> since doxygen does not know matlab, I have to use a perl-filter for
> those files. The perl-filter itself works well as long as I only use
> my matlab-files. But I'm not able to configure doxygen to use this
> filter for matlab-files only and to use its own build-in c-parser for
> all other files.
>
> If I use
> INPUT_FILTER = "perl ./folder/subfolder/m2cpp.pl"
> all matlab-files will be parsed correctly but the files with the
> c-comments will be ignored.
>
> If I use
> FILTER_PATTERNS = "*.m=perl ./folder/subfolder/m2cpp.pl"
> doxygen tells me that the perl-script can not be opened. The c-comment
> files will be analysed but not the matlab-files.
>
> I had the idea to use
> INPUT_FILTER = "perl ./folder/subfolder/m2cpp.pl"
> together with
> FILTER_PATTERNS = "*.txt=????? to use the perl-fileter as
> default-filter and to deactivate it for the txt-files which contain
> the c-comment blocks. But I don't know what to use instead for the
> question-marks to ensure that no filter will be used but the
> doxygen-parser directly.
>
> Is someone able to help me?
>
> With many thanks,
> Eckard Klotz.
>
>
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and
their applications. This 200-page book is written by three acclaimed
leaders in the field. The early access version is available now.
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
_______________________________________________
Doxygen-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/doxygen-develop
M2CPP.PL
(text/plain, 6.5 KB)
#!C:/Program Files/Perl64/bin/perl.exe
#!/usr/bin/perl.exe
if ($#ARGV != 0)
{
die "Argument must contain filename $#ARGV"
}
else
{
$fname=$ARGV[0];
}
# If we have a .m file inside a (@)-folder with the same name :
# we will read each file of this folder
if ($fname =~ /^(.*)\@([\d\w-_]*)[\/\\](\2)\.m/)
{
$name = $2;
$nameExt = $name.".m";
$dir = $1."@".$name."/\*.m";
@fic = glob($dir);
$i = 0;
@listeFic[0] = $fname;
foreach $my_test (@fic)
{
if (!($my_test =~ $nameExt))
{
$i++;
@listeFic[$i] = $my_test;
}
}
}
# otherwise @-folder, but .m with a different name : ignore it
elsif ($fname =~ /^(.*)\@([\d\w-_]*)[\/\\](.*)\.m/)
{
}
# otherwise
else
{
@listeFic[0] = $fname;
}
$output = "";
foreach $my_fic (@listeFic)
{
open(my $in, $my_fic);
$declTypeDef="";
$inClass = 0;
$inAbstractMethodBlock = 0;
$listeProperties = 0;
$listeEnumeration = 0;
$methodAttribute = "";
while (<$in>)
{
if (/(^\s*)(%>)(.*)/)
{
$output=$output."$1///$3";
}
if (($listeProperties == 1) && (/(^\s*\bend\b\s*)/))
{
$listeProperties = 0;
}
if (($inAbstractMethodBlock == 1) && (/(^\s*\bend\b\s*)/))
{
$inAbstractMethodBlock = 0;
}
if (($listeProperties == 1) && (/^\s*([\w\d]*)\s*(=\s*[\w\d{}'',\s\[\]\.]*)?.*(%>.*)?/))
{
$propertyName = $1;
$propertyValue = $2;
$propertyComment = $3;
if (!($propertyName =~ /^$/))
{
if ($typeProperties =~ /Constant/)
{
$properties = $propertyName."$propertyValue;$propertyComment";
}
else
{
$properties = $propertyName.";$propertyComment";
}
$properties =~ s/%>/\/\/\//g;
$properties =~ s/%/\/\//g;
$output=$output.$typeProperties."Property ".$properties;
}
}
if (($listeEnumeration == 1) && (/(^\s*\bend\b\s*)/))
{
$listeEnumeration = 0;
$output=$output."};";
}
if (($listeEvents == 1) && (/(^\s*\bend\b\s*)/))
{
$listeEvents = 0;
$output=$output."};";
}
if (($listeEvents == 1) && (/^\s*([\w\d]*)\s*/))
{
$name_event = $1;
if (!($name_event =~ /^$/))
{
$event = $name_event.",";
$event =~ s/%>/\/\/\//g;
$event =~ s/%/\/\//g;
$output=$output.$event;
}
}
if (($listeEnumeration == 1) && (/^\s*([\w\d]*)\s*(\(.*\))?(%>.*)?/))
{
$name_enum = $1;
$val_enum = $2;
if (!($name_enum =~ /^$/))
{
if (!($val_enum =~ /^$/))
{
$enum = "$name_enum=$val_enum,";
$enum =~ s/%>/\/\/\//g;
$enum =~ s/%/\/\//g;
$output=$output.$enum;
}
else
{
$enum = "$name_enum,";
$enum =~ s/%>/\/\/\//g;
$enum =~ s/%/\/\//g;
$output=$output.$enum;
}
}
}
if (/(^\s*function)\s*([\] \w\d,_\[]+=)?\s*([.\w\d_-]*)\s*\(?([\w\d\s,~]*)\)?(%?.*)/)
{
$functionKeyWord = $1;
$functionName = $3;
$arguments = $4;
if ($inClass == 0)
{
$output = $declTypeDef.$output;
$declTypeDef = "";
}
$arguments =~ s/,/,in /g;
$arguments =~ s/~/ignoredArg/g;
$arguments = "in $arguments";
if ($arguments =~ /^in $/)
{
$arguments = "";
}
$ligne = "$methodAttribute $functionKeyWord $functionName($arguments);";
$output=$output.$ligne;
}
# Signature of functions in abstract methods
elsif ((/^\s*([\] \w\d,_\[]+=)?\s*([.\w\d_-]+)\s*\(?([\w\d\s,~]*)\)?(%?.*)/) & ($inAbstractMethodBlock == 1) )
{
$functionName = $2;
$arguments = $3;
$arguments =~ s/,/,in /g;
$arguments =~ s/~/ignoredArg/g;
$arguments = "in $arguments";
if ($arguments =~ /^in $/)
{
$arguments = "";
}
$ligne = "$methodAttribute $functionKeyWord $functionName($arguments);";
$output=$output.$ligne;
}
# inheritance for classes
if (/(^\s*classdef)\s*(\s*\([\{\}\?\w,=\s]+\s*\))?\s*([\w\d_]+)\s*<?\s*([\s\w\d._&]+)?(.*)/)
{
$className = $3;
$classInheritance = $4;
$classAttributes = $2;
if (!($classInheritance =~ /^$/))
{
$classInheritance =~ s/&/,public /g;
$classDef = "class ".$className.":public $classInheritance";
}
else
{
$classDef = "class ".$className;
}
$output=$output.$classDef;
$output=$output."{";
$output=$output.$declTypeDef;
$output=$output."public:\n";
$inClass = 1;
}
if (/(^\s*properties)\s*(\s*\([\w,=\s]+\s*\))?(.*)/)
{
$listeProperties = 1;
$propertiesAttributes = $2;
$typeProperties = "public:\n";
if (lc($propertiesAttributes) =~ /(access\s*=\s*private)/)
{
$typeProperties = "private:\n"
}
elsif (lc($propertiesAttributes) =~ /(access\s*=\s*public)/)
{
$typeProperties = "public:\n"
}
elsif (lc($propertiesAttributes) =~ /(access\s*=\s*protected)/)
{
$typeProperties = "protected:\n"
}
if ((lc($propertiesAttributes) =~ /(constant\s*=\s*false)/) || (lc($propertiesAttributes) =~ /(~constant)/))
{
}
elsif (lc($propertiesAttributes) =~ /(constant(\s*=\s*true\s*)?)/)
{
$typeProperties = $typeProperties." Constant ";
}
}
if (/(^\s*enumeration)\s*(.*)/)
{
$listeEnumeration = 1;
$output=$output."public:\nenum ".$className." {";
}
if (/(^\s*events)\s*(.*)/)
{
$listeEvents = 1;
$output=$output."public:\nenum Events {";
}
if (/(^\s*methods)\s*(\s*\([\w,=\s]+\s*\))?(.*)/)
{
$methodAttribute = "public:\n";
$methodsAttributes = $2;
if (lc($methodsAttributes) =~ /(access\s*=\s*private)/)
{
$methodAttribute = "private:\n"
}
elsif (lc($methodsAttributes) =~ /(access\s*=\s*protected)/)
{
$methodAttribute = "protected:\n"
}
elsif (lc($methodsAttributes) =~ /(access\s*=\s*public)/)
{
$methodAttribute = "public:\n"
}
if (lc($methodsAttributes) =~ /(abstract(\s*=\s*true\s*)?)/)
{
$inAbstractMethodBlock = 1;
$methodAttribute = $methodAttribute." virtual ";
}
if ((lc($methodsAttributes) =~ /(static\s*=\s*false)/) || (lc($methodsAttributes) =~ /(~static)/))
{
}
elsif (lc($methodsAttributes) =~ /(static(\s*=\s*true\s*)?)/)
{
$methodAttribute = $methodAttribute." static";
}
}
$output=$output."\n";
}
close $in;
}
$output=$output."};\n";
print $output;