@Override
    public Void visitTerminal(final TerminalNode node) {
        // skip EOF node
        if (null == node || node.getSymbol().getType() == -1) return null;

        final String terminal = node.getSymbol().getText();
        switch (terminal) {
            case "(":
                appendStepOpen();
                break;
            case ")":
                appendStepClose();
                break;
            case ",":
                appendArgumentSeparator();
                break;
            case ".":
                appendStepSeparator();
                break;
            case "new":
                // seems we still sometimes interpret this as a TerminalNode like when newing up a class
                // which is optional syntax and will go away in the future.
                sb.append("new");
                if (!(node.getParent() instanceof GremlinParser.MapKeyContext))
                    sb.append(" "); // includes a space for when not use in context of a Map entry key...one off
                break;
            default:
                sb.append(processGremlinSymbol(terminal));
        }
        return null;
    }
A Gremlin to Gremlin translator. Makes no changes to input except:
<ul>
    <li>Normalizes whitespace</li>
    <li>Normalize numeric suffixes to lower case</li>
    <li>Makes anonymous traversals explicit with double underscore</li>
    <li>Makes enums explicit with their proper name</li>
</ul>
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/TranslateVisitor.java