gov.llnl.babel.backend.rmi
Class GenerateRMIClient

java.lang.Object
  extended by gov.llnl.babel.backend.rmi.GenerateRMIClient
All Implemented Interfaces:
CodeGenerator, ContextAware

public class GenerateRMIClient
extends java.lang.Object
implements CodeGenerator

Class GenerateRMIClient is the main entry point for the IOR code generation routines. This class calls the IOR header and source file generation routines. It is assumed that all symbols necessary to generate IOR code are available in the symbol table, which can be guaranteed by calling resolveAllReferences on the symbol table.


Constructor Summary
GenerateRMIClient()
          The constructor does nothing interesting.
 
Method Summary
 void generateCode(java.util.Set symbols)
          Generate IOR code for each symbol identifier in the set argument.
 java.util.Set getLanguages()
          Return the set of language names that this generator supports.
 java.lang.String getName()
          Return the canonical name of this generator.
 java.lang.String getType()
          Return the type of generator.
 boolean getUserSymbolsOnly()
          Return true if and only if this code factory should only operate on symbols outside the sidl namespace (i.e., exclude symbols from the sidl runtime library).
 void setContext(Context context)
          Routine to notify extensions of the context.
 void setName(java.lang.String name)
          Set the name of the generator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenerateRMIClient

public GenerateRMIClient()
The constructor does nothing interesting. The entry point for the GenerateRMIClient class is generateCode.

Method Detail

generateCode

public void generateCode(java.util.Set symbols)
                  throws CodeGenerationException
Generate IOR code for each symbol identifier in the set argument. This routine assumes that all necessary symbol references are available in the symbol table.

Specified by:
generateCode in interface CodeGenerator
Parameters:
symbols - a set of Symbol instances. The generator is expetected to write code for each symbol.
Throws:
CodeGenerationException - this indicates that something failed during the code generation. It could be anything from an I/O error to a illegal data type.

getType

public java.lang.String getType()
Description copied from interface: CodeGenerator
Return the type of generator. Currently, there are three types of generator "stub", "skel" and "ior". "xml" might be added someday.

Specified by:
getType in interface CodeGenerator

getUserSymbolsOnly

public boolean getUserSymbolsOnly()
Description copied from interface: CodeGenerator
Return true if and only if this code factory should only operate on symbols outside the sidl namespace (i.e., exclude symbols from the sidl runtime library). This is typically true for C and Python where the stubs for the sidl runtime library are pregenerated. Generally, this should be true for anything other than a stub. Implementors do not need to worry about the special case of generating the sidl runtime library itself.

Specified by:
getUserSymbolsOnly in interface CodeGenerator

getLanguages

public java.util.Set getLanguages()
Description copied from interface: CodeGenerator
Return the set of language names that this generator supports. Normally, there is one one name per generator. However, the C++ generator can be referred to as cxx or c++, so it has two in its set. The names should be lower case. Some examples are "c", "ior", "c++", etc.

Specified by:
getLanguages in interface CodeGenerator
Returns:
a Set of strings. Each string is a language name that this generator supports.

setName

public void setName(java.lang.String name)
             throws CodeGenerationException
Description copied from interface: CodeGenerator
Set the name of the generator. This sets the name of the generator as it appeared on the command line. This method should be called at least once before CodeGenerator.getName() is called.

Specified by:
setName in interface CodeGenerator
Parameters:
name - this should be the name that the end user designated for the generator.
Throws:
CodeGenerationException

getName

public java.lang.String getName()
Description copied from interface: CodeGenerator
Return the canonical name of this generator. This exists for cases where a backend may have more than one name. CodeGenerator.setName(String) should be called at least once before this method is called.

Specified by:
getName in interface CodeGenerator
Returns:
the return value should always be a string in the set returned by CodeGenerator.getLanguages(). It may not be equal to the name given in CodeGenerator.setName(String).

setContext

public void setContext(Context context)
Description copied from interface: ContextAware
Routine to notify extensions of the context.

Specified by:
setContext in interface ContextAware