Skip to content

TEDEFO-5142, TEDEFO-5144: Transpile EFX selectors to element paths - #171

Merged
rousso merged 3 commits into
developfrom
feature/TEDEMD-547-efx-selector
Aug 26, 2026
Merged

TEDEFO-5142, TEDEFO-5144: Transpile EFX selectors to element paths#171
rousso merged 3 commits into
developfrom
feature/TEDEMD-547-efx-selector

Conversation

@rousso

@rousso rousso commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

This pull request implements, in both expression translators, the selector added to the EFX-1 and EFX-2 grammars under TEDEFO-5141 and TEDEFO-5143.

A selector yields the same path that the equivalent expression would use, without the final step that reads the value. It is relative or absolute according to how the reference is written. The translated result is therefore a location path rather than a sequence of values, and can be used to select the elements the reference designates.

The version of the SDK from which the EFX-1 grammar is generated moves from 1.13.0 to 1.16.0-SNAPSHOT, which is the first version to contain the selector. The two grammars were otherwise identical, so no other change follows from it.

The implementation is one listener method in each translator. The path produced by the reference is already on the stack, so the only work is to leave the value step uncomposed. An attribute reference needs its attribute step composed there, because attributeReference has no exit handler of its own; composing it globally would apply it twice in the scalar and sequence positions and change existing output.

One difference between a selector and an expression is worth noting. An indexed selector uses the node-level indexer that fieldContext applies everywhere else in the language, as it does for rawValue, context iterators and context overrides, and therefore selects the nth occurrence within each parent. An indexed expression indexes the sequence of values and selects the nth item overall. This is deliberate and is covered by a test, so that the two forms are not mistaken for one another.

The suite contains 1373 tests, all passing. The output of the existing corpus is unchanged, and the build was verified against the published snapshots of both SDK branches rather than local installations.

@rousso
rousso merged commit bbd972a into develop Aug 26, 2026
1 check passed
@rousso
rousso deleted the feature/TEDEMD-547-efx-selector branch August 26, 2026 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant