Class LexicalPreservingPrinter.Observer

    • Constructor Detail

      • Observer

        private Observer()
    • Method Detail

      • isCompleteLine

        private boolean isCompleteLine​(java.util.List<TextElement> elements,
                                       int index)
      • removeAllExtraCharacters

        private void removeAllExtraCharacters​(java.util.List<TextElement> elements,
                                              int index)
      • removeAllExtraCharactersBeforePosition

        private void removeAllExtraCharactersBeforePosition​(java.util.ListIterator<TextElement> iterator)
      • removeAllExtraCharactersStartingFrom

        private void removeAllExtraCharactersStartingFrom​(java.util.ListIterator<TextElement> iterator)
      • getIndexOfComment

        private int getIndexOfComment​(Comment oldValue,
                                      NodeText nodeText)
      • isSameComment

        private boolean isSameComment​(Comment childValue,
                                      Comment oldValue)
      • fixIndentOfAddedNode

        private void fixIndentOfAddedNode​(NodeText nodeText,
                                          int index)
        This method inserts new space tokens at the given index. If a new comment is added to the token list at the position following index, the new comment and the node will have the same indent.
        Parameters:
        nodeText - The text of the node
        index - The position at which the analysis should start