private void addTraversal(final Traversal.Admin t) {
        this.traversals.add(t);
        for (final Object ss : t.getSteps()) {
            if (ss instanceof Scoping) {
                for (String label : ((Scoping) ss).getScopeKeys()) {
                    this.referencedLabels.add(label);
                }
            }
        }
    }
Gets a list of all labels held in parameters that have a traversal as a value.
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/Parameters.java