@Override
    public Void visitTraversalStrategy(final GremlinParser.TraversalStrategyContext ctx) {
        sb.append("new ");

        if (ctx.getChildCount() == 1)
            sb.append(ctx.getText()).append("()");
        else {
            sb.append(ctx.getChild(0).getText().equals("new") ? ctx.getChild(1).getText() : ctx.getChild(0).getText()).append("({");

            final List<ParseTree> configs = ctx.children.stream().
                    filter(c -> c instanceof GremlinParser.ConfigurationContext).collect(Collectors.toList());

            // the rest are the arguments to the strategy
            for (int ix = 0; ix < configs.size(); ix++) {
                visit(configs.get(ix));
                if (ix < configs.size() - 1)
                    sb.append(", ");
            }

            sb.append("})");
        }

        return null;
    }
Converts a Gremlin traversal string into a Javascript source code representation of that traversal with an aim at
sacrificing some formatting for the ability to compile correctly.
<ul>
    <li>Range syntax has no direct support</li>
    <li>Normalizes whitespace</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/JavascriptTranslateVisitor.java