gov.llnl.babel.backend.fortran
Class GenerateServer
java.lang.Object
gov.llnl.babel.backend.fortran.GenerateServer
- CodeGenerator, ContextAware
public class GenerateServer
extends java.lang.Object
This class implements the
CodeGenerator
interface for the FORTRAN server side code generator.
This generator creates C source code to provide the glue between
IOR and an object implemented in FORTRAN. This will also generate an
implementation file in FORTRAN for the developer to fill in with
the appropriate behavior.
void | generateCode(Set symbols) - Given a set of symbol ids, this method will generate FORTRAN
skeletons (written in C) for all classes in the set.
|
Set | getLanguages() - Return the set of language names that this generator supports.
|
String | getName() - Return the canonical name of this generator.
|
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(String name) - Set the name of the generator.
|
GenerateServer
public GenerateServer()
Create a new instance.
generateCode
public void generateCode(Set symbols)
throws CodeGenerationException
Given a set of symbol ids, this method will generate FORTRAN
skeletons (written in C) for all classes in the set. This will
also generate a FORTRAN source file with templates for each
of the required methods. The end user who is implementing the
sidl object is expected to fill in the FORTRAN template.
- generateCode in interface CodeGenerator
symbols
- the set of symbol names for which code will be
generated as needed. Each object in the
set should be a SymbolID
.
getLanguages
public Set getLanguages()
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.
- getLanguages in interface CodeGenerator
- a Set of strings. Each string is a language name that this
generator supports.
getName
public String getName()
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.
- getName in interface CodeGenerator
getType
public String getType()
Return the type of generator. Currently, there are three types
of generator "stub", "skel" and "ior". "xml" might be added someday.
- getType in interface CodeGenerator
getUserSymbolsOnly
public 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). 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.
- getUserSymbolsOnly in interface CodeGenerator
setName
public void setName(String name)
throws CodeGenerationException
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.
- setName in interface CodeGenerator
name
- this should be the name that the end user designated for
the generator.