@Override
    public Void visitStringNullableLiteral(final GremlinParser.StringNullableLiteralContext ctx) {
        // remove the first and last character (single or double quotes) but only if it is not null
        if (ctx.getText().equals("null")) {
            sb.append("null");
        } else {
            final String text = removeFirstAndLastCharacters(ctx.getText());
            handleStringLiteralText(text);
        }
        return null;
    }
A base class for visitors that translate Gremlin AST nodes to Gremlin strings.
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/AbstractTranslateVisitor.java