net.sourceforge.jane.jjtree
Class JJTreeUtils

java.lang.Object
  |
  +--net.sourceforge.jane.jjtree.JJTreeUtils
All Implemented Interfaces:
JavaParserConstants

public class JJTreeUtils
extends java.lang.Object
implements JavaParserConstants

Utilities for parsing/manipulating JJTree constructs.


Fields inherited from interface net.sourceforge.jane.jjtree.JavaParserConstants
_DEFAULT, ABSTRACT, ANDASSIGN, ASSERT, ASSIGN, BANG, BIT_AND, BIT_OR, BOOLEAN, BREAK, BYTE, CASE, CATCH, CHAR, CHARACTER_LITERAL, CLASS, COLON, COMMA, CONST, CONTINUE, DECIMAL_LITERAL, DECR, DEFAULT, DIGIT, DO, DOT, DOUBLE, ELSE, EOF, EQ, EXPONENT, EXTENDS, FALSE, FINAL, FINALLY, FLOAT, FLOATING_POINT_LITERAL, FOR, FORMAL_COMMENT, GE, GOTO, GT, HEX_LITERAL, HOOK, IDENTIFIER, IF, IMPLEMENTS, IMPORT, IN_FORMAL_COMMENT, IN_MULTI_LINE_COMMENT, IN_SINGLE_LINE_COMMENT, INCR, INSTANCEOF, INT, INTEGER_LITERAL, INTERFACE, LBRACE, LBRACKET, LE, LETTER, LONG, LPAREN, LSHIFT, LSHIFTASSIGN, LT, MINUS, MINUSASSIGN, MULTI_LINE_COMMENT, NATIVE, NE, NEW, NULL, OCTAL_LITERAL, ORASSIGN, PACKAGE, PLUS, PLUSASSIGN, PRIVATE, PROTECTED, PUBLIC, RBRACE, RBRACKET, REM, REMASSIGN, RETURN, RPAREN, RSIGNEDSHIFT, RSIGNEDSHIFTASSIGN, RUNSIGNEDSHIFT, RUNSIGNEDSHIFTASSIGN, SC_AND, SC_OR, SEMICOLON, SHORT, SINGLE_LINE_COMMENT, SLASH, SLASHASSIGN, STAR, STARASSIGN, STATIC, STRICTFP, STRING_LITERAL, SUPER, SWITCH, SYNCHRONIZED, THIS, THROW, THROWS, TILDE, tokenImage, TRANSIENT, TRUE, TRY, VOID, VOLATILE, WHILE, XOR, XORASSIGN
 
Constructor Summary
JJTreeUtils()
           
 
Method Summary
static ChildNodeEnumeration childNodes(Node parent, java.lang.Class type)
          Returns the child nodes of the given type.
static Node findChild(Node parent, int startingIndex, java.lang.Class type)
          Find the first child node of the given type, starting at the given index.
static Node findFirstChild(Node parent, java.lang.Class type)
          Find the first child node of the given type.
static Node findFirstDescendant(Node parent, java.lang.Class type)
          Find the first descendant node of the given type.
static JavaCompilationUnit getCompilationUnit(Node node)
          Returns the compilation unit.
static java.lang.String[] getNameListArray(Node parent)
          Returns an array of names from a JavaNameList.
static java.lang.String getNormalizedTokenImage(int kind)
          Returns the image of the given kind of token.
static JavaCompilationUnit parse(java.io.InputStream in)
          Parse the given input stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JJTreeUtils

public JJTreeUtils()
Method Detail

childNodes

public static ChildNodeEnumeration childNodes(Node parent,
                                              java.lang.Class type)
Returns the child nodes of the given type.

findChild

public static Node findChild(Node parent,
                             int startingIndex,
                             java.lang.Class type)
Find the first child node of the given type, starting at the given index.

findFirstChild

public static Node findFirstChild(Node parent,
                                  java.lang.Class type)
Find the first child node of the given type.

findFirstDescendant

public static Node findFirstDescendant(Node parent,
                                       java.lang.Class type)
Find the first descendant node of the given type.

getNameListArray

public static java.lang.String[] getNameListArray(Node parent)
Returns an array of names from a JavaNameList.

getNormalizedTokenImage

public static java.lang.String getNormalizedTokenImage(int kind)
Returns the image of the given kind of token.

getCompilationUnit

public static JavaCompilationUnit getCompilationUnit(Node node)
Returns the compilation unit.

parse

public static JavaCompilationUnit parse(java.io.InputStream in)
                                 throws ParseException
Parse the given input stream.


Copyright © 2002-2002 SourceForge. All Rights Reserved.