Java 类org.eclipse.xtext.formatting2.regionaccess.IHiddenRegion 实例源码

项目:xtext-extras    文件:IndentOnceAutowrapFormatter.java   
@Override
public void format(final ITextSegment region, final IHiddenRegionFormatting wrapped, @Extension final IFormattableDocument document) {
  if ((!this.hasWrapped)) {
    IHiddenRegion _switchResult = null;
    boolean _matched = false;
    if (region instanceof IHiddenRegion) {
      _matched=true;
      _switchResult = ((IHiddenRegion)region);
    }
    if (!_matched) {
      if (region instanceof IHiddenRegionPart) {
        _matched=true;
        _switchResult = ((IHiddenRegionPart)region).getHiddenRegion();
      }
    }
    final IHiddenRegion hiddenRegion = _switchResult;
    final Procedure1<IHiddenRegionFormatter> _function = (IHiddenRegionFormatter it) -> {
      it.indent();
    };
    document.set(hiddenRegion, this.last, _function);
    this.hasWrapped = true;
  }
}
项目:xtext-extras    文件:FormatterTester.java   
protected void assertAllWhitespaceIsFormatted(ITextRegionAccess access, List<ITextReplacement> replacements) {
    List<ITextSegment> expected = Lists.newArrayList();
    IHiddenRegion current = access.regionForRootEObject().getPreviousHiddenRegion();
    while (current != null) {
        expected.addAll(current.getMergedSpaces());
        current = current.getNextHiddenRegion();
    }
    List<ITextSegment> missing = TextRegions.difference(expected, replacements);
    if (!missing.isEmpty()) {
        TextRegionsToString toString = new TextRegionsToString().setTextRegionAccess(access);
        for (ITextSegment region : missing)
            toString.add(region, region.getClass().getSimpleName());
        String msg = "The following regions are not formatted:\n" + toString;
        System.err.println(msg);
        Assert.fail(msg);
    }
}
项目:xtext-core    文件:TextRegionAccessToString.java   
protected String toString(ITextSegment region) {
    String result;
    if (region instanceof IEObjectRegion)
        result = toString((IEObjectRegion) region);
    else if (region instanceof ISemanticRegion)
        result = toString((ISemanticRegion) region);
    else if (region instanceof IHiddenRegion)
        result = toString((IHiddenRegion) region);
    else if (region instanceof IWhitespace)
        result = toString((IWhitespace) region);
    else if (region instanceof IComment)
        result = toString((IComment) region);
    else if (region != null)
        result = region.getClass().getName() + "@" + Integer.toHexString(System.identityHashCode(region));
    else
        result = "null";
    if (hightlightOrigin && region == origin)
        return ">>>" + result + "<<<";
    return result;
}
项目:xtext-core    文件:StringBasedTextRegionAccessDiffAppender.java   
protected ISequentialRegion copyAndAppend(ISequentialRegion first, ISequentialRegion last) {
    ISequentialRegion current = first;
    ISequentialRegion result = null;
    while (true) {
        if (current instanceof IHiddenRegion) {
            copyAndAppend((IHiddenRegion) current);
        } else if (current instanceof ISemanticRegion) {
            copyAndAppend((ISemanticRegion) current, current.getText());
        }
        if (result == null) {
            result = this.last;
        }
        if (current == last) {
            break;
        }
        current = current.getNextSequentialRegion();
        if (current == null) {
            throw new IllegalStateException("last didn't match");
        }
    }
    return result;
}
项目:xtext-core    文件:HiddenRegionPartMerger.java   
@Override
public List<IHiddenRegionPart> merge(ITextRegionAccess b, IHiddenRegion first, IHiddenRegion last, boolean del) {
    List<IHiddenRegionPart> parts1 = first.getParts();
    List<IHiddenRegionPart> parts2 = last.getParts();
    boolean firstInFile1 = first.getPreviousSemanticRegion() == null;
    boolean firstInFile2 = last.getPreviousSemanticRegion() == null;
    int index1 = firstInFile1 ? getIndexFirstInFile(parts1) : getIndex(parts1);
    int index2 = firstInFile2 ? getIndexFirstInFile(parts2) : getIndex(parts2);
    List<IHiddenRegionPart> result = Lists.newArrayList();
    if (del && !first.isMultiline()) {
        result.addAll(parts1);
    } else {
        for (int i = 0; i < index1; i++) {
            result.add(parts1.get(i));
        }
    }
    if (del && !last.isMultiline()) {
        result.addAll(parts2);
    } else {
        for (int i = index2; i < parts2.size(); i++) {
            result.add(parts2.get(i));
        }
    }
    return result;
}
项目:xtext-core    文件:TextReplacerMerger.java   
protected ITextReplacer mergeHiddenRegionReplacers(List<? extends ITextReplacer> conflicting) {
    List<IHiddenRegionFormatting> formattings = Lists.newArrayList();
    IHiddenRegion region = null;
    for (ITextReplacer replacer : conflicting) {
        if (replacer instanceof HiddenRegionReplacer) {
            HiddenRegionReplacer hiddenRegionReplacer = (HiddenRegionReplacer) replacer;
            formattings.add(hiddenRegionReplacer.getFormatting());
            if (region == null)
                region = hiddenRegionReplacer.getRegion();
            else if (region != hiddenRegionReplacer.getRegion())
                return null;
        } else
            return null;
    }
    IHiddenRegionFormatting mergedFormatting = merger.merge(formattings);
    if (mergedFormatting != null)
        return formatter.createHiddenRegionReplacer(region, mergedFormatting);
    return null;
}
项目:xtext-core    文件:WhitespaceReplacer.java   
protected int computeNewLineCount(ITextReplacerContext context) {
    Integer newLineDefault = formatting.getNewLineDefault();
    Integer newLineMin = formatting.getNewLineMin();
    Integer newLineMax = formatting.getNewLineMax();
    if (newLineMin != null || newLineDefault != null || newLineMax != null) {
        if (region instanceof IHiddenRegion && ((IHiddenRegion) region).isUndefined()) {
            if (newLineDefault != null)
                return newLineDefault;
            if (newLineMin != null)
                return newLineMin;
            if (newLineMax != null)
                return newLineMax;
        } else {
            int lineCount = region.getLineCount() - 1;
            if (newLineMin != null && newLineMin > lineCount)
                lineCount = newLineMin;
            if (newLineMax != null && newLineMax < lineCount)
                lineCount = newLineMax;
            return lineCount;
        }
    }
    return 0;
}
项目:xtext-core    文件:AbstractFormatter2.java   
protected boolean isInRequestedRange(EObject obj) {
    Collection<ITextRegion> regions = request.getRegions();
    if (regions.isEmpty())
        return true;
    ITextRegionAccess access = request.getTextRegionAccess();
    IEObjectRegion objRegion = access.regionForEObject(obj);
    if (objRegion == null)
        return false;
    IHiddenRegion previousHidden = objRegion.getPreviousHiddenRegion();
    IHiddenRegion nextHidden = objRegion.getNextHiddenRegion();
    int objOffset = previousHidden != null ? previousHidden.getOffset() : 0;
    int objEnd = nextHidden != null ? nextHidden.getEndOffset() : access.regionForRootEObject().getEndOffset();
    for (ITextRegion region : regions) {
        int regionOffset = region.getOffset();
        int regionEnd = regionOffset + region.getLength();
        if (regionOffset <= objEnd && regionEnd >= objOffset)
            return true;
    }
    return false;
}
项目:xtext-core    文件:FormatterTestHelper.java   
protected void assertAllWhitespaceIsFormatted(ITextRegionAccess access, List<ITextReplacement> replacements) {
    List<ITextSegment> expected = Lists.newArrayList();
    IHiddenRegion current = access.regionForRootEObject().getPreviousHiddenRegion();
    while (current != null) {
        expected.addAll(current.getMergedSpaces());
        current = current.getNextHiddenRegion();
    }
    List<ITextSegment> missing = TextRegions.difference(expected, replacements);
    if (!missing.isEmpty()) {
        TextRegionsToString toString = new TextRegionsToString().setTextRegionAccess(access);
        for (ITextSegment region : missing)
            toString.add(region, region.getClass().getSimpleName());
        String msg = "The following regions are not formatted:\n" + toString;
        System.err.println(msg);
        Assert.fail(msg);
    }
}
项目:xtext-core    文件:RegionAccessBuilderTest.java   
private void assertToStringDoesNotCrash(final ITextRegionAccess access) {
  IHiddenRegion _previousHiddenRegion = access.regionForRootEObject().getPreviousHiddenRegion();
  ISequentialRegion current = ((ISequentialRegion) _previousHiddenRegion);
  while ((current != null)) {
    {
      Assert.assertNotNull(current.toString());
      boolean _matched = false;
      if (current instanceof IHiddenRegion) {
        _matched=true;
        current = ((IHiddenRegion)current).getNextSemanticRegion();
      }
      if (!_matched) {
        if (current instanceof ISemanticRegion) {
          _matched=true;
          Assert.assertNotNull(((ISemanticRegion)current).getEObjectRegion().toString());
          current = ((ISemanticRegion)current).getNextHiddenRegion();
        }
      }
    }
  }
}
项目:xtext-core    文件:PartialSerializer.java   
@Override
public void serialize(ITextRegionDiffBuilder result) {
    ISemanticSequencer semantic = semanticSequencerProvider.get();
    ISyntacticSequencer syntactic = syntacticSequencerProvider.get();
    IHiddenTokenSequencer hidden = hiddenTokenSequencerProvider.get();
    semantic.init((ISemanticSequenceAcceptor) syntactic, errorAcceptor);
    syntactic.init(context, root, (ISyntacticSequenceAcceptor) hidden, errorAcceptor);
    ISequenceAcceptor acceptor;
    if (insertAt instanceof IHiddenRegion) {
        IHiddenRegion h = (IHiddenRegion) insertAt;
        acceptor = result.replaceSequence(h, h, context, root);
    } else {
        IHiddenRegion originalFirst = insertAt.getPreviousHiddenRegion();
        IHiddenRegion originalLast = insertAt.getNextHiddenRegion();
        acceptor = result.replaceSequence(originalFirst, originalLast, context, root);
    }
    hidden.init(context, root, acceptor, errorAcceptor);
    if (acceptor instanceof TokenStreamSequenceAdapter)
        ((TokenStreamSequenceAdapter) acceptor).init(context);
    semantic.createSequence(context, root);
}
项目:xtext-core    文件:InsertionPointFinder.java   
public IHiddenRegion findInsertionPoint(ISerializationContext ctx, IEObjectRegion obj, AbstractElement ins) {
    ISerState insertionState = findState(ctx, ins);
    Set<AbstractElement> followers = collectAdjacent(insertionState, s -> s.getFollowers());
    Set<AbstractElement> precendents = collectAdjacent(insertionState, s -> s.getPrecedents());
    List<IAstRegion> regions = Lists.newArrayList(obj.getAstRegions());
    if (regions.isEmpty()) {
        return obj.getPreviousHiddenRegion();
    }
    if (followers.contains(regions.get(0).getGrammarElement())) {
        return obj.getPreviousHiddenRegion();
    }
    if (precendents.contains(regions.get(regions.size() - 1).getGrammarElement())) {
        return obj.getNextHiddenRegion();
    }
    for (int i = 0; i < regions.size() - 1; i++) {
        IAstRegion leading = regions.get(i);
        IAstRegion trailing = regions.get(i + 1);
        if (precendents.contains(leading.getGrammarElement()) && followers.contains(trailing.getGrammarElement())) {
            return leading.getNextHiddenRegion();
        }
    }
    return null;
}
项目:xtext-core    文件:TextRegionAccessToString.java   
protected String toString(IHiddenRegion hiddens) {
    List<IHiddenRegionPart> parts = hiddens.getParts();
    if (parts.isEmpty())
        return HIDDEN;
    List<String> children = Lists.newArrayListWithExpectedSize(parts.size());
    children.add(HIDDEN_PADDED + toString(parts.get(0)));
    for (int i = 1; i < parts.size(); i++)
        children.add(EMPTY_TITLE + toString(parts.get(i)));
    return Joiner.on("\n").join(children);
}
项目:xtext-core    文件:StringBasedTextRegionAccessDiffBuilder.java   
@Override
public SequentialRegionDiff apply(StringBasedTextRegionAccessDiffAppender appender) {
    StringBasedRegionAccess textRegionAccess = sequencer.getRegionAccess();
    IEObjectRegion substituteRoot = textRegionAccess.regionForRootEObject();
    IHiddenRegion substituteFirst = substituteRoot.getPreviousHiddenRegion();
    IHiddenRegion substituteLast = substituteRoot.getNextHiddenRegion();
    SequentialRegionDiff result = appender.copyAndAppend((IHiddenRegion) originalFirst,
            (IHiddenRegion) originalLast, substituteFirst, substituteLast);
    return result;
}
项目:xtext-core    文件:StringBasedTextRegionAccessDiffBuilder.java   
protected void addRemoveAction(IHiddenRegion first, IHiddenRegion last, boolean del) {
    for (RewriteAction rw : rewrites) {
        if (rw.originalFirst == last) {
            rw.originalFirst = first;
            return;
        }
        if (rw.originalLast == first) {
            rw.originalLast = last;
            return;
        }
    }
    rewrites.add(new RemoveRewriteAction(first, last, del));
}
项目:xtext-core    文件:StringBasedTextRegionAccessDiffBuilder.java   
@Override
public void replace(IHiddenRegion originalFirst, IHiddenRegion originalLast, IHiddenRegion modifiedFirst,
        IHiddenRegion modifiedLast) {
    checkOriginal(originalFirst);
    checkOriginal(originalLast);
    addInsert(new ReplaceRewriteAction(originalFirst, originalLast, modifiedFirst, modifiedLast));
}
项目:xtext-core    文件:StringBasedTextRegionAccessDiffBuilder.java   
@Override
public void replace(IHiddenRegion originalFirst, IHiddenRegion originalLast, ITextRegionAccess acc) {
    checkOriginal(originalFirst);
    checkOriginal(originalLast);
    IEObjectRegion substituteRoot = acc.regionForRootEObject();
    IHiddenRegion substituteFirst = substituteRoot.getPreviousHiddenRegion();
    IHiddenRegion substituteLast = substituteRoot.getNextHiddenRegion();
    replace(originalFirst, originalLast, substituteFirst, substituteLast);
}
项目:xtext-core    文件:StringBasedTextRegionAccessDiffBuilder.java   
@Override
public ISequenceAcceptor replaceSequence(IHiddenRegion originalFirst, IHiddenRegion originalLast,
        ISerializationContext ctx, EObject root) {
    checkOriginal(originalFirst);
    checkOriginal(originalLast);
    TextRegionAccessBuildingSequencer sequenceAcceptor = new TextRegionAccessBuildingSequencer();
    addInsert(new SequenceRewriteAction(originalFirst, originalLast, sequenceAcceptor));
    return sequenceAcceptor.withRoot(ctx, root);
}
项目:xtext-core    文件:StringBasedTextRegionAccessDiffAppender.java   
protected IHiddenRegion copyAndAppend(IHiddenRegion source) {
    ISequentialRegion last2 = this.last;
    StringHiddenRegion region = appendHiddenRegion(source.isUndefined());
    List<IHiddenRegionPart> parts;
    if (region == last2) {
        parts = hiddenRegionMerger.merge(access.getOriginalTextRegionAccess(), region, source, false);
    } else {
        parts = source.getParts();
    }
    copyHiddenRegionParts(region, parts);
    return region;
}
项目:xtext-core    文件:StringBasedTextRegionAccessDiffAppender.java   
protected IHiddenRegion copyAndAppend(IHiddenRegion region1, IHiddenRegion region2) {
    StringHiddenRegion region = appendHiddenRegion(region1.isUndefined() || region2.isUndefined());
    ITextRegionAccess original = access.getOriginalTextRegionAccess();
    List<IHiddenRegionPart> merged = hiddenRegionMerger.merge(original, region1, region2, false);
    copyHiddenRegionParts(region, merged);
    return region;
}
项目:xtext-core    文件:StringBasedTextRegionAccessDiffAppender.java   
public SequentialRegionDiff copyAndAppend(IHiddenRegion originalFirst, IHiddenRegion originalLast,
        IHiddenRegion substituteFirst, IHiddenRegion substituteLast) {
    if (substituteFirst == substituteLast) {
        return copySurroundingHidden(originalFirst, originalLast, true);
    }
    IHiddenRegion first = copyAndAppend(originalFirst, substituteFirst);
    ISemanticRegion firstSem = substituteFirst.getNextSemanticRegion();
    ISemanticRegion lastSem = substituteLast.getPreviousSemanticRegion();
    copyAndAppend(firstSem, lastSem);
    IHiddenRegion last = copyAndAppend(substituteLast, originalLast);
    return new SequentialRegionDiff(originalFirst, originalLast, first, last);
}
项目:xtext-core    文件:StringBasedTextRegionAccessDiffAppender.java   
public SequentialRegionDiff copySurroundingHidden(IHiddenRegion originalFirst, IHiddenRegion originalLast,
        boolean delete) {
    boolean firstHidden = originalFirst instanceof IHiddenRegion;
    boolean lastHidden = originalLast instanceof IHiddenRegion;
    if (firstHidden && lastHidden) {
        IHiddenRegion hiddenFirst = (IHiddenRegion) originalFirst;
        IHiddenRegion hiddenLast = (IHiddenRegion) originalLast;
        StringHiddenRegion merged = appendHiddenRegion(hiddenFirst.isUndefined() || hiddenLast.isUndefined());
        ITextRegionAccess original = access.getOriginalTextRegionAccess();
        List<IHiddenRegionPart> parts = hiddenRegionMerger.merge(original, hiddenFirst, hiddenLast, delete);
        copyHiddenRegionParts(merged, parts);
        return new SequentialRegionDiff(originalFirst, originalLast, merged, merged);
    }
    IHiddenRegion inserted = null;
    if (originalFirst == null) {
        if (!lastHidden) {
            inserted = appendHiddenRegion(true);
        }
    } else if (originalLast == null) {
        if (!firstHidden) {
            inserted = appendHiddenRegion(true);
        }
    } else if (!firstHidden && !lastHidden) {
        inserted = appendHiddenRegion(true);
    }
    return new SequentialRegionDiff(originalFirst, originalLast, inserted, inserted);
}
项目:xtext-core    文件:AbstractRegionAccess.java   
@Override
public IHiddenRegion previousHiddenRegion(EObject owner) {
    AbstractEObjectRegion tokens = regionForEObject(owner);
    if (tokens == null)
        return null;
    return tokens.getLeadingHiddenRegion();
}
项目:xtext-core    文件:AbstractRegionAccess.java   
@Override
public IHiddenRegion nextHiddenRegion(EObject owner) {
    AbstractEObjectRegion tokens = regionForEObject(owner);
    if (tokens == null)
        return null;
    return tokens.getTrailingHiddenRegion();
}
项目:xtext-core    文件:FormattableDocument.java   
@Override
public ISemanticRegion append(ISemanticRegion token, Procedure1<? super IHiddenRegionFormatter> after) {
    if (token != null) {
        IHiddenRegion gap = token.getNextHiddenRegion();
        set(gap, after);
    }
    return token;
}
项目:xtext-core    文件:FormattableDocument.java   
@Override
public <T extends EObject> T append(T owner, Procedure1<? super IHiddenRegionFormatter> after) {
    if (owner != null) {
        IEObjectRegion region = getTextRegionAccess().regionForEObject(owner);
        if (region != null) {
            IHiddenRegion gap = region.getNextHiddenRegion();
            set(gap, after);
        }
    }
    return owner;
}
项目:xtext-core    文件:FormattableDocument.java   
@Override
public <T extends EObject> T interior(T object, Procedure1<? super IHiddenRegionFormatter> init) {
    if (object != null) {
        IEObjectRegion objRegion = getTextRegionAccess().regionForEObject(object);
        if (objRegion != null) {
            IHiddenRegion previous = objRegion.getPreviousHiddenRegion();
            IHiddenRegion next = objRegion.getNextHiddenRegion();
            if (previous != null && next != null && previous != next) {
                interior(previous.getNextSemanticRegion(), next.getPreviousSemanticRegion(), init);
            }
        }
    }
    return object;
}
项目:xtext-core    文件:FormattableDocument.java   
@Override
public ISemanticRegion prepend(ISemanticRegion token, Procedure1<? super IHiddenRegionFormatter> before) {
    if (token != null) {
        IHiddenRegion gap = token.getPreviousHiddenRegion();
        set(gap, before);
    }
    return token;
}
项目:xtext-core    文件:FormattableDocument.java   
@Override
public <T extends EObject> T prepend(T owner, Procedure1<? super IHiddenRegionFormatter> before) {
    if (owner != null) {
        IEObjectRegion region = getTextRegionAccess().regionForEObject(owner);
        if (region != null) {
            IHiddenRegion gap = region.getPreviousHiddenRegion();
            set(gap, before);
        }
    }
    return owner;
}
项目:xtext-core    文件:FormattableDocument.java   
@Override
public Pair<IHiddenRegion, IHiddenRegion> set(IHiddenRegion first, IHiddenRegion second,
        Procedure1<? super IHiddenRegionFormatter> init) {
    if (first != null && second != null) {
        AbstractFormatter2 formatter = getFormatter();
        IHiddenRegionFormatting f1 = formatter.createHiddenRegionFormatting();
        IHiddenRegionFormatting f2 = formatter.createHiddenRegionFormatting();
        init.apply(formatter.createHiddenRegionFormatter(f1, f2));
        ITextReplacer replacer1 = formatter.createHiddenRegionReplacer(first, f1);
        ITextReplacer replacer2 = formatter.createHiddenRegionReplacer(second, f2);
        addReplacer(replacer1);
        addReplacer(replacer2);
    }
    return Pair.of(first, second);
}
项目:xtext-core    文件:FormattableDocument.java   
@Override
public IHiddenRegion set(IHiddenRegion hiddenRegion, Procedure1<? super IHiddenRegionFormatter> init) {
    if (hiddenRegion != null) {
        AbstractFormatter2 formatter = getFormatter();
        IHiddenRegionFormatting formatting = formatter.createHiddenRegionFormatting();
        init.apply(formatter.createHiddenRegionFormatter(formatting));
        ITextReplacer replacer = formatter.createHiddenRegionReplacer(hiddenRegion, formatting);
        addReplacer(replacer);
    }
    return hiddenRegion;
}
项目:xtext-core    文件:FormattableDocument.java   
@Override
public ISemanticRegion surround(ISemanticRegion token, Procedure1<? super IHiddenRegionFormatter> beforeAndAfter) {
    if (token != null) {
        IHiddenRegion previous = token.getPreviousHiddenRegion();
        IHiddenRegion next = token.getNextHiddenRegion();
        set(previous, next, beforeAndAfter);
    }
    return token;
}
项目:xtext-core    文件:FormattableDocument.java   
@Override
public <T extends EObject> T surround(T owner, Procedure1<? super IHiddenRegionFormatter> beforeAndAfter) {
    if (owner != null && !owner.eIsProxy()) {
        IEObjectRegion region = getTextRegionAccess().regionForEObject(owner);
        if (region == null)
            return owner;
        IHiddenRegion previous = region.getPreviousHiddenRegion();
        IHiddenRegion next = region.getNextHiddenRegion();
        set(previous, next, beforeAndAfter);
    }
    return owner;
}
项目:xtext-extras    文件:IndentOnceAutowrapFormatter.java   
public IndentOnceAutowrapFormatter(final IHiddenRegion last) {
  super();
  this.last = last;
}
项目:xtext-core    文件:IFormattableDocument.java   
Pair<IHiddenRegion, IHiddenRegion> set(IHiddenRegion first, IHiddenRegion second,
Procedure1<? super IHiddenRegionFormatter> init);
项目:xtext-core    文件:StringBasedTextRegionAccessDiffBuilder.java   
public RemoveRewriteAction(IHiddenRegion originalFirst, IHiddenRegion originalLast, boolean delete) {
    super(originalFirst, originalLast);
    this.delete = delete;
}
项目:xtext-core    文件:StringBasedTextRegionAccessDiffBuilder.java   
@Override
public SequentialRegionDiff apply(StringBasedTextRegionAccessDiffAppender appender) {
    return appender.copySurroundingHidden((IHiddenRegion) originalFirst, (IHiddenRegion) originalLast, delete);
}
项目:xtext-core    文件:StringBasedTextRegionAccessDiffBuilder.java   
public ReplaceRewriteAction(IHiddenRegion originalFirst, IHiddenRegion originalLast,
        IHiddenRegion modifiedFirst, IHiddenRegion modifiedLast) {
    super(originalFirst, originalLast);
    this.modifiedFirst = modifiedFirst;
    this.modifiedLast = modifiedLast;
}
项目:xtext-core    文件:StringBasedTextRegionAccessDiffBuilder.java   
@Override
public SequentialRegionDiff apply(StringBasedTextRegionAccessDiffAppender appender) {
    SequentialRegionDiff result = appender.copyAndAppend((IHiddenRegion) originalFirst,
            (IHiddenRegion) originalLast, modifiedFirst, modifiedLast);
    return result;
}
项目:xtext-core    文件:StringBasedTextRegionAccessDiffBuilder.java   
public SequenceRewriteAction(IHiddenRegion originalFirst, IHiddenRegion originalLast,
        TextRegionAccessBuildingSequencer sequencer) {
    super(originalFirst, originalLast);
    this.sequencer = sequencer;
}