|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.llnl.babel.backend.writers.PrettyWriter
gov.llnl.babel.backend.writers.LanguageWriter
public abstract class LanguageWriter
Abstract class LanguageWriter
extends the pretty
writer class with additional features for backend code generation.
The language writer manages block comments and file headers.
Language-specific writers manage formatting for a particular
language.
Field Summary | |
---|---|
protected Context |
d_context
|
Constructor Summary | |
---|---|
LanguageWriter(java.io.PrintWriter writer,
Context context)
Create a LanguageWriter instance that will send
output to the specified print writer object. |
Method Summary | |
---|---|
abstract void |
beginBlockComment(boolean is_doc)
Abstract method to begin a block comment. |
abstract void |
endBlockComment(boolean is_doc)
Abstract method to end a block comment. |
java.lang.String |
processHTML(java.lang.String str)
Convert HTML/XML entities as appropriate. |
java.lang.String |
safeCommentString(java.lang.String string)
Convert a string into a string that is safe to include inside a comment. |
void |
writeBanner(Symbol symbol,
java.lang.String file,
boolean is_Impl,
java.lang.String desc)
Write a file banner for automatically generated files. |
void |
writeComment(Comment comment,
boolean is_doc)
Write a comment for a sidl Comment to the pretty writer stream. |
void |
writeComment(Comment comment,
java.lang.String alt)
Write a comment with an alternative string. |
void |
writeComment(Method method,
boolean is_doc)
Write a comment for a sidl method to the pretty writer stream. |
void |
writeComment(Method method,
boolean is_doc,
boolean add_default)
Write a comment for a sidl method to the pretty writer stream. |
void |
writeComment(java.lang.String s,
boolean is_doc)
Write a single-line block comment to the pretty writer stream. |
void |
writeComment(Symbol symbol,
boolean is_doc)
Write a comment for a sidl symbol to the pretty writer stream. |
void |
writeComment(Symbol symbol,
boolean is_doc,
boolean output_sym)
Write a comment for a sidl symbol to the pretty writer stream. |
abstract void |
writeCommentLine(java.lang.String comment)
Abstract method to output a comment to the pretty writer stream. |
abstract void |
writeSplicerTagLine(java.lang.String tagLine)
Write the splicer tag as a language-specific comment. |
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 |
Field Detail |
---|
protected Context d_context
Constructor Detail |
---|
public LanguageWriter(java.io.PrintWriter writer, Context context)
LanguageWriter
instance that will send
output to the specified print writer object.
Method Detail |
---|
public abstract void beginBlockComment(boolean is_doc)
public abstract void endBlockComment(boolean is_doc)
public abstract void writeSplicerTagLine(java.lang.String tagLine)
public abstract void writeCommentLine(java.lang.String comment)
Abstract method to output a comment to the pretty writer stream. The comment is not written in a comment block but only on one line of the output stream. The comment should not contain any new line characters. If the comment is null, then nothing is output.
It is assumed that comment is safe for inclusion in a comment for any language.
comment
- a single line comment to include in the outputsafeCommentString(java.lang.String)
public void writeComment(java.lang.String s, boolean is_doc)
Write a single-line block comment to the pretty writer stream. If the string is null or contains no characters, then no comment is written. The documentation flag determines whether this is a documentation comment.
It is assumed that comment is safe for inclusion in a comment for any language.
s
- the comment string to include in the outputis_doc
- true
means that the comment should
be treated as a document-style comment in
languages that have such things.safeCommentString(java.lang.String)
public java.lang.String safeCommentString(java.lang.String string)
*
/
in side a C or Java comment would
prematurely end the comment.
string
- the string to make safe for inclusion inside a
comment.
public java.lang.String processHTML(java.lang.String str)
public void writeComment(Comment comment, boolean is_doc)
public void writeComment(Symbol symbol, boolean is_doc, boolean output_sym)
public void writeComment(Symbol symbol, boolean is_doc)
public void writeComment(Method method, boolean is_doc, boolean add_default)
public void writeComment(Method method, boolean is_doc)
public void writeComment(Comment comment, java.lang.String alt)
comment
- a comment or nullalt
- an alternate string if comment==null, or null itselfpublic void writeBanner(Symbol symbol, java.lang.String file, boolean is_Impl, java.lang.String desc)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |