gov.llnl.babel.backend.sidl
public class SidlSource extends java.lang.Object
Constructor and Description |
---|
SidlSource(LanguageWriterForSidl writer,
Context context)
Generate an instance to write the SIDL file.
|
Modifier and Type | Method and Description |
---|---|
void |
generateCode(Class cls)
Generate the SIDL for the class.
|
void |
generateCode(Enumeration enm)
Generate the SIDL for the enumeration.
|
void |
generateCode(Interface iface)
Generate the SIDL for the interface.
|
void |
generateCode(Package pkg)
Generate the SIDL for a package.
|
void |
generateCode(Struct st)
Generate the SIDL for a struct.
|
static void |
generateCode(Symbol sym,
LanguageWriterForSidl writer,
Context context)
Generate the SIDL file only for a package.
|
static boolean |
isBaseClassName(java.lang.String name)
Return indication of whether or not the symbol name is the same as
the base class.
|
static boolean |
isBaseInterfaceName(java.lang.String name)
/**
Return indication of whether or not the symbol name is the same as
the base interface.
|
void |
printMethods(Extendable ext)
Print the methods associated with the extendable (i.e., class or
interface).
|
void |
printParentInterfaces(Extendable ext)
Print the parent interfaces for the extendable (i.e., class or interface).
|
void |
printRequires(Package pkg)
Prints the requires statements based on symbols associated with the
specified package.
|
void |
printSignaturePlus(LanguageWriter lw,
Extendable ext,
Method meth,
java.lang.String parent_pkg)
Print the signature of the method, optionally including the definition
modifier, and any associated pre- and post-conditions to the specified
LanguageWriter . |
public SidlSource(LanguageWriterForSidl writer, Context context)
writer
- the output device to which the SIDL should be written.public void generateCode(Struct st) throws CodeGenerationException
enm
- the SIDL struct to be written.CodeGenerationException
- a catch all exception to indicate problems in the code generation
phase.public void generateCode(Enumeration enm) throws CodeGenerationException
enm
- the SIDL enumeration to be written.CodeGenerationException
- a catch all exception to indicate problems in the code generation
phase.public static boolean isBaseClassName(java.lang.String name)
name
- the symbol name being checkedpublic static boolean isBaseInterfaceName(java.lang.String name)
name
- the symbol name being checkedpublic void printParentInterfaces(Extendable ext) throws CodeGenerationException
ext
- the SIDL extendable whose parent interfaces are to be writtenCodeGenerationException
- a catch all exception to indicate problems in the code generation
phase.public void printSignaturePlus(LanguageWriter lw, Extendable ext, Method meth, java.lang.String parent_pkg)
LanguageWriter
. Also, optionally abbreviate the type if
in specified package.lw
- the language writer to which the signature is printedext
- the Extendable for which this method is being generatedmeth
- the method whose signature is being printedparent_pkg
- the string containing the parent package. When not
null, it is used to strip the package from the return
string if it is in the specified package.public void printMethods(Extendable ext) throws CodeGenerationException
ext
- the SIDL extendable whose methods are to be writtenCodeGenerationException
- a catch all exception to indicate problems in the code generation
phase.
Assumes the method is sandwiched between the printing of open
and close parentheses.public void generateCode(Class cls) throws CodeGenerationException
cls
- the SIDL class to be written.CodeGenerationException
- a catch all exception to indicate problems in the code generation
phase.public void generateCode(Interface iface) throws CodeGenerationException
iface
- the SIDL interface to be written.CodeGenerationException
- a catch all exception to indicate problems in the code generation
phase.public void printRequires(Package pkg)
pkg
- the package whose imports/requires list is being outputpublic void generateCode(Package pkg) throws CodeGenerationException
pkg
- the SIDL package whose file is to be written.CodeGenerationException
- a catch all exception to indicate problems in the code generation
phase.public static void generateCode(Symbol sym, LanguageWriterForSidl writer, Context context) throws CodeGenerationException
CodeGenerationException
- a catch all exception to indicate problems in the code generation
phase.