gov.llnl.babel.backend.sidl
Class GenerateSidl

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

public class GenerateSidl
extends java.lang.Object
implements CodeGenerator

This class implements the CodeGenerator interface for the SIDL code generator. This generator creates a SIDL file for a package based on the contents of the symbol table.


Constructor Summary
GenerateSidl()
          Create a new instance.
 
Method Summary
 void generateCode(java.util.Set symbols)
          Given a set of symbol ids, this method will generate SIDL source for all the corresponding packages in the set as needed.
 java.util.Set getLanguages()
          Returns a set containing only "sidl" since we are only generating the sidl representation of the interface.
 java.lang.String getName()
          Return the canonical name of this generator.
 java.lang.String getType()
          Return "text" since we are generating a textual representation of the interface.
 boolean getUserSymbolsOnly()
          Returns false since we are not limited it to user symbols only.
 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

GenerateSidl

public GenerateSidl()
Create a new instance.

Method Detail

generateCode

public void generateCode(java.util.Set symbols)
                  throws CodeGenerationException
Given a set of symbol ids, this method will generate SIDL source for all the corresponding packages in the set as needed.

Specified by:
generateCode in interface CodeGenerator
Parameters:
symbols - a set of symbol id (symbol names) for whom stubs should be written as needed. Each object in the set should be a SymbolID.
Throws:
CodeGenerationException - a catch all exception to indicate problems in the code generation phase.

getType

public java.lang.String getType()
Return "text" since we are generating a textual representation of the interface.

Specified by:
getType in interface CodeGenerator

getUserSymbolsOnly

public boolean getUserSymbolsOnly()
Returns false since we are not limited it to user symbols only.

Specified by:
getUserSymbolsOnly in interface CodeGenerator

getLanguages

public java.util.Set getLanguages()
Returns a set containing only "sidl" since we are only generating the sidl representation of the interface.

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