public static void createPositionInfo(SNodeTextGen nodeTextGen, SNode node) { final TraceInfoCollector tic = getTraceInfoCollector(nodeTextGen.getContext()); if (tic == null) { return; } nodeTextGen.getContext().getBuffer().pushMark(); }
public static void fillPositionInfo(SNodeTextGen nodeTextGen, SNode node, String propertyString) { final TraceInfoCollector tic = getTraceInfoCollector(nodeTextGen.getContext()); if (tic == null) { return; } final TextMark m = nodeTextGen.getContext().getBuffer().popMark(); TraceablePositionInfo info = tic.createTracePosition(m, node); info.setPropertyString(propertyString); }
public static void fillUnitInfo(SNodeTextGen nodeTextGen, SNode node, String unitName) { final TraceInfoCollector tic = getTraceInfoCollector(nodeTextGen.getContext()); if (tic == null) { return; } final TextMark m = nodeTextGen.getContext().getBuffer().popMark(); UnitPositionInfo info = tic.createUnitPosition(m, node); info.setUnitName(unitName); warnIfUnitNameInvalid(unitName, node); }
public static void fillScopeInfo(SNodeTextGen nodeTextGen, SNode node, List<SNode> vars) { final TraceInfoCollector tic = getTraceInfoCollector(nodeTextGen.getContext()); if (tic == null) { return; } final TextMark m = nodeTextGen.getContext().getBuffer().popMark(); ScopePositionInfo info = tic.createScopePosition(m, node); for (SNode var : vars) { if (var != null) { info.addVarInfo(var); } } }
// compatibility stuff @Deprecated public static void appendNodeText(SNodeTextGen textGen, SNode node, TextGenBuffer buffer) { textGen.setBuffer(buffer); try { textGen.setSNode(node); textGen.doGenerateText(node); textGen.setSNode(null); } catch (Exception e) { buffer.foundError( "failed to generate text for " + org.jetbrains.mps.openapi.model.SNodeUtil.getDebugText(node), node, e); } }