40package com.jogamp.gluegen;
42import java.io.IOException;
45import com.jogamp.gluegen.cgram.types.*;
63 System.out.println(
"----- BEGIN EMISSION OF GLUE CODE -----");
68 System.out.println(
"----- END EMISSION OF GLUE CODE -----");
76 final String name = def.
getName();
78 System.out.println(
"#define " + name +
" " + value +
79 (optionalComment !=
null ? (
"// " + optionalComment) :
""));
87 final Map<Type, Type> canonMap,
88 List<FunctionSymbol> cFunctions) {
89 final Set<String> keys = typedefDictionary.
keySet();
90 for (
final String key: keys) {
91 final Type value = typedefDictionary.
get(key);
92 System.out.println(
"typedef " + value +
" " + key +
";");
97 public Iterator<FunctionSymbol>
emitFunctions(
final List<FunctionSymbol> originalCFunctions)
throws Exception {
101 return originalCFunctions.iterator();
104 System.out.println(sym);
105 System.out.println(
" -> " + sym.
toString());
124 if (name ==
null && typedefType !=
null) {
128 System.out.println(
"Referenced type \"" + name +
"\"");
Represents a [native] constant expression, comprises the [native] expression, see getNativeExpr() and...
String getNativeExpr()
Returns the original [native] expression.
Debug emitter which prints the parsing results to standard output.
Iterator< FunctionSymbol > emitFunctions(final List< FunctionSymbol > originalCFunctions)
Emit glue code for the list of FunctionSymbols.
void beginStructLayout()
Begins the process of computing field offsets and type sizes for the structs to be emitted.
void emitDefine(final ConstantDefinition def, final String optionalComment)
void emitSingleFunction(final FunctionSymbol sym)
void beginEmission(final GlueEmitterControls controls)
Begin the emission of glue code.
void readConfigurationFile(final String filename)
void beginStructs(final TypeDictionary typedefDictionary, final TypeDictionary structDictionary, final Map< Type, Type > canonMap)
void beginFunctions(final TypeDictionary typedefDictionary, final TypeDictionary structDictionary, final Map< Type, Type > canonMap, List< FunctionSymbol > cFunctions)
void emitStruct(final CompoundType t, final Type typedefType)
Emit glue code for the given CompoundType.
void endStructLayout()
Finishes the struct layout process.
void endEmission()
Finish the emission of glue code.
JavaConfiguration createConfig()
Create the object that will read and store configuration information for this JavaEmitter.
void layoutStruct(final CompoundType t)
Lays out one struct which will be emitted later.
JavaConfiguration getConfig()
Parses and provides access to the contents of .cfg files for the JavaEmitter.
final void read(final String filename)
Reads the configuration file.
String getName()
Return the current-name, which is the last renamed-name if issued, or the original-name.
Models all compound types, i.e., those containing fields: structs and unions.
Describes a function symbol, which includes the name and type.
Utility class for recording names of typedefs and structs.
Type get(final String name)
Get the type corresponding to the given name.
Set< String > keySet()
Get all the names that map to Types.
final String getName()
Returns the name of this type.
Specifies the interface by which a GlueEmitter can request additional information from the glue gener...
Specifies the interface by which GlueGen requests glue code to be generated.
String getName()
Return the current-name, which is the last renamed-name if issued, or the original-name.