Search in sources :

Example 1 with SequencePathElement

use of com.inova8.pathql.element.SequencePathElement in project com.inova8.intelligentgraph by peterjohnlawrence.

the class PathPatternVisitor method visitPathSequence.

/**
 * Visit path sequence.
 *
 * @param ctx the ctx
 * @return the sequence path element
 */
@Override
public SequencePathElement visitPathSequence(PathSequenceContext ctx) {
    // pathPatterns :   pathPatterns '/'  pathPatterns  #PathSequence
    if (ctx.pathPatterns().size() == 1) {
        return (SequencePathElement) visit(ctx.pathPatterns(0));
    } else {
        SequencePathElement pathSequenceElement = new SequencePathElement(this.repositoryContext);
        pathSequenceElement.setLeftPathElement(visit(ctx.pathPatterns(0)));
        pathSequenceElement.setRightPathElement(visit(ctx.pathPatterns(1)));
        return pathSequenceElement;
    }
}
Also used : SequencePathElement(com.inova8.pathql.element.SequencePathElement)

Aggregations

SequencePathElement (com.inova8.pathql.element.SequencePathElement)1