generator: Update the documentation in generator/DESIGN
This commit is contained in:
parent
3b37e81b05
commit
f20970258e
1 changed files with 77 additions and 39 deletions
|
@ -1,13 +1,19 @@
|
||||||
Main Program
|
Main Program
|
||||||
------------
|
------------
|
||||||
|
|
||||||
CodeGenerator: Static class. Contains Main
|
CodeGenerator: Static class. Contains Main. It uses the Parser to load the
|
||||||
|
IGeneratable objects, validates them, and then calls the
|
||||||
|
IGeneratable.Generate() method on each of them.
|
||||||
|
|
||||||
GenerationInfo: Stores info passed in on the command line, such as the
|
GenerationInfo: Stores info passed in on the command line, such as the
|
||||||
assembly name and glue library name. Passed to
|
assembly name and glue library name. Passed to
|
||||||
IGeneratable.Generate().
|
IGeneratable.Generate().
|
||||||
|
|
||||||
Parser: Reads the foo-api.xml file and creates IGeneratable objects
|
Parser: Reads the foo-api.xml file and creates IGeneratable objects
|
||||||
|
|
||||||
Statistics: Static class. Used by other classes to keep statistics on
|
Statistics: Static class. Used by other classes to keep statistics on
|
||||||
generated classes
|
generated classes
|
||||||
|
|
||||||
SymbolTable: Static class. Keeps track of the type hierarchy and the
|
SymbolTable: Static class. Keeps track of the type hierarchy and the
|
||||||
mappings between C types and IGeneratable classes
|
mappings between C types and IGeneratable classes
|
||||||
|
|
||||||
|
@ -17,14 +23,13 @@ IGeneratables
|
||||||
The IGeneratable interface is implemented by all classes that
|
The IGeneratable interface is implemented by all classes that
|
||||||
represent types.
|
represent types.
|
||||||
|
|
||||||
GenBase: Abstract base class for any api.xml element that will have
|
GenBase: Abstract base class for any api.xml element that will have its own
|
||||||
its own generated .cs file
|
generated .cs file
|
||||||
|
|
||||||
CallbackGen: Handles <callback> elements by creating a public
|
CallbackGen: Handles <callback> elements by creating a public delegate type
|
||||||
delegate type for the public API (in NAME.cs), and an
|
for the public API (in NAME.cs), and an internal type that
|
||||||
internal type that wraps that delegate, to be passed
|
wraps that delegate, to be passed as the actual unmanaged
|
||||||
as the actual unmanaged callback (in
|
callback (in NAMESPACESharp.NAMENative.cs)
|
||||||
NAMESPACESharp.NAMENative.cs)
|
|
||||||
|
|
||||||
ClassBase: Abstract base class for types that will be converted
|
ClassBase: Abstract base class for types that will be converted
|
||||||
to C# classes, structs, or interfaces
|
to C# classes, structs, or interfaces
|
||||||
|
@ -42,8 +47,8 @@ GenBase: Abstract base class for any api.xml element that will have
|
||||||
|
|
||||||
ObjectGen: Handles <object> elements
|
ObjectGen: Handles <object> elements
|
||||||
|
|
||||||
StructBase: Abstract base class for types that will be
|
StructBase: Abstract base class for types that will be translated
|
||||||
translated to C# structs.
|
to C# structs.
|
||||||
|
|
||||||
BoxedGen: Handles non-opaque <boxed> elements
|
BoxedGen: Handles non-opaque <boxed> elements
|
||||||
|
|
||||||
|
@ -56,18 +61,27 @@ SimpleBase: Abstract base class for types which aren't generated from
|
||||||
|
|
||||||
ByRefGen: Handles struct types that must be passed into C code by
|
ByRefGen: Handles struct types that must be passed into C code by
|
||||||
reference (at the moment, only GValue/GLib.Value)
|
reference (at the moment, only GValue/GLib.Value)
|
||||||
|
|
||||||
ManualGen: Handles types that must be manually marshalled between
|
ManualGen: Handles types that must be manually marshalled between
|
||||||
managed and unmanaged code (by handwritten classes such
|
managed and unmanaged code (by handwritten classes such
|
||||||
as GLib.List)
|
as GLib.List)
|
||||||
|
|
||||||
MarshalGen: Handles types that must be manually marshalled between
|
MarshalGen: Handles types that must be manually marshalled between
|
||||||
managed and unmanaged code via special CallByName/FromNative
|
managed and unmanaged code via special CallByName/FromNative
|
||||||
syntax (eg time_t<->DateTime, gunichar<->char)
|
syntax (eg time_t<->DateTime, gunichar<->char)
|
||||||
|
|
||||||
|
OwnableGen: Handles ownable types.
|
||||||
|
|
||||||
SimpleGen: Handles types that can be simply converted from an
|
SimpleGen: Handles types that can be simply converted from an
|
||||||
unmanaged type to a managed type (int, byte, short, etc...)
|
unmanaged type to a managed type (int, byte, short, etc...)
|
||||||
|
|
||||||
LPGen : marshals system specific long and "size" types.
|
LPGen : marshals system specific long and "size" types.
|
||||||
|
|
||||||
LPUGen : marshals system specific unsigned long and "size" types.
|
LPUGen : marshals system specific unsigned long and "size" types.
|
||||||
|
|
||||||
ConstStringGen: Handles conversion between "const char *" and
|
ConstStringGen: Handles conversion between "const char *" and
|
||||||
System.String
|
System.String
|
||||||
|
|
||||||
StringGen: Handles conversion between non-const "char *" and
|
StringGen: Handles conversion between non-const "char *" and
|
||||||
System.String
|
System.String
|
||||||
|
|
||||||
|
@ -79,21 +93,45 @@ SimpleBase: Abstract base class for types which aren't generated from
|
||||||
Other code-generating classes used by IGeneratables
|
Other code-generating classes used by IGeneratables
|
||||||
---------------------------------------------------
|
---------------------------------------------------
|
||||||
|
|
||||||
Ctor: Handles <constructor> elements
|
ImportSignature: Represents a signature for an unmanaged method
|
||||||
Field: Handle <field> elements (only used by StructBase, not
|
|
||||||
ClassBase)
|
MethodBase: Abstract base class for constructors, methods and virtual methods
|
||||||
Method: Handle <method> elements
|
Ctor: Handles <constructor> elements
|
||||||
Property: Handles <property> elements
|
Method: Handles <method> elements
|
||||||
|
VirtualMethod: Abstract class for virtual methods
|
||||||
|
GObjectVM: Handles virtual methods for objects
|
||||||
|
InterfaceVM: Handles virtual methods for interfaces
|
||||||
|
|
||||||
|
MethodBody: Used by Method and its subclasses
|
||||||
|
|
||||||
|
PropertyBase: Abstract base class for property-like elements
|
||||||
|
FieldBase: Abstract base class for field-like elements
|
||||||
|
ObjectField: Handles <field> elements in objects
|
||||||
|
StructField: Handles <field> elements in structs
|
||||||
|
ClassField: Handles <field> elements in classes
|
||||||
|
Property: Handles <property> elements
|
||||||
ChildProperty: Handles <childprop> elements
|
ChildProperty: Handles <childprop> elements
|
||||||
|
|
||||||
Signal: Handles <signal> elements
|
Signal: Handles <signal> elements
|
||||||
|
|
||||||
ImportSignature: Represents a signature for an unmanaged method
|
ManagedCallString: Represents a call to a managed method from a method that
|
||||||
ManagedCallString: Represents a call to a managed method from a
|
has unmanaged data
|
||||||
method that has unmanaged data
|
|
||||||
MethodBody: shared by Ctor and Method
|
Parameter: Represents a single parameter to a method
|
||||||
Parameter: Represents the parameters to a method
|
ErrorParameter: Represents an "out" parameter used to indicate an error
|
||||||
SignalHandler: Used by Signal. Like CallbackGen, this creates an
|
StructParameter: Represents a parameter that is a struct
|
||||||
internal type to wrap a signal-handler delegate.
|
ArrayParameter: Represents an parameter that is an array. Can be
|
||||||
|
null-terminated or not.
|
||||||
|
ArrayCountPair: Represents an array parameter for which the number of
|
||||||
|
elements is given by another parameter.
|
||||||
|
|
||||||
|
Parameters: Represents the list of parameters to a method
|
||||||
|
|
||||||
|
ReturnValue: Represents the return value of a method, virtual method or signal
|
||||||
|
|
||||||
|
SignalHandler: Used by Signal. Like CallbackGen, this creates an internal type
|
||||||
|
to wrap a signal-handler delegate.
|
||||||
|
|
||||||
Signature: Represents the signature of a method
|
Signature: Represents the signature of a method
|
||||||
VMSignature: Used by Signal. Represents the signature of a virtual
|
|
||||||
method.
|
VMSignature: Used by Signal. Represents the signature of a virtual method.
|
||||||
|
|
Loading…
Add table
Reference in a new issue