|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gov.llnl.babel.backend.CodeSplicer
Class CodeSplicer
splices code segments from an existing
user file into a new automatically generated file. The intended use of
the code splicer is to preserve user edits to generated code. The new
file replaces the original one; however, the code splicer preserves areas
delineated with the pair of strings:
DO-NOT-DELETE splicer.begin(symbol)
DO-NOT-DELETE splicer.end(symbol)
embedded in comments in both the edited and generated files. The
code splicer also tracks which symbols were not used in the newly
generated file, and these symbols may be output at the end of the
new file to preserve code for the user.
Constructor Summary | |
CodeSplicer()
Create an empty CodeSplicer. |
|
CodeSplicer(java.io.BufferedReader reader,
java.lang.String vpath,
java.lang.String path)
Create a new instance of the code splicer class. |
Method Summary | |
static java.lang.String |
getBeginString(java.lang.String symbol)
Return the code splicer start string for the beginning of a code splice region. |
java.lang.String |
getEditString(java.lang.String symbol)
Retrieve the edit string associated with the specified symbol. |
static java.lang.String |
getEndString(java.lang.String symbol)
Return the code splicer end string for the closing of a code splice region. |
java.util.Set |
getSymbols()
Retrieve a Set of the symbols in the symbol edit
database. |
java.lang.String |
getVPath()
query the current vpath setting "." indicates no vpath |
boolean |
hasSymbol(java.lang.String symbol)
Query whether the specified symbol exists in the symbol database. |
boolean |
hasUnusedSymbolEdits()
Returns TRUE if there is at least one unused edit in the symbol edit database. |
static void |
main(java.lang.String[] args)
Test out the code splicer class. |
void |
outputSymbolEdits(java.lang.String symbol,
java.io.PrintWriter writer)
Output symbol information to the specified output print writer. |
void |
outputUnusedSymbolEdits(java.io.PrintWriter writer)
Output the unused edits in the symbol edit database. |
void |
setLineRedirector(LineRedirector lr)
|
void |
setVPath(java.lang.String vpath)
explicitly set the vpath. |
void |
splice(java.lang.String symbol,
LanguageWriter writer,
java.lang.String alt_msg)
The easiest method to envoke to create a spliced region during code generation. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CodeSplicer(java.io.BufferedReader reader, java.lang.String vpath, java.lang.String path) throws java.io.IOException
public CodeSplicer()
Method Detail |
public static java.lang.String getBeginString(java.lang.String symbol)
public static java.lang.String getEndString(java.lang.String symbol)
public void setLineRedirector(LineRedirector lr)
public java.lang.String getVPath()
public void setVPath(java.lang.String vpath)
public boolean hasSymbol(java.lang.String symbol)
public void outputSymbolEdits(java.lang.String symbol, java.io.PrintWriter writer)
public java.lang.String getEditString(java.lang.String symbol)
public boolean hasUnusedSymbolEdits()
public void outputUnusedSymbolEdits(java.io.PrintWriter writer)
public java.util.Set getSymbols()
Set
of the symbols in the symbol edit
database. Each entry in the set is a string representing a symbol.
public void splice(java.lang.String symbol, LanguageWriter writer, java.lang.String alt_msg)
symbol
- The string symbol to match. Should be unique in a filewriter
- The LanguageWriter to embed the symbols in appropriate
commentsalt_msg
- An alternate message to embed in comments only if no
information was found by the splicer.public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |