com.sun.tools.javac.jvm
Class CRTable.SourceComputer

java.lang.Object
  extended by com.sun.tools.javac.tree.JCTree.Visitor
      extended by com.sun.tools.javac.jvm.CRTable.SourceComputer
Enclosing class:
CRTable

 class CRTable.SourceComputer
extends JCTree.Visitor

This class contains methods to compute source positions for trees. Extends Tree.Visitor to traverse the abstract syntax tree.


Field Summary
(package private)  CRTable.SourceRange result
          The result of the tree traversal methods.
 
Constructor Summary
CRTable.SourceComputer()
           
 
Method Summary
 CRTable.SourceRange csp(JCTree tree)
          Visitor method: compute source positions for a single node.
 CRTable.SourceRange csp(List<? extends JCTree> trees)
          Visitor method: compute source positions for a list of nodes.
 CRTable.SourceRange cspCases(List<JCTree.JCCase> trees)
          Visitor method: compute source positions for a list of case blocks of switch statements.
 CRTable.SourceRange cspCatchers(List<JCTree.JCCatch> trees)
          Visitor method: compute source positions for a list of catch clauses in try statements.
 int endPos(JCTree tree)
          The end position of given tree, if it has defined endpos, NOPOS otherwise.
 int startPos(JCTree tree)
          The start position of given tree.
 void visitApply(JCTree.JCMethodInvocation tree)
           
 void visitAssert(JCTree.JCAssert tree)
           
 void visitAssign(JCTree.JCAssign tree)
           
 void visitAssignop(JCTree.JCAssignOp tree)
           
 void visitBinary(JCTree.JCBinary tree)
           
 void visitBlock(JCTree.JCBlock tree)
           
 void visitBreak(JCTree.JCBreak tree)
           
 void visitCase(JCTree.JCCase tree)
           
 void visitCatch(JCTree.JCCatch tree)
           
 void visitConditional(JCTree.JCConditional tree)
           
 void visitContinue(JCTree.JCContinue tree)
           
 void visitDoLoop(JCTree.JCDoWhileLoop tree)
           
 void visitErroneous(JCTree.JCErroneous tree)
           
 void visitExec(JCTree.JCExpressionStatement tree)
           
 void visitForeachLoop(JCTree.JCEnhancedForLoop tree)
           
 void visitForLoop(JCTree.JCForLoop tree)
           
 void visitIdent(JCTree.JCIdent tree)
           
 void visitIf(JCTree.JCIf tree)
           
 void visitIndexed(JCTree.JCArrayAccess tree)
           
 void visitLabelled(JCTree.JCLabeledStatement tree)
           
 void visitLiteral(JCTree.JCLiteral tree)
           
 void visitMethodDef(JCTree.JCMethodDecl tree)
           
 void visitNewArray(JCTree.JCNewArray tree)
           
 void visitNewClass(JCTree.JCNewClass tree)
           
 void visitParens(JCTree.JCParens tree)
           
 void visitReturn(JCTree.JCReturn tree)
           
 void visitSelect(JCTree.JCFieldAccess tree)
           
 void visitSkip(JCTree.JCSkip tree)
           
 void visitSwitch(JCTree.JCSwitch tree)
           
 void visitSynchronized(JCTree.JCSynchronized tree)
           
 void visitThrow(JCTree.JCThrow tree)
           
 void visitTree(JCTree tree)
           
 void visitTry(JCTree.JCTry tree)
           
 void visitTypeApply(JCTree.JCTypeApply tree)
           
 void visitTypeArray(JCTree.JCArrayTypeTree tree)
           
 void visitTypeCast(JCTree.JCTypeCast tree)
           
 void visitTypeIdent(JCTree.JCPrimitiveTypeTree tree)
           
 void visitTypeParameter(JCTree.JCTypeParameter tree)
           
 void visitTypeTest(JCTree.JCInstanceOf tree)
           
 void visitUnary(JCTree.JCUnary tree)
           
 void visitVarDef(JCTree.JCVariableDecl tree)
           
 void visitWhileLoop(JCTree.JCWhileLoop tree)
           
 void visitWildcard(JCTree.JCWildcard tree)
           
 
Methods inherited from class com.sun.tools.javac.tree.JCTree.Visitor
visitAnnotation, visitBracketExpr, visitBracketStat, visitClassDef, visitEscapeExpr, visitEscapeStat, visitImport, visitLetExpr, visitModifiers, visitTopLevel, visitTypeBoundKind
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

result

CRTable.SourceRange result
The result of the tree traversal methods.

Constructor Detail

CRTable.SourceComputer

CRTable.SourceComputer()
Method Detail

csp

public CRTable.SourceRange csp(JCTree tree)
Visitor method: compute source positions for a single node.


csp

public CRTable.SourceRange csp(List<? extends JCTree> trees)
Visitor method: compute source positions for a list of nodes.


cspCases

public CRTable.SourceRange cspCases(List<JCTree.JCCase> trees)
Visitor method: compute source positions for a list of case blocks of switch statements.


cspCatchers

public CRTable.SourceRange cspCatchers(List<JCTree.JCCatch> trees)
Visitor method: compute source positions for a list of catch clauses in try statements.


visitMethodDef

public void visitMethodDef(JCTree.JCMethodDecl tree)
Overrides:
visitMethodDef in class JCTree.Visitor

visitVarDef

public void visitVarDef(JCTree.JCVariableDecl tree)
Overrides:
visitVarDef in class JCTree.Visitor

visitSkip

public void visitSkip(JCTree.JCSkip tree)
Overrides:
visitSkip in class JCTree.Visitor

visitBlock

