JastAdd 2.1.13
The declaration syntax for a collection attribute looks like this:
coll Collection<B> A.set() [new HashSet<B>()] with add root A;
Currently JastAdd does not care what the spelling of the words with or root is. For example the following compiles identically to the above:
coll Collection<B> A.set() [new HashSet<B>()] without add not_root A;
This bug has the troublesome consequence that the order of 'with' and 'root' does not matter, only the order of their arguments. For example, the following declaration is also identical to the first one:
coll Collection<B> A.set() [new HashSet<B>()] root add with A;
The origin of this bug is the parser rule for collection attribute declarations, which only requires an identifier in place of root and with. These should have been keywords, but making root and with keywords might cause old code to break.
It makes sense to not have "root" and "with" as keywords. Instead this error can be reported as a semantic error.