lexx.parser.ast.java
Class JavaASTAnalyser

java.lang.Object
  |
  +--lexx.parser.ast.java.JavaASTAnalyser
All Implemented Interfaces:
ASTAnalyser

public final class JavaASTAnalyser
extends java.lang.Object
implements ASTAnalyser

This takes a JavaAST and analyses it

This class extends ANTLRs and give you the environment/possible variables/methods what can be called at a given position. It also says what are the possible classes available in the current AST

Copyright (c) 2002-2003

Since:
19/03/2003
Version:
1.0
Author:
Mohammed Imran

Constructor Summary
JavaASTAnalyser(IncrementAST rootTree, JavaPackages packages)
           
 
Method Summary
 java.lang.String getCurrentClassName()
           
static ASTAnalyser getDeafult()
           
static ASTAnalyser getDeafult(JavaPackages pack)
           
 Trie getEnvironmentAt(int pos)
          Tells you what variables/methods can be called at a specific position.
static java.lang.String getFullName(antlr.collections.AST node)
           
 java.lang.String getPackageName()
          returns the package of class that the AST
 Trie getPossibleClassesSmallList()
          Tells you what classes/object can be created/called given an AST.
 Trie getPossibleObjects()
          Tells you what classes/object can be created/called given an AST
 java.lang.String getSuperClass()
          returns the name of class that the AST is extending
 int getType(java.lang.Class c)
          This method works out if you can view public, private, or protected methods and files
 void setAST(IncrementAST rootTree)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaASTAnalyser

public JavaASTAnalyser(IncrementAST rootTree,
                       JavaPackages packages)
Method Detail

setAST

public void setAST(IncrementAST rootTree)

getType

public final int getType(java.lang.Class c)
This method works out if you can view public, private, or protected methods and files

Parameters:
c - - Class you wish to find out which methods/variables are accessible
Returns:
- refer to JavaObjectUtil types

getPossibleObjects

public final Trie getPossibleObjects()
Tells you what classes/object can be created/called given an AST

Specified by:
getPossibleObjects in interface ASTAnalyser
Returns:
a trie data structure

getPossibleClassesSmallList

public final Trie getPossibleClassesSmallList()
Tells you what classes/object can be created/called given an AST. However it ignores classes with full names like javax.swing.JPanel as this trie can be very large

Returns:
a trie data structure

getEnvironmentAt

public final Trie getEnvironmentAt(int pos)
Tells you what variables/methods can be called at a specific position. This also include inhertited variables/methods

Specified by:
getEnvironmentAt in interface ASTAnalyser
Parameters:
pos - the position where you want to get its enviroment
Returns:
a trie data structure

getPackageName

public final java.lang.String getPackageName()
returns the package of class that the AST

Returns:
the package of class that the AST

getSuperClass

public final java.lang.String getSuperClass()
returns the name of class that the AST is extending

Returns:
the name of class that the AST is extending

getCurrentClassName

public final java.lang.String getCurrentClassName()

getDeafult

public static ASTAnalyser getDeafult()

getDeafult

public static ASTAnalyser getDeafult(JavaPackages pack)

getFullName

public static java.lang.String getFullName(antlr.collections.AST node)