private static void writePositions(Writer writer, CommonTree tree)
			throws IOException {

		if (!INCLUDE_POSITIONING) {
			return;
		}

		final Position start = ANTLR.getStart(tree);
		final Position end = ANTLR.getEnd(tree);

		if (start != null) {
			writer.append(" from=\"" + start.getPositionInFile() + "\"");
			writer.append(" from-line=\"" + start.getLinenumber() + "\"");
			writer.append(" from-column=\"" + start.getPositionInLine() + "\"");
		}

		if (end != null) {
			writer.append(" to=\"" + end.getPositionInFile() + "\"");
			writer.append(" to-line=\"" + end.getLinenumber() + "\"");
			writer.append(" to-column=\"" + end.getPositionInLine() + "\"");
		}
	}