/** * Parses the supplied SPARQL update sequence and builds a syntax tree from it. * * @param sequence A SPARQL update sequence string. * @return The root of the syntax tree. * @throws TokenMgrError If the update sequence was syntactically incorrect. * @throws ParseException If the update sequence was syntactically incorrect. */ public static ASTUpdateSequence parseUpdateSequence(final String sequence) throws TokenMgrError, ParseException { final SyntaxTreeBuilder stb = new SyntaxTreeBuilder( new StringReader(sequence) ); final ASTUpdateSequence seq = stb.UpdateSequence(); seq.setSourceString(sequence); return seq; }
final public void NumericFunction() throws ParseException { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case RAND: Rand(); break; case ABS: Abs(); break; case CEIL: Ceil(); break; case FLOOR: Floor(); break; case ROUND: Round(); break; default: jj_la1[137] = jj_gen; jj_consume_token(-1); throw new ParseException(); } }
final public void Update() throws ParseException { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LOAD: Load(); break; case CLEAR: Clear(); break; case DROP: Drop(); break; case ADD: Add(); break; case MOVE: Move(); break; case COPY: Copy(); break; case CREATE: Create(); break; case DROP_ENTAILMENTS: DropEntailments(); break; case CREATE_ENTAILMENTS: CreateEntailments(); break; case ENABLE_ENTAILMENTS:
final public void Query() throws ParseException { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case SELECT: SelectQuery(); break; case CONSTRUCT: ConstructQuery(); break; case DESCRIBE: DescribeQuery(); break; case ASK: AskQuery(); break; default: jj_la1[4] = jj_gen; jj_consume_token(-1); throw new ParseException(); } }
final public void Aggregate() throws ParseException { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COUNT: Count(); break; case SUM: Sum(); break; case MIN: Min(); break; case MAX: Max(); break; case AVG: Avg(); break; case SAMPLE: Sample(); break; case GROUP_CONCAT: GroupConcat(); break; default: jj_la1[125] = jj_gen; jj_consume_token(-1); throw new ParseException(); } }
final public void RDFTermFunction() throws ParseException { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case IS_IRI: IsIRI(); break; case IS_BLANK: IsBlank(); break; case IS_LITERAL: IsLiteral(); break; case IS_NUMERIC: IsNumeric(); break; case BNODE: BNodeFunc(); break; case IRI: IRIFunc(); break; case LANG: Lang(); break; case DATATYPE: Datatype(); break; case STR: Str(); break; case STRDT:
final public void PrimaryExpression() throws ParseException { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LPAREN: BrackettedExpression(); break; case EXISTS: case SHA384: case SHA512: BuiltInCall(); break; default: jj_la1[123] = jj_gen; if (jj_2_4(2)) { FunctionCall(); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case Q_IRI_REF: case PNAME_NS: case PNAME_LN: IRIref(); break; case STRING_LITERAL1: case STRING_LITERAL_LONG1: case STRING_LITERAL_LONG2: RDFLiteral(); break; case INTEGER:
final public void Prolog() throws ParseException { label_1: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BASE: case PREFIX: ; break; default: jj_la1[2] = jj_gen; break label_1; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PREFIX: PrefixDecl(); break; case BASE: BaseDecl(); break; default: jj_la1[3] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } }
final public void In() throws ParseException { /*@bgen(jjtree) In */ ASTIn jjtn000 = new ASTIn(JJTIN); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); try { jj_consume_token(IN); ArgList(); } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); } } }
/** * Parses the supplied SPARQL query and builds a syntax tree from it. * * @param query A SPARQL query string. * @return The root of the syntax tree. * @throws TokenMgrError If the query was syntactically incorrect. * @throws ParseException If the query was syntactically incorrect. */ public static ASTQueryContainer parseQuery(final String query) throws TokenMgrError, ParseException { final SyntaxTreeBuilder stb = new SyntaxTreeBuilder( new StringReader(query) ); // Set size of tab to 1 to force tokenmanager to report correct column // index for substring splitting of service graph pattern. stb.jj_input_stream.setTabSize(1); final ASTQueryContainer container = stb.QueryContainer(); container.setSourceString(query); return container; }
final public void FunctionCall() throws ParseException { /*@bgen(jjtree) FunctionCall */ ASTFunctionCall jjtn000 = new ASTFunctionCall(JJTFUNCTIONCALL); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); try { IRIref(); ArgList(); } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); } } }
final public void NumericExpression() throws ParseException { AdditiveExpression(); }
final public void RDFTermFunction() throws ParseException { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case IS_IRI: IsIRI(); break; case IS_BLANK: IsBlank(); break; case IS_LITERAL: IsLiteral(); break; case IS_NUMERIC: IsNumeric(); break; case BNODE: BNodeFunc(); break; case IRI: IRIFunc(); break; case LANG: Lang(); break; case DATATYPE: Datatype(); break; case STR: Str(); break; case STRDT:
final public void PrimaryExpression() throws ParseException { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LPAREN: BrackettedExpression(); break; case EXISTS: case SHA384: case SHA512: BuiltInCall(); break; default: jj_la1[123] = jj_gen; if (jj_2_4(2)) { FunctionCall(); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case Q_IRI_REF: case PNAME_NS: case PNAME_LN: IRIref(); break; case STRING_LITERAL1: case STRING_LITERAL_LONG1: case STRING_LITERAL_LONG2: RDFLiteral(); break; case INTEGER:
final public void Aggregate() throws ParseException { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COUNT: Count(); break; case SUM: Sum(); break; case MIN: Min(); break; case MAX: Max(); break; case AVG: Avg(); break; case SAMPLE: Sample(); break; case GROUP_CONCAT: GroupConcat(); break; default: jj_la1[125] = jj_gen; jj_consume_token(-1); throw new ParseException(); } }
final public void Query() throws ParseException { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case SELECT: SelectQuery(); break; case CONSTRUCT: ConstructQuery(); break; case DESCRIBE: DescribeQuery(); break; case ASK: AskQuery(); break; default: jj_la1[4] = jj_gen; jj_consume_token(-1); throw new ParseException(); } }
final public void Prolog() throws ParseException { label_1: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BASE: case PREFIX: ; break; default: jj_la1[2] = jj_gen; break label_1; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PREFIX: PrefixDecl(); break; case BASE: BaseDecl(); break; default: jj_la1[3] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } }
final public void Concat() throws ParseException { /*@bgen(jjtree) Concat */ ASTConcat jjtn000 = new ASTConcat(JJTCONCAT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); try { jj_consume_token(CONCAT); ArgList(); } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); } } }
/** * Parses the supplied SPARQL query and builds a syntax tree from it. * * @param query A SPARQL query string. * @return The root of the syntax tree. * @throws TokenMgrError If the query was syntactically incorrect. * @throws ParseException If the query was syntactically incorrect. */ public static ASTQueryContainer parseQuery(final String query) throws TokenMgrError, ParseException { final SyntaxTreeBuilder stb = new SyntaxTreeBuilder( new StringReader(query) ); // Set size of tab to 1 to force tokenmanager to report correct column // index for substring splitting of service graph pattern. stb.jj_input_stream.setTabSize(1); final ASTQueryContainer container = stb.QueryContainer(); container.setSourceString(query); return container; }
final public void FunctionCall() throws ParseException { /*@bgen(jjtree) FunctionCall */ ASTFunctionCall jjtn000 = new ASTFunctionCall(JJTFUNCTIONCALL); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); try { IRIref(); ArgList(); } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); } } }