com.octagroup.foregej.java.lang
Class JavaAST

java.lang.Object
  |
  +--antlr.BaseAST
        |
        +--antlr.CommonAST
              |
              +--antlr.CommonASTWithHiddenTokens
                    |
                    +--com.octagroup.foregej.antlr.BaseAST
                          |
                          +--com.octagroup.foregej.java.lang.JavaAST
All Implemented Interfaces:
antlr.collections.AST, java.io.Serializable
Direct Known Subclasses:
AST_ARRAY_DECLARATOR, AST_ARRAY_INIT, AST_BNOT, AST_BREAK, AST_CASE, AST_CASE_GROUP, AST_CHAR_LITERAL, AST_CLASS_DEF, AST_CONTINUE, AST_CTOR_CALL, AST_CTOR_DEF, AST_DEC, AST_DO, AST_ELIST, AST_EMPTY_STAT, AST_EXPR, AST_EXTENDS_CLAUSE, AST_FINALLY_CLAUSE, AST_FOR, AST_FOR_CONDITION, AST_FOR_INIT, AST_FOR_ITERATOR, AST_HANDLER, AST_IF, AST_IMPLEMENTS_CLAUSE, AST_IMPORT, AST_INC, AST_INDEX_OP, AST_INTERFACE_DEF, AST_LABELED_STAT, AST_LNOT, AST_METHOD_CALL, AST_METHOD_DEF, AST_MODIFIERS, AST_NEW_EXPRESSION, AST_NUM_LONG, AST_OBJBLOCK, AST_PACKAGE_DEF, AST_PARAMETER_DEF, AST_PARAMETERS, AST_POST_DEC, AST_POST_INC, AST_QUESTION, AST_RETURN, AST_SLIST, AST_STATIC_INIT, AST_STRICTFP, AST_SUPER_CTOR_CALL, AST_SWITCH, AST_SYNCHRONIZED, AST_THROW, AST_THROWS_CLAUSE, AST_TRY_BLOCK, AST_TYPE, AST_TYPECAST, AST_UNARY_MINUS, AST_UNARY_PLUS, AST_VARIABLE_DEF, AST_WHILE, BiOp, CompilationUnit, Identifier, Literal

public class JavaAST
extends BaseAST

See Also:
Serialized Form

Field Summary
protected  JavaRecognizer javaRecognizer_
          the java recognizer used to parse data
 
Fields inherited from class com.octagroup.foregej.antlr.BaseAST
astFactory_, WRAP_PREF_NO, WRAP_PREF_NONE, WRAP_PREF_OK
 
Fields inherited from class antlr.CommonASTWithHiddenTokens
hiddenAfter, hiddenBefore
 
Fields inherited from class antlr.BaseAST
down, right
 
Constructor Summary
JavaAST()
           
 
Method Summary
 java.util.List getCommentsAfter()
          Returns all the comments after this node.
 java.util.List getCommentsBefore()
          Returns all the comments before this node.
 TOK_JAVA_COMMENT getJavadoc()
          Returns the javadoc associated with this JavaAST.
 AST_JAVADOC getJavadocAst()
          Returns the javadoc AST associated with this JavaAST.
 boolean hasCommentsAfter()
          Returns true if this node has any comments attached after it.
 boolean hasCommentsBefore()
          Returns true if this node has any comments attached before it.
 void initialize(antlr.collections.AST ast)
          Adds functionality when initializing an AST from another ast.
 void setJavadoc(TOK_JAVA_COMMENT javadoc)
          Sets the javadoc asociated with this AST.
 void setJavadocAst(AST_JAVADOC javadoc)
          Sets the javadoc asociated with this AST.
 void setupRecognizer(java.lang.String s)
          Sets up the recognized so that it parses the supplied string.
 void setupRecognizer(java.lang.String fileName, java.io.Reader source)
          Sets up the recognizer so that it parses the supplied source.
 void stealCommentsFromFirstChild(java.lang.Class type)
          This method steals comments from the first child.
 void stealJavadocFromFirstChild()
          This method steals the javadoc from the first child.
 java.lang.String toString()
          Returns a string representation of the AST.
 
Methods inherited from class com.octagroup.foregej.antlr.BaseAST
deepCopy, deepCopy, equals, equals, getChildAST, getChildASTs, getChildASTsExcluding, getParentAst, getWrappingPreference, insertAfter, insertFirst, replaceAST, setASTFactory, setFirstChild, setFirstChildForced, setHiddenAfter, setHiddenBefore, setNextSibling, setNextSiblingForced, setParentAst, setType, toString, write
 
Methods inherited from class antlr.CommonASTWithHiddenTokens
getHiddenAfter, getHiddenBefore, initialize
 
Methods inherited from class antlr.CommonAST
getText, getType, initialize, setText
 
Methods inherited from class antlr.BaseAST
addChild, decode, encode, equals, equalsList, equalsListPartial, equalsTree, equalsTreePartial, findAll, findAllPartial, getFirstChild, getNextSibling, getNumberOfChildren, removeChildren, setVerboseStringConversion, toStringList, toStringTree, xmlSerialize, xmlSerializeNode, xmlSerializeRootClose, xmlSerializeRootOpen
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

javaRecognizer_

protected JavaRecognizer javaRecognizer_
the java recognizer used to parse data
Constructor Detail

JavaAST

public JavaAST()
Method Detail

initialize

public void initialize(antlr.collections.AST ast)
Adds functionality when initializing an AST from another ast.

This is done by the DynASTFactory when it discovers that an AST instance is not of the correct class.

Overrides:
initialize in class antlr.CommonAST
Parameters:
ast -  

getJavadoc

public TOK_JAVA_COMMENT getJavadoc()
Returns the javadoc associated with this JavaAST.
Returns:
the javadoc associated with this JavaAST.

setJavadoc

public void setJavadoc(TOK_JAVA_COMMENT javadoc)
Sets the javadoc asociated with this AST.
Parameters:
javadoc - the javadoc to set.

getJavadocAst

public AST_JAVADOC getJavadocAst()
Returns the javadoc AST associated with this JavaAST.

This method fetches the javadoc token an returns the ast from that token. If there is no javadok token associated with this ast or we failed to parse the javadoc null will be returned.

Returns:
the javadoc associated with this JavaAST.

setJavadocAst

public void setJavadocAst(AST_JAVADOC javadoc)
Sets the javadoc asociated with this AST.

If there is a javadoc token associated with this ast it will be replaced.

Parameters:
javadoc - the javadoc to set.

getCommentsBefore

public java.util.List getCommentsBefore()
Returns all the comments before this node.
Returns:
all the comments before this node.

getCommentsAfter

public java.util.List getCommentsAfter()
Returns all the comments after this node.
Returns:
all the comments after this node.

hasCommentsBefore

public boolean hasCommentsBefore()
Returns true if this node has any comments attached before it.
Returns:
true if this node has any comments attached before it.

hasCommentsAfter

public boolean hasCommentsAfter()
Returns true if this node has any comments attached after it.
Returns:
true if this node has any comments attached after it.

stealCommentsFromFirstChild

public void stealCommentsFromFirstChild(java.lang.Class type)
This method steals comments from the first child.

This metod is normally invoked from an abstract AST that combines some other asts. ie CompilationUnit or AST_METHOD_DEF

Parameters:
type -  

stealJavadocFromFirstChild

public void stealJavadocFromFirstChild()
This method steals the javadoc from the first child.

setupRecognizer

public void setupRecognizer(java.lang.String s)
Sets up the recognized so that it parses the supplied string.
Parameters:
s - the string to parse

setupRecognizer

public void setupRecognizer(java.lang.String fileName,
                            java.io.Reader source)
Sets up the recognizer so that it parses the supplied source.
Parameters:
fileName - the name of the source.
source - the source to parse.

toString

public java.lang.String toString()
Returns a string representation of the AST.
Overrides:
toString in class BaseAST
Returns:
 


Copyright © 2003 El Icognito des Noboby. All Rights Reserved.