diff options
author | Sven Gothel <[email protected]> | 2015-03-09 07:02:43 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2015-03-09 07:02:43 +0100 |
commit | 5dd12c17bf5037c7ac6a2ac73caf4d61443c4749 (patch) | |
tree | c7d236cfbf44544852fcdab31ad44130471032f0 /src/java/com | |
parent | 8efdf71e2de6392344326ba6a28e8f8fa7e3e8e5 (diff) |
Bug 1134 - Add ASTLocusTagProvider for Define and fix newline in c-parser (Expose source location for log/error messages)
Diffstat (limited to 'src/java/com')
-rw-r--r-- | src/java/com/jogamp/gluegen/GlueGen.java | 3 | ||||
-rw-r--r-- | src/java/com/jogamp/gluegen/cgram/Define.java | 16 |
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; } } |