Skip to main content

Crate openehr_query

Crate openehr_query 

Source
Expand description

openEHR QUERY (AQL 1.1.0): a hand-written lexer, parser, and AST over the canonical ANTLR4 grammar vendored at vendor/grammar/, with no ANTLR runtime dependency. AQL has no BMM meta-model, so this crate is written by hand against the grammar and tested against vendor/examples/.

The crate stops at the AST: lexer tokenizes AqlLexer.g4 with logos, ast carries one type per AqlParser.g4 rule, and parser builds an ast::SelectQuery with chumsky. visit walks and rewrites the tree, bind substitutes ITS-REST query_parameters into it, and printer renders it back to AQL text. Query execution lives in the application.

The federation feature adds federation, which separates the federation-only FROM ENDPOINT / ORGANISATION directive from a query before the strict AQL 1.1.0 parse.

Modules§

ast
AQL abstract syntax tree, transcribed from AqlParser.g4 (vendored at vendor/grammar/).
bind
Binding ITS-REST query_parameters into a parsed query.
federation
The federation-only FROM ENDPOINT / ORGANISATION directive, separated from a query before the strict AQL 1.1.0 parse.
lexer
AQL lexer — a logos tokenizer transcribed from the authoritative AqlLexer.g4 (vendored at vendor/grammar/).
parser
AQL parser — a chumsky parser transcribed from AqlParser.g4, turning the crate::lexer token stream into an crate::ast::SelectQuery.
printer
Canonical AQL text rendering of the crate::ast.
visit
Traversal of the crate::ast: a read-only Visit and a mutating VisitMut, each exhaustive over every node type.

Constants§

SPEC_VERSION
The openEHR specification version this crate implements.