aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp/gluegen
diff options
context:
space:
mode:
Diffstat (limited to 'src/java/com/jogamp/gluegen')
-rw-r--r--src/java/com/jogamp/gluegen/GlueGen.java3
-rw-r--r--src/java/com/jogamp/gluegen/cgram/Define.java16
2 files changed, 16 insertions, 3 deletions
diff --git a/src/java/com/jogamp/gluegen/GlueGen.java b/src/java/com/jogamp/gluegen/GlueGen.java
index c4eb1c5..778ed75 100644
--- a/src/java/com/jogamp/gluegen/GlueGen.java
+++ b/src/java/com/jogamp/gluegen/GlueGen.java
@@ -220,8 +220,7 @@ public class GlueGen implements GlueEmitterControls {
}
for (final Object elem : lexer.getDefines()) {
final Define def = (Define) elem;
- // TODO: Add ASTLocusTag
- allConstants.add(new ConstantDefinition(def.getName(), def.getValue(), null));
+ allConstants.add(new ConstantDefinition(def.getName(), def.getValue(), def.getASTLocusTag()));
}
allFunctions = headerParser.getParsedFunctions();
diff --git a/src/java/com/jogamp/gluegen/cgram/Define.java b/src/java/com/jogamp/gluegen/cgram/Define.java
index 797cf6f..23caabd 100644
--- a/src/java/com/jogamp/gluegen/cgram/Define.java
+++ b/src/java/com/jogamp/gluegen/cgram/Define.java
@@ -39,18 +39,32 @@
package com.jogamp.gluegen.cgram;
+import com.jogamp.gluegen.ASTLocusTag;
+import com.jogamp.gluegen.ASTLocusTag.ASTLocusTagProvider;
+
/** Represents a #define of a literal to a value (a number represented
in string form.) */
-public class Define {
+public class Define implements ASTLocusTagProvider {
private final String name;
private final String value;
+ private final ASTLocusTag astLocus;
public Define(final String name, final String value) {
this.name = name;
this.value = value;
+ this.astLocus = null;
+ }
+
+ public Define(final String name, final String value, final ASTLocusTag astLocus) {
+ this.name = name;
+ this.value = value;
+ this.astLocus = astLocus;
}
public String getName() { return name; }
public String getValue() { return value; }
+
+ @Override
+ public ASTLocusTag getASTLocusTag() { return astLocus; }
}