use of org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentEvent in project webtools.sourceediting by eclipse.
the class StructuredDocumentReParser method checkForPI.
/**
* A change to a PI tag can result in all being reparsed.
*/
private StructuredDocumentEvent checkForPI() {
StructuredDocumentEvent result = null;
// $NON-NLS-1$
result = checkForCriticalKey("<?");
if (result == null)
// $NON-NLS-1$
result = checkForCriticalKey("?>");
return result;
}
use of org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentEvent in project webtools.sourceediting by eclipse.
the class StructuredDocumentReParser method _core_reparse_update_model.
/**
* Part 2 of 2 steps to do a core_reparse
*
* Integrates a list of StructuredDocumentRegions based on the current
* text contents of the IStructuredDocument into the IStructuredDocument
* data structure
*/
private StructuredDocumentEvent _core_reparse_update_model(IStructuredDocumentRegion newNodesHead, int rescanStart, int rescanEnd, CoreNodeList oldNodes, boolean firstTime) {
StructuredDocumentEvent result = null;
CoreNodeList newNodes = null;
// rescan
newNodes = new CoreNodeList(newNodesHead);
// adjust our newNode chain so the offset positions match
// our text store (not the simple string of text reparsed)
StructuredDocumentRegionIterator.adjustStart(newNodesHead, rescanStart);
// initialize the parentDocument variable of each instance in the new
// chain
StructuredDocumentRegionIterator.setParentDocument(newNodesHead, fStructuredDocument);
//
if (firstTime) {
fStructuredDocument.setCachedDocumentRegion(newNodesHead);
fStructuredDocument.initializeFirstAndLastDocumentRegion();
// note: since we are inserting nodes, for the first time, there
// is
// no adjustments
// to downstream stuff necessary.
result = new StructuredDocumentRegionsReplacedEvent(fStructuredDocument, fRequester, oldNodes, newNodes, fChanges, fStart, fLengthToReplace, fIsEntireDocument);
} else {
// note: integrates changes into model as a side effect
result = minimumEvent(oldNodes, newNodes);
}
result.setDeletedText(fDeletedText);
return result;
}
use of org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentEvent in project webtools.sourceediting by eclipse.
the class StructuredDocumentReParser method reparse.
/**
* An entry point for reparsing. It calculates the dirty start and dirty
* end flatnodes based on the start point and length of the changes.
*/
public StructuredDocumentEvent reparse() {
StructuredDocumentEvent result = null;
// otherwise, find them.
if (fStructuredDocument.getCachedDocumentRegion() != null) {
findDirtyStart(fStart);
int end = fStart + fLengthToReplace;
findDirtyEnd(end);
}
if (fStructuredDocument.getCachedDocumentRegion() != null) {
result = checkHeuristics();
}
if (result == null) {
result = reparse(dirtyStart, dirtyEnd);
}
endReParse();
return result;
}
use of org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentEvent in project webtools.sourceediting by eclipse.
the class StructuredDocumentReParser method core_reparse.
/**
* The core reparsing method ... after the dirty start and dirty end have
* been calculated elsewhere, and the text updated.
*/
protected StructuredDocumentEvent core_reparse(int rescanStart, int rescanEnd, CoreNodeList oldNodes, boolean firstTime) {
IStructuredDocumentRegion newNodesHead = null;
StructuredDocumentEvent result = null;
newNodesHead = _core_reparse_text(rescanStart, rescanEnd);
result = _core_reparse_update_model(newNodesHead, rescanStart, rescanEnd, oldNodes, firstTime);
return result;
}
use of org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentEvent in project webtools.sourceediting by eclipse.
the class StructuredDocumentReParser method reparse.
/**
* An entry point for reparsing. It calculates the dirty start and dirty
* end flatnodes based on suggested positions to begin and end. This is
* needed for cases where parsing must go beyond the immediate node and
* its direct neighbors.
*/
protected StructuredDocumentEvent reparse(int reScanStartHint, int reScanEndHint) {
StructuredDocumentEvent result = null;
// must be empty, so simply use 'null' as the dirtyStart and dirtyEnd
if (fStructuredDocument.getCachedDocumentRegion() != null) {
findDirtyStart(reScanStartHint);
findDirtyEnd(reScanEndHint);
}
result = reparse(dirtyStart, dirtyEnd);
isParsing = false;
// verifyStructured(result);
return result;
}
Aggregations