org.eclipse.jet.core.parser.ast
Class JETASTElement

java.lang.Object
  extended by org.eclipse.jet.core.parser.ast.JETASTElement
Direct Known Subclasses:
BodyElement, JETCompilationUnit

public abstract class JETASTElement
extends java.lang.Object

An abstract class representing common aspects of all JET AST elements.

This class is not intended to be subclassed by clients


Method Summary
 void accept(JETASTVisitor visitor)
          Visit the AST and its contained elements.
protected abstract  void accept0(JETASTVisitor visitor)
          Visit the AST and its contained elements.
 JETAST getAst()
          Return the AST root object
 int getColumn()
          Return the column number (one-based) at which the element starts.
 int getEnd()
          The document relative offset of the first character after the element.
 int getLine()
          Return the line (one-based) on which the element starts.
 JETASTElement getNextElement()
           
 JETASTElement getParent()
           
 JETASTElement getPrevElement()
           
 int getStart()
          The document relative offset of the start of the element.
abstract  boolean removeLineWhenOtherwiseEmpty()
          Indicate whether the the surrounding whitespace, including the trailing new line should be removed from the template output.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getParent

public final JETASTElement getParent()
Returns:
Returns the parent.

getStart

public final int getStart()
The document relative offset of the start of the element.

Returns:
the start offset

getEnd

public final int getEnd()
The document relative offset of the first character after the element.

Returns:
the end offset

accept

public final void accept(JETASTVisitor visitor)
Visit the AST and its contained elements.

Parameters:
visitor -

accept0

protected abstract void accept0(JETASTVisitor visitor)
Visit the AST and its contained elements.

Parameters:
visitor -

getAst

public JETAST getAst()
Return the AST root object

Returns:
the AST root object
Since:
0.8.0

getLine

public final int getLine()
Return the line (one-based) on which the element starts.

Returns:
the line number.

getNextElement

public JETASTElement getNextElement()

getPrevElement

public JETASTElement getPrevElement()

getColumn

public final int getColumn()
Return the column number (one-based) at which the element starts.

Returns:
the column number.

removeLineWhenOtherwiseEmpty

public abstract boolean removeLineWhenOtherwiseEmpty()
Indicate whether the the surrounding whitespace, including the trailing new line should be removed from the template output. In general, elements that create output should return false, while element that do should should return true.

Returns:
true if the containing line should be removed if otherwise empty.

Copyright 2006 IBM Corporation and others.
All Rights Reserved.