Consolidate Behavior Annex validator traversals with EMF switches 馃 - #3245
Merged
Merged
Conversation
Characterize independent Behavior Annex diagnostics across an invalid array dimension and nested for/forall actions. Assert the diagnostic codes, severities, and written source spans, including both checks on one property reference, while a second valid annex verifies per-annex isolation. Keep the fixture in its own issue3244 model project. This behavior-preserving refactor is covered by a test that passes before and after the traversal change.
Use the generated BehaviorAnnexSwitch to collect declarations, detect unresolved references, and queue node-local checks during one source-model walk. Execute the queued checks after the existing translation prerequisites have passed, retaining independent diagnostics and strict-checker gating. Use AadlBaSwitch to check property values and units together in one strict-model walk. This reduces the adapter's twelve whole-model traversals to one per model while preserving fast Xtext checks and the existing semantic analyzers. Fixes #3244.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3244.
BehaviorAnnexValidatorpreviously enumerated the declarative annex ten times and the translated strict annex twice. Dispatch through the generatedBehaviorAnnexSwitchnow collects declarations, detects unresolved references, and queues applicable checks in one source-model traversal. Translation still waits for the existing prerequisites, and every queued check runs before deciding whether to invoke the strict analyzers.AadlBaSwitchcombines property-value and property-units checks in one strict-model traversal.Fast Xtext checks, diagnostic messages/codes/locations, and the existing type, initialization, and legality analyzers retain their behavior. The traversal consolidation applies to the adapter; the translator and semantic analyzers retain their own processing.
Issue3244Testuses an externalissue3244AADL project with an invalid array size, nestedfor/foralltargets, an outgoing-port status value, and a property reference with both missing-value and units errors. It asserts all six diagnostics with their severities and written source spans, while a second valid annex checks isolation. The characterization test passes on the original implementation and after the refactor. The test commit precedes the production commit.Validation
Characterization against the original validator: 1 test, no failures, errors, or skips.
Final clean root reactor: 143 projects and 1,651 tests, with no failures, errors, or skips. This includes 206 BA and BA integration tests; the existing diagnostic goldens remain unchanged.
git diff --checkpasses.Dependencies and residual risk
Targets
master; there are no unmerged PR dependencies or merge-order requirements. Queued checks add temporary memory proportional to the applicable checks, and diagnostic emission can follow traversal order rather than the previous grouping by check type. No elapsed-time performance improvement has been measured.