gov.llnl.babel.backend.mangler

Interface NameMangler

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

String
shortArrayName(String symbol, String method, String suffix)
Convert the long name for the array method into a shorter name.
String
shortName(String symbol, String suffix)
Convert a type name to a short length.
String
shortName(String symbol, String method, String suffix)
Convert the long name for the method into a shorter name.

Method Details

shortArrayName

public String shortArrayName(String symbol,
                             String method,
                             String suffix)
            throws 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.

shortName

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

shortName

public String shortName(String symbol,
                        String method,
                        String suffix)
            throws 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.