Exemplo n.º 1
0
 public static void createPositionInfo(SNodeTextGen nodeTextGen, SNode node) {
   final TraceInfoCollector tic = getTraceInfoCollector(nodeTextGen.getContext());
   if (tic == null) {
     return;
   }
   nodeTextGen.getContext().getBuffer().pushMark();
 }
Exemplo n.º 2
0
  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);
  }
Exemplo n.º 3
0
  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);
  }
Exemplo n.º 4
0
  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);
      }
    }
  }
Exemplo n.º 5
0
 // 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);
   }
 }