aboutsummaryrefslogtreecommitdiffstats
path: root/src/classes/com/sun/gluegen/cgram/TNodeFactory.java
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2005-10-24 19:21:03 +0000
committerKenneth Russel <[email protected]>2005-10-24 19:21:03 +0000
commitd6f9dbc493df725d3d574403549de142c5e1222a (patch)
tree8eb152b0627f8d1897a27c5204d6ce2efb4963e4 /src/classes/com/sun/gluegen/cgram/TNodeFactory.java
parent42843c3290d64c41c9c8a18b93f5ad3c00d35ddc (diff)
Merged JSR-231 branch on to the main JOGL trunk. The main trunk now
contains the evolving JSR-231 Reference Implementation and the JSR-231 branch is permanently closed. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@401 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/classes/com/sun/gluegen/cgram/TNodeFactory.java')
-rw-r--r--src/classes/com/sun/gluegen/cgram/TNodeFactory.java33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/classes/com/sun/gluegen/cgram/TNodeFactory.java b/src/classes/com/sun/gluegen/cgram/TNodeFactory.java
new file mode 100644
index 000000000..452363263
--- /dev/null
+++ b/src/classes/com/sun/gluegen/cgram/TNodeFactory.java
@@ -0,0 +1,33 @@
+package com.sun.gluegen.cgram;
+
+import antlr.Token;
+import antlr.ASTFactory;
+import antlr.collections.AST;
+
+/** This class extends ASTFactory to build instances
+ of class TNode */
+public class TNodeFactory extends ASTFactory {
+
+ /** Create a new ampty AST node */
+ public AST create() {
+ return new TNode();
+ }
+
+ /** Create a new AST node from type and text */
+ public AST create(int ttype, String text) {
+ AST ast = new TNode();
+ ast.setType(ttype);
+ ast.setText(text);
+ return ast;
+ }
+
+ /** Create a new AST node from an existing AST node */
+ public AST create(AST ast) {
+ AST newast = new TNode();
+ newast.setType(ast.getType());
+ newast.setText(ast.getText());
+ return newast;
+ }
+
+
+}