public void visitBlock(JCTree.JCBlock tree)
Overrides:
visitBlock in class JCTree.Visitor

visitDoLoop

public void visitDoLoop(JCTree.JCDoWhileLoop tree)
Overrides:
visitDoLoop in class JCTree.Visitor

visitWhileLoop

public void visitWhileLoop(JCTree.JCWhileLoop tree)
Overrides:
visitWhileLoop in class JCTree.Visitor

visitForLoop

public void visitForLoop(JCTree.JCForLoop tree)
Overrides:
visitForLoop in class JCTree.Visitor

visitForeachLoop

public void visitForeachLoop(JCTree.JCEnhancedForLoop tree)
Overrides:
visitForeachLoop in class JCTree.Visitor

visitLabelled

public void visitLabelled(JCTree.JCLabeledStatement tree)
Overrides:
visitLabelled in class JCTree.Visitor

visitSwitch

public void visitSwitch(JCTree.JCSwitch tree)
Overrides:
visitSwitch in class JCTree.Visitor

visitCase

public void visitCase(JCTree.JCCase tree)
Overrides:
visitCase in class JCTree.Visitor

visitSynchronized

public void visitSynchronized(JCTree.JCSynchronized tree)
Overrides:
visitSynchronized in class JCTree.Visitor

visitTry

public void visitTry(JCTree.JCTry tree)
Overrides:
visitTry in class JCTree.Visitor

visitCatch

public void visitCatch(JCTree.JCCatch tree)
Overrides:
visitCatch in class JCTree.Visitor

visitConditional

public void visitConditional(JCTree.JCConditional tree)
Overrides:
visitConditional in class JCTree.Visitor

visitIf

public void visitIf(JCTree.JCIf tree)
Overrides:
visitIf in class JCTree.Visitor

visitExec

public void visitExec(JCTree.JCExpressionStatement tree)
Overrides:
visitExec in class JCTree.Visitor

visitBreak

public void visitBreak(JCTree.JCBreak tree)
Overrides:
visitBreak in class JCTree.Visitor

visitContinue

public void visitContinue(JCTree.JCContinue tree)
Overrides:
visitContinue in class JCTree.Visitor

visitReturn

public void visitReturn(JCTree.JCReturn tree)
Overrides:
visitReturn in class JCTree.Visitor

visitThrow

public void visitThrow(JCTree.JCThrow tree)
Overrides:
visitThrow in class JCTree.Visitor

visitAssert

public void visitAssert(JCTree.JCAssert tree)
Overrides:
visitAssert in class JCTree.Visitor

visitApply

public void visitApply(JCTree.JCMethodInvocation tree)
Overrides:
visitApply in class JCTree.Visitor

visitNewClass

public void visitNewClass(JCTree.JCNewClass tree)
Overrides:
visitNewClass in class JCTree.Visitor

visitNewArray

public void visitNewArray(JCTree.JCNewArray tree)
Overrides:
visitNewArray in class JCTree.Visitor

visitParens

public void visitParens(JCTree.JCParens tree)
Overrides:
visitParens in class JCTree.Visitor

visitAssign

public void visitAssign(JCTree.JCAssign tree)
Overrides:
visitAssign in class JCTree.Visitor

visitAssignop

public void visitAssignop(JCTree.JCAssignOp tree)
Overrides:
visitAssignop in class JCTree.Visitor

visitUnary

public void visitUnary(JCTree.JCUnary tree)
Overrides:
visitUnary in class JCTree.Visitor

visitBinary

public void visitBinary(JCTree.JCBinary tree)
Overrides:
visitBinary in class JCTree.Visitor

visitTypeCast

public void visitTypeCast(JCTree.JCTypeCast tree)
Overrides:
visitTypeCast in class JCTree.Visitor

visitTypeTest

public void visitTypeTest(JCTree.JCInstanceOf tree)
Overrides:
visitTypeTest in class JCTree.Visitor

visitIndexed

public void visitIndexed(JCTree.JCArrayAccess tree)
Overrides:
visitIndexed in class JCTree.Visitor

visitSelect

public void visitSelect(JCTree.JCFieldAccess tree)
Overrides:
visitSelect in class JCTree.Visitor

visitIdent

public void visitIdent(JCTree.JCIdent tree)
Overrides:
visitIdent in class JCTree.Visitor

visitLiteral

public void visitLiteral(JCTree.JCLiteral tree)
Overrides:
visitLiteral in class JCTree.Visitor

visitTypeIdent

public void visitTypeIdent(JCTree.JCPrimitiveTypeTree tree)
Overrides:
visitTypeIdent in class JCTree.Visitor

visitTypeArray

public void visitTypeArray(JCTree.JCArrayTypeTree tree)
Overrides:
visitTypeArray in class JCTree.Visitor

visitTypeApply

public void visitTypeApply(JCTree.JCTypeApply tree)
Overrides:
visitTypeApply in class JCTree.Visitor

visitTypeParameter

public void visitTypeParameter(JCTree.JCTypeParameter tree)
Overrides:
visitTypeParameter in class JCTree.Visitor

visitWildcard

public void visitWildcard(JCTree.JCWildcard tree)
Overrides:
visitWildcard in class JCTree.Visitor

visitErroneous

public void visitErroneous(JCTree.JCErroneous tree)
Overrides:
visitErroneous in class JCTree.Visitor

visitTree

public void visitTree(JCTree tree)
Overrides:
visitTree in class JCTree.Visitor

startPos

public int startPos(JCTree tree)
The start position of given tree.


endPos

public int endPos(JCTree tree)
The end position of given tree, if it has defined endpos, NOPOS otherwise.