# Statically Verifying Well-Definedness of Separately Compiled Attribute Grammars

DevFeed: [Statically Verifying Well-Definedness of Separately Compiled Attribute Grammars](<https://devfeed.tech/articles/statically-verifying-well-definedness-of-separately-compiled-attribute-grammars-127180.md>)

Original publisher: [Read original article](<https://arxiv.org/abs/2602.03777>)

Author: Federico Bruzzone, Walter Cazzola, Luca Favalli

Published: 2026-11-10T05:00:00Z

Content type: article

Language: en

Sources: [arXiv: Software Engineering](<https://devfeed.tech/sources/arxiv-software-engineering.md>)

Topics: [Credo](<https://devfeed.tech/topics/credo.md>), [Integration testing](<https://devfeed.tech/topics/integration-testing.md>)

Tags: [abstract](<https://devfeed.tech/tags/abstract.md>), [analysis](<https://devfeed.tech/tags/analysis.md>), [compilation](<https://devfeed.tech/tags/compilation.md>), [cost](<https://devfeed.tech/tags/cost.md>), [cs-pl](<https://devfeed.tech/tags/cs-pl.md>), [cs-se](<https://devfeed.tech/tags/cs-se.md>), [data](<https://devfeed.tech/tags/data.md>), [dependency](<https://devfeed.tech/tags/dependency.md>), [development](<https://devfeed.tech/tags/development.md>), [errors](<https://devfeed.tech/tags/errors.md>), [evaluation](<https://devfeed.tech/tags/evaluation.md>), [experimental](<https://devfeed.tech/tags/experimental.md>), [extension](<https://devfeed.tech/tags/extension.md>), [extensions](<https://devfeed.tech/tags/extensions.md>), [flexibility](<https://devfeed.tech/tags/flexibility.md>), [flow](<https://devfeed.tech/tags/flow.md>), [guarantees](<https://devfeed.tech/tags/guarantees.md>), [integration](<https://devfeed.tech/tags/integration.md>), [key](<https://devfeed.tech/tags/key.md>), [language](<https://devfeed.tech/tags/language.md>), [modular](<https://devfeed.tech/tags/modular.md>), [modular-development](<https://devfeed.tech/tags/modular-development.md>)

## AI overview

Separately compiled language extensions can introduce attributes that make previously generated AST structures unsafe, leading to runtime errors such as undefined attribute accesses. The paper presents nlgcheck, a data-flow-based static analysis tool for the Neverlang workbench that checks composed, separately compiled language components before execution. The authors report that mutation testing on Neverlang projects found it improves robustness while preserving modularity and flexibility, with performance they say is suitable for routine development.

## Source excerpt

arXiv:2602.03777v2 Announce Type: replace-cross Abstract: The development of programming languages involves complex theoretical and practical challenges, particularly when addressing modularity and reusability through language extensions. While language workbenches aim to enable modular development under the constraints of the language extension problem, one critical constraint--separate compilation--is often relaxed due to its complexity. However, this relaxation undermines artifact reusability and integration with common dependency systems. A key difficulty under separate compilation arises from managing attribute grammars, as extensions may introduce new attributes that invalidate previously generated abstract syntax tree structures. Existing approaches, such as the use of dynamic maps in the Neverlang workbench, favor flexibility at the cost of compile-time correctness, leading to potential runtime errors due to undefined attributes. This work addresses this issue by introducing nlgcheck, a theoretically sound static analysis tool based on data-flow analysis for the Neverlang language workbench, which detects potential runtime errors--such as undefined attribute accesses--when separately compiled language components are composed, before the resulting language is ever run, thus preserving separate compilation while maintaining strong static correctness guarantees. Experimental evaluation using mutation testing on Neverlang-based projects demonstrates that nlgcheck effectively enhances robustness without sacrificing modularity or flexibility and with a level of performance that does not impede its adoption in daily development activities.