summaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp/gluegen/ConstantDefinition.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2015-03-06 07:28:35 +0100
committerSven Gothel <[email protected]>2015-03-06 07:28:35 +0100
commit8eb9e27bccca4a0cd6a0b1b15bee76576ce030c3 (patch)
tree27dc3f766a4c5085325fd6a019bd92b9c99f46ee /src/java/com/jogamp/gluegen/ConstantDefinition.java
parentea6df88075c44f6b6317920119d6b33d5d97b362 (diff)
Bug 1134 - Add ASTLocationTag, locating source of [semantic] errors while parsing / analyzing
New GlueGenException supports ASTLocationTag, which will be throws in case of semantic and/or parsing errors.
Diffstat (limited to 'src/java/com/jogamp/gluegen/ConstantDefinition.java')
-rw-r--r--src/java/com/jogamp/gluegen/ConstantDefinition.java15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/java/com/jogamp/gluegen/ConstantDefinition.java b/src/java/com/jogamp/gluegen/ConstantDefinition.java
index 78d2e43..1ea4233 100644
--- a/src/java/com/jogamp/gluegen/ConstantDefinition.java
+++ b/src/java/com/jogamp/gluegen/ConstantDefinition.java
@@ -33,24 +33,27 @@
package com.jogamp.gluegen;
+import com.jogamp.gluegen.ASTLocusTag.ASTLocusTagProvider;
import com.jogamp.gluegen.cgram.types.AliasedSymbol.AliasedSymbolImpl;
import com.jogamp.gluegen.cgram.types.TypeComparator.AliasedSemanticSymbol;
import com.jogamp.gluegen.cgram.types.TypeComparator.SemanticEqualityOp;
/** Represents the definition of a constant which was provided either
via a #define statement or through an enum definition. */
-public class ConstantDefinition extends AliasedSymbolImpl implements AliasedSemanticSymbol {
+public class ConstantDefinition extends AliasedSymbolImpl implements AliasedSemanticSymbol, ASTLocusTagProvider {
private final boolean relaxedEqSem;
private final String sValue;
private final long iValue;
private final boolean hasIntValue;
private final boolean isEnum;
private final String enumName;
+ private final ASTLocusTag astLocus;
/** Covering enums */
public ConstantDefinition(final String name,
final long value,
- final String enumName) {
+ final String enumName,
+ final ASTLocusTag astLocus) {
super(name);
this.relaxedEqSem = TypeConfig.relaxedEqualSemanticsTest();
this.sValue = String.valueOf(value);
@@ -58,11 +61,13 @@ public class ConstantDefinition extends AliasedSymbolImpl implements AliasedSema
this.hasIntValue = true;
this.isEnum = true;
this.enumName = enumName;
+ this.astLocus = astLocus;
}
/** Covering defines */
public ConstantDefinition(final String name,
- final String value) {
+ final String value,
+ final ASTLocusTag astLocus) {
super(name);
this.relaxedEqSem = TypeConfig.relaxedEqualSemanticsTest();
this.sValue = value;
@@ -82,8 +87,12 @@ public class ConstantDefinition extends AliasedSymbolImpl implements AliasedSema
}
this.isEnum = false;
this.enumName = null;
+ this.astLocus = astLocus;
}
+ @Override
+ public ASTLocusTag getASTLocusTag() { return astLocus; }
+
/**
* Hash by its given {@link #getName() name}.
*/