GlueGen v2.6.0-rc-20250712
GlueGen, Native Binding Generator for Java™ (public API).
TNodeFactory.java
Go to the documentation of this file.
1package com.jogamp.gluegen.cgram;
2
3import antlr.ASTFactory;
4import antlr.collections.AST;
5
6/** This class extends ASTFactory to build instances
7 of class TNode */
8public class TNodeFactory extends ASTFactory {
9
10 /** Create a new ampty AST node */
11 @Override
12 public AST create() {
13 return new TNode();
14 }
15
16 /** Create a new AST node from type and text */
17 @Override
18 public AST create(final int ttype, final String text) {
19 final AST ast = new TNode();
20 ast.setType(ttype);
21 ast.setText(text);
22 return ast;
23 }
24
25 /** Create a new AST node from an existing AST node */
26 @Override
27 public AST create(final AST ast) {
28 final AST newast = new TNode();
29 newast.setType(ast.getType());
30 newast.setText(ast.getText());
31 return newast;
32 }
33
34
35}
This class extends ASTFactory to build instances of class TNode.
AST create(final AST ast)
Create a new AST node from an existing AST node.
AST create()
Create a new ampty AST node.
AST create(final int ttype, final String text)
Create a new AST node from type and text.
Class TNode is an implementation of the AST interface and adds many useful features:
Definition: TNode.java:38