Parser for VTL expressions (see https://sdmx.org/?page_id=5096). The parser is based on the official VTL grammar (see https://github.com/vtl-sdmx-task-force/sdmx-vtl) including some adjustments (see comments in Vtl.g4 and VtlTokens.g4). It's written using ANTLR4 (see http://www.antlr.org/) and the Abstract syntax tree (AST) class, as well as the Abstract compiler class are written by Bart Kiers (see https://github.com/bkiers). The compiler class allows for the extraction of tree structures (i.e. parse tree structure or transformation tree structure) from an input expression.
Please note that this project is dependent on the project transformations (in the sense that including the project transformations in this projects build path is required).
- Clone the repository transformations
- Clone this repository
- Include the transformations project into the build path of this project
- Type a VTL expression in the (String) variable query (that is set to "z := sqrt(x * x + y * y)" initially) in the class Playground
- Run the main() method in the class Playground
- Results: on the console you will see the (i) tree structure of the abstract syntax tree, the (ii) tree structure compliant with the BIRD interpretation of the SDMX information model, (iii) the nodes stored in the persistence context and (iv) the VTL built expression based on (ii)
Please note that the BIRD VTL tree structure is the BIRD group's interpretation of the SDMX information model and not an official structure documented by the SDMX community. Please also note that the (re)generation of the VTL expression from the BIRD VTL tree structure is still in development.
For questions related to this repository please contact BIRD@ecb.europa.eu.