コード例 #1
0
ファイル: GIndentBlock_TextGen.java プロジェクト: sprig/MPS
 public void doGenerateText(SNode node) {
   if (getBuffer().hasPositionsSupport()) {
     TraceInfoGenerationUtil.createPositionInfo(this, node);
   }
   this.increaseDepth();
   TextGenManager.instance()
       .appendNodeText(
           this.getContext(),
           this.getBuffer(),
           SLinkOperations.getTarget(node, "itemList", true),
           this.getSNode());
   this.decreaseDepth();
   if (getBuffer().hasPositionsSupport()) {
     {
       String traceableProperty = "";
       try {
         traceableProperty =
             BehaviorReflection.invokeVirtual(
                 String.class,
                 SNodeOperations.cast(
                     node, "jetbrains.mps.lang.traceable.structure.TraceableConcept"),
                 "virtual_getTraceableProperty_5067982036267369901",
                 new Object[] {});
       } catch (Throwable t) {
         if (LOG.isEnabledFor(Priority.ERROR)) {
           LOG.error("Can't calculate traceable prorerty for a node " + node + ".", t);
         }
       }
       TraceInfoGenerationUtil.fillPositionInfo(this, node, traceableProperty);
     }
   }
 }
コード例 #2
0
 public void doGenerateText(SNode node) {
   if (getBuffer().hasPositionsSupport()) {
     TraceInfoGenerationUtil.createPositionInfo(this, node);
   }
   for (SNode item : SLinkOperations.getTargets(node, "item", true)) {
     if (item != ListSequence.fromList(SLinkOperations.getTargets(node, "item", true)).first()) {
       TextGenManager.instance()
           .appendNodeText(
               this.getContext(),
               this.getBuffer(),
               SLinkOperations.getTarget(node, "separator", true),
               this.getSNode());
     }
     TextGenManager.instance()
         .appendNodeText(this.getContext(), this.getBuffer(), item, this.getSNode());
   }
   if (getBuffer().hasPositionsSupport()) {
     {
       String traceableProperty = "";
       try {
         traceableProperty =
             BehaviorReflection.invokeVirtual(
                 String.class,
                 SNodeOperations.cast(
                     node, "jetbrains.mps.lang.traceable.structure.TraceableConcept"),
                 "virtual_getTraceableProperty_5067982036267369901",
                 new Object[] {});
       } catch (Throwable t) {
         LOG.error("Can't calculate traceable prorerty for a node " + node + ".", t);
       }
       TraceInfoGenerationUtil.fillPositionInfo(this, node, traceableProperty);
     }
   }
 }