gov.llnl.babel.backend.mangler
Interface NameMangler

All Known Implementing Classes:
CMangler, FortranMangler, NonMangler, ShaMangler

public interface NameMangler

When symbol names are too long for a language, a NameMangler maps long names onto shorter names that are unlikely to conflict with other symbol names. When mapping a set of long names onto a set of shorter names, there is a nonzero probably of a symbol conflict.


Method Summary
 java.lang.String shortArrayName(java.lang.String symbol, java.lang.String method, java.lang.String suffix)
          Convert the long name for the array method into a shorter name.
 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)
          Convert the long name for the method into a shorter name.
 

Method Detail

shortName

java.lang.String shortName(java.lang.String symbol,
                           java.lang.String method,
                           java.lang.String suffix)
                           throws java.io.UnsupportedEncodingException
Convert the long name for the method into a shorter name. The fullname for the method is the concatenation of symbol, an underscore, method, and suffix with period characters converted to underscore characters. The name mangler will attempt to preserve as much of the fullname. First priority is given to maintaining suffix part of the name, second priority is given to maintaining the method name, and third priority is given maintaining the symbol part of the name. The returned name is guaranteed to have an underscore in it.

Parameters:
symbol - the fullname of the Symbol. This name has period characters between the various parts of the fullname.
method - the name of the method Method. This name has no periods in it.
suffix - a string that is tagged onto the end of the method. Implementation methods may have "_i" as a suffix to keep them distinct from stubs and skeletons.
Throws:
java.io.UnsupportedEncodingException - in generating the mangled name, the mangler may need to convert symbols to a standard byte encoding.

shortArrayName

java.lang.String shortArrayName(java.lang.String symbol,
                                java.lang.String method,
                                java.lang.String suffix)
                                throws java.io.UnsupportedEncodingException
Convert the long name for the array method into a shorter name. The fullname for the method is the concatenation of symbol, an underscore, "array", underscore, method, and suffix with period characters converted to underscore characters. The name mangler will attempt to preserve as much of the fullname. First priority is given to maintaining suffix part of the nam, second priority is given to maintaining the method name, and third priority is given maintaining the symbol part of the name. The returned name is guaranteed to have an underscore in it.

Parameters:
symbol - the fullname of the Symbol. This name has period characters between the various parts of the fullname.
method - the name of the method Method. This name has no periods in it.
suffix - a string that is tagged onto the end of the method. Implementation methods may have "_i" as a suffix to keep them distinct from stubs and skeletons.
Throws:
java.io.UnsupportedEncodingException - in generating the mangled name, the mangler may need to convert symbols to a standard byte encoding.

shortName

java.lang.String shortName(java.lang.String symbol,
                           java.lang.String suffix)
                           throws java.io.UnsupportedEncodingException
Convert a type name to a short length.

Throws:
java.io.UnsupportedEncodingException