The main problem with merging two independent context-free grammars is that grammars have no inherent scoping, and grammar rules in different component grammars may have the same name, thus causing a clash. Modularisation has then to be designed so as to prevent these name clashes. While this is the central functional design need for modularisation, a number of other requirements and desiderata were formulated for the design:
It should be designed as a preprocessor that takes modules and an invoking grammar, and produces a single ixml grammar as output; in this way it will work with all existing ixml processors without change.
Consequently, there should be no change required to ixml proper: just use the existing syntax and semantics.
Modules should be able to invoke other modules.
Modules should have a visible contract of use, on both the producer's as the user's side, so that it is obvious what each module uses and shares, and that if there are different implementations of a particular module they can be swapped in and out.
The internals of a module should be protected, so that a module owner can change the implementation of a module, as long as the interface contract is maintained.
It should be possible to independently check modules for completeness and consistency, so that modules can be checked before they are combined.
Although modules may be transformed to prevent name clashes, no changes should be made to the invoking grammar, so that error messages are in the user's terms, and not using renamed terms.
Despite rules being renamed, the resultant serialisation should not change.
Modularisation should be kept as simple and easy-to-use as possible while meeting the requirements.