Wiki source code of AQL Parser

Last modified by superadmin on 2026/10/14 18:44

Hide last authors
Raphaël Jakse 2.1 1 AQL (Atlassian Query Language) is the family of query language to which CQL (Confluence Query Language) and JQL (Jira Query Language) belong.
Raphaël Jakse 1.1 2
3 Our AQL Parser module parses this syntax and lets you implement languages of this family. Our [[CQL Query module does this>>doc:documentation.extensions.dev.cql.query.WebHome]].
Raphaël Jakse 2.1 4
5 For a description of how this module was designed, please see [[xwiki:documentation.extensions.dev.cql.aql-parser.design.WebHome]].
6
7 = Basic usage =
8
Raphaël Jakse 3.1 9 This module is intended to be used with the [[Query>>doc:documentation.extensions.dev.cql.query.WebHome]] module. However, if you indeed want to deal with the Abstract Syntax Tree produced by the AQL parser, here's how to parse an AQL statement:
Raphaël Jakse 2.1 10
Vincent Massol 3.3 11 {{code language="java"}}
Raphaël Jakse 2.1 12 import java.io.IOException;
13
14 import javax.inject.Inject;
15 import javax.inject.Singleton;
16
17 import org.xwiki.component.annotation.Component;
18 import org.xwiki.contrib.cql.aqlparser.AQLParser;
19 import org.xwiki.contrib.cql.aqlparser.ast.AQLStatement;
20 import org.xwiki.contrib.cql.aqlparser.exceptions.ParserException;
21
22 @Component (roles = DefaultScratch.class)
23 @Singleton
24 class DefaultScratch
25 {
26 public void example() throws ParserException, IOException
27 {
28 AQLStatement cql = AQLParser.parse( "title = 'Main'");
29 }
30 }
31 {{/code}}
32
33 See the [[list of nodes that can be produced by the parser>>https://github.com/xwiki-contrib/cql/tree/master/aqlparser/src/main/java/org/xwiki/contrib/cql/aqlparser/ast]].
34

Get Connected