org.eclipse.xtext.parsetree.reconstr.impl
Class DefaultCommentAssociater

java.lang.Object
  extended by org.eclipse.xtext.parsetree.reconstr.impl.AbstractCommentAssociater
      extended by org.eclipse.xtext.parsetree.reconstr.impl.DefaultCommentAssociater
All Implemented Interfaces:
ICommentAssociater

public class DefaultCommentAssociater
extends AbstractCommentAssociater

Author:
meysholdt - Initial contribution and API, Jan Koehnlein

Field Summary
protected  TokenUtil tokenUtil
           
 
Constructor Summary
DefaultCommentAssociater()
           
 
Method Summary
protected  void addMapping(java.util.Map<ILeafNode,org.eclipse.emf.ecore.EObject> mapping, java.util.List<ILeafNode> currentComments, org.eclipse.emf.ecore.EObject currentEObject)
           
 java.util.Map<ILeafNode,org.eclipse.emf.ecore.EObject> associateCommentsWithSemanticEObjects(org.eclipse.emf.ecore.EObject model, java.util.Set<ICompositeNode> roots)
           
protected  void associateCommentsWithSemanticEObjects(java.util.Map<ILeafNode,org.eclipse.emf.ecore.EObject> mapping, ICompositeNode rootNode)
          This implementation associates each comment with the next following semantic token's EObject, except for the case, where a line of the document end by a semantic element followed by a comment.
protected  org.eclipse.emf.ecore.EObject getEObjectForRemainingComments(ICompositeNode rootNode)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tokenUtil

@Inject
protected TokenUtil tokenUtil
Constructor Detail

DefaultCommentAssociater

public DefaultCommentAssociater()
Method Detail

associateCommentsWithSemanticEObjects

public java.util.Map<ILeafNode,org.eclipse.emf.ecore.EObject> associateCommentsWithSemanticEObjects(org.eclipse.emf.ecore.EObject model,
                                                                                                    java.util.Set<ICompositeNode> roots)

associateCommentsWithSemanticEObjects

protected void associateCommentsWithSemanticEObjects(java.util.Map<ILeafNode,org.eclipse.emf.ecore.EObject> mapping,
                                                     ICompositeNode rootNode)
This implementation associates each comment with the next following semantic token's EObject, except for the case, where a line of the document end by a semantic element followed by a comment. Then, the the comment is associated with this preceding semantic token.


addMapping

protected void addMapping(java.util.Map<ILeafNode,org.eclipse.emf.ecore.EObject> mapping,
                          java.util.List<ILeafNode> currentComments,
                          org.eclipse.emf.ecore.EObject currentEObject)

getEObjectForRemainingComments

protected org.eclipse.emf.ecore.EObject getEObjectForRemainingComments(ICompositeNode rootNode)