Increasing the amount of memory available to the JVM is the first thing you will have to do when dealing with complex grammars. That however doesn't help in this case. That's because this error is due to a timeout inside the ANTLR generator which by default kicks in after 1000ms. After that ANTLR gives up on creating a DFA for your grammar and you may end up with the error message above.
Fortunately this timeout can be configured by passing ANTLR the -Xconversiontimeout option. In Xtext you do this by adding two antlrParam elements to the ANTLR generator fragment as in the example below (here I use a timeout of 10000ms):
// The antlr parser generator fragment.
fragment = parser.antlr.XtextAntlrGeneratorFragment {
antlrParam = "-Xconversiontimeout" antlrParam = "10000"
}
Now don't forget to add the same option to the parser.antlr.XtextAntlrUiGeneratorFragment fragment!
Just had this problem, and this post solved it! Thank you very much!
ReplyDeletenice tips, it works and helped me
ReplyDeletetake care
Much appreesh - this solved my problem as well!
ReplyDeletethanks!
ReplyDeleteyour blog contains interesting stuff about Xtext, I hope you'll post again soon.