Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.eclipse.jdt.core.dom
Class ASTConverter  view ASTConverter download ASTConverter.java

java.lang.Object
  extended byorg.eclipse.jdt.core.dom.ASTConverter

class ASTConverter
extends java.lang.Object

Internal class for converting internal compiler ASTs into public ASTs.


Field Summary
private  AST ast
           
private  DefaultCommentMapper commentMapper
           
private  Comment[] commentsTable
           
(package private)  char[] compilationUnitSource
           
private  DocCommentParser docParser
           
private  boolean insideComments
           
private  org.eclipse.core.runtime.IProgressMonitor monitor
           
private  java.util.Set pendingNameScopeResolution
           
private  java.util.Set pendingThisExpressionScopeResolution
           
private  boolean resolveBindings
           
(package private)  org.eclipse.jdt.internal.compiler.parser.Scanner scanner
           
 
Constructor Summary
ASTConverter(java.util.Map options, boolean resolveBindings, org.eclipse.core.runtime.IProgressMonitor monitor)
           
 
Method Summary
private  void adjustSourcePositionsForParent(org.eclipse.jdt.internal.compiler.ast.Expression expression)
           
private  void buildBodyDeclarations(org.eclipse.jdt.internal.compiler.ast.TypeDeclaration expression, AnonymousClassDeclaration anonymousClassDeclaration)
           
private  void buildBodyDeclarations(org.eclipse.jdt.internal.compiler.ast.TypeDeclaration typeDeclaration, TypeDeclaration typeDecl)
           
(package private)  void buildCommentsTable(CompilationUnit compilationUnit, int[][] comments)
           
private  void checkAndAddMultipleFieldDeclaration(org.eclipse.jdt.internal.compiler.ast.FieldDeclaration[] fields, int index, java.util.List bodyDeclarations)
           
private  void checkAndAddMultipleLocalDeclaration(org.eclipse.jdt.internal.compiler.ast.Statement[] stmts, int index, java.util.List blockStatements)
           
private  void checkCanceled()
           
private  void completeRecord(ArrayType arrayType, org.eclipse.jdt.internal.compiler.ast.ASTNode astNode)
           
 MethodDeclaration convert(org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration methodDeclaration)
           
 ClassInstanceCreation convert(org.eclipse.jdt.internal.compiler.ast.AllocationExpression expression)
           
 Expression convert(org.eclipse.jdt.internal.compiler.ast.AND_AND_Expression expression)
           
 SingleVariableDeclaration convert(org.eclipse.jdt.internal.compiler.ast.Argument argument)
           
 ArrayCreation convert(org.eclipse.jdt.internal.compiler.ast.ArrayAllocationExpression expression)
           
 ArrayInitializer convert(org.eclipse.jdt.internal.compiler.ast.ArrayInitializer expression)
           
 ArrayAccess convert(org.eclipse.jdt.internal.compiler.ast.ArrayReference reference)
           
 AssertStatement convert(org.eclipse.jdt.internal.compiler.ast.AssertStatement statement)
           
 Assignment convert(org.eclipse.jdt.internal.compiler.ast.Assignment expression)
           
 TypeDeclaration convert(org.eclipse.jdt.internal.compiler.ast.ASTNode[] nodes)
           
 Expression convert(org.eclipse.jdt.internal.compiler.ast.BinaryExpression expression)
           
 Block convert(org.eclipse.jdt.internal.compiler.ast.Block statement)
           
 BreakStatement convert(org.eclipse.jdt.internal.compiler.ast.BreakStatement statement)
           
 SwitchCase convert(org.eclipse.jdt.internal.compiler.ast.CaseStatement statement)
           
 CastExpression convert(org.eclipse.jdt.internal.compiler.ast.CastExpression expression)
           
 CharacterLiteral convert(org.eclipse.jdt.internal.compiler.ast.CharLiteral expression)
           
 Expression convert(org.eclipse.jdt.internal.compiler.ast.ClassLiteralAccess expression)
           
 CompilationUnit convert(org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration unit, char[] source)
           
 Assignment convert(org.eclipse.jdt.internal.compiler.ast.CompoundAssignment expression)
           
 ConditionalExpression convert(org.eclipse.jdt.internal.compiler.ast.ConditionalExpression expression)
           
 ContinueStatement convert(org.eclipse.jdt.internal.compiler.ast.ContinueStatement statement)
           
 DoStatement convert(org.eclipse.jdt.internal.compiler.ast.DoStatement statement)
           
 NumberLiteral convert(org.eclipse.jdt.internal.compiler.ast.DoubleLiteral expression)
           
 EmptyStatement convert(org.eclipse.jdt.internal.compiler.ast.EmptyStatement statement)
           
 Expression convert(org.eclipse.jdt.internal.compiler.ast.EqualExpression expression)
           
 Statement convert(org.eclipse.jdt.internal.compiler.ast.ExplicitConstructorCall statement)
           
 Expression convert(org.eclipse.jdt.internal.compiler.ast.Expression expression)
           
 StringLiteral convert(org.eclipse.jdt.internal.compiler.ast.ExtendedStringLiteral expression)
           
 BooleanLiteral convert(org.eclipse.jdt.internal.compiler.ast.FalseLiteral expression)
           
 Expression convert(org.eclipse.jdt.internal.compiler.ast.FieldReference reference)
           
 NumberLiteral convert(org.eclipse.jdt.internal.compiler.ast.FloatLiteral expression)
           
 ForStatement convert(org.eclipse.jdt.internal.compiler.ast.ForStatement statement)
           
 IfStatement convert(org.eclipse.jdt.internal.compiler.ast.IfStatement statement)
           
 InstanceofExpression convert(org.eclipse.jdt.internal.compiler.ast.InstanceOfExpression expression)
           
 NumberLiteral convert(org.eclipse.jdt.internal.compiler.ast.IntLiteral expression)
           
 NumberLiteral convert(org.eclipse.jdt.internal.compiler.ast.IntLiteralMinValue expression)
           
 void convert(org.eclipse.jdt.internal.compiler.ast.Javadoc javadoc, BodyDeclaration bodyDeclaration)
           
 LabeledStatement convert(org.eclipse.jdt.internal.compiler.ast.LabeledStatement statement)
           
 NumberLiteral convert(org.eclipse.jdt.internal.compiler.ast.LongLiteral expression)
           
 NumberLiteral convert(org.eclipse.jdt.internal.compiler.ast.LongLiteralMinValue expression)
           
 Expression convert(org.eclipse.jdt.internal.compiler.ast.MessageSend expression)
           
 Name convert(org.eclipse.jdt.internal.compiler.ast.NameReference reference)
           
 NullLiteral convert(org.eclipse.jdt.internal.compiler.ast.NullLiteral expression)
           
 Expression convert(org.eclipse.jdt.internal.compiler.ast.OR_OR_Expression expression)
           
 PostfixExpression convert(org.eclipse.jdt.internal.compiler.ast.PostfixExpression expression)
           
 PrefixExpression convert(org.eclipse.jdt.internal.compiler.ast.PrefixExpression expression)
           
 Expression convert(org.eclipse.jdt.internal.compiler.ast.QualifiedAllocationExpression allocation)
           
 Name convert(org.eclipse.jdt.internal.compiler.ast.QualifiedNameReference nameReference)
           
 Name convert(org.eclipse.jdt.internal.compiler.ast.QualifiedSuperReference reference)
           
 ThisExpression convert(org.eclipse.jdt.internal.compiler.ast.QualifiedThisReference reference)
           
 Expression convert(org.eclipse.jdt.internal.compiler.ast.Reference reference)
           
 ReturnStatement convert(org.eclipse.jdt.internal.compiler.ast.ReturnStatement statement)
           
 SimpleName convert(org.eclipse.jdt.internal.compiler.ast.SingleNameReference nameReference)
           
 Statement convert(org.eclipse.jdt.internal.compiler.ast.Statement statement)
           
 StringLiteral convert(org.eclipse.jdt.internal.compiler.ast.StringLiteral expression)
           
 InfixExpression convert(org.eclipse.jdt.internal.compiler.ast.StringLiteralConcatenation expression)
           
 SwitchStatement convert(org.eclipse.jdt.internal.compiler.ast.SwitchStatement statement)
           
 SynchronizedStatement convert(org.eclipse.jdt.internal.compiler.ast.SynchronizedStatement statement)
           
 Expression convert(org.eclipse.jdt.internal.compiler.ast.ThisReference reference)
           
 ThrowStatement convert(org.eclipse.jdt.internal.compiler.ast.ThrowStatement statement)
           
 BooleanLiteral convert(org.eclipse.jdt.internal.compiler.ast.TrueLiteral expression)
           
 TryStatement convert(org.eclipse.jdt.internal.compiler.ast.TryStatement statement)
           
 TypeDeclaration convert(org.eclipse.jdt.internal.compiler.ast.TypeDeclaration typeDeclaration)
           
 Name convert(org.eclipse.jdt.internal.compiler.ast.TypeReference typeReference)
           
 PrefixExpression convert(org.eclipse.jdt.internal.compiler.ast.UnaryExpression expression)
           
 WhileStatement convert(org.eclipse.jdt.internal.compiler.ast.WhileStatement statement)
           
 ImportDeclaration convertImport(org.eclipse.jdt.internal.compiler.ast.ImportReference importReference)
           
 PackageDeclaration convertPackage(org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration compilationUnitDeclaration)
           
 Expression convertToExpression(org.eclipse.jdt.internal.compiler.ast.Statement statement)
           
private  FieldDeclaration convertToFieldDeclaration(org.eclipse.jdt.internal.compiler.ast.FieldDeclaration fieldDecl)
           
 ParenthesizedExpression convertToParenthesizedExpression(org.eclipse.jdt.internal.compiler.ast.Expression expression)
           
 Type convertToType(org.eclipse.jdt.internal.compiler.ast.NameReference reference)
           
private  VariableDeclarationExpression convertToVariableDeclarationExpression(org.eclipse.jdt.internal.compiler.ast.LocalDeclaration localDeclaration)
           
private  VariableDeclarationFragment convertToVariableDeclarationFragment(org.eclipse.jdt.internal.compiler.ast.FieldDeclaration fieldDeclaration)
           
private  VariableDeclarationFragment convertToVariableDeclarationFragment(org.eclipse.jdt.internal.compiler.ast.LocalDeclaration localDeclaration)
           
private  VariableDeclarationStatement convertToVariableDeclarationStatement(org.eclipse.jdt.internal.compiler.ast.LocalDeclaration localDeclaration)
           
 Type convertType(org.eclipse.jdt.internal.compiler.ast.TypeReference typeReference)
           
private  Comment createComment(int[] positions)
           
private  InfixExpression.Operator getOperatorFor(int operatorID)
           
private  PrimitiveType.Code getPrimitiveTypeCode(char[] name)
           
private  boolean isPrimitiveType(char[] name)
           
private  void lookupForScopes()
           
private  org.eclipse.jdt.internal.compiler.lookup.BlockScope lookupScope(ASTNode node)
           
(package private)  void propagateErrors(ASTNode astNode, org.eclipse.jdt.core.compiler.IProblem[] problems)
           
private  void recordName(Name name, org.eclipse.jdt.internal.compiler.ast.ASTNode compilerNode)
           
private  void recordNodes(ASTNode node, org.eclipse.jdt.internal.compiler.ast.ASTNode oldASTNode)
           
private  void recordNodes(org.eclipse.jdt.internal.compiler.ast.Javadoc javadoc, TagElement tagElement)
           
private  void recordPendingNameScopeResolution(Name name)
           
private  void recordPendingThisExpressionScopeResolution(ThisExpression thisExpression)
           
private  void removeLeadingAndTrailingCommentsFromLiteral(ASTNode node)
          Remove potential trailing comment by settings the source end on the closing parenthesis
private  void removeTrailingCommentFromExpressionEndingWithAParen(ASTNode node)
          Remove potential trailing comment by settings the source end on the closing parenthesis
private  void retrieveColonPosition(ASTNode node)
          This method is used to set the right end position for expression statement.
private  int retrieveEndBlockPosition(int start, int end)
          This method is used to retrieve the end position of the block.
private  int retrieveEndingSemiColonPosition(int start, int end)
           
private  int retrieveEndOfDimensionsPosition(int start, int end)
          This method is used to retrieve the ending position for a type declaration when the dimension is right after the type name.
private  int retrieveEndOfElementTypeNamePosition(int start, int end)
          This method is used to retrieve the position just before the left bracket.
private  int retrieveEndOfRightParenthesisPosition(int start, int end)
          This method is used to retrieve the position after the right parenthesis.
private  int retrieveExtraDimension(int start, int end)
          This method is used to retrieve the array dimension declared after the name of a local or a field declaration.
private  void retrieveIdentifierAndSetPositions(int start, int end, Name name)
           
private  int retrieveIdentifierEndPosition(int start, int end)
          This method is used to retrieve the start position of the block.
private  int retrievePositionBeforeNextCommaOrSemiColon(int start, int end)
          This method is used to retrieve position before the next comma or semi-colon.
private  int retrieveProperRightBracketPosition(int bracketNumber, int start, int end)
           
private  int retrieveRightBraceOrSemiColonPosition(MethodDeclaration node, org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration methodDeclaration)
          This method is used to retrieve position before the next right brace or semi-colon.
private  int retrieveRightBracketPosition(int start, int end)
          This method is used to retrieve the position of the right bracket.
private  void retrieveSemiColonPosition(ASTNode node)
           
private  int retrieveStartBlockPosition(int start, int end)
          This method is used to retrieve the start position of the block.
private  int retrieveStartingCatchPosition(int start, int end)
          This method is used to retrieve the starting position of the catch keyword.
 void setAST(AST ast)
           
private  QualifiedName setQualifiedNameNameAndSourceRanges(char[][] typeName, long[] positions, org.eclipse.jdt.internal.compiler.ast.ASTNode node)
           
private  void setTypeForField(FieldDeclaration fieldDeclaration, Type type, int extraDimension)
           
private  void setTypeForMethodDeclaration(MethodDeclaration methodDeclaration, Type type, int extraDimension)
           
private  void setTypeForSingleVariableDeclaration(SingleVariableDeclaration singleVariableDeclaration, Type type, int extraDimension)
           
private  void setTypeForVariableDeclarationExpression(VariableDeclarationExpression variableDeclarationExpression, Type type, int extraDimension)
           
private  void setTypeForVariableDeclarationStatement(VariableDeclarationStatement variableDeclarationStatement, Type type, int extraDimension)
           
private  void trimWhiteSpacesAndComments(org.eclipse.jdt.internal.compiler.ast.Expression expression)
          Remove whitespaces and comments before and after the expression.
private  void updateInnerPositions(Type type, int dimensions)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ast

private AST ast

compilationUnitSource

char[] compilationUnitSource

scanner

org.eclipse.jdt.internal.compiler.parser.Scanner scanner

resolveBindings

private boolean resolveBindings

pendingThisExpressionScopeResolution

private java.util.Set pendingThisExpressionScopeResolution

pendingNameScopeResolution

private java.util.Set pendingNameScopeResolution

monitor

private org.eclipse.core.runtime.IProgressMonitor monitor

insideComments

private boolean insideComments

docParser

private DocCommentParser docParser

commentsTable

private Comment[] commentsTable

commentMapper

private DefaultCommentMapper commentMapper
Constructor Detail

ASTConverter

public ASTConverter(java.util.Map options,
                    boolean resolveBindings,
                    org.eclipse.core.runtime.IProgressMonitor monitor)
Method Detail

setAST

public void setAST(AST ast)

convert

public TypeDeclaration convert(org.eclipse.jdt.internal.compiler.ast.ASTNode[] nodes)

convert

public CompilationUnit convert(org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration unit,
                               char[] source)

buildCommentsTable

void buildCommentsTable(CompilationUnit compilationUnit,
                        int[][] comments)

convertPackage

public PackageDeclaration convertPackage(org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration compilationUnitDeclaration)

convertImport

public ImportDeclaration convertImport(org.eclipse.jdt.internal.compiler.ast.ImportReference importReference)

convert

public TypeDeclaration convert(org.eclipse.jdt.internal.compiler.ast.TypeDeclaration typeDeclaration)

buildBodyDeclarations

private void buildBodyDeclarations(org.eclipse.jdt.internal.compiler.ast.TypeDeclaration typeDeclaration,
                                   TypeDeclaration typeDecl)

checkAndAddMultipleFieldDeclaration

private void checkAndAddMultipleFieldDeclaration(org.eclipse.jdt.internal.compiler.ast.FieldDeclaration[] fields,
                                                 int index,
                                                 java.util.List bodyDeclarations)

checkAndAddMultipleLocalDeclaration

private void checkAndAddMultipleLocalDeclaration(org.eclipse.jdt.internal.compiler.ast.Statement[] stmts,
                                                 int index,
                                                 java.util.List blockStatements)

checkCanceled

private void checkCanceled()

convert

public Name convert(org.eclipse.jdt.internal.compiler.ast.TypeReference typeReference)

convert

public SimpleName convert(org.eclipse.jdt.internal.compiler.ast.SingleNameReference nameReference)

convert

public Name convert(org.eclipse.jdt.internal.compiler.ast.QualifiedNameReference nameReference)

setQualifiedNameNameAndSourceRanges

private QualifiedName setQualifiedNameNameAndSourceRanges(char[][] typeName,
                                                          long[] positions,
                                                          org.eclipse.jdt.internal.compiler.ast.ASTNode node)

convert

public Expression convert(org.eclipse.jdt.internal.compiler.ast.ThisReference reference)

convert

public ThisExpression convert(org.eclipse.jdt.internal.compiler.ast.QualifiedThisReference reference)

convert

public Name convert(org.eclipse.jdt.internal.compiler.ast.QualifiedSuperReference reference)

convert

public ArrayAccess convert(org.eclipse.jdt.internal.compiler.ast.ArrayReference reference)

convert

public Expression convert(org.eclipse.jdt.internal.compiler.ast.FieldReference reference)

convert

public Expression convert(org.eclipse.jdt.internal.compiler.ast.Reference reference)

convert

public Name convert(org.eclipse.jdt.internal.compiler.ast.NameReference reference)

completeRecord

private void completeRecord(ArrayType arrayType,
                            org.eclipse.jdt.internal.compiler.ast.ASTNode astNode)

convertType

public Type convertType(org.eclipse.jdt.internal.compiler.ast.TypeReference typeReference)

convert

public MethodDeclaration convert(org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration methodDeclaration)

convert

public Expression convert(org.eclipse.jdt.internal.compiler.ast.Expression expression)

convertToParenthesizedExpression

public ParenthesizedExpression convertToParenthesizedExpression(org.eclipse.jdt.internal.compiler.ast.Expression expression)

convert

public ClassInstanceCreation convert(org.eclipse.jdt.internal.compiler.ast.AllocationExpression expression)

buildBodyDeclarations

private void buildBodyDeclarations(org.eclipse.jdt.internal.compiler.ast.TypeDeclaration expression,
                                   AnonymousClassDeclaration anonymousClassDeclaration)

convert

public ArrayCreation convert(org.eclipse.jdt.internal.compiler.ast.ArrayAllocationExpression expression)

convert

public SingleVariableDeclaration convert(org.eclipse.jdt.internal.compiler.ast.Argument argument)

convert

public ArrayInitializer convert(org.eclipse.jdt.internal.compiler.ast.ArrayInitializer expression)

convert

public Expression convert(org.eclipse.jdt.internal.compiler.ast.QualifiedAllocationExpression allocation)

convert

public Assignment convert(org.eclipse.jdt.internal.compiler.ast.Assignment expression)

convert

public Assignment convert(org.eclipse.jdt.internal.compiler.ast.CompoundAssignment expression)

convert

public PrefixExpression convert(org.eclipse.jdt.internal.compiler.ast.PrefixExpression expression)

convert

public PostfixExpression convert(org.eclipse.jdt.internal.compiler.ast.PostfixExpression expression)

convert

public CastExpression convert(org.eclipse.jdt.internal.compiler.ast.CastExpression expression)

convertToType

public Type convertToType(org.eclipse.jdt.internal.compiler.ast.NameReference reference)

convert

public Expression convert(org.eclipse.jdt.internal.compiler.ast.ClassLiteralAccess expression)

convert

public BooleanLiteral convert(org.eclipse.jdt.internal.compiler.ast.FalseLiteral expression)

convert

public BooleanLiteral convert(org.eclipse.jdt.internal.compiler.ast.TrueLiteral expression)

convert

public InfixExpression convert(org.eclipse.jdt.internal.compiler.ast.StringLiteralConcatenation expression)

convert

public NullLiteral convert(org.eclipse.jdt.internal.compiler.ast.NullLiteral expression)

convert

public CharacterLiteral convert(org.eclipse.jdt.internal.compiler.ast.CharLiteral expression)

convert

public NumberLiteral convert(org.eclipse.jdt.internal.compiler.ast.DoubleLiteral expression)

convert

public NumberLiteral convert(org.eclipse.jdt.internal.compiler.ast.FloatLiteral expression)

convert

public NumberLiteral convert(org.eclipse.jdt.internal.compiler.ast.IntLiteral expression)

convert

public NumberLiteral convert(org.eclipse.jdt.internal.compiler.ast.IntLiteralMinValue expression)

convert

public NumberLiteral convert(org.eclipse.jdt.internal.compiler.ast.LongLiteral expression)

convert

public NumberLiteral convert(org.eclipse.jdt.internal.compiler.ast.LongLiteralMinValue expression)

convert

public StringLiteral convert(org.eclipse.jdt.internal.compiler.ast.StringLiteral expression)

convert

public StringLiteral convert(org.eclipse.jdt.internal.compiler.ast.ExtendedStringLiteral expression)

convert

public Expression convert(org.eclipse.jdt.internal.compiler.ast.BinaryExpression expression)

convert

public PrefixExpression convert(org.eclipse.jdt.internal.compiler.ast.UnaryExpression expression)

convert

public InstanceofExpression convert(org.eclipse.jdt.internal.compiler.ast.InstanceOfExpression expression)

convert

public ConditionalExpression convert(org.eclipse.jdt.internal.compiler.ast.ConditionalExpression expression)

convert

public Expression convert(org.eclipse.jdt.internal.compiler.ast.MessageSend expression)

convert

public Expression convert(org.eclipse.jdt.internal.compiler.ast.AND_AND_Expression expression)

convert

public Expression convert(org.eclipse.jdt.internal.compiler.ast.EqualExpression expression)

convert

public Expression convert(org.eclipse.jdt.internal.compiler.ast.OR_OR_Expression expression)

convert

public Statement convert(org.eclipse.jdt.internal.compiler.ast.Statement statement)

convert

public AssertStatement convert(org.eclipse.jdt.internal.compiler.ast.AssertStatement statement)

convert

public Block convert(org.eclipse.jdt.internal.compiler.ast.Block statement)

convert

public BreakStatement convert(org.eclipse.jdt.internal.compiler.ast.BreakStatement statement)

convert

public ContinueStatement convert(org.eclipse.jdt.internal.compiler.ast.ContinueStatement statement)

convert

public SwitchCase convert(org.eclipse.jdt.internal.compiler.ast.CaseStatement statement)

convert

public DoStatement convert(org.eclipse.jdt.internal.compiler.ast.DoStatement statement)

convert

public EmptyStatement convert(org.eclipse.jdt.internal.compiler.ast.EmptyStatement statement)

convert

public Statement convert(org.eclipse.jdt.internal.compiler.ast.ExplicitConstructorCall statement)

convert

public ForStatement convert(org.eclipse.jdt.internal.compiler.ast.ForStatement statement)

convertToExpression

public Expression convertToExpression(org.eclipse.jdt.internal.compiler.ast.Statement statement)

convert

public IfStatement convert(org.eclipse.jdt.internal.compiler.ast.IfStatement statement)

convert

public LabeledStatement convert(org.eclipse.jdt.internal.compiler.ast.LabeledStatement statement)

convert

public ReturnStatement convert(org.eclipse.jdt.internal.compiler.ast.ReturnStatement statement)

convert

public SwitchStatement convert(org.eclipse.jdt.internal.compiler.ast.SwitchStatement statement)

convert

public SynchronizedStatement convert(org.eclipse.jdt.internal.compiler.ast.SynchronizedStatement statement)

convert

public ThrowStatement convert(org.eclipse.jdt.internal.compiler.ast.ThrowStatement statement)

convert

public TryStatement convert(org.eclipse.jdt.internal.compiler.ast.TryStatement statement)

convert

public WhileStatement convert(org.eclipse.jdt.internal.compiler.ast.WhileStatement statement)

isPrimitiveType

private boolean isPrimitiveType(char[] name)

getPrimitiveTypeCode

private PrimitiveType.Code getPrimitiveTypeCode(char[] name)

retrieveSemiColonPosition

private void retrieveSemiColonPosition(ASTNode node)

retrieveColonPosition

private void retrieveColonPosition(ASTNode node)
This method is used to set the right end position for expression statement. The actual AST nodes don't include the trailing semicolon. This method fixes the length of the corresponding node.


retrieveEndingSemiColonPosition

private int retrieveEndingSemiColonPosition(int start,
                                            int end)

retrieveExtraDimension

private int retrieveExtraDimension(int start,
                                   int end)
This method is used to retrieve the array dimension declared after the name of a local or a field declaration. For example: int i, j[] = null, k[][] = {{}}; It should return 0 for i, 1 for j and 2 for k.


retrieveEndOfDimensionsPosition

private int retrieveEndOfDimensionsPosition(int start,
                                            int end)
This method is used to retrieve the ending position for a type declaration when the dimension is right after the type name. For example: int[] i; => return 5, but int i[] => return -1;


retrieveStartingCatchPosition

private int retrieveStartingCatchPosition(int start,
                                          int end)
This method is used to retrieve the starting position of the catch keyword.


retrieveEndOfElementTypeNamePosition

private int retrieveEndOfElementTypeNamePosition(int start,
                                                 int end)
This method is used to retrieve the position just before the left bracket.


retrieveRightBracketPosition

private int retrieveRightBracketPosition(int start,
                                         int end)
This method is used to retrieve the position of the right bracket.


retrieveEndOfRightParenthesisPosition

private int retrieveEndOfRightParenthesisPosition(int start,
                                                  int end)
This method is used to retrieve the position after the right parenthesis.


retrieveProperRightBracketPosition

private int retrieveProperRightBracketPosition(int bracketNumber,
                                               int start,
                                               int end)

retrieveStartBlockPosition

private int retrieveStartBlockPosition(int start,
                                       int end)
This method is used to retrieve the start position of the block.


retrieveIdentifierEndPosition

private int retrieveIdentifierEndPosition(int start,
                                          int end)
This method is used to retrieve the start position of the block.


retrieveEndBlockPosition

private int retrieveEndBlockPosition(int start,
                                     int end)
This method is used to retrieve the end position of the block.


retrieveRightBraceOrSemiColonPosition

private int retrieveRightBraceOrSemiColonPosition(MethodDeclaration node,
                                                  org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration methodDeclaration)
This method is used to retrieve position before the next right brace or semi-colon.


retrievePositionBeforeNextCommaOrSemiColon

private int retrievePositionBeforeNextCommaOrSemiColon(int start,
                                                       int end)
This method is used to retrieve position before the next comma or semi-colon.


convertToVariableDeclarationFragment

private VariableDeclarationFragment convertToVariableDeclarationFragment(org.eclipse.jdt.internal.compiler.ast.FieldDeclaration fieldDeclaration)

convertToVariableDeclarationFragment

private VariableDeclarationFragment convertToVariableDeclarationFragment(org.eclipse.jdt.internal.compiler.ast.LocalDeclaration localDeclaration)

convertToFieldDeclaration

private FieldDeclaration convertToFieldDeclaration(org.eclipse.jdt.internal.compiler.ast.FieldDeclaration fieldDecl)

convertToVariableDeclarationStatement

private VariableDeclarationStatement convertToVariableDeclarationStatement(org.eclipse.jdt.internal.compiler.ast.LocalDeclaration localDeclaration)

convertToVariableDeclarationExpression

private VariableDeclarationExpression convertToVariableDeclarationExpression(org.eclipse.jdt.internal.compiler.ast.LocalDeclaration localDeclaration)

setTypeForField

private void setTypeForField(FieldDeclaration fieldDeclaration,
                             Type type,
                             int extraDimension)

updateInnerPositions

private void updateInnerPositions(Type type,
                                  int dimensions)

setTypeForSingleVariableDeclaration

private void setTypeForSingleVariableDeclaration(SingleVariableDeclaration singleVariableDeclaration,
                                                 Type type,
                                                 int extraDimension)

setTypeForMethodDeclaration

private void setTypeForMethodDeclaration(MethodDeclaration methodDeclaration,
                                         Type type,
                                         int extraDimension)

setTypeForVariableDeclarationStatement

private void setTypeForVariableDeclarationStatement(VariableDeclarationStatement variableDeclarationStatement,
                                                    Type type,
                                                    int extraDimension)

setTypeForVariableDeclarationExpression

private void setTypeForVariableDeclarationExpression(VariableDeclarationExpression variableDeclarationExpression,
                                                     Type type,
                                                     int extraDimension)

convert

public void convert(org.eclipse.jdt.internal.compiler.ast.Javadoc javadoc,
                    BodyDeclaration bodyDeclaration)

recordNodes

private void recordNodes(org.eclipse.jdt.internal.compiler.ast.Javadoc javadoc,
                         TagElement tagElement)

recordName

private void recordName(Name name,
                        org.eclipse.jdt.internal.compiler.ast.ASTNode compilerNode)

createComment

private Comment createComment(int[] positions)

propagateErrors

void propagateErrors(ASTNode astNode,
                     org.eclipse.jdt.core.compiler.IProblem[] problems)

recordNodes

private void recordNodes(ASTNode node,
                         org.eclipse.jdt.internal.compiler.ast.ASTNode oldASTNode)

trimWhiteSpacesAndComments

private void trimWhiteSpacesAndComments(org.eclipse.jdt.internal.compiler.ast.Expression expression)
Remove whitespaces and comments before and after the expression.


adjustSourcePositionsForParent

private void adjustSourcePositionsForParent(org.eclipse.jdt.internal.compiler.ast.Expression expression)

retrieveIdentifierAndSetPositions

private void retrieveIdentifierAndSetPositions(int start,
                                               int end,
                                               Name name)

removeTrailingCommentFromExpressionEndingWithAParen

private void removeTrailingCommentFromExpressionEndingWithAParen(ASTNode node)
Remove potential trailing comment by settings the source end on the closing parenthesis


removeLeadingAndTrailingCommentsFromLiteral

private void removeLeadingAndTrailingCommentsFromLiteral(ASTNode node)
Remove potential trailing comment by settings the source end on the closing parenthesis


recordPendingThisExpressionScopeResolution

private void recordPendingThisExpressionScopeResolution(ThisExpression thisExpression)

recordPendingNameScopeResolution

private void recordPendingNameScopeResolution(Name name)

lookupForScopes

private void lookupForScopes()

lookupScope

private org.eclipse.jdt.internal.compiler.lookup.BlockScope lookupScope(ASTNode node)

getOperatorFor

private InfixExpression.Operator getOperatorFor(int operatorID)