|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.llnl.babel.backend.mangler.ShaMangler
public class ShaMangler
This class uses the SHA message digest algorithm to generate the mangled part of a shortened identifier. The message digest of the symbol, method and suffix is converted into a sequence of allowable characters. The mangled part of the name may appear random, but it is completely deterministic and reproducible.
Constructor Summary | |
---|---|
ShaMangler(int maxNameLen,
int maxUnmangled,
char[] charSet)
Create an instance of the ShaMangler . |
Method Summary | |
---|---|
java.lang.String |
shortArrayName(java.lang.String symbol,
java.lang.String method,
java.lang.String suffix)
Create the short name from the symbol , method
and suffix . |
java.lang.String |
shortName(java.lang.String symbol,
java.lang.String suffix)
Convert a type name to a short length. |
java.lang.String |
shortName(java.lang.String symbol,
java.lang.String method,
java.lang.String suffix)
Create the short name from the symbol , method
and suffix . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ShaMangler(int maxNameLen, int maxUnmangled, char[] charSet) throws java.security.NoSuchAlgorithmException
ShaMangler
.
maxNameLen
- this is the maximum number of characters that
a name may contain. For Fortran 90 and strict
ANSI C, this would be 31. For strict FORTRAN
77, this would be 6.maxUnmangled
- this indicates how many characters out of
maxNameLen
should be used for
unmangled content.charSet
- this provides the complete set of allowable
characters that are considered distinct by
the language compiler.
java.security.NoSuchAlgorithmException
- this will only be thrown if the SHA message digest algorithm
is not available.Method Detail |
---|
public java.lang.String shortName(java.lang.String symbol, java.lang.String method, java.lang.String suffix) throws java.io.UnsupportedEncodingException
symbol
, method
and suffix
. This mangler uses the SHA message digest to
generate the extra characters to attempt to avoid a symbol conflict.
shortName
in interface NameMangler
symbol
- the fully qualified name of the class or interface
holding the method. This name has periods separating
the different package components and class name.method
- this is the full name of the method. For overloaded
methods, this should be the full method name.suffix
- this suffix is used to designate what kind of
kind of function name is being generated (i.e.,
stub, skel, or impl).
java.io.UnsupportedEncodingException
- this exception should never occur because the ISO-8859-1 encoding
used by this method is supposed to be available on all JVMs.public java.lang.String shortArrayName(java.lang.String symbol, java.lang.String method, java.lang.String suffix) throws java.io.UnsupportedEncodingException
symbol
, method
and suffix
. This mangler uses the SHA message digest to
generate the extra characters to attempt to avoid a symbol conflict.
shortArrayName
in interface NameMangler
symbol
- the fully qualified name of the class or interface
holding the method. This name has periods separating
the different package components and class name.method
- this is the full name of the method. For overloaded
methods, this should be the full method name.suffix
- this suffix is used to designate what kind of
kind of function name is being generated (i.e.,
stub, skel, or impl).
java.io.UnsupportedEncodingException
- this exception should never occur because the ISO-8859-1 encoding
used by this method is supposed to be available on all JVMs.public java.lang.String shortName(java.lang.String symbol, java.lang.String suffix) throws java.io.UnsupportedEncodingException
NameMangler
shortName
in interface NameMangler
java.io.UnsupportedEncodingException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |