private Expression parseCommentConstructor(int offset) throws XPathException { nextToken(); Expression value; if (t.currentToken == Token.RCURLY && allowXPath31Syntax) { value = Literal.makeEmptySequence(); } else { value = parseExpression(); } expect(Token.RCURLY); lookAhead(); // after an RCURLY nextToken(); Comment com = new Comment(); makeSimpleContent(value, com, offset); return makeTracer(offset, com, StandardNames.XSL_COMMENT, null); }
private Expression parseCommentConstructor(int offset) throws XPathException { nextToken(); Expression value; if (t.currentToken == Token.RCURLY && allowXPath31Syntax) { value = Literal.makeEmptySequence(); } else { value = parseExpression(); } expect(Token.RCURLY); lookAhead(); // after an RCURLY nextToken(); Comment com = new Comment(); makeSimpleContent(value, com, offset); return makeTracer(offset, com, StandardNames.XSL_COMMENT, null); }
/** * Parse a processing instruction constructor of the form * processing-instruction {expr} {expr} * * @param offset the position of the expression in the source query * @return the compiled instruction * @throws XPathException if parsing fails */ private Expression parseProcessingInstructionConstructor(int offset) throws XPathException { nextToken(); Expression name = parseExpression(); expect(Token.RCURLY); lookAhead(); // must be done manually after an RCURLY nextToken(); expect(Token.LCURLY); t.setState(Tokenizer.DEFAULT_STATE); nextToken(); Expression content = null; if (t.currentToken != Token.RCURLY) { content = parseExpression(); expect(Token.RCURLY); } lookAhead(); // after an RCURLY nextToken(); ProcessingInstruction pi = new ProcessingInstruction(name); makeSimpleContent(content, pi, offset); return makeTracer(offset, pi, StandardNames.XSL_PROCESSING_INSTRUCTION, null); }
/** * Parse a processing instruction constructor of the form * processing-instruction {expr} {expr} * * @param offset the position of the expression in the source query * @return the compiled instruction * @throws XPathException if parsing fails */ private Expression parseProcessingInstructionConstructor(int offset) throws XPathException { nextToken(); Expression name = parseExpression(); expect(Token.RCURLY); lookAhead(); // must be done manually after an RCURLY nextToken(); expect(Token.LCURLY); t.setState(Tokenizer.DEFAULT_STATE); nextToken(); Expression content = null; if (t.currentToken != Token.RCURLY) { content = parseExpression(); expect(Token.RCURLY); } lookAhead(); // after an RCURLY nextToken(); ProcessingInstruction pi = new ProcessingInstruction(name); makeSimpleContent(content, pi, offset); return makeTracer(offset, pi, StandardNames.XSL_PROCESSING_INSTRUCTION, null); }
private Expression parseTextNodeConstructor(int offset) throws XPathException { nextToken(); Expression value; if (t.currentToken == Token.RCURLY && allowXPath31Syntax) { value = Literal.makeEmptySequence(); } else { value = parseExpression(); } expect(Token.RCURLY); lookAhead(); // after an RCURLY nextToken(); Expression select = stringify(value, true, env); ValueOf vof = new ValueOf(select, false, true); setLocation(vof, offset); return makeTracer(offset, vof, StandardNames.XSL_TEXT, null); }
private Expression parseTextNodeConstructor(int offset) throws XPathException { nextToken(); Expression value; if (t.currentToken == Token.RCURLY && allowXPath31Syntax) { value = Literal.makeEmptySequence(); } else { value = parseExpression(); } expect(Token.RCURLY); lookAhead(); // after an RCURLY nextToken(); Expression select = stringify(value, true, env); ValueOf vof = new ValueOf(select, false, true); setLocation(vof, offset); return makeTracer(offset, vof, StandardNames.XSL_TEXT, null); }
expect(Token.RCURLY); lookAhead(); // after an RCURLY nextToken(); if (warning == null) {
expect(Token.RCURLY); lookAhead(); // after an RCURLY nextToken(); if (warning == null) {
expect(Token.RCURLY); lookAhead(); // after an RCURLY nextToken(); if (warning == null) {
expect(Token.RCURLY); lookAhead(); // after an RCURLY nextToken(); if (warning == null) {
/** * Parse document constructor: document {...} * * @param offset the location in the source query * @return the document constructor instruction * @throws XPathException if parsing fails */ /*@NotNull*/ private Expression parseDocumentConstructor(int offset) throws XPathException { nextToken(); Expression content; if (t.currentToken == Token.RCURLY && allowXPath31Syntax) { content = Literal.makeEmptySequence(); } else { content = parseExpression(); } expect(Token.RCURLY); lookAhead(); // must be done manually after an RCURLY nextToken(); DocumentInstr doc = new DocumentInstr(false, null); if (!((QueryModule) env).isPreserveNamespaces()) { content = new CopyOf(content, false, Validation.PRESERVE, null, true); } doc.setValidationAction(((QueryModule) env).getConstructionMode(), null); doc.setContentExpression(content); setLocation(doc, offset); return doc; }
/** * Parse a namespace node constructor of the form * namespace name { expr } * * @param offset the location of the expression in the query source * @return the compiled instruction * @throws XPathException in the event of a syntax error */ /*@NotNull*/ private Expression parseNamedNamespaceConstructor(int offset) throws XPathException { if (!allowXPath30Syntax) { grumble("Namespace node constructors require XQuery 3.0"); } String target = t.currentTokenValue; if (!NameChecker.isValidNCName(target)) { grumble("Invalid namespace prefix " + Err.wrap(target)); } Expression nsName = new StringLiteral(target); Expression nsContent = null; nextToken(); if (t.currentToken != Token.RCURLY) { nsContent = parseExpression(); expect(Token.RCURLY); } lookAhead(); // after an RCURLY nextToken(); NamespaceConstructor instr = new NamespaceConstructor(nsName); makeSimpleContent(nsContent, instr, offset); return makeTracer(offset, instr, StandardNames.XSL_NAMESPACE, null); }
/** * Parse document constructor: document {...} * * @param offset the location in the source query * @return the document constructor instruction * @throws XPathException if parsing fails */ /*@NotNull*/ private Expression parseDocumentConstructor(int offset) throws XPathException { nextToken(); Expression content; if (t.currentToken == Token.RCURLY && allowXPath31Syntax) { content = Literal.makeEmptySequence(); } else { content = parseExpression(); } expect(Token.RCURLY); lookAhead(); // must be done manually after an RCURLY nextToken(); DocumentInstr doc = new DocumentInstr(false, null); if (!((QueryModule) env).isPreserveNamespaces()) { content = new CopyOf(content, false, Validation.PRESERVE, null, true); } doc.setValidationAction(((QueryModule) env).getConstructionMode(), null); doc.setContentExpression(content); setLocation(doc, offset); return doc; }
/** * Parse a namespace node constructor of the form * namespace name { expr } * * @param offset the location of the expression in the query source * @return the compiled instruction * @throws XPathException in the event of a syntax error */ /*@NotNull*/ private Expression parseNamedNamespaceConstructor(int offset) throws XPathException { if (!allowXPath30Syntax) { grumble("Namespace node constructors require XQuery 3.0"); } String target = t.currentTokenValue; if (!NameChecker.isValidNCName(target)) { grumble("Invalid namespace prefix " + Err.wrap(target)); } Expression nsName = new StringLiteral(target); Expression nsContent = null; nextToken(); if (t.currentToken != Token.RCURLY) { nsContent = parseExpression(); expect(Token.RCURLY); } lookAhead(); // after an RCURLY nextToken(); NamespaceConstructor instr = new NamespaceConstructor(nsName); makeSimpleContent(nsContent, instr, offset); return makeTracer(offset, instr, StandardNames.XSL_NAMESPACE, null); }
expect(Token.RCURLY); lookAhead(); // after an RCURLY nextToken(); FixedElement el2 = new FixedElement(nodeName,
expect(Token.RCURLY); lookAhead(); // after an RCURLY nextToken(); FixedElement el2 = new FixedElement(nodeName,