Package jetbrains.mps.textgen.trace
Class TracingUtil
- java.lang.Object
 - 
- jetbrains.mps.textgen.trace.TracingUtil
 
 
- 
public final class TracingUtil extends Object
Mechanism Generator uses to keep trace of origin for transformed nodes. As the package name suggests, it's rather part of [debuginfo-api] module, however, generated code uses this class in runtime, and as long as [debuginfo-api] is auxiliary (not part of the [kernel]/mps-core), it's better to keep this class here. After all, [debuginfo-api] is not the only client of the trace. Perhaps, shall push this class even further, down to [smodel], as it's quite generic. Meanwhile, there's CopyUtil that got quite some dependencies to [kernel]. Once either CopyUtil's dependencies are in [smodel], or there's simplified alternative (I don't need too much from CopyUtil here, in fact), consider moving the class further. 
- 
- 
Field Summary
Fields Modifier and Type Field Description static StringORIGINAL_INPUT_NODE 
- 
Constructor Summary
Constructors Constructor Description TracingUtil() 
- 
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static List<SNode>copyWithTrace(List<SNode> nodes)static SNodecopyWithTrace(SNode node)static voidderiveOriginalNode(SNode inputNode, Collection<SNode> outputNodes, boolean force)Derive original input node from a transient input node, if any.static voidderiveOriginalNode(SNode inputNode, SNode outputNode)Derive original input node from a transient input node, if any.static voidfillOriginalNode(SNode inputNode, SNode outputNode, boolean originalInput)Deprecated.code branching done with boolean flag.static SNodeReferencegetInput(SNode output)static SNodegetInputNode(SNode output, SRepository repo)static voidputInput(SNode output, SNodeReference input)static voidputInputNode(SNode output, SNode input) 
 - 
 
- 
- 
Field Detail
- 
ORIGINAL_INPUT_NODE
public static final String ORIGINAL_INPUT_NODE
- See Also:
 - Constant Field Values
 
 
 - 
 
- 
Method Detail
- 
getInput
@Nullable public static SNodeReference getInput(@NotNull SNode output)
 
- 
putInput
public static void putInput(@NotNull SNode output, SNodeReference input)
 
- 
getInputNode
@Nullable public static SNode getInputNode(@NotNull SNode output, @NotNull SRepository repo)
 
- 
fillOriginalNode
@Deprecated public static void fillOriginalNode(@NotNull SNode inputNode, @NotNull SNode outputNode, boolean originalInput)
Deprecated.code branching done with boolean flag. 
- 
deriveOriginalNode
public static void deriveOriginalNode(SNode inputNode, SNode outputNode)
Derive original input node from a transient input node, if any. Doesn't override origin trace if already set- Parameters:
 inputNode- shall never be null, the one we take origin fromoutputNode- node to receive same origin as the inputNode (unless already has one), not null.
 
- 
deriveOriginalNode
public static void deriveOriginalNode(SNode inputNode, Collection<SNode> outputNodes, boolean force)
Derive original input node from a transient input node, if any. Optionally doesn't override origin trace if already set- Parameters:
 inputNode- shall never be null, the one we take origin fromoutputNodes- nodes to receive same origin as the inputNode (unless they already has one)
 
 - 
 
 -