/**
  * Calculates the prefix for each given expected element. The prefix depends on the current
  * document content, the cursor position, and the position where the element is expected.
  */
 protected void setPrefixes(
     List<org.emftext.language.xpath3.resource.xpath3.mopp.Xpath3ExpectedTerminal>
         expectedElements,
     String content,
     int cursorOffset) {
   if (cursorOffset < 0) {
     return;
   }
   for (org.emftext.language.xpath3.resource.xpath3.mopp.Xpath3ExpectedTerminal expectedElement :
       expectedElements) {
     String prefix = findPrefix(expectedElements, expectedElement, content, cursorOffset);
     expectedElement.setPrefix(prefix);
   }
 }