summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/java/com/jogamp/gluegen/jgram/JavaParser.g8
-rw-r--r--src/java/com/jogamp/gluegen/jgram/Test.java24
2 files changed, 15 insertions, 17 deletions
diff --git a/src/java/com/jogamp/gluegen/jgram/JavaParser.g b/src/java/com/jogamp/gluegen/jgram/JavaParser.g
index 18f2970..f67579e 100644
--- a/src/java/com/jogamp/gluegen/jgram/JavaParser.g
+++ b/src/java/com/jogamp/gluegen/jgram/JavaParser.g
@@ -155,7 +155,7 @@ tokens {
}
/** Returns the EnumTypes this HeaderParser processed. */
- public Set getParsedEnumNames() {
+ public Set<String> getParsedEnumNames() {
return enumNames;
}
@@ -167,13 +167,13 @@ tokens {
}
/** Returns the list of FunctionSymbols this HeaderParser has parsed. */
- public Set getParsedFunctionNames() {
+ public Set<String> getParsedFunctionNames() {
return functionNames;
}
- private Set/*<String>*/ functionNames = new HashSet();
+ private Set<String> functionNames = new HashSet<String>();
// hash from name of an enumerated value to the EnumType to which it belongs
- private Set/*<String>*/ enumNames = new HashSet();
+ private Set<String> enumNames = new HashSet<String>();
private int blockDepth = 0;
}
diff --git a/src/java/com/jogamp/gluegen/jgram/Test.java b/src/java/com/jogamp/gluegen/jgram/Test.java
index 8baff02..19d2110 100644
--- a/src/java/com/jogamp/gluegen/jgram/Test.java
+++ b/src/java/com/jogamp/gluegen/jgram/Test.java
@@ -1,13 +1,11 @@
package com.jogamp.gluegen.jgram;
-import java.util.*;
-
-import java.io.*;
-// import antlr.collections.AST;
-import antlr.collections.impl.*;
-import antlr.debug.misc.*;
-import antlr.*;
-// import java.awt.event.*;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.Reader;
+import java.util.Iterator;
+import java.util.Set;
class Test {
@@ -74,16 +72,16 @@ class Test {
// start parsing at the compilationUnit rule
parser.compilationUnit();
- Set set = parser.getParsedEnumNames();
+ Set<String> set = parser.getParsedEnumNames();
System.out.println("Enums");
- for(Iterator iter = set.iterator(); iter.hasNext(); ) {
- String s = (String) iter.next();
+ for(Iterator<String> iter = set.iterator(); iter.hasNext(); ) {
+ String s = iter.next();
System.out.println(s);
}
System.out.println("Functions");
set = parser.getParsedFunctionNames();
- for(Iterator iter = set.iterator(); iter.hasNext(); ) {
- String s = (String) iter.next();
+ for(Iterator<String> iter = set.iterator(); iter.hasNext(); ) {
+ String s = iter.next();
System.out.println(s);
}