Menu

#11 Underscore replacement and operators

v3.5.0
open
nobody
5
2001-08-25
2001-08-25
No

Submitted by James Yu on Tue, 16 May 2000 10:52:52
-0400

Problems:

For {memberef} generation, it performs the
underscore replacement, which replaces all
non-word chars to underscore. In my case, it
generated the same {memberef} for following
different functions:

MatrixBase operator + \(const int c\);
MatrixBase operator - \(const int c\);
MatrixBase operator \* \(const int c\);
MatrixBase operator / \(const int c\);

Fixes:

I added some lines in perceps.pl:747 so that it
now replaces + with _plus_, - with _dash_, * with
_star_, / with _slash_, etc.

elsif \($arg\[0\] eq "memberef"\) \{

$cleaned=$mname;
$cleaned=~s/\~/_tilda_/g;
$cleaned=~s/\`/_bquo_/g;
$cleaned=~s/\!/_ban_/g;
$cleaned=~s/\@/_at_/g;
$cleaned=~s/\#/_pound_/g;
$cleaned=~s/\$/_dollar_/g;
$cleaned=~s/\%/_percent_/g;
$cleaned=~s/\^/_carot_/g;
$cleaned=~s/\&/_ampsand_/g;
$cleaned=~s/\*/_star_/g;
$cleaned=~s/\(/_lpar_/g;
$cleaned=~s/\)/_rpar_/g;
$cleaned=~s/\-/_dash_/g;
$cleaned=~s/\=/_equal_/g;
$cleaned=~s/\+/_plus_/g;
$cleaned=~s/\[/_lsbra_/g;
$cleaned=~s/\]/_rsbra_/g;
$cleaned=~s/\{/_lcbra_/g;
$cleaned=~s/\}/_rcbra_/g;
$cleaned=~s/|/_vbar_/g;
$cleaned=~s/\\/_bslash_/g;
$cleaned=~s/\?/_qmark_/g;
$cleaned=~s/\</_labra_/g;
$cleaned=~s/\>/_rabra_/g;
$cleaned=~s/\W/_/g;
$cleaned=~s/COMM//g;
$str=~s/$TO([^$TO$TC]*)$TC/$cleaned/;
}
And it has fixed my problem.

Anyway I truely beleve that perceps is a
wonderfully product and I have recommented it to
my company. Right now I am the one that are doing
some start-up process like to create templates and
use it to create some initial html documentations
for the code.

Sincerely,
-James Yu
Solipsys Corp.

Discussion


Log in to post a comment.