Public Member Functions | |
XmlIdlCompiler () | |
void | compile_file (String file_name, IdlParser parser) |
Static Public Member Functions | |
static void | main (String[] args) |
Static Public Attributes | |
static final String | PROP_DO_GENERATE_COMP_HELPERS = "alma.acs.tools.comphelpergen.doGenerate" |
static final String | PROP_COMP_HELPERS_OUTDIR = "alma.acs.tools.comphelpergen.outRootDir" |
Static Protected Attributes | |
static IdlCompiler | s_idlCompiler = new IdlCompiler() |
Main class of the ACS IDL compiler that produces interfaces, structs, and holders for use with XML binding classes. The generated code will be similar but different from the output of a regular CORBA IDL compiler. IDL interfaces, structs, etc. that contain a field or parameter of type XmlEntityStruct
will be compiled into source code that contains a corresponding XML binding class.
In collaboration with the other classes from this package, this class performs the following steps for each IDL file specified:
typedef
s for the type XmlEntityStruct
, e.g. the definition of the type SchedBlock
. (see IdlTreeManipulator#findXmlTypedefNodes) SchedBlock
, then both IDL structs will get marked. HelperInfo
in the package alma.acs.tools.comphelpergen
. Parameters and properties:
-verbose
. ACS.idl2jbind
specifies the mappings from typedef'd XmlEntityStruct
s to Java binding classes.alma.xmljbind.test.schedblock.SchedBlock
whereever an XmlEntityStruct
typedef'd to SchedBlock
is found. alma.acs.tools.comphelpergen.doGenerate
: if true
, the ACS IDL compiler will run the generator after compiling an IDL file. See alma.tools.idlgen.comphelpgen.ComponentHelperGeneratorProxy. alma.acs.tools.comphelpergen.outRootDir
specifies the directory under which the component helper classes will be generated according to their Java packages. In order to keep things simple, the implementation uses the OpenORB IDL compiler (org.openorb.compiler.IdlCompiler
and related classes) whereever this is possible. No OpenORB code is modified; this goal results in some less intuitive handling of parse tree nodes, since new behavior could not be attached to the existing classes. On the other hand, we won't have to insert our patches into any new version of OpenORB that we might want to use in the future.
A half-inspired attempt has been made to pave the road for code generation for languages other than Java. The tree manipulations could also be used by other code generators. For Java we reused OpenORB's implementation of the IDL2Java mapping logic (see JavaGenerator), but similar generators for other languages would be much more complex.
Remark on the proprietary code generation strategy used: Since OpenORB does not separate IDL2Java mapping logic from Java code generation, we can't use any standard code generation framework without reimplementing the IDL2Java logic ourselves. The choice was to accept being different from other ACS code generators, with the advantage of not writing lots of new code.
alma.tools.idlgen.XmlIdlCompiler.XmlIdlCompiler | ( | ) |
Constructor for XmlIdlCompiler.
Referenced by alma.tools.idlgen.XmlIdlCompiler.main().
void alma.tools.idlgen.XmlIdlCompiler.compile_file | ( | String | file_name, | |
IdlParser | parser | |||
) |
This operation is used to compile an IDL file
References alma.tools.idlgen.IdlTreeManipulator.findXmlEntityNodes(), alma.tools.idlgen.IdlTreeManipulator.findXmlTypedefNodes(), alma.tools.idlgen.XmlIdlCompiler.PROP_COMP_HELPERS_OUTDIR, alma.tools.idlgen.XmlIdlCompiler.PROP_DO_GENERATE_COMP_HELPERS, alma.tools.idlgen.IdlTreeManipulator.recursivePrint(), alma.tools.idlgen.IdlTreeManipulator.resetGraph(), and alma.tools.idlgen.JavaGenerator.setIdlStruct2JavaBindingClassMappings().
Referenced by alma.tools.idlgen.XmlIdlCompiler.main().
static void alma.tools.idlgen.XmlIdlCompiler.main | ( | String[] | args | ) | [static] |
Modelled after org.openorb.compiler.IdlCompiler#main
args | same as for IdlCompiler#scan_arguments(String[]) |
References alma.tools.idlgen.XmlIdlCompiler.compile_file(), and alma.tools.idlgen.XmlIdlCompiler.XmlIdlCompiler().
final String alma.tools.idlgen.XmlIdlCompiler.PROP_COMP_HELPERS_OUTDIR = "alma.acs.tools.comphelpergen.outRootDir" [static] |
Referenced by alma.tools.idlgen.XmlIdlCompiler.compile_file().
final String alma.tools.idlgen.XmlIdlCompiler.PROP_DO_GENERATE_COMP_HELPERS = "alma.acs.tools.comphelpergen.doGenerate" [static] |
Referenced by alma.tools.idlgen.XmlIdlCompiler.compile_file().
IdlCompiler alma.tools.idlgen.XmlIdlCompiler.s_idlCompiler = new IdlCompiler() [static, protected] |