void () { if (!ourParsingAllowed) { LOG.error("Parsing not allowed!!!"); } if (myParsed) return; CharSequence text; waitForLock(myLock); try { if (myParsed) return; text = myText.get(); assert text != null; FileElement fileElement = TreeUtil.getFileElement(this); if (fileElement == null) { LOG.error("Chameleons must not be parsed till they're in file tree: " + this); } else { fileElement.assertReadAccessAllowed(); } if (rawFirstChild() != null) { LOG.error("Reentrant parsing?"); } DebugUtil.performPsiModification("lazy-parsing", () -> { TreeElement parsedNode = (TreeElement)((ILazyParseableElementTypeBase)getElementType()).parseContents(this); assertTextLengthIntact(text, parsedNode); if (parsedNode != null) { setChildren(parsedNode); } myParsed = true; myText = new SoftReference<>(text); }); } finally { myLock.unlock(); } }