gov.llnl.babel.backend.sidl
Class SidlSource
java.lang.Object
gov.llnl.babel.backend.sidl.SidlSource
public class SidlSource
extends java.lang.Object
This class provides the ability to write SIDL source file for a SIDL
class/interface.
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(String name) - Return indication of whether or not the symbol name is the same as
the base class.
|
static boolean | isBaseInterfaceName(String name) - /**
Return indication of whether or not the symbol name is the same as
the base interface.
|
void | printAssertion(LanguageWriter lw, Assertion as) - Print the assertion.
|
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, 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 .
|
SidlSource
public SidlSource(LanguageWriterForSidl writer,
Context context)
Generate an instance to write the SIDL file.
writer
- the output device to which the SIDL should be written.
generateCode
public void generateCode(Class cls)
throws CodeGenerationException
Generate the SIDL for the class.
cls
- the SIDL class to be written.
generateCode
public void generateCode(Interface iface)
throws CodeGenerationException
Generate the SIDL for the interface.
iface
- the SIDL interface to be written.
generateCode
public void generateCode(Package pkg)
throws CodeGenerationException
Generate the SIDL for a package.
pkg
- the SIDL package whose file is to be written.
generateCode
public void generateCode(Struct st)
Generate the SIDL for a struct.
isBaseClassName
public static boolean isBaseClassName(String name)
Return indication of whether or not the symbol name is the same as
the base class.
name
- the symbol name being checked
- true if the name equals the base class name; else, false
isBaseInterfaceName
public static boolean isBaseInterfaceName(String name)
/**
Return indication of whether or not the symbol name is the same as
the base interface.
name
- the symbol name being checked
- true if the name equals the base interface name; else, false
printAssertion
public void printAssertion(LanguageWriter lw,
Assertion as)
Print the assertion.
lw
- the language writer to which the signature is printed
printMethods
public void printMethods(Extendable ext)
throws CodeGenerationException
Print the methods associated with the extendable (i.e., class or
interface). Indentation is handled accordingly.
ext
- the SIDL extendable whose methods are to be written
printParentInterfaces
public void printParentInterfaces(Extendable ext)
throws CodeGenerationException
Print the parent interfaces for the extendable (i.e., class or interface).
Indentation is handled accordingly.
ext
- the SIDL extendable whose parent interfaces are to be written
printRequires
public void printRequires(Package pkg)
Prints the requires statements based on symbols associated with the
specified package.
pkg
- the package whose imports/requires list is being output
printSignaturePlus
public void printSignaturePlus(LanguageWriter lw,
Extendable ext,
Method meth,
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
. Also, optionally abbreviate the type if
in specified package.
lw
- the language writer to which the signature is printedext
- The Extendable this method is being generated formeth
- 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.