All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.jogamp.gluegen.cgram.TNodeFactory Maven / Gradle / Ivy

There is a newer version: 2.3.2
Show newest version
package com.jogamp.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 */
  @Override
  public AST create() {
    return new TNode();
  }

        /** Create a new AST node from type and text */
        @Override
        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 */
        @Override
        public AST create(AST ast) {
                AST newast = new TNode();
                newast.setType(ast.getType());
                newast.setText(ast.getText());
                return newast;
        }


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy