I am trying to generate valid, compilable Java programs using Grammarinator. To achieve this, I downloaded the Java 8 ANTR Grammar and executed the following command to create a new generator:
However, the resulting programs are invalid and cannot be compiled. Below are some examples of the generated programs:
// Example 1
@ၡൈؓ.ꬮ۰੍.ࠏ@ߺ.ᨐ@ℓ᪅.ᠢ.ꭜ({})@ꩀৢ(ச=@ᅧ,ﹲ={},ၛ={@ቾ࠙(),},ஃ=@ᮮᢩ.ⷀ.ਸ਼({{{}},}),Ῐಂꦂি=@ଡ଼.ᡐ({@ˮ᱄.ૠ,}),J={{,},})packageꮉ.ᮄ.ᝢ;importঢ়ၭే;importใ;importstaticૹ.ࡅ୦ᬸꩌᢆ.ਫ਼;;%
// Example 2
packageὙ;
// Example 3
packageಐ.ⸯၱඃ;importၡ.ꪱ഻;importꩀ.*;%
As shown, the generated code is difficult to understand, and it appears that whitespaces are ignored.
Is there a way to adjust the command or configuration to generate valid Java programs? Or is it fundamentally impossible to generate compilable Java programs using Grammarinator?
I am trying to generate valid, compilable Java programs using Grammarinator. To achieve this, I downloaded the Java 8 ANTR Grammar and executed the following command to create a new generator:
Next, I attempted to use this generator to produce several Java programs with the command:
However, the resulting programs are invalid and cannot be compiled. Below are some examples of the generated programs:
As shown, the generated code is difficult to understand, and it appears that whitespaces are ignored. Is there a way to adjust the command or configuration to generate valid Java programs? Or is it fundamentally impossible to generate compilable Java programs using Grammarinator?