public Object visit(ASTCollection node, Object data) throws VisitorException { return node.childrenAccept(this, data); }
@Override public Object visit(ASTCollection node, Object data) throws VisitorException { node.setVarName(createAnonVarName()); return super.visit(node, data); } }
/** * Handle the RDF Collection syntax. */ @Override public VarNode visit(final ASTCollection node, final Object data) throws VisitorException { final String listVarName = node.getVarName(); final VarNode rootListVar = context.createAnonVar(listVarName); TermNode listVar = rootListVar; final int childCount = node.jjtGetNumChildren(); for (int i = 0; i < childCount; i++) { final TermNode childValue = (TermNode) node.jjtGetChild(i) .jjtAccept(this, null); graphPattern.addSP(listVar, context.createConstVar(RDF.FIRST), childValue); TermNode nextListVar; if (i == childCount - 1) { nextListVar = context.createConstVar(RDF.NIL); } else { nextListVar = context.createAnonVar(listVarName + "-" + (i + 1)); } graphPattern.addSP(listVar, context.createConstVar(RDF.REST), nextListVar); listVar = nextListVar; } return rootListVar; }
final public void Collection() throws ParseException { ASTCollection jjtn000 = new ASTCollection(JJTCOLLECTION); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000);
/** * Handle the RDF Collection syntax. */ @Override public VarNode visit(final ASTCollection node, final Object data) throws VisitorException { final String listVarName = node.getVarName(); final VarNode rootListVar = context.createAnonVar(listVarName); TermNode listVar = rootListVar; final int childCount = node.jjtGetNumChildren(); for (int i = 0; i < childCount; i++) { final TermNode childValue = (TermNode) node.jjtGetChild(i) .jjtAccept(this, null); graphPattern.addSP(listVar, context.createConstVar(RDF.FIRST), childValue); TermNode nextListVar; if (i == childCount - 1) { nextListVar = context.createConstVar(RDF.NIL); } else { nextListVar = context.createAnonVar(listVarName + "-" + (i + 1)); } graphPattern.addSP(listVar, context.createConstVar(RDF.REST), nextListVar); listVar = nextListVar; } return rootListVar; }
final public void Collection() throws ParseException { ASTCollection jjtn000 = new ASTCollection(JJTCOLLECTION); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000);
final public void CollectionPath() throws ParseException { ASTCollection jjtn000 = new ASTCollection(JJTCOLLECTION); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000);
public Object visit(ASTCollection node, Object data) throws VisitorException { return node.childrenAccept(this, data); }
@Override public Object visit(ASTCollection node, Object data) throws VisitorException { node.setVarName(createAnonVarName()); return super.visit(node, data); } }
final public void CollectionPath() throws ParseException { ASTCollection jjtn000 = new ASTCollection(JJTCOLLECTION); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000);