lexx.parser.ast.java
Class JavaAST

java.lang.Object
  |
  +--antlr.BaseAST
        |
        +--antlr.CommonAST
              |
              +--lexx.parser.ast.IncrementAST
                    |
                    +--lexx.parser.ast.java.JavaAST
All Implemented Interfaces:
antlr.collections.AST, java.lang.Cloneable, java.io.Serializable

public final class JavaAST
extends IncrementAST
implements java.lang.Cloneable, java.io.Serializable

Incremental Parsing for java

Parsing is still not perfect

Under Construction

Copyright (c) 2002-2003

Since:
19/03/2003
Version:
0.8
Author:
Mohammed Imran
See Also:
Serialized Form

Field Summary
 
Fields inherited from class lexx.parser.ast.IncrementAST
length, pos, ROOTNODE
 
Fields inherited from class antlr.CommonAST
 
Fields inherited from class antlr.BaseAST
down, right
 
Constructor Summary
JavaAST()
           
 
Method Summary
 java.lang.Object clone()
           
 int[] updateTree(java.lang.String originalCode, int offset, int lengthOfChange)
          This is where incremental parsing will actually occur.
 java.util.List walkThruTree(int pos)
          Given a specific position it walks through the AST until it reaches it
 java.util.List walkThruTree(int pos, int type)
          Given a specific position it walks through the AST until it reaches it
 
Methods inherited from class lexx.parser.ast.IncrementAST
changeChildren, contains, getAllChildren, getAllNodes, getAllNodes, getChild, getIncrementAST, getLexxSubTreeAST, getMax, getMin, getPath, getType, increament, increament, increament, initialize, insert, isValid, remove, setMax, setMin, sortLists, toString, toString, update, update
 
Methods inherited from class antlr.CommonAST
getText, getType, initialize, initialize, setText, setType
 
Methods inherited from class antlr.BaseAST
addChild, decode, encode, equals, equalsList, equalsListPartial, equalsTree, equalsTreePartial, findAll, findAllPartial, getFirstChild, getNextSibling, getNumberOfChildren, removeChildren, setFirstChild, setNextSibling, setVerboseStringConversion, toStringList, toStringTree, xmlSerialize, xmlSerializeNode, xmlSerializeRootClose, xmlSerializeRootOpen
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JavaAST

public JavaAST()
Method Detail

walkThruTree

public final java.util.List walkThruTree(int pos)
Given a specific position it walks through the AST until it reaches it

Specified by:
walkThruTree in class IncrementAST
Parameters:
pos - the postion to walk to
Returns:
it records (inorder) all the nodes/AST visited until reaching that specific position

walkThruTree

public final java.util.List walkThruTree(int pos,
                                         int type)
Given a specific position it walks through the AST until it reaches it

Specified by:
walkThruTree in class IncrementAST
Parameters:
pos - the postion to walk to
type - only include nodes/AST of this type
Returns:
it records (inorder) all the nodes/AST of a specific type visited until reaching that specific position

updateTree

public final int[] updateTree(java.lang.String originalCode,
                              int offset,
                              int lengthOfChange)
                       throws java.lang.Exception
This is where incremental parsing will actually occur. This object contains the old AST of the source code. This method updates this AST

Specified by:
updateTree in class IncrementAST
Parameters:
originalCode - The changed test
offset - The position where the text chagned
lengthOfChange - The amount of text that was inserted/removed
Returns:
the region of coding that has changed. This may be useful if you want to update a syntax highlighter
Throws:
java.lang.Exception

clone

public java.lang.Object clone()
Specified by:
clone in class IncrementAST