summaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp/gluegen/FunctionEmitter.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2015-03-05 07:14:04 +0100
committerSven Gothel <[email protected]>2015-03-05 07:14:04 +0100
commit72d3635279ffc8ad88e47dff9bbe95d211226d11 (patch)
tree62b3735680dfc5980a94afa14c56045bd082af24 /src/java/com/jogamp/gluegen/FunctionEmitter.java
parentdd2440cbadc642a561d8f92c502fe822b2f11762 (diff)
Bug 1134 - Enhance GlueGen Compiler: Minimal GL Header Changes _and_ Typesafety
- We shall be able to import 'most' vanilla GL header, i.e. only change the typedef part using our GlueGen types - Type Safety: - GlueGen now detects '#define' and 'enum' redefines and throw an exception in this case. This helps detecting wrongly renamed GL extensions into core! - GlueGen now detects function redefines (overloading) and throw an exception in this case. Hence the semantics of duplicate functions has to be equal! This helps detecting wrongly renamed GL extensions into core! - Semantic equality for all types is provided via interface TypeComparator.SemanticEqualityOp, i.e. 'boolean equalSemantics(..)' implemented by com.jogamp.gluegen.cgram.types.Type. Semantic equality can be relaxed via config "RelaxedEqualSemanticsTest true", i.e. ignoring integer size, and const / volatile qualifiers. - All equality/hash methods of 'com.jogamp.gluegen.cgram.types.*' are restructured. - Track and simplify renamed 'symbol', i.e. use a common sub-interface for all renamed symbols (ConstantDefinition, FunctionSymbol, ..) - This is provided in a unified manner via interface com.jogamp.gluegen.cgram.types.AliasedSymbol and its common implementation AliasedSymbolImpl - All JavaConfiguration.shouldIgnore* methods operate w/ 'AliasedSymbol' trying to match all aliases. - Support 'struct NAME [ { ... } ]' w/o typedef's - New GL / CL headers do not use typedef's for anonymous opaque types - Opaque Type handling - JavaConfiguration.typeInfo(..), identifying opaque types, no more back references from target-type -> typedef. Hence the following is possible now: typedef void * Opaque01; // Opaque typedef void * APointerBuffer; // A Buffer - All Logger instances are no more static and derive their warning level from the package's root Logger via Logging.getLogger(..).
Diffstat (limited to 'src/java/com/jogamp/gluegen/FunctionEmitter.java')
-rw-r--r--src/java/com/jogamp/gluegen/FunctionEmitter.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/java/com/jogamp/gluegen/FunctionEmitter.java b/src/java/com/jogamp/gluegen/FunctionEmitter.java
index 8e9d306..5655e0e 100644
--- a/src/java/com/jogamp/gluegen/FunctionEmitter.java
+++ b/src/java/com/jogamp/gluegen/FunctionEmitter.java
@@ -42,6 +42,7 @@ package com.jogamp.gluegen;
import java.util.*;
import java.io.*;
+import com.jogamp.gluegen.cgram.types.FunctionSymbol;
import com.jogamp.gluegen.cgram.types.Type;
public abstract class FunctionEmitter {
@@ -52,25 +53,29 @@ public abstract class FunctionEmitter {
private final ArrayList<EmissionModifier> modifiers;
private CommentEmitter commentEmitter = null;
private final PrintWriter defaultOutput;
+ // Only present to provide more clear comments
+ protected final JavaConfiguration cfg;
/**
* Constructs the FunctionEmitter with a CommentEmitter that emits nothing.
*/
- public FunctionEmitter(final PrintWriter defaultOutput, final boolean isInterface) {
+ public FunctionEmitter(final PrintWriter defaultOutput, final boolean isInterface, final JavaConfiguration configuration) {
assert(defaultOutput != null);
+ this.isInterfaceVal = isInterface;
this.modifiers = new ArrayList<EmissionModifier>();
this.defaultOutput = defaultOutput;
- this.isInterfaceVal = isInterface;
+ this.cfg = configuration;
}
/**
* Makes this FunctionEmitter a copy of the passed one.
*/
public FunctionEmitter(final FunctionEmitter arg) {
+ isInterfaceVal = arg.isInterfaceVal;
modifiers = new ArrayList<EmissionModifier>(arg.modifiers);
commentEmitter = arg.commentEmitter;
defaultOutput = arg.defaultOutput;
- isInterfaceVal = arg.isInterfaceVal;
+ cfg = arg.cfg;
}
public boolean isInterface() { return isInterfaceVal; }
@@ -113,6 +118,8 @@ public abstract class FunctionEmitter {
public abstract String getName();
+ public abstract FunctionSymbol getCSymbol();
+
/**
* Emit the function to the specified output (instead of the default
* output).