gov.llnl.babel.backend.writers
Class LanguageWriterForFortran

java.lang.Object
  extended by gov.llnl.babel.backend.writers.PrettyWriter
      extended by gov.llnl.babel.backend.writers.LanguageWriter
          extended by gov.llnl.babel.backend.writers.LanguageWriterForFortran
All Implemented Interfaces:
CodeConstants

public class LanguageWriterForFortran
extends LanguageWriter
implements CodeConstants

Class LanguageWriterForFortran extends the generic language writer to provide additional capabilities for writing Fortran code, such as Fortran comment blocks.


Field Summary
 
Fields inherited from class gov.llnl.babel.backend.writers.LanguageWriter
d_context
 
Fields inherited from interface gov.llnl.babel.backend.CodeConstants
C_AUTO_GEN_SPLICER, C_AUTO_GEN_WARNING, C_BACKSLASH, C_BEGIN_UNREFERENCED_METHODS, C_COMMENT_CLOSE, C_COMMENT_DOC_OPEN, C_COMMENT_F77, C_COMMENT_F90, C_COMMENT_HASH, C_COMMENT_OPEN, C_COMMENT_SLASH, C_COMMENT_SUBSEQUENT, C_DEFINE, C_DESC_CJNI_PREFIX, C_DESC_HEADER_PREFIX, C_DESC_IMPL_PREFIX, C_DESC_IOR_PREFIX, C_DESC_SJNI_PREFIX, C_DESC_SKEL_PREFIX, C_DESC_STUB_PREFIX, C_END_UNREFERENCED_METHODS, C_F77_IMPL_EXTENSION, C_F77_IMPL_METHOD_SUFFIX, C_F77_METHOD_SUFFIX, C_F77_VERSION, C_F7731_IMPL_EXTENSION, C_F90_ALT_SUFFIX, C_F90_IMPL_EXTENSION, C_F90_IMPL_METHOD_SUFFIX, C_F90_METHOD_SUFFIX, C_F90_VERSION, C_FORTRAN_DESC_STUB_PREFIX, C_FORTRAN_IMPL_MODULE_PREFIX, C_FORTRAN_MODULE_PREFIX, C_FORTRAN_TYPE_MODULE_PREFIX, C_GUARD_CLOSE, C_GUARD_OPEN, C_HASH, C_IFDEFINE_CLOSE, C_IFDEFINE_CXX, C_IFDEFINE_OPEN, C_INCLUDE, C_INSERT_HERE, C_INT_BACKSLASH, C_IS_IMPL, C_IS_NOT_IMPL, C_SLASH, C_UNREFERENCED_COMMENT1, C_UNREFERENCED_COMMENT2, C_UNREFERENCED_COMMENT3, MATLAB_COMMENT_OPEN
 
Constructor Summary
LanguageWriterForFortran(java.io.PrintWriter writer, Context context)
          Create a LanguageWriterForFortran instance that will send output to the specified print writer object.
 
Method Summary
 void beginBlockComment(boolean is_doc)
          Begin a block comment.
 void endBlockComment(boolean is_doc)
          End a block comment.
 void generateInclude(java.lang.String file)
          Generate a user include statement for the specified include file.
 void generateSystemInclude(java.lang.String file)
          Generate a system include statement for the specified include file.
 void generateUse(java.lang.String module, java.util.Map rename)
          Generate a use statement for the specified string.
 java.lang.String processHTML(java.lang.String str)
          Convert HTML/XML entities as appropriate.
 void writeComment(Method method, boolean is_doc, boolean add_default)
          Write a comment for a sidl method to the pretty writer stream.
 void writeCommentLine(java.lang.String comment)
          Output a single-line comment to the pretty writer stream.
 void writeSplicerTagLine(java.lang.String tagLine)
          Write the splicer tag as a language-specific comment.
 
Methods inherited from class gov.llnl.babel.backend.writers.LanguageWriter
safeCommentString, writeBanner, writeComment, writeComment, writeComment, writeComment, writeComment, writeComment
 
Methods inherited from class gov.llnl.babel.backend.writers.PrettyWriter
backTab, changeTabLevel, close, defineBlockComment, disableBlockComment, disableLineBreak, enableBlockComment, enableLineBreak, enableLineBreak, flushPrintWriter, getPrintWriter, popLineBreak, print, printAligned, println, println, printlnUnformatted, printSpaces, printUnformatted, pushLineBreak, restoreFirstTabStop, setFirstTabStop, setLineBreakString, setStrictBreaking, setTabSpacing, setTemporaryFirstTabStop, tab
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LanguageWriterForFortran

public LanguageWriterForFortran(java.io.PrintWriter writer,
                                Context context)
Create a LanguageWriterForFortran instance that will send output to the specified print writer object. Set up the output properties of the language writer for Fortran. For F77, it sets the first tab at eight, the tab spacing to three, and a line break at column 72.

Method Detail

beginBlockComment

public void beginBlockComment(boolean is_doc)
Begin a block comment. The comment block is enabled and a blank line is printed. There is no difference between documentation comments and regular comments in Fortran.

Specified by:
beginBlockComment in class LanguageWriter

endBlockComment

public void endBlockComment(boolean is_doc)
End a block comment. A line is printed to close the comment. An empty line is printed after the comment. There is no difference between documentation commends and regular comments in Fortran.

Specified by:
endBlockComment in class LanguageWriter

writeSplicerTagLine

public void writeSplicerTagLine(java.lang.String tagLine)
Write the splicer tag as a language-specific comment.

Specified by:
writeSplicerTagLine in class LanguageWriter

writeCommentLine

public void writeCommentLine(java.lang.String comment)
Output a single-line comment to the pretty writer stream. The comment should not contain any new line characters. If the comment is null, then nothing is output.

Specified by:
writeCommentLine in class LanguageWriter
Parameters:
comment - a single line comment to include in the output
See Also:
LanguageWriter.safeCommentString(java.lang.String)

writeComment

public void writeComment(Method method,
                         boolean is_doc,
                         boolean add_default)
Write a comment for a sidl method to the pretty writer stream. Optionally write the method name if the symbol does not have an associated comment.

Overrides:
writeComment in class LanguageWriter

processHTML

public final java.lang.String processHTML(java.lang.String str)
Description copied from class: LanguageWriter
Convert HTML/XML entities as appropriate.

Overrides:
processHTML in class LanguageWriter

generateInclude

public void generateInclude(java.lang.String file)
Generate a user include statement for the specified include file. There is no guard flag for the fortran version.


generateSystemInclude

public void generateSystemInclude(java.lang.String file)
Generate a system include statement for the specified include file.


generateUse

public void generateUse(java.lang.String module,
                        java.util.Map rename)
Generate a use statement for the specified string.