private void setSource(final Node node, final NodeToken source) { if (source == null) node.astSetSource(filename); else node.astSetSource(filename + ":" + source.beginLine + "-" + source.beginColumn); }
newNode.astSetSource(node.astGetSource());
result.astSetSource(elem.astGetSource());
@SuppressWarnings("unchecked") private static <T extends Node> T cloneNodeState(final T node) { // first create a new node instance final T newNode = (T) node.astNewInstance(); // copy node attributes newNode.astSetAttributes(node.astGetAttributes()); // copy node decoration newNode.astSetDecorations(node.astGetDecorations()); // copy source newNode.astSetSource(node.astGetSource()); return newNode; }